mirror of
https://github.com/postgres/postgres.git
synced 2025-07-30 11:03:19 +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:
@ -1,5 +1,5 @@
|
||||
dnl Process this file with autoconf to produce a configure script.
|
||||
dnl $PostgreSQL: pgsql/configure.in,v 1.630 2010/06/04 07:28:30 scrappy Exp $
|
||||
dnl $PostgreSQL: pgsql/configure.in,v 1.631 2010/07/05 18:54:37 tgl Exp $
|
||||
dnl
|
||||
dnl Developers, please strive to achieve this order:
|
||||
dnl
|
||||
@ -785,7 +785,8 @@ AC_SUBST(ELF_SYS)
|
||||
CPPFLAGS="$CPPFLAGS $INCLUDES"
|
||||
LDFLAGS="$LDFLAGS $LIBDIRS"
|
||||
|
||||
AC_ARG_VAR(LDFLAGS_SL, [linker flags for shared library linking])
|
||||
AC_ARG_VAR(LDFLAGS_EX, [extra linker flags for linking executables only])
|
||||
AC_ARG_VAR(LDFLAGS_SL, [extra linker flags for linking shared libraries only])
|
||||
|
||||
PGAC_PROG_LD
|
||||
AC_SUBST(LD)
|
||||
@ -1770,7 +1771,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.
|
||||
|
Reference in New Issue
Block a user