bug-gnulib
[Top][All Lists]
Advanced

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

gettext: Update to gettext 0.22


From: Bruno Haible
Subject: gettext: Update to gettext 0.22
Date: Sat, 17 Jun 2023 16:12:56 +0200

This patch updates the (obsolete?) 'gettext' module to match
gettext version 0.22.


2023-06-17  Bruno Haible  <bruno@clisp.org>

        gettext: Update to gettext 0.22.
        * modules/gettext (Files): Add m4/build-to-host.m4.
        (configure.ac): Request infrastructure compatible with gettext 0.22.
        * m4/gettext.m4: Update from gettext 0.22.
        * m4/po.m4: Likewise.

diff --git a/m4/gettext.m4 b/m4/gettext.m4
index a0eda3d8d9..019d1adb5a 100644
--- a/m4/gettext.m4
+++ b/m4/gettext.m4
@@ -1,4 +1,4 @@
-# gettext.m4 serial 71 (gettext-0.20.2)
+# gettext.m4 serial 77 (gettext-0.22)
 dnl Copyright (C) 1995-2014, 2016, 2018-2023 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -20,11 +20,13 @@
 dnl Macro to add for using GNU gettext.
 
 dnl Usage: AM_GNU_GETTEXT([INTLSYMBOL], [NEEDSYMBOL], [INTLDIR]).
