Check for __attribute__((visibility("hidden"))).

This commit is contained in:
gb 2010-01-25 13:49:55 +00:00
parent c89e9afc5d
commit 59f5b70f3e

View file

@ -30,6 +30,32 @@ AC_CANONICAL_TARGET
AM_INIT_AUTOMAKE AM_INIT_AUTOMAKE
AM_CONFIG_HEADER([config.h]) AM_CONFIG_HEADER([config.h])
dnl Check for __attribute__((visibility()))
AC_CACHE_CHECK([whether __attribute__((visibility())) is supported],
vaapi_cv_visibility_attribute,
[cat > conftest.c <<EOF
int foo __attribute__ ((visibility ("hidden"))) = 1;
int bar __attribute__ ((visibility ("protected"))) = 1;
EOF
vaapi_cv_visibility_attribute=no
if ${CC-cc} -Werror -S conftest.c -o conftest.s >/dev/null 2>&1; then
if grep '\.hidden.*foo' conftest.s >/dev/null; then
if grep '\.protected.*bar' conftest.s >/dev/null; then
vaapi_cv_visibility_attribute=yes
fi
fi
fi
rm -f conftest.[cs]
])
if test $vaapi_cv_visibility_attribute = yes; then
vaapi_cv_visibility_attribute_hidden="__attribute__((visibility(\"hidden\")))"
else
vaapi_cv_visibility_attribute_hidden=""
fi
AC_DEFINE_UNQUOTED([attribute_hidden],
[$vaapi_cv_visibility_attribute_hidden],
[Define the "hidden" visibility attribute])
dnl Versions for GStreamer and plugins-base dnl Versions for GStreamer and plugins-base
GST_MAJORMINOR=gst_major_minor_version GST_MAJORMINOR=gst_major_minor_version
GST_VERSION_REQUIRED=gst_version GST_VERSION_REQUIRED=gst_version