summaryrefslogtreecommitdiff
path: root/source4/build/m4
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2006-03-06 22:01:03 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:52:21 -0500
commitc389883ba2c93dfc11ac410a952f42f1065057d2 (patch)
tree316742e41486876c9eb2fe021f28a913aca55171 /source4/build/m4
parent9862fabead2f82ed0864c5de0dfe4f3bda4db7f5 (diff)
downloadsamba-c389883ba2c93dfc11ac410a952f42f1065057d2.tar.gz
samba-c389883ba2c93dfc11ac410a952f42f1065057d2.tar.bz2
samba-c389883ba2c93dfc11ac410a952f42f1065057d2.zip
r13902: Stricter checking for the -fvisibility flag
Add two more proto headers. (This used to be commit 0c95bf0cd33d8a6c35f692b796d7fbfd98b4d068)
Diffstat (limited to 'source4/build/m4')
-rw-r--r--source4/build/m4/check_cc.m429
1 files changed, 18 insertions, 11 deletions
diff --git a/source4/build/m4/check_cc.m4 b/source4/build/m4/check_cc.m4
index 33bb7050af..72a882b7d8 100644
--- a/source4/build/m4/check_cc.m4
+++ b/source4/build/m4/check_cc.m4
@@ -115,18 +115,25 @@ AC_TRY_RUN([#include "${srcdir-.}/build/tests/trivial.c"],
#
# Check if the compiler support ELF visibility for symbols
#
+
visibility_attribute=no
-AC_MSG_CHECKING([whether the C compiler supports the visibility attribute])
-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"
-], [
- 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);])
+if test x"$GCC" = x"yes" ; then
+ 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])
+ 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"
+ ], [
+ 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);])
+fi
AC_SUBST(visibility_attribute)
#