diff options
Diffstat (limited to 'config/c-compiler.m4')
-rw-r--r-- | config/c-compiler.m4 | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/config/c-compiler.m4 b/config/c-compiler.m4 index 7422f9572e6..eeb2ee94942 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.18 2008/05/20 03:30:21 tgl Exp $ +# $PostgreSQL: pgsql/config/c-compiler.m4,v 1.19 2008/06/27 00:36:16 tgl Exp $ # PGAC_C_SIGNED @@ -119,12 +119,15 @@ _AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], # command-line option. If it does, add the string to LDFLAGS. # For reasons you'd really rather not know about, this checks whether # you can link to a particular function, not just whether you can link. +# In fact, we must actually check that the resulting program runs :-( 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_CALL([],[$2])], - AC_MSG_RESULT(yes), - [LDFLAGS="$pgac_save_LDFLAGS" - AC_MSG_RESULT(no)]) +AC_RUN_IFELSE([AC_LANG_PROGRAM([extern void $2 (); void (*fptr) () = $2;],[])], + AC_MSG_RESULT(yes), + [LDFLAGS="$pgac_save_LDFLAGS" + AC_MSG_RESULT(no)], + [LDFLAGS="$pgac_save_LDFLAGS" + AC_MSG_RESULT(assuming no)]) ])# PGAC_PROG_CC_LDFLAGS_OPT |