summaryrefslogtreecommitdiff
path: root/source4/build/m4
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2006-03-07 10:16:03 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:52:23 -0500
commitf266ee7c28aa6ddf1571108a1a8a9b447ec1034c (patch)
tree35ef4298aee1fe0a0afdc37156c884023ceb4ec5 /source4/build/m4
parent107f7b9efa960145019e16e2a0a626572b5ec2d0 (diff)
downloadsamba-f266ee7c28aa6ddf1571108a1a8a9b447ec1034c.tar.gz
samba-f266ee7c28aa6ddf1571108a1a8a9b447ec1034c.tar.bz2
samba-f266ee7c28aa6ddf1571108a1a8a9b447ec1034c.zip
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)
Diffstat (limited to 'source4/build/m4')
-rw-r--r--source4/build/m4/check_cc.m421
1 files changed, 14 insertions, 7 deletions
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)