1 AC_DEFUN([AC_FUNC_GCC_VISIBILITY],
2 [AC_CACHE_CHECK(whether __attribute__((visibility())) is supported,
3 libc_cv_visibility_attribute,
4 [cat > conftest.c <<EOF
5 int foo __attribute__ ((visibility ("hidden"))) = 1;
6 int bar __attribute__ ((visibility ("protected"))) = 1;
8 libc_cv_visibility_attribute=no
9 if ${CC-cc} -Werror -S conftest.c -o conftest.s \
11 if grep '\.hidden.*foo' conftest.s >/dev/null; then
12 if grep '\.protected.*bar' conftest.s >/dev/null; then
13 libc_cv_visibility_attribute=yes
19 if test $libc_cv_visibility_attribute = yes; then
20 AC_DEFINE(HAVE_VISIBILITY_ATTRIBUTE, [], [GCC supports visibility attributes])