lstat64:: use Posix st_mode defines
[xfstests-dev.git] / m4 / visibility_hidden.m4
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;
7 EOF
8                   libc_cv_visibility_attribute=no
9                   if ${CC-cc} -Werror -S conftest.c -o conftest.s \
10                         >/dev/null 2>&1; then
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
14                       fi
15                     fi
16                   fi
17                   rm -f conftest.[cs]
18                   ])
19    if test $libc_cv_visibility_attribute = yes; then
20      AC_DEFINE(HAVE_VISIBILITY_ATTRIBUTE, [], [GCC supports visibility attributes])
21    fi
22   ])