]> git.ipfire.org Git - thirdparty/postgresql.git/commitdiff
Fix out-of-order inclusion of -L switches from LDFLAGS on AIX and HPUX.
authorTom Lane <tgl@sss.pgh.pa.us>
Sat, 3 Dec 2005 20:16:50 +0000 (20:16 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Sat, 3 Dec 2005 20:16:50 +0000 (20:16 +0000)
Per example from Dirk Pirschel.

src/Makefile.shlib

index 2fbe117159849a588dff1adb37fe930b0e41197a..bdb0f700d3b3ab876184a7b021e73e075f1daec0 100644 (file)
@@ -6,7 +6,7 @@
 # Copyright (c) 1998, Regents of the University of California
 #
 # IDENTIFICATION
-#    $PostgreSQL: pgsql/src/Makefile.shlib,v 1.90.4.1 2005/07/17 04:05:47 tgl Exp $
+#    $PostgreSQL: pgsql/src/Makefile.shlib,v 1.90.4.2 2005/12/03 20:16:50 tgl Exp $
 #
 #-------------------------------------------------------------------------
 
@@ -76,6 +76,9 @@ 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))
 
+# Need a -L-free version of LDFLAGS to use in combination with SHLIB_LINK
+LDFLAGS_NO_L := $(filter-out -L%, $(LDFLAGS))
+
 # Default shlib naming convention used by the majority of platforms
 shlib          = lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION)
 shlib_major    = lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION)
@@ -157,7 +160,7 @@ ifeq ($(PORTNAME), hpux)
     SHLIB_LINK         += `$(CC) $(LDFLAGS) -print-libgcc-file-name`
   endif
   ifeq ($(with_gnu_ld), yes)
-    LINK.shared                = $(CC) $(LDFLAGS) -shared -Wl,-h -Wl,$(soname)
+    LINK.shared                = $(CC) $(LDFLAGS_NO_L) -shared -Wl,-h -Wl,$(soname)
   else
     # can't use the CC-syntax rpath pattern here
     rpath =
@@ -303,7 +306,7 @@ else # PORTNAME == aix
 # AIX case
 $(shlib): lib$(NAME).a
        $(MKLDEXPORT) lib$(NAME).a > lib$(NAME)$(EXPSUFF)
-       $(COMPILER) $(LDFLAGS_SL) -o $@ $< $(LDFLAGS) $(SHLIB_LINK) -Wl,-bI:$(top_builddir)/src/backend/$(POSTGRES_IMP) -Wl,-bE:lib$(NAME)$(EXPSUFF)
+       $(COMPILER) $(LDFLAGS_SL) -o $@ $< $(LDFLAGS_NO_L) $(SHLIB_LINK) -Wl,-bI:$(top_builddir)/src/backend/$(POSTGRES_IMP) -Wl,-bE:lib$(NAME)$(EXPSUFF)
        
 endif # PORTNAME == aix