From 291a9577454a63f99b5537e48a3dceae6d35ea8d Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Mon, 5 Jul 2010 18:54:38 +0000 Subject: 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. --- configure | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'configure') diff --git a/configure b/configure index f6b891e46b1..91261a47b86 100755 --- a/configure +++ b/configure @@ -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 if you have headers in a nonstandard directory 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. -- cgit v1.2.3