summaryrefslogtreecommitdiff
path: root/m4/xcb.m4
diff options
context:
space:
mode:
Diffstat (limited to 'm4/xcb.m4')
-rw-r--r--m4/xcb.m418
1 files changed, 15 insertions, 3 deletions
diff --git a/m4/xcb.m4 b/m4/xcb.m4
index 32e852d..cf525c0 100644
--- a/m4/xcb.m4
+++ b/m4/xcb.m4
@@ -38,15 +38,27 @@ dnl XCB_EXTENSION(name, default)
dnl set the X extension
dnl
AC_DEFUN([XCB_EXTENSION],
-[
+[dnl
pushdef([UP], translit([$1], [-a-z], [_A-Z]))dnl
pushdef([DOWN], translit([$1], [A-Z], [a-z]))dnl
+dnl
+m4_if([$2], [yes], [m4_define([xcb_defopt], [yes])],
+ [$2], [no], [m4_define([xcb_defopt], [no])],
+ m4_define([xcb_defopt], [auto]))dnl
AC_ARG_ENABLE(DOWN,
- [AS_HELP_STRING([--enable-[]DOWN], [Build XCB $1 Extension (default: $2)])],
+ [AS_HELP_STRING([--enable-[]DOWN],
+ [Build XCB $1 Extension (default: ]xcb_defopt[)])],
[BUILD_[]UP=$enableval],
- [BUILD_[]UP=$2])
+ [BUILD_[]UP=xcb_defopt])
+dnl
+m4_if(xcb_defopt, [auto], [
+# This extension has a default value of "auto" and depends on the value of $2
+if test "x$BUILD_[]UP" = "xauto" ; then
+ BUILD_[]UP=$2
+fi])
+m4_undefine([xcb_defopt])dnl
AM_CONDITIONAL(BUILD_[]UP, [test "x$BUILD_[]UP" = "xyes"])
])