gobject-introspection r813 - in trunk: . gir girepository



Author: walters
Date: Sat Oct 25 14:59:25 2008
New Revision: 813
URL: http://svn.gnome.org/viewvc/gobject-introspection?rev=813&view=rev

Log:
Bug 557076 - move typelibs to $libdir

Added:
   trunk/acinclude.m4
Modified:
   trunk/ChangeLog
   trunk/configure.ac
   trunk/gir/Makefile.am
   trunk/girepository/girepository.c

Added: trunk/acinclude.m4
==============================================================================
--- (empty file)
+++ trunk/acinclude.m4	Sat Oct 25 14:59:25 2008
@@ -0,0 +1,49 @@
+dnl as-ac-expand.m4 0.2.0                                   -*- autoconf -*-
+dnl autostars m4 macro for expanding directories using configure's prefix
+
+dnl (C) 2003, 2004, 2005 Thomas Vander Stichele <thomas at apestaart dot org>
+
+dnl Copying and distribution of this file, with or without modification,
+dnl are permitted in any medium without royalty provided the copyright
+dnl notice and this notice are preserved.
+
+dnl AS_AC_EXPAND(VAR, CONFIGURE_VAR)
+
+dnl example:
+dnl AS_AC_EXPAND(SYSCONFDIR, $sysconfdir)
+dnl will set SYSCONFDIR to /usr/local/etc if prefix=/usr/local
+
+AC_DEFUN([AS_AC_EXPAND],
+[
+  EXP_VAR=[$1]
+  FROM_VAR=[$2]
+
+  dnl first expand prefix and exec_prefix if necessary
+  prefix_save=$prefix
+  exec_prefix_save=$exec_prefix
+
+  dnl if no prefix given, then use /usr/local, the default prefix
+  if test "x$prefix" = "xNONE"; then
+    prefix="$ac_default_prefix"
+  fi
+  dnl if no exec_prefix given, then use prefix
+  if test "x$exec_prefix" = "xNONE"; then
+    exec_prefix=$prefix
+  fi
+
+  full_var="$FROM_VAR"
+  dnl loop until it doesn't change anymore
+  while true; do
+    new_full_var="`eval echo $full_var`"
+    if test "x$new_full_var" = "x$full_var"; then break; fi
+    full_var=$new_full_var
+  done
+
+  dnl clean up
+  full_var=$new_full_var
+  AC_SUBST([$1], "$full_var")
+
+  dnl restore prefix and exec_prefix
+  prefix=$prefix_save
+  exec_prefix=$exec_prefix_save
+])

Modified: trunk/configure.ac
==============================================================================
--- trunk/configure.ac	(original)
+++ trunk/configure.ac	Sat Oct 25 14:59:25 2008
@@ -88,6 +88,22 @@
 fi
 AC_DEFINE_UNQUOTED([SHLIB_SUFFIX], "$SHLIB_SUFFIX", [Define to the platform's shared library suffix])
 
+# Copied from dbus configure.in
+#### find the actual value for $prefix that we'll end up with
+##   (I know this is broken and should be done in the Makefile, but
+##    that's a major pain and almost nobody actually seems to care)
+AS_AC_EXPAND(EXPANDED_LOCALSTATEDIR, "$localstatedir")
+AS_AC_EXPAND(EXPANDED_SYSCONFDIR, "$sysconfdir")
+AS_AC_EXPAND(EXPANDED_BINDIR, "$bindir")
+AS_AC_EXPAND(EXPANDED_LIBDIR, "$libdir")
+AS_AC_EXPAND(EXPANDED_LIBEXECDIR, "$libexecdir")
+AS_AC_EXPAND(EXPANDED_DATADIR, "$datadir")
+
+#### Directory to install the libexec binaries
+GOBJECT_INTROSPECTION_LIBDIR="$EXPANDED_LIBDIR"
+AC_SUBST(GOBJECT_INTROSPECTION_LIBDIR)
+AC_DEFINE_UNQUOTED(GOBJECT_INTROSPECTION_LIBDIR,"$GOBJECT_INTROSPECTION_LIBDIR", [Directory prefix for typelib installation])
+
 PKG_CHECK_MODULES(GOBJECT, [gobject-2.0])
 
 PKG_CHECK_MODULES(SCANNER, [gobject-2.0 gthread-2.0])

Modified: trunk/gir/Makefile.am
==============================================================================
--- trunk/gir/Makefile.am	(original)
+++ trunk/gir/Makefile.am	Sat Oct 25 14:59:25 2008
@@ -121,7 +121,7 @@
 %.typelib: %.gir $(top_builddir)/tools/g-ir-compiler$(EXEEXT) Makefile
 	$(DEBUG) $(top_builddir)/tools/g-ir-compiler$(EXEEXT) --includedir=. $(G_IR_COMPILER_OPTS) $< -o $@
 
-typelibsdir = $(datadir)/girepository
+typelibsdir = $(libdir)/girepository
 typelibs_DATA = GLib-2.0.typelib GModule-2.0.typelib GObject-2.0.typelib Gio-2.0.typelib
 CLEANFILES += $(typelibs_DATA)
 

Modified: trunk/girepository/girepository.c
==============================================================================
--- trunk/girepository/girepository.c	(original)
+++ trunk/girepository/girepository.c	Sat Oct 25 14:59:25 2008
@@ -31,6 +31,8 @@
 #include "girepository.h"
 #include "gtypelib.h"
 
+#include "config.h"
+
 static GStaticMutex globals_lock = G_STATIC_MUTEX_INIT;
 static GIRepository *default_repository = NULL;
 static GSList *search_path = NULL;
@@ -91,8 +93,8 @@
 
   if (search_path == NULL)
     {
-      const gchar *const *datadirs;
-      const gchar *const *dir;
+      const char *libdir;
+      char *typelib_dir;
       const gchar *type_lib_path_env;
 
       type_lib_path_env = g_getenv ("GI_TYPELIB_PATH");
@@ -116,13 +118,11 @@
           g_free (custom_dirs);
         }
 
-      datadirs = g_get_system_data_dirs ();
+      libdir = GOBJECT_INTROSPECTION_LIBDIR;
 
-      for (dir = datadirs; *dir; dir++)
-        {
-          char *path = g_build_filename (*dir, "girepository", NULL);
-          search_path = g_slist_prepend (search_path, path);
-        }
+      typelib_dir = g_build_filename (libdir, "girepository", NULL);
+
+      search_path = g_slist_prepend (search_path, typelib_dir);
 
       search_path = g_slist_reverse (search_path);
     }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]