diff options
Diffstat (limited to 'configure.in')
-rw-r--r-- | configure.in | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/configure.in b/configure.in index b8f83960308..a888e352749 100644 --- a/configure.in +++ b/configure.in @@ -1,5 +1,5 @@ dnl Process this file with autoconf to produce a configure script. -dnl $PostgreSQL: pgsql/configure.in,v 1.560 2008/05/03 00:24:05 adunstan Exp $ +dnl $PostgreSQL: pgsql/configure.in,v 1.561 2008/05/18 20:13:12 tgl Exp $ dnl dnl Developers, please strive to achieve this order: dnl @@ -450,6 +450,16 @@ fi AC_PROG_CPP AC_SUBST(GCC) +# If compiler will take -Wl,--as-needed then add that to LDFLAGS. +# This is much easier than trying to filter LIBS to the minimum for each +# executable. (Note that shared libraries won't use this switch, though.) +# On Darwin it's spelled -Wl,-dead_strip_dylibs, but don't try that elsewhere +if test "$PORTNAME" != "darwin"; then + PGAC_PROG_CC_LDFLAGS_OPT([-Wl,--as-needed]) +else + PGAC_PROG_CC_LDFLAGS_OPT([-Wl,-dead_strip_dylibs]) +fi + # Create compiler version string if test x"$GCC" = x"yes" ; then cc_string="GCC `${CC} --version | sed q`" |