-dnl INTLSYMBOL must be one of 'external', 'use-libtool'.
-dnl    INTLSYMBOL should be 'external' for packages other than GNU gettext, and
-dnl    'use-libtool' for the packages 'gettext-runtime' and 'gettext-tools'.
-dnl    If INTLSYMBOL is 'use-libtool', then a libtool library
-dnl    $(top_builddir)/intl/libintl.la will be created (shared and/or static,
+dnl INTLSYMBOL must be one of 'external', 'use-libtool', 'here'.
+dnl    INTLSYMBOL should be 'external' for packages other than GNU gettext.
+dnl    It should be 'use-libtool' for the packages 'gettext-runtime' and
+dnl    'gettext-tools'.
+dnl    It should be 'here' for the package 'gettext-runtime/intl'.
+dnl    If INTLSYMBOL is 'here', then a libtool library
+dnl    $(top_builddir)/libintl.la will be created (shared and/or static,
 dnl    depending on --{enable,disable}-{shared,static} and on the presence of
 dnl    AM-DISABLE-SHARED).
 dnl If NEEDSYMBOL is specified and is 'need-ngettext', then GNU gettext
@@ -55,24 +57,21 @@
 AC_DEFUN([AM_GNU_GETTEXT],
 [
   dnl Argument checking.
-  ifelse([$1], [], , [ifelse([$1], [external], , [ifelse([$1], [use-libtool], ,
+  m4_if([$1], [], , [m4_if([$1], [external], , [m4_if([$1], [use-libtool], , 
[m4_if([$1], [here], ,
     [errprint([ERROR: invalid first argument to AM_GNU_GETTEXT
-])])])])
-  ifelse(ifelse([$1], [], [old])[]ifelse([$1], [no-libtool], [old]), [old],
+])])])])])
+  m4_if(m4_if([$1], [], [old])[]m4_if([$1], [no-libtool], [old]), [old],
     [errprint([ERROR: Use of AM_GNU_GETTEXT without [external] argument is no 
longer supported.
 ])])
-  ifelse([$2], [], , [ifelse([$2], [need-ngettext], , [ifelse([$2], 
[need-formatstring-macros], ,
+  m4_if([$2], [], , [m4_if([$2], [need-ngettext], , [m4_if([$2], 
[need-formatstring-macros], ,
     [errprint([ERROR: invalid second argument to AM_GNU_GETTEXT
 ])])])])
-  define([gt_included_intl],
-    ifelse([$1], [external], [no], [yes]))
+  define([gt_building_libintl_in_same_build_tree],
+    m4_if([$1], [use-libtool], [yes], [m4_if([$1], [here], [yes], [no])]))
   gt_NEEDS_INIT
   AM_GNU_GETTEXT_NEED([$2])
 
   AC_REQUIRE([AM_PO_SUBDIRS])dnl
-  ifelse(gt_included_intl, yes, [
-    AC_REQUIRE([AM_INTL_SUBDIR])dnl
-  ])
 
   dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
   AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
@@ -82,13 +81,13 @@ AC_DEFUN([AM_GNU_GETTEXT]
   dnl Ideally we would do this search only after the
   dnl      if test "$USE_NLS" = "yes"; then
   dnl        if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" != 
"yes"; }; then
-  dnl tests. But if configure.in invokes AM_ICONV after AM_GNU_GETTEXT
+  dnl tests. But if configure.ac invokes AM_ICONV after AM_GNU_GETTEXT
   dnl the configure script would need to contain the same shell code
   dnl again, outside any 'if'. There are two solutions:
   dnl - Invoke AM_ICONV_LINKFLAGS_BODY here, outside any 'if'.
   dnl - Control the expansions in more detail using AC_PROVIDE_IFELSE.
   dnl Since AC_PROVIDE_IFELSE is not documented, we avoid it.
-  ifelse(gt_included_intl, yes, , [
+  m4_if(gt_building_libintl_in_same_build_tree, yes, , [
     AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
   ])
 
@@ -98,8 +97,7 @@ AC_DEFUN([AM_GNU_GETTEXT]
   dnl Set USE_NLS.
   AC_REQUIRE([AM_NLS])
 
-  ifelse(gt_included_intl, yes, [
-    BUILD_INCLUDED_LIBINTL=no
+  m4_if(gt_building_libintl_in_same_build_tree, yes, [
     USE_INCLUDED_LIBINTL=no
   ])
   LIBINTL=
@@ -118,7 +116,7 @@ AC_DEFUN([AM_GNU_GETTEXT]
   dnl If we use NLS figure out what method
   if test "$USE_NLS" = "yes"; then
     gt_use_preinstalled_gnugettext=no
-    ifelse(gt_included_intl, yes, [
+    m4_if(gt_building_libintl_in_same_build_tree, yes, [
       AC_MSG_CHECKING([whether included gettext is requested])
       AC_ARG_WITH([included-gettext],
         [  --with-included-gettext use the GNU gettext library included here],
@@ -174,7 +172,7 @@ AC_DEFUN([AM_GNU_GETTEXT]
 
         if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" != 
"yes"; }; then
           dnl Sometimes libintl requires libiconv, so first search for 
libiconv.
-          ifelse(gt_included_intl, yes, , [
+          m4_if(gt_building_libintl_in_same_build_tree, yes, , [
             AM_ICONV_LINK
           ])
           dnl Search for libintl and define LIBINTL, LTLIBINTL and INCINTL
@@ -252,7 +250,8 @@ AC_DEFUN([AM_GNU_GETTEXT]
         if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" = "yes"; 
} \
            || { { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" 
= "yes"; } \
                 && test "$PACKAGE" != gettext-runtime \
-                && test "$PACKAGE" != gettext-tools; }; then
+                && test "$PACKAGE" != gettext-tools \
+                && test "$PACKAGE" != libintl; }; then
           gt_use_preinstalled_gnugettext=yes
         else
           dnl Reset the values set by searching for libintl.
@@ -261,7 +260,7 @@ AC_DEFUN([AM_GNU_GETTEXT]
           INCINTL=
         fi
 
-    ifelse(gt_included_intl, yes, [
+    m4_if(gt_building_libintl_in_same_build_tree, yes, [
         if test "$gt_use_preinstalled_gnugettext" != "yes"; then
           dnl GNU gettext is not found in the C library.
           dnl Fall back on included GNU gettext library.
@@ -271,10 +270,9 @@ AC_DEFUN([AM_GNU_GETTEXT]
 
       if test "$nls_cv_use_gnu_gettext" = "yes"; then
         dnl Mark actions used to generate GNU NLS library.
-        BUILD_INCLUDED_LIBINTL=yes
         USE_INCLUDED_LIBINTL=yes
-        LIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.la 
$LIBICONV $LIBTHREAD"
-        LTLIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.la 
$LTLIBICONV $LTLIBTHREAD"
+        LIBINTL="m4_if([$3],[],\${top_builddir}/intl,[$3])/libintl.la 
$LIBICONV $LIBTHREAD"
+        LTLIBINTL="m4_if([$3],[],\${top_builddir}/intl,[$3])/libintl.la 
$LTLIBICONV $LTLIBTHREAD"
         LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'`
       fi
 
@@ -341,25 +339,39 @@ AC_DEFUN([AM_GNU_GETTEXT]
     POSUB=po
   fi
 
-  ifelse(gt_included_intl, yes, [
-    dnl In GNU gettext we have to set BUILD_INCLUDED_LIBINTL to 'yes'
-    dnl because some of the testsuite requires it.
-    BUILD_INCLUDED_LIBINTL=yes
-
+  m4_if(gt_building_libintl_in_same_build_tree, yes, [
     dnl Make all variables we use known to autoconf.
-    AC_SUBST([BUILD_INCLUDED_LIBINTL])
     AC_SUBST([USE_INCLUDED_LIBINTL])
     AC_SUBST([CATOBJEXT])
   ])
 
-  dnl For backward compatibility. Some Makefiles may be using this.
-  INTLLIBS="$LIBINTL"
-  AC_SUBST([INTLLIBS])
+  m4_if(gt_building_libintl_in_same_build_tree, yes, [], [
+    dnl For backward compatibility. Some Makefiles may be using this.
+    INTLLIBS="$LIBINTL"
+    AC_SUBST([INTLLIBS])
+  ])
 
   dnl Make all documented variables known to autoconf.
   AC_SUBST([LIBINTL])
   AC_SUBST([LTLIBINTL])
   AC_SUBST([POSUB])
+
+  dnl Define localedir_c and localedir_c_make.
+  dnl Find the final value of localedir.
+  gt_save_prefix="${prefix}"
+  gt_save_datarootdir="${datarootdir}"
+  gt_save_localedir="${localedir}"
+  dnl Unfortunately, prefix gets only finally determined at the end of
+  dnl configure.
+  if test "X$prefix" = "XNONE"; then
+    prefix="$ac_default_prefix"
+  fi
+  eval datarootdir="$datarootdir"
+  eval localedir="$localedir"
+  gl_BUILD_TO_HOST([localedir])
+  localedir="${gt_save_localedir}"
+  datarootdir="${gt_save_datarootdir}"
+  prefix="${gt_save_prefix}"
 ])
 
 
diff --git a/m4/po.m4 b/m4/po.m4
index 26a5a6f5ff..2f14f8e2b1 100644
--- a/m4/po.m4
+++ b/m4/po.m4
@@ -1,5 +1,5 @@
-# po.m4 serial 31 (gettext-0.20.2)
-dnl Copyright (C) 1995-2014, 2016, 2018-2023 Free Software Foundation, Inc.
+# po.m4 serial 32 (gettext-0.21.1)
+dnl Copyright (C) 1995-2014, 2016, 2018-2022 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -179,7 +179,9 @@ AC_DEFUN([AM_PO_SUBDIRS]
                 #      presentlang can be used as a fallback for messages
                 #      which are not translated in the desiredlang catalog).
                 case "$desiredlang" in
-                  "$presentlang"*) useit=yes;;
+                  "$presentlang" | "$presentlang"_* | "$presentlang".* | 
"$presentlang"@*)
+                    useit=yes
+                    ;;
                 esac
               done
               if test $useit = yes; then
@@ -379,7 +381,9 @@ AC_DEFUN([AM_POSTPROCESS_PO_MAKEFILE]
         #      presentlang can be used as a fallback for messages
         #      which are not translated in the desiredlang catalog).
         case "$desiredlang" in
-          "$presentlang"*) useit=yes;;
+          "$presentlang" | "$presentlang"_* | "$presentlang".* | 
"$presentlang"@*)
+            useit=yes
+            ;;
         esac
       done
       if test $useit = yes; then
diff --git a/modules/gettext b/modules/gettext
index 06572691d7..eff69bcf2c 100644
--- a/modules/gettext
+++ b/modules/gettext
@@ -11,6 +11,7 @@ used.
 
 Files:
 m4/gettext.m4
+m4/build-to-host.m4
 m4/host-cpu-c-abi.m4
 m4/iconv.m4
 m4/intl-thread-locale.m4
@@ -27,7 +28,7 @@ havelib
 
 configure.ac:
 AM_GNU_GETTEXT([external])
-AM_GNU_GETTEXT_VERSION([0.20])
+AM_GNU_GETTEXT_VERSION([0.22])
 
 Makefile.am:
 # If your project uses "gettextize --intl" to put a source-code






reply via email to

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