From f266ee7c28aa6ddf1571108a1a8a9b447ec1034c Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Tue, 7 Mar 2006 10:16:03 +0000 Subject: r13917: fix detection of the visibility support, as we don't use #pragma for the build don't use it for the configure test and use -fvisibility=hidden in CFLAGS in the configure test metze (This used to be commit a0c543c0d6440627da594611fbff3ef1ab0d4251) --- source4/build/m4/check_cc.m4 | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) (limited to 'source4') diff --git a/source4/build/m4/check_cc.m4 b/source4/build/m4/check_cc.m4 index 72a882b7d8..0a215ef802 100644 --- a/source4/build/m4/check_cc.m4 +++ b/source4/build/m4/check_cc.m4 @@ -117,22 +117,29 @@ AC_TRY_RUN([#include "${srcdir-.}/build/tests/trivial.c"], # visibility_attribute=no +VISIBILITY_CFLAGS="" if test x"$GCC" = x"yes" ; then - AX_CFLAGS_GCC_OPTION([-fvisibility=hidden], VISIBILITY_CFLAGS) + AX_CFLAGS_GCC_OPTION([-fvisibility=hidden], VISIBILITY_CFLAGS) fi if test -n "$VISIBILITY_CFLAGS"; then AC_MSG_CHECKING([whether the C compiler supports the visibility attribute]) + OLD_CFLAGS="$CFLAGS" + + CFLAGS="$CFLAGS $VISIBILITY_CFLAGS" AC_TRY_RUN([ - #pragma GCC visibility push(hidden) - void vis_foo1(void) {} - __attribute__((visibility("default"))) void vis_foo2(void) {} - #include "${srcdir-.}/build/tests/trivial.c" - ], [ + void vis_foo1(void) {} + __attribute__((visibility("default"))) void vis_foo2(void) {} + #include "${srcdir-.}/build/tests/trivial.c" + ],[ AC_MSG_RESULT(yes) AC_DEFINE(HAVE_VISIBILITY_ATTR,1,[Whether the C compiler supports the visibility attribute]) visibility_attribute=yes - ], [AC_MSG_RESULT(no);]) + ],[ + AC_MSG_RESULT(no) + VISIBILITY_CFLAGS="" + ]) + CFLAGS="$OLD_CFLAGS" fi AC_SUBST(visibility_attribute) -- cgit