summaryrefslogtreecommitdiff
path: root/m4/gcc4_visibility.m4
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff-webhosting.net>2015-02-04 14:09:54 +0100
committerJörg Frings-Fürst <debian@jff-webhosting.net>2015-02-04 14:09:54 +0100
commitbd82d030011cd8b9655e5ded6b6df9343b42a6bd (patch)
treede82d886dfea0cb7dbb6e80436218a25cb211bc3 /m4/gcc4_visibility.m4
Imported Upstream version 3.22upstream/3.22
Diffstat (limited to 'm4/gcc4_visibility.m4')
-rw-r--r--m4/gcc4_visibility.m421
1 files changed, 21 insertions, 0 deletions
diff --git a/m4/gcc4_visibility.m4 b/m4/gcc4_visibility.m4
new file mode 100644
index 0000000..708d42b
--- /dev/null
+++ b/m4/gcc4_visibility.m4
@@ -0,0 +1,21 @@
+
+# GCC 4.x -fvisibility=hidden
+
+AC_DEFUN([CHECK_GCC_FVISIBILITY], [
+ AC_LANG_PUSH([C])
+ saved_CFLAGS="$CFLAGS"
+ CFLAGS="$saved_CFLAGS -fvisibility=hidden"
+ AC_CACHE_CHECK([whether compiler accepts -fvisibility=hidden],
+ [ac_cv_fvisibility_hidden], AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE()],
+ [ac_cv_fvisibility_hidden=yes],
+ [ac_cv_fvisibility_hidden=no]
+ ))
+ if test "$ac_cv_fvisibility_hidden" = "yes"; then
+ AC_DEFINE([HAVE_VISIBILITY_HIDDEN], [1],
+ [True if compiler supports -fvisibility=hidden])
+ visibility_CFLAGS="-fvisibility=hidden"
+ fi
+ CFLAGS="$saved_CFLAGS"
+ AC_LANG_POP([C])
+])