bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] AM_GNU_GETTEXT([external]) disables NLS


From: Sergey Poznyakoff
Subject: [PATCH] AM_GNU_GETTEXT([external]) disables NLS
Date: Mon, 06 Jun 2005 20:07:15 +0300

Hello,

Using AM_GNU_GETTEXT([external]) with gettext version 0.14.4 and later
will in some circumstances disable NLS altogether. In particular, this
happens in GNU awk 3.1.4. Its configure.ac contains:

dnl initialize GNU gettext
AM_GNU_GETTEXT([external])
AM_GNU_GETTEXT_VERSION([0.14.4])

Its main() contains:

##if HAVE_LC_MESSAGES && defined(LC_MESSAGES)
        setlocale(LC_MESSAGES, "");
##endif

Now, checking for LC_MESSAGES occurs in gettext-runtime/m4/gettext.m4,
in defun AM_INTL_SUBDIR. This function is called from AM_GNU_GETTEXT
only if variable gt_included_intl equals to `yes', which in turn
occurs only if the first argument to AM_GNU_GETTEXT is not `external'.

Thus GNU awk and any programs using an approach similar to that of gawk,
are effectively distributed witout NLS support.

Proposed is a patch to gettext-runtime/m4/gettext.m4 that moves checking
for LC_MESSAGES to AM_GNU_GETTEXT (see attachment).

Regards,
Sergey

Index: m4/gettext.m4
--- /usr/share/aclocal/gettext.m4       2005-06-02 00:44:58.000000000 +0300
+++ m4/gettext.m4       2005-06-02 00:57:45.000000000 +0300
@@ -67,6 +67,11 @@ AC_DEFUN([AM_GNU_GETTEXT],
   define([gt_libtool_suffix_prefix], ifelse([$1], [use-libtool], [l], []))
 
   AC_REQUIRE([AM_PO_SUBDIRS])dnl
+  AC_CHECK_HEADERS([locale.h])
+  if test $ac_cv_header_locale_h = yes; then
+    gt_LC_MESSAGES
+  fi
+
   ifelse(gt_included_intl, yes, [
     AC_REQUIRE([AM_INTL_SUBDIR])dnl
   ])
@@ -393,7 +398,7 @@ AC_DEFUN([AM_INTL_SUBDIR],
     [AC_DEFINE([ptrdiff_t], [long],
        [Define as the type of the result of subtracting two pointers, if the 
system doesn't define it.])
     ])
-  AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h stddef.h \
+  AC_CHECK_HEADERS([argz.h limits.h nl_types.h malloc.h stddef.h \
 stdlib.h string.h unistd.h sys/param.h])
   AC_CHECK_FUNCS([asprintf fwprintf getcwd getegid geteuid getgid getuid \
 mempcpy munmap putenv setenv setlocale snprintf stpcpy strcasecmp strdup \
@@ -440,9 +445,6 @@ __fsetlocking])
 
   AM_ICONV
   AM_LANGINFO_CODESET
-  if test $ac_cv_header_locale_h = yes; then
-    gt_LC_MESSAGES
-  fi
 
   if test -n "$INTL_MACOSX_LIBS"; then
     CPPFLAGS="$CPPFLAGS 
-I/System/Library/Frameworks/CoreFoundation.framework/Headers"


reply via email to

[Prev in Thread] Current Thread [Next in Thread]