Accept slightly grotty coding in Makefile.global in order to keep the -L

flag for src/port/ in front of any -L flags placed in LDFLAGS by configure.
This undoes an L-flag-ordering change that I had thought would be safe,
but seems to be making at least one buildfarm member fail --- the only
theory for orca's failure that I can think of is that it's got an old
copy of libpgport.a in /usr/lib.  Also allow for LDFLAGS_SL to be set by
contrib makefiles before they invoke Makefile.global.
This commit is contained in:
Tom Lane 2010-07-06 22:03:05 +00:00
parent 46ee42b816
commit 458474d9d7
1 changed files with 16 additions and 9 deletions

View File

@ -1,5 +1,5 @@
# -*-makefile-*-
# $PostgreSQL: pgsql/src/Makefile.global.in,v 1.263 2010/07/05 18:54:37 tgl Exp $
# $PostgreSQL: pgsql/src/Makefile.global.in,v 1.264 2010/07/06 22:03:05 tgl Exp $
#------------------------------------------------------------------------------
# All PostgreSQL makefiles include this file and use the variables it sets,
@ -235,9 +235,21 @@ OSSP_UUID_LIBS = @OSSP_UUID_LIBS@
LD = @LD@
with_gnu_ld = @with_gnu_ld@
ld_R_works = @ld_R_works@
LDFLAGS = @LDFLAGS@
# We want -L for libpgport.a to be first in LDFLAGS. We also need LDFLAGS
# to be a "recursively expanded" variable, else adjustments to rpathdir
# don't work right. So we must NOT do LDFLAGS := something, meaning this has
# to be done first and elsewhere we must only do LDFLAGS += something.
ifdef PGXS
LDFLAGS = -L$(libdir)
else
LDFLAGS = -L$(top_builddir)/src/port
endif
LDFLAGS += @LDFLAGS@
LDFLAGS_EX = @LDFLAGS_EX@
LDFLAGS_SL = @LDFLAGS_SL@
# LDFLAGS_SL might have already been assigned by calling makefile
LDFLAGS_SL += @LDFLAGS_SL@
LDREL = -r
LDOUT = -o
RANLIB = @RANLIB@
@ -450,16 +462,11 @@ endif
##########################################################################
#
# substitute implementations of C library routines (see src/port/)
# note we already included -L.../src/port in LDFLAGS above
LIBOBJS = @LIBOBJS@
LIBS := -lpgport $(LIBS)
# add location of libpgport.a to LDFLAGS
ifdef PGXS
LDFLAGS += -L$(libdir)
else
LDFLAGS += -L$(top_builddir)/src/port
endif
# to make ws2_32.lib the last library, and always link with shfolder,
# so SHGetFolderName isn't picked up from shell32.dll