In addition to proper quoting for M4, the macro would not behave totally as
expected: for example, providing '--disable-modelock' would enable the
feature instead of keeping it disabled as the default.

The definitions now properly behave as expectable, so the user can
explicitly specify how he wants the feature even if it is the default; it
will also fail on improper use which is always a good idea to ease possible
future evolution.

Signed-off-by: Christophe CURIS <christophe.cu...@free.fr>
---
 configure.ac | 33 ++++++++++++++++++++++-----------
 1 file changed, 22 insertions(+), 11 deletions(-)

diff --git a/configure.ac b/configure.ac
index 8462a73..53a39df 100644
--- a/configure.ac
+++ b/configure.ac
@@ -588,8 +588,14 @@ AC_CHECK_LIB([X11], [XConvertCase],
 
 dnl XKB keyboard language status
 dnl ============================
-AC_ARG_ENABLE(modelock, AS_HELP_STRING([--enable-modelock], [XKB keyboard 
language status support]),
-               AC_DEFINE(XKB_MODELOCK, 1, [whether XKB language MODELOCK 
should be enabled]))
+AC_ARG_ENABLE([modelock],
+    [AS_HELP_STRING([--enable-modelock], [XKB keyboard language status 
support])],
+    [AS_CASE([$enableval],
+        [yes|no], [],
+        [AC_MSG_ERROR([bad value '$enableval' for --enable-modelock])])],
+    [enable_modelock=no])
+AS_IF([test "x$enable_modelock" = "xyes"],
+    [AC_DEFINE([XKB_MODELOCK], [1], [whether XKB language MODELOCK should be 
enabled]) ])
 
 
 dnl XDND Drag-nd-Drop support
@@ -599,10 +605,11 @@ AC_ARG_ENABLE([xdnd],
     [AS_CASE(["$enableval"],
         [yes|no], [],
         [AC_MSG_ERROR([bad value $enableval for --disable-xdnd]) ]) ],
-    [enable_xdnd=yes
-  supported_xext="$supported_xext XDnD"
-  AC_DEFINE(XDND, 1, [whether Drag-nd-Drop support should be enabled])
-])
+    [enable_xdnd=yes])
+AS_IF([test "x$enable_xdnd" = "xyes"],
+    [supported_xext="$supported_xext XDnD"
+     AC_DEFINE([XDND], [1], [whether Drag-nd-Drop support should be enabled])],
+    [unsupported="$unsupported XDnd"])
 
 
 dnl XShape support
@@ -922,11 +929,15 @@ AC_SUBST(wprefs_bindir)
 
 dnl Enable User Defined Menu thing
 dnl ==============================
-AC_ARG_ENABLE(usermenu, AS_HELP_STRING([--enable-usermenu], [user defined 
menus for applications]),
-if test "$enableval" = yes; then
-       AC_DEFINE(USER_MENU, 1, [define if you want user defined menus for 
applications])
-fi
-)
+AC_ARG_ENABLE([usermenu],
+    [AS_HELP_STRING([--enable-usermenu], [user defined menus for 
applications])],
+    [AS_CASE([$enableval],
+        [yes|no], [],
+        [AC_MSG_ERROR([bad value '$enableval' for --enable-usermenu])])],
+    [enable_usermenu=no])
+AS_IF([test "x$enable_usermenu" = "xyes"],
+    [AC_DEFINE([USER_MENU], [1],
+        [define if you want user defined menus for applications])])
 
 
 dnl Support for removing non-public symbols from a library
-- 
2.1.4


-- 
To unsubscribe, send mail to wmaker-dev-unsubscr...@lists.windowmaker.org.

Reply via email to