summaryrefslogtreecommitdiff
blob: 63cb0fc0c55f38916fe370ef72e583f316c200a9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
Adds support for --(enable|disable)-nls configure option.

This enables\disables the generation of language files and
sets the ENABLE_NLS define appropriately.

Default value is enabled to preserve current behavior.

Patch by Zentaro Kavanagh <zentaro@google.com>
https://crbug.com/654842

https://github.com/krb5/krb5/pull/584

--- src/configure.in
+++ src/configure.in
@@ -118,15 +118,22 @@
 ])
 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(NLS).]), ,
+               enableval=yes)
+if test "$enableval" = yes ; then
+        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)
+        if test x"$MSGFMT" != x; then
+                po=po
+        fi
 fi
 AC_SUBST(po)