daily update
[binutils-gdb.git] / gettext.m4
index 82a5277f2253fb9a35887a5bcbb3abb2dbc2a7e3..2c54fb8c140969ca267e610e52c064fc16863f66 100644 (file)
@@ -11,7 +11,7 @@
 
 # serial 3
 
 
 # serial 3
 
-AC_DEFUN(CY_WITH_NLS,
+AC_DEFUN([CY_WITH_NLS],
   [AC_MSG_CHECKING([whether NLS is requested])
     dnl Default is enabled NLS
     AC_ARG_ENABLE(nls,
   [AC_MSG_CHECKING([whether NLS is requested])
     dnl Default is enabled NLS
     AC_ARG_ENABLE(nls,
@@ -24,7 +24,6 @@ AC_DEFUN(CY_WITH_NLS,
 
     dnl If we use NLS figure out what method
     if test "$USE_NLS" = "yes"; then
 
     dnl If we use NLS figure out what method
     if test "$USE_NLS" = "yes"; then
-      AC_DEFINE(ENABLE_NLS, 1, [Define to 1 if NLS is requested])
       AC_MSG_CHECKING([whether included gettext is requested])
       AC_ARG_WITH(included-gettext,
         [  --with-included-gettext use the GNU gettext library included here],
       AC_MSG_CHECKING([whether included gettext is requested])
       AC_ARG_WITH(included-gettext,
         [  --with-included-gettext use the GNU gettext library included here],
@@ -40,7 +39,7 @@ AC_DEFUN(CY_WITH_NLS,
        dnl catgets is only used if permitted by option --with-catgets.
        nls_cv_header_intl=
        nls_cv_header_libgt=
        dnl catgets is only used if permitted by option --with-catgets.
        nls_cv_header_intl=
        nls_cv_header_libgt=
-       CATOBJEXT=NONE
+       CATOBJEXT=
 
        AC_CHECK_HEADER(libintl.h,
          [AC_CACHE_CHECK([for gettext in libc], gt_cv_func_gettext_libc,
 
        AC_CHECK_HEADER(libintl.h,
          [AC_CACHE_CHECK([for gettext in libc], gt_cv_func_gettext_libc,
@@ -81,9 +80,9 @@ AC_DEFUN(CY_WITH_NLS,
        dnl In the standard gettext, we would now check for catgets.
         dnl However, we never want to use catgets for our releases.
 
        dnl In the standard gettext, we would now check for catgets.
         dnl However, we never want to use catgets for our releases.
 
-        if test "$CATOBJEXT" = "NONE"; then
-         dnl Neither gettext nor catgets in included in the C library.
-         dnl Fall back on GNU gettext library.
+        if test x"$CATOBJEXT" = x && test -d $srcdir/../intl; then
+         # Neither gettext nor catgets in included in the C library.
+         # Fall back on GNU gettext library (assuming it is present).
          nls_cv_use_gnu_gettext=yes
         fi
       fi
          nls_cv_use_gnu_gettext=yes
         fi
       fi
@@ -156,9 +155,12 @@ AC_DEFUN(CY_WITH_NLS,
     AC_SUBST(INTLOBJS)
     AC_SUBST(POFILES)
     AC_SUBST(POSUB)
     AC_SUBST(INTLOBJS)
     AC_SUBST(POFILES)
     AC_SUBST(POSUB)
+    if test "x$CATOBJEXT" != "x"; then
+      AC_DEFINE(ENABLE_NLS, 1, [Define to 1 if NLS is requested])
+    fi
   ])
 
   ])
 
-AC_DEFUN(CY_GNU_GETTEXT,
+AC_DEFUN([CY_GNU_GETTEXT],
   [AC_REQUIRE([AC_PROG_MAKE_SET])dnl
    AC_REQUIRE([AC_PROG_CC])dnl
    AC_REQUIRE([AC_PROG_RANLIB])dnl
   [AC_REQUIRE([AC_PROG_MAKE_SET])dnl
    AC_REQUIRE([AC_PROG_CC])dnl
    AC_REQUIRE([AC_PROG_RANLIB])dnl
@@ -286,7 +288,7 @@ __argz_count __argz_stringify __argz_next])
 
 dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
 dnl   TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
 
 dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
 dnl   TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
-AC_DEFUN(AM_PATH_PROG_WITH_TEST,
+AC_DEFUN([AM_PATH_PROG_WITH_TEST],
 [# Extract the first word of "$2", so it can be a program name with args.
 set dummy $2; ac_word=[$]2
 AC_MSG_CHECKING([for $ac_word])
 [# Extract the first word of "$2", so it can be a program name with args.
 set dummy $2; ac_word=[$]2
 AC_MSG_CHECKING([for $ac_word])
@@ -332,7 +334,7 @@ AC_SUBST($1)dnl
 
 # serial 1
 
 
 # serial 1
 
-AC_DEFUN(AM_LC_MESSAGES,
+AC_DEFUN([AM_LC_MESSAGES],
   [if test $ac_cv_header_locale_h = yes; then
     AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
       [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
   [if test $ac_cv_header_locale_h = yes; then
     AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
       [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],