scanner: Also add an RPATH for library paths specified
authorColin Walters <walters@verbum.org>
Thu, 3 Nov 2011 22:23:53 +0000 (18:23 -0400)
committerColin Walters <walters@verbum.org>
Thu, 3 Nov 2011 22:23:53 +0000 (18:23 -0400)
Introspection scanning is a bit special in that we both compile *and*
run a temporary binary.  In some cases like jhbuild we will pick up
the runtime location of libraries via LD_LIBRARY_PATH.  But this falls
over when we've been given a private subdirectory, since it won't be
in that path.

Let's just "do the right thing" here by injecting an rpath for the
directories as well.

giscanner/dumper.py

index 9b20f387dba3fa8b7f669d752fa1ed3907500979..3645d4cee70922e45fd0cbca23ab3d78dd2ad2ad 100644 (file)
@@ -277,6 +277,11 @@ class DumpCompiler(object):
 
         for library_path in self._options.library_paths:
             args.append('-L' + library_path)
+            if libtool:
+                args.append('-rpath')
+                args.append(library_path)
+            else:
+                args.append('-Wl,-rpath=' + library_path)
 
         args.extend(self._run_pkgconfig('--libs'))