diff options
author | Gaetan Nadon <memsize@videotron.ca> | 2014-02-21 17:06:15 -0500 |
---|---|---|
committer | Gaetan Nadon <memsize@videotron.ca> | 2014-04-02 13:29:54 -0400 |
commit | f5757bd75e4aefe9bc8da79dbf2d0776ce19d666 (patch) | |
tree | 5d95948def4c108a7dae32a4cfec22a9deedd8c5 | |
parent | be0fe56c3bcad5124dcc6c47a2fad01acd16f71a (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>
-rw-r--r-- | configure.ac | 52 | ||||
-rw-r--r-- | m4/xcb.m4 | 18 |
2 files changed, 41 insertions, 29 deletions
diff --git a/configure.ac b/configure.ac index 68c3b2f..61941d7 100644 --- a/configure.ac +++ b/configure.ac @@ -212,32 +212,32 @@ case $host_os in ;; esac -XCB_EXTENSION(Composite, "yes") -XCB_EXTENSION(Damage, "yes") -XCB_EXTENSION(DPMS, "yes") -XCB_EXTENSION(DRI2, "yes") -XCB_EXTENSION(DRI3, "$sendfds") -XCB_EXTENSION(GLX, "yes") -XCB_EXTENSION(Present, "yes") -XCB_EXTENSION(RandR, "yes") -XCB_EXTENSION(Record, "yes") -XCB_EXTENSION(Render, "yes") -XCB_EXTENSION(Resource, "yes") -XCB_EXTENSION(Screensaver, "yes") -XCB_EXTENSION(Shape, "yes") -XCB_EXTENSION(Shm, "yes") -XCB_EXTENSION(Sync, "yes") -XCB_EXTENSION(Xevie, "yes") -XCB_EXTENSION(XFixes, "yes") -XCB_EXTENSION(XFree86-DRI, "yes") -XCB_EXTENSION(Xinerama, "yes") -XCB_EXTENSION(XInput, "no") -XCB_EXTENSION(XKB, "yes") -XCB_EXTENSION(Xprint, "yes") -XCB_EXTENSION(SELinux, "no") -XCB_EXTENSION(XTest, "yes") -XCB_EXTENSION(Xv, "yes") -XCB_EXTENSION(XvMC, "yes") +XCB_EXTENSION(Composite, yes) +XCB_EXTENSION(Damage, yes) +XCB_EXTENSION(DPMS, yes) +XCB_EXTENSION(DRI2, yes) +XCB_EXTENSION(DRI3, $sendfds) +XCB_EXTENSION(GLX, yes) +XCB_EXTENSION(Present, yes) +XCB_EXTENSION(RandR, yes) +XCB_EXTENSION(Record, yes) +XCB_EXTENSION(Render, yes) +XCB_EXTENSION(Resource, yes) +XCB_EXTENSION(Screensaver, yes) +XCB_EXTENSION(Shape, yes) +XCB_EXTENSION(Shm, yes) +XCB_EXTENSION(Sync, yes) +XCB_EXTENSION(Xevie, yes) +XCB_EXTENSION(XFixes, yes) +XCB_EXTENSION(XFree86-DRI, yes) +XCB_EXTENSION(Xinerama, yes) +XCB_EXTENSION(XInput, no) +XCB_EXTENSION(XKB, yes) +XCB_EXTENSION(Xprint, yes) +XCB_EXTENSION(SELinux, no) +XCB_EXTENSION(XTest, yes) +XCB_EXTENSION(Xv, yes) +XCB_EXTENSION(XvMC, yes) AC_ARG_WITH(launchd, AS_HELP_STRING([--with-launchd], [Build with support for Apple's launchd (default: auto)]), [LAUNCHD=$withval], [LAUNCHD=auto]) if test "x$LAUNCHD" = xauto; then @@ -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"]) ]) |