Back-patch recent changes to alter the order of -L flags inserted from
authorTom Lane <[email protected]>
Sun, 17 Jul 2005 04:06:04 +0000 (04:06 +0000)
committerTom Lane <[email protected]>
Sun, 17 Jul 2005 04:06:04 +0000 (04:06 +0000)
LDFLAGS versus those built into the Makefiles.  This looks like it will
fix several buildfarm failures in the back branches.

src/Makefile.shlib

index 3cc0ec0b7614b42835112941ef565bc3c3d7d7fa..acc4b2d77e0f36e670c6ba87935f3729fea36efa 100644 (file)
@@ -65,6 +65,9 @@ LINK.static = $(AR) $(AROPT)
 
 ifeq ($(enable_shared), yes)
 
+# Insert -L from LDFLAGS after any -L already present in SHLIB_LINK
+SHLIB_LINK := $(filter -L%, $(SHLIB_LINK)) $(filter -L%, $(LDFLAGS)) $(filter-out -L%, $(SHLIB_LINK))
+
 # For each platform we support shared libraries on, set shlib to the
 # name of the library, LINK.shared to the command to link the library,
 # and adjust SHLIB_LINK if necessary.
@@ -207,7 +210,6 @@ ifeq ($(PORTNAME), beos)
   SHLIB_LINK           += -ltermcap -lstdc++.r4 -lbind -lsocket -L/boot/develop/lib/x86
 endif
 
-SHLIB_LINK := $(filter -L%, $(LDFLAGS)) $(SHLIB_LINK)
 ifeq ($(enable_rpath), yes)
 SHLIB_LINK += $(rpath)
 endif