Use all libraries specified on the command line
authorColin Walters <walters@verbum.org>
Wed, 5 Aug 2009 17:24:23 +0000 (13:24 -0400)
committerColin Walters <walters@verbum.org>
Wed, 5 Aug 2009 17:24:23 +0000 (13:24 -0400)
Earlier we were only using the first library specified when
compiling an introspection binary.  This breaks builds on Solaris
which doesn't have implicit linking and we need to be able
to specify multiple libraries.

The tension here is primarily related to OS X' distinction between
modules and shared libraries; if we build the custom libraries
in gir-repository as shared libraries, then we can't dlopen them.
If we build them as modules, then the introspection binary compiler
can't link to them.

If we want to fix the OS X build, probably the way to go would be
a special --use-first-library-only option that gets conditionalized
on OS X + gir-repository.

But even better is to finish killing gir-repository entirely.

giscanner/dumper.py

index e6a8148..0353a2f 100644 (file)
@@ -207,12 +207,11 @@ class DumpCompiler(object):
         # hack for building GIRepository.gir, skip -lgirepository-1.0 since
         # libgirepository-1.0.la is not in current directory and we refer to it
         # explicitly below anyway
-        if (not uninst_builddir or
-            self._options.libraries[0] != 'girepository-1.0'):
-            # 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])
+        for library in self._options.libraries:
+            if (uninst_builddir and
+                self._options.libraries[0] == 'girepository-1.0'):
+                continue
+            args.append('-l' + library)
 
         # hack for building gobject-introspection itself
         if uninst_builddir: