LD_LIBRARY_PATH exorcism
authorColin Walters <walters@verbum.org>
Thu, 20 Aug 2009 22:21:41 +0000 (18:21 -0400)
committerColin Walters <walters@verbum.org>
Mon, 24 Aug 2009 18:14:53 +0000 (14:14 -0400)
Thanks to commit 6d510b8db, we now no longer need LD_LIBRARY_PATH
to be set for invoking the compiler.

Next, before we were taking the LD_LIBRARY_PATH variable and
turning it into a compile path, presumably to attempt to handle
the cases where we weren't getting the right -L flags.  Also
interacting with this was a while ago we weren't really doing
uninstalled libtool libraries correctly, which is probably
how hacks involving LD_LIBRARY_PATH crept into the scanner.

Just require that we're passed the right -L flags, and we
should be doing libtool libraries better now.

gir/Makefile.am
giscanner/scannermain.py
tests/invoke/Makefile.am
tests/offsets/Makefile.am
tests/scanner/Makefile.am

index 3cd4bf7..d136316 100644 (file)
@@ -206,7 +206,7 @@ girdir = $(GIR_DIR)
 dist_gir_DATA = $(GIRSOURCES)
 
 %.typelib: %.gir $(top_builddir)/tools/g-ir-compiler$(EXEEXT)
-       LD_LIBRARY_PATH=$(top_builddir)/girepository/.libs:.libs$${LD_LIBRARY_PATH:+:$$LD_LIBRARY_PATH} $(DEBUG) $(top_builddir)/tools/g-ir-compiler$(EXEEXT) --includedir=. $(G_IR_COMPILER_OPTS) $< -o $@
+       $(top_builddir)/tools/g-ir-compiler$(EXEEXT) --includedir=. $(G_IR_COMPILER_OPTS) $< -o $@
 
 typelibsdir = $(libdir)/girepository-1.0
 typelibs_DATA = $(GIRSOURCES:.gir=.typelib)
index 4b74253..d70eed4 100644 (file)
@@ -247,20 +247,6 @@ def scanner_main(args):
         _error("Must specify --program or --library")
     libraries = options.libraries
 
-    # FIXME: using LPATH is definitely not portable enough. Using Python's
-    # find_library for finding our shared libraries is not a portable enough
-    # anyway as it behaves differently depending on the OS
-    lpath = os.environ.get('LPATH')
-    library_path = ':'.join(options.library_paths)
-
-    ld_library_path = os.environ.get('LD_LIBRARY_PATH')
-    if ld_library_path:
-        library_path = ':'.join([ld_library_path, library_path])
-
-    if lpath:
-        os.environ['LPATH'] = ':'.join([lpath, library_path])
-    else:
-        os.environ['LPATH'] = library_path
     filenames = []
     for arg in args:
         if (arg.endswith('.c') or
index 2902d51..54c28ff 100644 (file)
@@ -20,7 +20,7 @@ BUILT_SOURCES = testfns-metadata.c
 CLEANFILES = testfns-metadata.c 
 
 testfns-metadata.c: testfns-1.0.gir $(top_builddir)/tools/g-ir-compiler Makefile
-       LD_LIBRARY_PATH=$${LD_LIBRARY_PATH:+$$LD_LIBRARY_PATH:}:$(top_builddir)/girepository/.libs $(CHECK_DEBUG) $(top_builddir)/tools/g-ir-compiler $(srcdir)/testfns-1.0.gir --code -o testfns-metadata.c
+       $(CHECK_DEBUG) $(top_builddir)/tools/g-ir-compiler $(srcdir)/testfns-1.0.gir --code -o testfns-metadata.c
 
 invoke_SOURCES = invoke.c
 invoke_CFLAGS = $(GIREPO_CFLAGS)  -I$(top_srcdir)/girepository
index 62b0d79..1713eb4 100644 (file)
@@ -30,8 +30,7 @@ offsets-1.0.gir: liboffsets.la offsets.h $(SCANNER_BIN) $(SCANNER_LIBS) Makefile
         --output $@
 
 %.typelib: %.gir $(top_builddir)/tools/g-ir-compiler$(EXEEXT) Makefile
-       LD_LIBRARY_PATH=$(top_builddir)/girepository/.libs:.libs$${LD_LIBRARY_PATH:+:$$LD_LIBRARY_PATH} \
-        $(top_builddir)/tools/g-ir-compiler --includedir=. --includedir=$(top_builddir)/gir $< -o $@
+       $(top_builddir)/tools/g-ir-compiler --includedir=. --includedir=$(top_builddir)/gir $< -o $@
 
 CLEANFILES += offsets-1.0.gir offsets-1.0.typelib
 
@@ -53,8 +52,7 @@ CLEANFILES += gitestoffsets.c
 ############################################################
 
 check-local: offsets-1.0.typelib
-       LD_LIBRARY_PATH=$(top_builddir)/girepository/.libs:.libs$${LD_LIBRARY_PATH:+:$$LD_LIBRARY_PATH} \
-        GI_TYPELIB_PATH=:$(top_builddir)/gir ./gitestoffsets$(EXEEXT) offsets.compiled offsets.introspected
+       GI_TYPELIB_PATH=:$(top_builddir)/gir ./gitestoffsets$(EXEEXT) offsets.compiled offsets.introspected
        diff -u offsets.compiled offsets.introspected
 
 CLEANFILES += offsets.compiled offsets.introspected
index 1317708..a14cf8d 100644 (file)
@@ -143,10 +143,10 @@ post-check:
        @true
 
 %.typelib: %.gir $(top_builddir)/tools/g-ir-compiler$(EXEEXT) Makefile
-       LD_LIBRARY_PATH=$(top_builddir)/girepository/.libs:.libs$${LD_LIBRARY_PATH:+:$$LD_LIBRARY_PATH} $(top_builddir)/tools/g-ir-compiler --includedir=. --includedir=$(top_builddir)/gir $< -o $@
+       $(top_builddir)/tools/g-ir-compiler --includedir=. --includedir=$(top_builddir)/gir $< -o $@
 
 %.tgir: %.typelib $(top_builddir)/tools/g-ir-generate$(EXEEXT) Makefile
-       LD_LIBRARY_PATH=$(top_builddir)/girepository/.libs:.libs$${LD_LIBRARY_PATH:+:$$LD_LIBRARY_PATH} $(top_builddir)/tools/g-ir-generate --includedir=. --includedir=$(top_builddir)/gir $< -o $@
+       $(top_builddir)/tools/g-ir-generate --includedir=. --includedir=$(top_builddir)/gir $< -o $@
 
 %.tgir.check: %.tgir
        @diff -u -U 10 $(srcdir)/$*-expected.tgir $*.tgir; \