1 dnl Detection and configuration of the visibility feature of gcc
2 dnl Vincent Torri 2006-02-11
4 dnl XCB_CHECK_VISIBILITY([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
5 dnl Check the visibility feature of gcc
7 AC_DEFUN([XCB_CHECK_VISIBILITY],
9 AC_MSG_CHECKING([whether ${CC} supports symbol visibility])
12 CFLAGS="$CFLAGS -fvisibility=hidden -fvisibility-inlines-hidden"
16 #pragma GCC visibility push(hidden)
18 #pragma GCC visibility pop
25 [Defined if GCC supports the visibility feature])
26 m4_if([$1], [], [:], [$1])
28 [m4_if([$2], [], [:], [$2])
34 dnl Detection and configuration of the visibility feature of gcc
35 dnl Vincent Torri 2006-02-11
37 dnl XCB_EXTENSION(name, default)
38 dnl set the X extension
40 AC_DEFUN([XCB_EXTENSION],
42 pushdef([UP], translit([$1], [-a-z], [_A-Z]))dnl
43 pushdef([DOWN], translit([$1], [A-Z], [a-z]))dnl
45 m4_if([$2], [yes], [m4_define([xcb_defopt], [yes])],
46 [$2], [no], [m4_define([xcb_defopt], [no])],
47 m4_define([xcb_defopt], [auto]))dnl
50 [AS_HELP_STRING([--enable-[]DOWN],
51 [Build XCB $1 Extension (default: ]xcb_defopt[)])],
52 [BUILD_[]UP=$enableval],
53 [BUILD_[]UP=xcb_defopt])
55 m4_if(xcb_defopt, [auto], [
56 # This extension has a default value of "auto" and depends on the value of $2
57 if test "x$BUILD_[]UP" = "xauto" ; then
60 if test "x$BUILD_[]UP" = "xyes" ; then
61 if test "x$2" = "xno" ; then
62 AC_MSG_ERROR([Extension []UP requested, but dependencies are not met])
66 m4_undefine([xcb_defopt])dnl
67 AM_CONDITIONAL(BUILD_[]UP, [test "x$BUILD_[]UP" = "xyes"])
70 dnl End of acinclude.m4