From c389883ba2c93dfc11ac410a952f42f1065057d2 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Mon, 6 Mar 2006 22:01:03 +0000 Subject: r13902: Stricter checking for the -fvisibility flag Add two more proto headers. (This used to be commit 0c95bf0cd33d8a6c35f692b796d7fbfd98b4d068) --- source4/build/m4/check_cc.m4 | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) (limited to 'source4/build/m4') 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) # -- cgit