1 AC_INIT(gwm, 0.0, gtw@gnu.org)
2 AC_CONFIG_SRCDIR(gwm.c)
4 AC_CONFIG_FILES(Makefile)
5 AC_CONFIG_HEADERS(config.h)
7 if test -f config.options; then
13 # GWM_MANDATORY_PACKAGE(PKG-NAME)
14 AC_DEFUN([GWM_MANDATORY_PACKAGE],[
15 AC_MSG_CHECKING([for $1])
16 PKG_CHECK_EXISTS([$1],
18 gwm_packages="$gwm_packages $1"],
22 # GWM_OPTIONAL_PACKAGE(PKG-NAME, [LABEL], [DEPENDENCIES])
23 AC_DEFUN([GWM_OPTIONAL_PACKAGE],[
24 gwm_label=m4_ifval([$2], [$2], [$1])
25 gwm_name=`echo $ECHO_N $gwm_label | tr 'a-z' 'A-Z' | tr -c 'a-zA-Z0-9' _`
28 if eval test "x\$gwm_found_$gwm_i" != "xyes"; then gwm_have_deps=no; fi
30 if test $gwm_have_deps = yes; then
31 AC_MSG_CHECKING([for $gwm_label])
32 if eval test "x\$with_$gwm_label" = xno; then
33 AC_MSG_RESULT(disabled)
35 PKG_CHECK_EXISTS([$1],
37 gwm_packages="$gwm_packages $1"
38 eval "gwm_found_$gwm_label=yes"
39 AC_DEFINE_UNQUOTED(USE_$gwm_name, 1)],
45 AC_DEFINE(_GNU_SOURCE, 1, [Enable GNU extensions on systems that have them.])
47 # Checks for programs:
51 # Checks for libraries:
52 AC_ARG_WITH(composite,[ --with-composite use the X Composite extension.])
53 AC_ARG_WITH(damage, [ --with-damage use the X DAMAGE extension.])
54 AC_ARG_WITH(render, [ --with-render use the X RENDER extension.])
55 AC_ARG_WITH(shape, [ --with-shape use the X SHAPE extension.])
56 AC_ARG_WITH(xfixes, [ --with-xfixes use the XFIXES extension.])
58 AH_TEMPLATE(USE_COMPOSITE,[Use the X Composite extension.])
59 AH_TEMPLATE(USE_DAMAGE,[Use the X DAMAGE extension.])
60 AH_TEMPLATE(USE_RENDER,[Use the X RENDER extension.])
61 AH_TEMPLATE(USE_SHAPE,[Use the X SHAPE extension.])
62 AH_TEMPLATE(USE_XFIXES,[Use the XFIXES extension.])
64 GWM_MANDATORY_PACKAGE(xcb)
65 GWM_OPTIONAL_PACKAGE(fontconfig)
66 GWM_OPTIONAL_PACKAGE(freetype2)
67 GWM_OPTIONAL_PACKAGE(xcb-composite, composite)
68 GWM_OPTIONAL_PACKAGE(xcb-damage, damage)
69 GWM_OPTIONAL_PACKAGE(xcb-render, render, fontconfig freetype2)
70 GWM_OPTIONAL_PACKAGE(xcb-shape, shape)
71 GWM_OPTIONAL_PACKAGE(xcb-xfixes, xfixes)
73 AM_CONDITIONAL(RENDER, [test x$gwm_found_render = xyes])
75 AC_SEARCH_LIBS(iconv, iconv)
77 # Checks for header files:
78 AC_CHECK_HEADERS(iconv.h mcheck.h poll.h)
80 # Checks for functions:
81 AC_CHECK_FUNCS(iconv mtrace ppoll)
83 PKG_CFLAGS=`$PKG_CONFIG --cflags $gwm_packages`
84 PKG_LIBS=`$PKG_CONFIG --libs $gwm_packages`