diff options
author | Tom Lane | 2008-05-18 20:13:12 +0000 |
---|---|---|
committer | Tom Lane | 2008-05-18 20:13:12 +0000 |
commit | 2dad10f467165ad87dace65ae9aa1cf19fae0867 (patch) | |
tree | ca2318ae03e3b2118be17d578cab8f22b8de7773 /config/c-compiler.m4 | |
parent | 07d08a8828cd31dd5911971ab768fe8d4ab793c7 (diff) |
Make another try at using -Wl,--as-needed to suppress linking of unnecessary
shared libraries. We've tried this before and had problems with libreadline
not linking properly on some platforms, but that seems to be a libreadline
bug that may have been fixed by now. In any case, it's early enough in the
8.4 devel cycle that we can afford to have some transient breakage while
we work out any portability problems.
On Darwin, we try -Wl,-dead_strip_dylibs, which seems to be the equivalent
incantation there.
Diffstat (limited to 'config/c-compiler.m4')
-rw-r--r-- | config/c-compiler.m4 | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/config/c-compiler.m4 b/config/c-compiler.m4 index cc25cf94ba0..2e3fba877a3 100644 --- a/config/c-compiler.m4 +++ b/config/c-compiler.m4 @@ -1,5 +1,5 @@ # Macros to detect C compiler features -# $PostgreSQL: pgsql/config/c-compiler.m4,v 1.16 2008/04/18 18:43:08 alvherre Exp $ +# $PostgreSQL: pgsql/config/c-compiler.m4,v 1.17 2008/05/18 20:13:12 tgl Exp $ # PGAC_C_SIGNED @@ -110,3 +110,19 @@ _AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [CFLAGS="$pgac_save_CFLAGS" AC_MSG_RESULT(no)]) ])# PGAC_PROG_CC_CFLAGS_OPT + + + +# PGAC_PROG_CC_LDFLAGS_OPT +# ------------------------ +# Given a string, check if the compiler supports the string as a +# command-line option. If it does, add the string to LDFLAGS. +AC_DEFUN([PGAC_PROG_CC_LDFLAGS_OPT], +[AC_MSG_CHECKING([if $CC supports $1]) +pgac_save_LDFLAGS=$LDFLAGS +LDFLAGS="$pgac_save_LDFLAGS $1" +AC_LINK_IFELSE([AC_LANG_PROGRAM()], + AC_MSG_RESULT(yes), + [LDFLAGS="$pgac_save_LDFLAGS" + AC_MSG_RESULT(no)]) +])# PGAC_PROG_CC_LDFLAGS_OPT |