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

configure: rewrote support for option '--disable-locale'

Renamed it to '--disable-xlocale' because the original name is misleading
about what the option really is for (it sets locale for X, not locales in
general) and updated its documentation;

Added checks to report incorrect uses to the user;

It is now possible to use '--enable-xlocale' to explicitely request for the
feature, so configure would stop if it were not found.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
This commit is contained in:
Christophe CURIS
2015-01-20 22:04:03 +01:00
committed by Carlos R. Mafra
parent f222a319b1
commit d543decee6
2 changed files with 24 additions and 8 deletions

View File

@@ -451,15 +451,8 @@ AC_SUBST(X_LIBRARY_PATH)
dnl Decide which locale function to use, setlocale() or _Xsetlocale() dnl Decide which locale function to use, setlocale() or _Xsetlocale()
dnl by MANOME Tomonori dnl by MANOME Tomonori
dnl =========================================== dnl ===========================================
use_locale=yes WM_I18N_XLOCALE
AC_ARG_ENABLE(locale, AS_HELP_STRING([--disable-locale], [disable use of X locale support]),
use_locale=no)
if test "$use_locale" = yes; then
AC_CHECK_LIB(X11, _Xsetlocale,
AC_DEFINE(X_LOCALE, 1, [define if you want support for X window's X_LOCALE (set by configure)]),,
$XLFLAGS $XLIBS)
fi
dnl Check whether XInternAtoms() exist dnl Check whether XInternAtoms() exist

View File

@@ -135,3 +135,26 @@ AS_IF([test "x$menutextdomain" != "x"],
[AC_DEFINE_UNQUOTED([MENU_TEXTDOMAIN], ["$menutextdomain"], [AC_DEFINE_UNQUOTED([MENU_TEXTDOMAIN], ["$menutextdomain"],
[gettext domain to be used for menu translations]) ]) [gettext domain to be used for menu translations]) ])
]) ])
dnl WM_I18N_XLOCALE
dnl ---------------
dnl
dnl X11 needs to redefine the function 'setlocale' to properly initialize itself,
dnl we check if user wants to disable this behaviour or if it is not supported
AC_DEFUN_ONCE([WM_I18N_XLOCALE],
[AC_ARG_ENABLE([xlocale],
[AS_HELP_STRING([--disable-xlocale],
[disable initialization of locale for X])],
[AS_CASE([$enableval],
[yes|no], [],
[AC_MSG_ERROR([bad value '$enableval' for --disable-xlocale])])],
[enable_xlocale=auto])
AS_IF([test "x$enable_xlocale" != "xno"],
[AC_CHECK_LIB([X11], [_Xsetlocale],
[AC_DEFINE([X_LOCALE], [1],
[defined if the locale is initialized by X window])],
[AS_IF([test "x$enable_xlocale" = "xyes"],
[AC_MSG_ERROR([support for X_LOCALE was explicitely requested, but X11 lacks the appropriate function])])],
[$XLFLAGS $XLIBS]) ])
])