1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-19 20:38:08 +01:00

configure: rewrote 3 ARG_ENABLEs to get them to behave properly

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.curis@free.fr>
This commit is contained in:
Christophe CURIS
2015-01-02 10:34:32 +01:00
committed by Carlos R. Mafra
parent 85a3fb13cc
commit c7843e3f3b

View File

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