diff --git a/configure.ac b/configure.ac
index 0a1d68d87bfbce4fc2883226ea48e3f83159c068..d9748b9472de4e567e0b1712ad2df4ff6a25cb25 100644 (file)
--- a/configure.ac
+++ b/configure.ac
set -- $CFLAGS
-dnl
-dnl Check for headers
-dnl
-
-AC_CHECK_HEADER([locale.h],
- AC_DEFINE([HAVE_LOCALE_H], [1], [locale.h]),
- ,)
-
dnl
dnl ncmpc-mini
AC_DEFINE([NCMPC_MINI], [1], [Build ncmpc-mini, which disables lots of features])
auto=no
disable_mini=no
+ auto_mini=no
ncurses=ncurses
else
auto=auto
disable_mini=yes
+ auto_mini=auto
ncurses=auto
fi
AC_DEFINE([ENABLE_WIDE], [1], [Enable wide character support])
fi
+dnl multi-byte character support
+
+AC_ARG_ENABLE([multibyte],
+ AC_HELP_STRING([--disable-multibyte],
+ [Disable multibyte character support (default: enabled)]),
+ [enable_multibyte=$enableval],
+ [enable_multibyte=$disable_mini])
+
+if test x$enable_multibyte = xyes; then
+ AC_DEFINE([ENABLE_MULTIBYTE], [1], [Enable multibyte character support])
+else
+ if test x$enable_wide = xyes; then
+ AC_MSG_WARN(wide characters without multibyte characters makes little sense)
+ fi
+fi
dnl Check for glib-2.4
PKG_CHECK_MODULES([GLIB], [glib-2.0 >= 2.4],,
dnl i18n
-AM_NLS
-nls=$USE_NLS
+AC_ARG_ENABLE([locale],
+ AC_HELP_STRING([--disable-locale],
+ [Disable locale support (default: auto)]),
+ [enable_locale=$enableval],
+ [enable_locale=$auto_mini])
+
+if test x$enable_locale = xyes; then
+ AC_CHECK_HEADER([locale.h],,
+ [AC_MSG_ERROR(locale.h is unavailable)])
+fi
+
+if test x$enable_locale = xauto; then
+ AC_CHECK_HEADER([locale.h],
+ [enable_locale=yes],
+ [enable_locale=no])
+fi
+
+if test x$enable_locale = xyes; then
+ AC_DEFINE([ENABLE_LOCALE], [1], [Locale support is enabled])
+fi
+
+if test x$enable_mini != xyes; then
+ AM_NLS
+else
+ USE_NLS=no
+fi
-if test "x$nls" = "xyes"; then
+if test x$USE_NLS = xyes; then
AM_GLIB_GNU_GETTEXT
GETTEXT_PACKAGE=$PACKAGE
AC_SUBST(GETTEXT_PACKAGE)
AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE],
["${GETTEXT_PACKAGE}"],
[gettext domain])
- nls=$gt_cv_have_gettext
- if test "x$nls" != "xyes"; then
+ USE_NLS=$gt_cv_have_gettext
+ if test x$USE_NLS != xyes; then
AC_MSG_WARN([NLS support disabled!])
fi
else