Author: metze Date: 2006-03-07 10:16:03 +0000 (Tue, 07 Mar 2006) New Revision: 13917
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=13917 Log: 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 Modified: branches/SAMBA_4_0/source/build/m4/check_cc.m4 Changeset: Modified: branches/SAMBA_4_0/source/build/m4/check_cc.m4 =================================================================== --- branches/SAMBA_4_0/source/build/m4/check_cc.m4 2006-03-07 09:09:13 UTC (rev 13916) +++ branches/SAMBA_4_0/source/build/m4/check_cc.m4 2006-03-07 10:16:03 UTC (rev 13917) @@ -117,22 +117,29 @@ # 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)