summaryrefslogtreecommitdiff
path: root/m4/xcb.m4
diff options
context:
space:
mode:
authorGaetan Nadon <memsize@videotron.ca>2014-03-26 15:24:44 -0400
committerUli Schlachter <psychon@znc.in>2014-08-06 13:26:08 +0200
commit7f07b57be587a2ebe0cadceba3fe67ed4a1e79db (patch)
tree8dde40a9a351131223e0ef28b94a3795772f207a /m4/xcb.m4
parentd1e8ec96fca4862f37ec9f0e9407bb989c4c161a (diff)
config: default option for enable-dri3 is not implemented
The first symptom is the help text: --enable-dri3 Build XCB DRI3 Extension (default: "$sendfds") The implementation variable $sendfds leaked into the user interface. Testing the various user inputs: <nothing> DRI3 is enabled PASS --enable-dri3 DRI3 is enabled PASS --enable-dri3=yes DRI3 is enabled PASS --enable-dri3=no DRI3 is disabled PASS --disable-dri3 DRI3 is disabled PASS --enable-dri3=$sendfds DRI3 is disabled FAIL This patch implements the usual idiom for features that are enabled by default if the various conditions are met (sendfds is available). New help text: --enable-dri3 Build XCB DRI3 Extension (default: auto) With the additional user input: --enable-dri3=auto which is equivalent to providing no input at all. Reviewed-by: Josh Triplett <josh@joshtriplett.org> Signed-off-by: Gaetan Nadon <memsize@videotron.ca> Signed-off-by: Uli Schlachter <psychon@znc.in>
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"])
])