summaryrefslogtreecommitdiff
path: root/source4/build/m4
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2006-03-05 18:28:33 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:52:15 -0500
commit8ef42b1fab5e7608a8f90f303ec4c1d3524627d9 (patch)
tree029c1856fc9338aa81bb8e4a7d5099cce86ec3dd /source4/build/m4
parent3bec2022eb610342de4a023205996b3872035da7 (diff)
downloadsamba-8ef42b1fab5e7608a8f90f303ec4c1d3524627d9.tar.gz
samba-8ef42b1fab5e7608a8f90f303ec4c1d3524627d9.tar.bz2
samba-8ef42b1fab5e7608a8f90f303ec4c1d3524627d9.zip
r13847: Fix some portability issues with the visibility attribute.
(This used to be commit fe5eae0e983d1c8634dd9b7caf19cd103c641223)
Diffstat (limited to 'source4/build/m4')
-rw-r--r--source4/build/m4/check_cc.m416
1 files changed, 9 insertions, 7 deletions
diff --git a/source4/build/m4/check_cc.m4 b/source4/build/m4/check_cc.m4
index a2d2bae79b..219dc6ad37 100644
--- a/source4/build/m4/check_cc.m4
+++ b/source4/build/m4/check_cc.m4
@@ -124,14 +124,16 @@ if test x"$GCC" = x"yes" ; then
fi
if test -n "$VISIBILITY_CFLAGS"; then
OLD_CFLAGS="${CFLAGS}"
- CFLAGS="${CFLAGS} ${VISIBILITY_CFLAGS} -D_PUBLIC_=__attribute__((visibility(\"default\")))"
- VISIBILITY_CFLAGS="${VISIBILITY_CFLAGS} -D_PUBLIC_=\"__attribute__((visibility(\\\"default\\\")))\""
- AC_MSG_CHECKING([that the C compiler can use the VISIBILITY_CFLAGS])
+ CFLAGS="${CFLAGS} ${VISIBILITY_CFLAGS}"
+ AC_MSG_CHECKING([whether the C compiler supports the visibility attribute])
AC_TRY_RUN([
- _PUBLIC_ void vis_foo1(void) {}
- __attribute__((visibility("default"))) void vis_foo2(void) {}
- #include "${srcdir-.}/build/tests/trivial.c"
- ], AC_MSG_RESULT(yes), [AC_MSG_RESULT(no);VISIBILITY_CFLAGS=""])
+#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])],
+[AC_MSG_RESULT(no);VISIBILITY_CFLAGS=""])
CFLAGS="${OLD_CFLAGS}"
fi