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.
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'))