fix link failure when introspecting girepository itself
authorTommi Komulainen <tko@src.gnome.org>
Tue, 25 Nov 2008 17:54:41 +0000 (17:54 +0000)
committerTommi Komulainen <tko@src.gnome.org>
Tue, 25 Nov 2008 17:54:41 +0000 (17:54 +0000)
* giscanner/dumper.py (_link): fix link failure when
introspecting girepository itself by ordering the command line
options better

svn path=/trunk/; revision=966

giscanner/dumper.py

index a694578..3511a7f 100644 (file)
@@ -171,10 +171,21 @@ class DumpCompiler(object):
         # Search the current directory first
         args.append('-L.')
 
-        # We only use the first library; assume others are "custom" libraries
-        # like from gir-repository.  Right now those don't define new GTypes,
-        # so we don't need to introspect them.
-        args.append('-l' + self._options.libraries[0])
+        uninst_builddir = os.environ.get('UNINSTALLED_INTROSPECTION_BUILDDIR')
+        # hack for building GIRepository.gir, skip -lgirepository since
+        # libgirepository.la is not in current directory and we refer to it
+        # explicitly below anyway
+        if not uninst_builddir or self._options.libraries[0] != 'girepository':
+            # We only use the first library; assume others are "custom"
+            # libraries like from gir-repository.  Right now those don't define
+            # new GTypes, so we don't need to introspect them.
+            args.append('-l' + self._options.libraries[0])
+
+        # hack for building gobject-introspection itself
+        if uninst_builddir:
+            path = os.path.join(uninst_builddir, 'girepository',
+                                'libgirepository.la')
+            args.append(path)
 
         args.extend(self._run_pkgconfig('--libs'))
         for source in sources:
@@ -183,13 +194,6 @@ class DumpCompiler(object):
                     "Could not find object file: %s" % (source, ))
         args.extend(list(sources))
 
-        uninst_builddir = os.environ.get('UNINSTALLED_INTROSPECTION_BUILDDIR')
-        # This hack is only for building gobject-introspection itself
-        if uninst_builddir:
-            path = os.path.join(uninst_builddir, 'girepository',
-                                'libgirepository.la')
-            args.append(path)
-
         subprocess.check_call(args)