diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2011-11-03 17:41:24 -0700 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2011-11-07 14:50:26 -0800 |
commit | 9b4a8bae3528950bdb87df095c212d646e15dbdb (patch) | |
tree | 8dab51380a54c95857ea73f378686339e4e6d8e8 /xorg-macros.m4.in | |
parent | 0295ee03ab45c55771581664d6c903c6d2f87e53 (diff) |
Define __wrap_exit in test program source for XORG_LD_WRAP
Otherwise the test fails on Solaris releases that actually have support
for ld -wrap because the linker instead returns an error that __wrap_exit
is an undefined symbol.
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
Diffstat (limited to 'xorg-macros.m4.in')
-rw-r--r-- | xorg-macros.m4.in | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/xorg-macros.m4.in b/xorg-macros.m4.in index bc5fcc1..9da74ef 100644 --- a/xorg-macros.m4.in +++ b/xorg-macros.m4.in @@ -1131,7 +1131,10 @@ AM_CONDITIONAL([HAVE_GLIB], [test "$have_glib" = yes]) # ld -wrap and others do not. # AC_DEFUN([XORG_LD_WRAP],[ -XORG_CHECK_LINKER_FLAGS([-Wl,-wrap,exit],[have_ld_wrap=yes],[have_ld_wrap=no]) +XORG_CHECK_LINKER_FLAGS([-Wl,-wrap,exit],[have_ld_wrap=yes],[have_ld_wrap=no], + [AC_LANG_PROGRAM([#include <stdlib.h> + void __wrap_exit(int status) { return; }], + [exit(0);])]) # Not having ld wrap when unit testing has been explicitly requested is an error if test "x$enable_unit_tests" = x"yes" -a "x$1" != "xoptional"; then if test "x$have_ld_wrap" = x"no"; then @@ -1146,7 +1149,7 @@ AM_CONDITIONAL([HAVE_LD_WRAP], [test "$have_ld_wrap" = yes]) # ----------------------- # SYNOPSIS # -# XORG_CHECK_LINKER_FLAGS(FLAGS, [ACTION-SUCCESS], [ACTION-FAILURE]) +# XORG_CHECK_LINKER_FLAGS(FLAGS, [ACTION-SUCCESS], [ACTION-FAILURE], [PROGRAM-SOURCE]) # # DESCRIPTION # @@ -1156,6 +1159,8 @@ AM_CONDITIONAL([HAVE_LD_WRAP], [test "$have_ld_wrap" = yes]) # ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on # success/failure. # +# PROGRAM-SOURCE is the program source to link with, if needed +# # NOTE: Based on AX_CHECK_COMPILER_FLAGS. # # LICENSE @@ -1196,7 +1201,7 @@ AS_LITERAL_IF([$1], [AC_CACHE_VAL(AS_TR_SH(xorg_cv_linker_flags_[$1]), [ ax_save_FLAGS=$LDFLAGS LDFLAGS="$1" - AC_LINK_IFELSE([AC_LANG_PROGRAM()], + AC_LINK_IFELSE([m4_default([$4],[AC_LANG_PROGRAM()])], AS_TR_SH(xorg_cv_linker_flags_[$1])=yes, AS_TR_SH(xorg_cv_linker_flags_[$1])=no) LDFLAGS=$ax_save_FLAGS])], |