Hash :
c9479c29
Author :
Date :
2023-01-12T20:31:31
tests: rework gettext to only check 'external' behavior 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.
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 46 47 48 49 50 51 52 53
#! /bin/sh
# Copyright (C) 2002-2023 Free Software Foundation, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# Check basic gettext support.
required='gettext'
. test-init.sh
cat >> configure.ac << 'END'
AM_GNU_GETTEXT([external])
AC_OUTPUT
END
: > Makefile.am
: > config.rpath
mkdir po intl
$ACLOCAL
$AUTOCONF
# 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
# Should not fail.
$AUTOMAKE --add-missing
echo 'SUBDIRS = intl' >Makefile.am
AUTOMAKE_fails --add-missing
grep 'AM_GNU_GETTEXT.*po' stderr
echo 'SUBDIRS = po intl' >Makefile.am
AUTOMAKE_fails --add-missing
grep 'intl.*SUBDIRS.*AM_GNU_GETTEXT' stderr
: