])
AC_SUBST(LIBUTIL)
-AC_CHECK_HEADER(libintl.h, [
- AC_SEARCH_LIBS(dgettext, intl, [
- AC_DEFINE(ENABLE_NLS, 1,
- [Define if translation functions should be used.])])])
-
-AC_CHECK_PROG(MSGFMT,msgfmt,msgfmt)
+# Determine if NLS is desired and supported.
po=
-if test x"$MSGFMT" != x; then
- po=po
+AC_ARG_ENABLE([nls],
+AC_HELP_STRING([--disable-nls], [disable native language support]),
+ [], [enable_nls=check])
+if test "$enable_nls" != no; then
+ AC_CHECK_HEADER(libintl.h, [
+ AC_SEARCH_LIBS(dgettext, intl, [
+ AC_DEFINE(ENABLE_NLS, 1,
+ [Define if translation functions should be used.])
+ nls_enabled=yes])])
+
+ AC_CHECK_PROG(MSGFMT,msgfmt,msgfmt)
+ if test x"$MSGFMT" != x; then
+ po=po
+ fi
+
+ # Error out if --enable-nls was explicitly requested but can't be enabled.
+ if test "$enable_nls" = yes; then
+ if test "$nls_enabled" != yes -o "x$po" = x; then
+ AC_MSG_ERROR([NLS support requested but cannot be built])
+ fi
+ fi
fi
AC_SUBST(po)