1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-27 12:41:57 +03:00

Split the LDFLAGS make variable into two parts: LDFLAGS is now used for

linking both executables and shared libraries, and we add on LDFLAGS_EX when
linking executables or LDFLAGS_SL when linking shared libraries.  This
provides a significantly cleaner way of dealing with link-time switches than
the former behavior.  Also, make sure that the various platform-specific
%.so: %.o rules incorporate LDFLAGS and LDFLAGS_SL; most of them missed that
before.  (I did not add these variables for the platforms that invoke $(LD)
directly, however.  It's not clear if we can do that safely, since for the
most part we assume these variables use CC command-line syntax.)

Per gripe from Aaron Swenson and subsequent investigation.
This commit is contained in:
Tom Lane
2010-07-05 18:54:38 +00:00
parent eb81b6509f
commit 291a957745
49 changed files with 183 additions and 135 deletions

7
configure vendored
View File

@ -704,6 +704,7 @@ ld_R_works
with_gnu_ld
LD
LDFLAGS_SL
LDFLAGS_EX
ELF_SYS
EGREP
GREP
@ -856,6 +857,7 @@ LDFLAGS
LIBS
CPPFLAGS
CPP
LDFLAGS_EX
LDFLAGS_SL
DOCBOOKSTYLE'
@ -1551,7 +1553,8 @@ Some influential environment variables:
CPPFLAGS C/C++/Objective C preprocessor flags, e.g. -I<include dir> if
you have headers in a nonstandard directory <include dir>
CPP C preprocessor
LDFLAGS_SL linker flags for shared library linking
LDFLAGS_EX extra linker flags for linking executables only
LDFLAGS_SL extra linker flags for linking shared libraries only
DOCBOOKSTYLE
location of DocBook stylesheets
@ -5788,6 +5791,7 @@ LDFLAGS="$LDFLAGS $LIBDIRS"
# Check whether --with-gnu-ld was given.
if test "${with_gnu_ld+set}" = set; then
withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes
@ -28826,7 +28830,6 @@ fi
# If compiler will take -Wl,--as-needed (or various platform-specific
# spellings thereof) then add that to LDFLAGS. This is much easier than
# trying to filter LIBS to the minimum for each executable.
# (Note that shared library links won't use this switch, though.)
# On (at least) some Red-Hat-derived systems, this switch breaks linking to
# libreadline; therefore we postpone testing it until we know what library
# dependencies readline has. The test code will try to link with $LIBS.