]> git.ipfire.org Git - thirdparty/krb5.git/commitdiff
Add configure option to disable nls support 584/head
authorZentaro Kavanagh <zentaro@google.com>
Wed, 21 Dec 2016 00:52:01 +0000 (16:52 -0800)
committerGreg Hudson <ghudson@mit.edu>
Fri, 6 Jan 2017 17:44:27 +0000 (12:44 -0500)
ChromeOS portage disables nls support as users are not expected to see
strings from the packages built.  Add a configure option to allow
this.

[ghudson@mit.edu: rewrote commit message, reformatted code]

ticket: 8534 (new)

src/configure.in

index a519a4f5897cbaf76a54937008c663f82a90644c..853e7bb28d9a515d99aec7aacd6dc89eb83c0775 100644 (file)
@@ -118,15 +118,29 @@ LIBUTIL=-lutil
 ])
 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)