generated man pages: build without hard coded extension
[free-sw/xcb/libxcb] / m4 / xcb.m4
1 dnl Detection and configuration of the visibility feature of gcc
2 dnl Vincent Torri 2006-02-11
3 dnl
4 dnl XCB_CHECK_VISIBILITY([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
5 dnl Check the visibility feature of gcc
6 dnl
7 AC_DEFUN([XCB_CHECK_VISIBILITY],
8 [
9 AC_MSG_CHECKING([whether ${CC} supports symbol visibility])
10
11 save_CFLAGS=${CFLAGS}
12 CFLAGS="$CFLAGS -fvisibility=hidden -fvisibility-inlines-hidden"
13 AC_COMPILE_IFELSE(
14    [AC_LANG_PROGRAM(
15       [[
16 #pragma GCC visibility push(hidden)
17 extern void f(int);
18 #pragma GCC visibility pop
19       ]],
20       [[]]
21     )],
22    [AC_DEFINE(
23        GCC_HAS_VISIBILITY,
24        [],
25        [Defined if GCC supports the visibility feature])
26     m4_if([$1], [], [:], [$1])
27     AC_MSG_RESULT(yes)],
28    [m4_if([$2], [], [:], [$2])
29     AC_MSG_RESULT(no)])
30
31 CFLAGS=${save_CFLAGS}
32 ])
33
34 dnl Detection and configuration of the visibility feature of gcc
35 dnl Vincent Torri 2006-02-11
36 dnl
37 dnl XCB_EXTENSION(name, default)
38 dnl set the X extension
39 dnl
40 AC_DEFUN([XCB_EXTENSION],
41 [
42 pushdef([UP], translit([$1], [-a-z], [_A-Z]))dnl
43 pushdef([DOWN], translit([$1], [A-Z], [a-z]))dnl
44
45 AC_ARG_ENABLE(DOWN,
46     [AS_HELP_STRING([--enable-[]DOWN], [Build XCB $1 Extension (default: $2)])],
47     [BUILD_[]UP=$enableval],
48     [BUILD_[]UP=$2])
49
50 AM_CONDITIONAL(BUILD_[]UP, [test "x$BUILD_[]UP" = "xyes"])
51 ])
52
53 dnl End of acinclude.m4