summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorGwenole Beauchesne <gwenole.beauchesne@intel.com>2012-08-06 18:16:58 +0200
committerGwenole Beauchesne <gwenole.beauchesne@intel.com>2012-09-26 11:53:58 +0200
commitf4a27f24ec5df32f28c3279e445200dded327585 (patch)
tree1192701889a0c066dd12068ffe496bce1b1fdc7e /configure.ac
parentbbc66c8772ee6000f9a2421922259ff39b71a272 (diff)
downloadlibva-f4a27f24ec5df32f28c3279e445200dded327585.tar.gz
configure: check for visibility attribute.
Add a check for GCC "visibility" attribute. Also define DLL_HIDDEN helper so that to declare functions as internal to a particular shared library. Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac22
1 files changed, 22 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 9f37d90..1f958a8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -171,6 +171,28 @@ if test "$enable_docs" = "yes"; then
fi
AM_CONDITIONAL(ENABLE_DOCS, test "$enable_docs" = "yes")
+# Check for __attribute__((visibility()))
+AC_CACHE_CHECK([whether __attribute__((visibility())) is supported],
+ ac_cv_have_gnuc_visibility_attribute,
+ [cat > conftest.c <<EOF
+int foo __attribute__ ((visibility ("hidden"))) = 1;
+int bar __attribute__ ((visibility ("protected"))) = 1;
+EOF
+ ac_cv_have_gnuc_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
+ ac_cv_have_gnuc_visibility_attribute="yes"
+ fi
+ fi
+ fi
+ rm -f conftest.[cs]
+])
+if test "$ac_cv_have_gnuc_visibility_attribute" = "yes"; then
+ AC_DEFINE([HAVE_GNUC_VISIBILITY_ATTRIBUTE], [1],
+ [Defined to 1 if GCC visibility attribute is supported])
+fi
+
# Check for X11
USE_X11="no"
if test "$enable_x11" = "yes"; then