summaryrefslogtreecommitdiff
path: root/acinclude.m4
diff options
context:
space:
mode:
authorTORRI Vincent <Vincent.Torri@iecn.u-nancy.fr>2006-03-07 10:25:23 -0800
committerJamey Sharp <jamey@minilop.net>2006-03-07 10:25:23 -0800
commit522a6e0eac9adeaac533a5b700f42d85d46e2dd7 (patch)
treec7b1a477737bf0a98be7f435061f84ab8e1cf98e /acinclude.m4
parent5437032c7dee85da99b612a707fa94d012d40282 (diff)
Use the GCC 4 visibility extension to mark everything in xcbint.h hidden.
Diffstat (limited to 'acinclude.m4')
-rw-r--r--acinclude.m429
1 files changed, 29 insertions, 0 deletions
diff --git a/acinclude.m4 b/acinclude.m4
new file mode 100644
index 0000000..46a82b9
--- /dev/null
+++ b/acinclude.m4
@@ -0,0 +1,29 @@
+dnl Detection and configuration of the visibility feature of gcc
+dnl Vincent Torri 2006-02-11
+dnl
+dnl GCC_CHECK_VISIBILITY([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
+dnl Check the visibility feature of gcc
+dnl
+AC_DEFUN([GCC_CHECK_VISIBILITY],
+ [AC_MSG_CHECKING([whether ${CC} supports visibility feature])
+ save_CFLAGS=${CFLAGS}
+ CFLAGS="$CFLAGS -fvisibility=hidden -fvisibility-inlines-hidden"
+ AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[
+#pragma GCC visibility push(hidden)
+extern void f(int);
+#pragma GCC visibility pop
+ ]],
+ [[]]
+ )],
+ [AC_DEFINE(
+ GCC_HAS_VISIBILITY,
+ [],
+ [Defined if GCC supports the vilibility feature])
+ m4_if([$1], [], [:], [$1])
+ AC_MSG_RESULT(yes)],
+ [m4_if([$2], [], [:], [$2])
+ AC_MSG_RESULT(no)])
+ CFLAGS=${save_CFLAGS}
+ ])