]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
tests: rework gettext to only check 'external' behavior
authorMike Frysinger <vapier@gentoo.org>
Fri, 13 Jan 2023 01:31:31 +0000 (20:31 -0500)
committerMike Frysinger <vapier@gentoo.org>
Sat, 14 Jan 2023 05:07:09 +0000 (00:07 -0500)
The gettext project deprecated non-external use back in 2010 with the
0.18 release, and made it fatal with the 0.20 release in 2019.  With
that version, calling AM_GNU_GETTEXT() fails, which means all Automake
tests are now skipped.  The t/gettext-macros.sh helper probes gettext
as such:

>+ autopoint --force
>  autopoint: *** AM_GNU_GETTEXT without 'external' argument is no longer supported in version 0.21.1
>  autopoint: *** Stop.
> ...
>+ aclocal-1.16 -Werror -Wno-syntax -I m4 --install
>  aclocal-1.16: warnings are treated as errors
>  configure.ac:4: warning: macro 'AM_GNU_GETTEXT' not found in library
>  configure.ac:5: warning: macro 'AM_GNU_GETTEXT_VERSION' not found in library
>+ echo skip_all_ "couldn't find or get gettext macros"

Since t/gettext-macros.sh generates a helper that all other gettext
tests use to see if gettext is available, all they get skipped.

Rework our existing tests to only check the 'external' gettext mode.
This should work with older versions, and we don't really need to
keep track of old non-external mode since it's been deprecated for
so long.

* t/gettext-basics.sh: Use external gettext mode, and adjust tests.
* t/gettext-config-rpath.sh: Likewise.
* t/gettext-macros.sh: Likewise.
* t/gettext-pr381.sh: Likewise.
* t/subdir-cond-gettext.sh: Likewise.

t/gettext-basics.sh
t/gettext-config-rpath.sh
t/gettext-macros.sh
t/gettext-pr381.sh
t/subdir-cond-gettext.sh

index 93fe782f40272f36e027c20b6f465b1c07e978b2..cb2101086d7d8f13f537181f3777911567621c63 100644 (file)
@@ -20,7 +20,7 @@ required='gettext'
 . test-init.sh
 
 cat >> configure.ac << 'END'
-AM_GNU_GETTEXT
+AM_GNU_GETTEXT([external])
 AC_OUTPUT
 END
 
@@ -31,28 +31,23 @@ mkdir po intl
 $ACLOCAL
 $AUTOCONF
 
-# po/ and intl/ are required.
+# po/ is required.  intl/ may not be used with external gettext.
+# Internal (bundled) was deprecated upstream in gettext 0.18 (2010)
+# and made fatal in gettext 0.20 (2019).
 
 AUTOMAKE_fails --add-missing
 grep 'AM_GNU_GETTEXT.*SUBDIRS' stderr
 
 echo 'SUBDIRS = po' >Makefile.am
-AUTOMAKE_fails --add-missing
-grep 'AM_GNU_GETTEXT.*intl' stderr
+# Should not fail.
+$AUTOMAKE --add-missing
 
 echo 'SUBDIRS = intl' >Makefile.am
 AUTOMAKE_fails --add-missing
 grep 'AM_GNU_GETTEXT.*po' stderr
 
-# Ok.
-
 echo 'SUBDIRS = po intl' >Makefile.am
-$AUTOMAKE --add-missing
-
-# Make sure distcheck runs './configure --with-included-gettext'.
-./configure
-echo distdir: > po/Makefile
-echo distdir: > intl/Makefile
-$MAKE -n distcheck | grep '.*--with-included-gettext'
+AUTOMAKE_fails --add-missing
+grep 'intl.*SUBDIRS.*AM_GNU_GETTEXT' stderr
 
 :
index 3953a0c3df838948adc9e0140caa2ea72a420130..522b42fce9671b97dbd04c76a83daaac064ec18e 100644 (file)
@@ -20,14 +20,14 @@ required='gettext'
 . test-init.sh
 
 cat >> configure.ac << 'END'
-AM_GNU_GETTEXT
+AM_GNU_GETTEXT([external])
 # config.rpath is required by versions >= 0.14.3.
 AM_GNU_GETTEXT_VERSION([0.14.3])
 AC_OUTPUT
 END
 
-echo 'SUBDIRS = po intl' >Makefile.am
-mkdir po intl
+echo 'SUBDIRS = po' >Makefile.am
+mkdir po
 
 # If aclocal fails here, it may be that gettext is too old to provide
 # AM_GNU_GETTEXT_VERSION.  Similarly, autopoint will fail if it's
index e352e679079e984260f3b6486fb2b1f7b2a8bc0a..1376be81eae0ca13536cbce5c8ab94a573d2b480 100644 (file)
@@ -47,8 +47,8 @@ autopoint_version=$(extract_program_version autopoint) \
 cat > configure.ac <<END
 AC_INIT([foo], [1.0])
 AC_PROG_CC
-# Both required by autopoint.
-AM_GNU_GETTEXT
+# Both required by autopoint.  Newer gettext (0.20+) requires external.
+AM_GNU_GETTEXT([external])
 AM_GNU_GETTEXT_VERSION([$autopoint_version])
 END
 
index 562e2226cee6e982785fe20a81db6d58036174d5..cac197271f469a85cd8e12554c57418eaeffa2b4 100644 (file)
@@ -21,7 +21,7 @@ required='gettext'
 . test-init.sh
 
 cat >> configure.ac << 'END'
-AM_GNU_GETTEXT
+AM_GNU_GETTEXT([external])
 AC_OUTPUT
 END
 
index 023eff1348850c336499749e917572025acbd715..a203c025d30812d87a0bc0d50958bab0cfbd42fc 100644 (file)
@@ -20,18 +20,18 @@ required=gettext
 . test-init.sh
 
 cat >> configure.ac << 'END'
-AM_GNU_GETTEXT
+AM_GNU_GETTEXT([external])
 AM_CONDITIONAL([MAUDE], [true])
 ALL_LINGUAS=
 AC_SUBST([ALL_LINGUAS])
 END
 
-mkdir po intl
+mkdir po
 : >config.rpath
 
 cat > Makefile.am << 'END'
 if MAUDE
-SUBDIRS = po intl
+SUBDIRS = po
 else
 SUBDIRS =
 endif