AC_DEFUN([AC_FUNC_GCC_VISIBILITY], [AC_CACHE_CHECK(whether __attribute__((visibility())) is supported, libc_cv_visibility_attribute, [cat > conftest.c </dev/null 2>&1; then if grep '\.hidden.*foo' conftest.s >/dev/null; then if grep '\.protected.*bar' conftest.s >/dev/null; then libc_cv_visibility_attribute=yes fi fi fi rm -f conftest.[cs] ]) if test $libc_cv_visibility_attribute = yes; then AC_DEFINE(HAVE_VISIBILITY_ATTRIBUTE, [], [GCC supports visibility attributes]) fi ])