From: Bruno Haible Date: Sun, 14 Apr 2019 01:58:21 +0000 (+0200) Subject: autopoint: Reject AM_GNU_GETTEXT without 'external' for versions >= 0.20. X-Git-Tag: v0.20~47 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=085578f6df825e7b36c7a34db2396732b317a848;p=thirdparty%2Fgettext.git autopoint: Reject AM_GNU_GETTEXT without 'external' for versions >= 0.20. * gettext-tools/misc/autopoint.in: Fail if AM_GNU_GETTEXT without 'external' is specified with a gettext version >= 0.20. * gettext-tools/tests/autopoint-2: Update. Add two more scenarios. * gettext-tools/tests/autopoint-3: Don't test AM_GNU_GETTEXT([use-libtool]) nor --with-included-gettext. Don't use libtoolize. --- diff --git a/gettext-tools/misc/autopoint.in b/gettext-tools/misc/autopoint.in index d872fd1cd..4d1de70e3 100644 --- a/gettext-tools/misc/autopoint.in +++ b/gettext-tools/misc/autopoint.in @@ -440,6 +440,13 @@ for arg in $xargs; do done IFS="$save_IFS" +if test -z "$omitintl"; then + case "$ver" in + 0.1[0-9] | 0.1[0-9].* ) ;; + *) func_fatal_error "AM_GNU_GETTEXT without 'external' argument is no longer supported in version $ver" ;; + esac +fi + # Check in which directory or directories the po/* infrastructure belongs. configfiles=`"$func_trace" AC_CONFIG_FILES "$configure_in"` # PO directories have a Makefile.in generated from Makefile.in.in. @@ -635,7 +642,7 @@ esac func_destfile () { # There are five categories of files: - # ABOUT_NLS -> top level directory + # ABOUT-NLS -> top level directory # config.rpath mkinstalldirs -> $auxdir # m4/* -> $m4dir/ # intl/* -> intl/ diff --git a/gettext-tools/tests/autopoint-2 b/gettext-tools/tests/autopoint-2 index e86a7f367..8f2aaf305 100755 --- a/gettext-tools/tests/autopoint-2 +++ b/gettext-tools/tests/autopoint-2 @@ -46,9 +46,9 @@ test -f m4/po.m4 || Exit 1 test -f po/Makefile.in.in || Exit 1 test -f build-aux/config.rpath || Exit 1 -rm -fr m4 po +rm -fr m4 po ABOUT-NLS build-aux/config.rpath -# Check for copying libintl source. +# Check for copying libintl source of the current version. cat <configure.ac AC_INIT AC_CONFIG_SRCDIR(hello.c) @@ -62,6 +62,25 @@ AC_CONFIG_FILES([po/Makefile.in]) AC_OUTPUT EOF +$gettext_datadir/autopoint >/dev/null 2>autopoint.err +test $? = 1 || { cat autopoint.err; Exit 1; } + +rm -fr intl m4 po ABOUT-NLS config.rpath + +# Check for copying libintl source of an older version. +cat <configure.ac +AC_INIT +AC_CONFIG_SRCDIR(hello.c) + +AC_PROG_CC +AM_GNU_GETTEXT +AM_GNU_GETTEXT_VERSION([0.19]) + +AC_CONFIG_FILES([Makefile]) +AC_CONFIG_FILES([po/Makefile.in]) +AC_OUTPUT +EOF + $gettext_datadir/autopoint >/dev/null 2>autopoint.err test $? = 0 || { cat autopoint.err; Exit 1; } @@ -73,7 +92,7 @@ test -f intl/VERSION || Exit 1 test -f m4/po.m4 || Exit 1 test -f po/Makefile.in.in || Exit 1 -rm -fr intl m4 po +rm -fr intl m4 po ABOUT-NLS config.rpath # Check for custom macro directory. cat <configure.ac @@ -106,7 +125,7 @@ test -d po || Exit 1 test -f gettext-m4/po.m4 || Exit 1 test -f po/Makefile.in.in || Exit 1 -rm -fr gettext-m4 po +rm -fr gettext-m4 po ABOUT-NLS config.rpath # Check for multiple arguments to AM_GNU_GETTEXT # @@ -133,7 +152,7 @@ test -d po || Exit 1 test -f m4/po.m4 || Exit 1 test -f po/Makefile.in.in || Exit 1 -rm -fr m4 po +rm -fr m4 po ABOUT-NLS config.rpath # Check for certain built-in macros are not in effect when tracing: # @@ -165,7 +184,7 @@ test -d po || Exit 1 test -f m4/po.m4 || Exit 1 test -f po/Makefile.in.in || Exit 1 -rm -fr m4 po +rm -fr m4 po ABOUT-NLS config.rpath # Check for AM_GNU_GETTEXT_REQUIRE_VERSION. cat <configure.ac @@ -192,7 +211,7 @@ test -f m4/po.m4 || Exit 1 test -f po/Makefile.in.in || Exit 1 # Check for the case where both AM_GNU_GETTEXT_REQUIRE_VERSION and -# AM_GNU_GETTEXT_VERSION are used. +# AM_GNU_GETTEXT_VERSION are used. Once with libintl source. cat <configure.ac AC_INIT AC_CONFIG_SRCDIR(hello.c) @@ -210,19 +229,36 @@ AC_CONFIG_FILES([po/Makefile.in]) AC_OUTPUT EOF +$gettext_datadir/autopoint >autopoint.out 2>autopoint.err +test $? = 1 || { cat autopoint.err; Exit 1; } + +# Check for the case where both AM_GNU_GETTEXT_REQUIRE_VERSION and +# AM_GNU_GETTEXT_VERSION are used. Once without libintl source. +cat <configure.ac +AC_INIT +AC_CONFIG_SRCDIR(hello.c) + +AC_PROG_CC +AM_GNU_GETTEXT([external]) +AM_GNU_GETTEXT_REQUIRE_VERSION([0.19]) +# This shall be ignored when AM_GNU_GETTEXT_REQUIRE_VERSION is defined +AM_GNU_GETTEXT_VERSION([0.19]) + +AC_CONFIG_MACRO_DIR([m4]) + +AC_CONFIG_FILES([Makefile]) +AC_CONFIG_FILES([po/Makefile.in]) +AC_OUTPUT +EOF + $gettext_datadir/autopoint >autopoint.out 2>autopoint.err test $? = 0 || { cat autopoint.err; Exit 1; } grep 'using AM_GNU_GETTEXT_REQUIRE_VERSION' autopoint.out 2>&1 >/dev/null || Exit 1 -test -d intl || Exit 1 +test ! -d intl || Exit 1 test -d m4 || Exit 1 test -d po || Exit 1 -cat >autopoint.ver </dev/null 2>/dev/null \ rm -f configure.ac Makefile.am -: ${LIBTOOLIZE=libtoolize} -${LIBTOOLIZE} --version >/dev/null 2>/dev/null \ - || { echo "Skipping test: libtoolize not found"; Exit 77; } - : ${MAKE=make} ${MAKE} --version >/dev/null 2>/dev/null \ || { echo "Skipping test: make not found"; Exit 77; } @@ -58,12 +54,11 @@ LT_INIT AC_CONFIG_MACRO_DIR([m4]) AC_PROG_CC -AM_GNU_GETTEXT([use-libtool]) +AM_GNU_GETTEXT([external]) AM_GNU_GETTEXT_VERSION([$ARCHIVE_VERSION]) AC_CONFIG_HEADERS([config.h]) AC_CONFIG_FILES([Makefile]) -AC_CONFIG_FILES([intl/Makefile]) AC_CONFIG_FILES([po/Makefile.in]) AC_OUTPUT EOF @@ -75,7 +70,7 @@ cat <<\EOF >Makefile.am # Makefile configuration - processed by automake. # The list of subdirectories containing Makefiles. -SUBDIRS = intl po +SUBDIRS = po # The list of programs that are built. bin_PROGRAMS = hello @@ -99,7 +94,7 @@ cp -p "$abs_top_srcdir"/examples/hello-c/hello.c . $gettext_datadir/autopoint -f >/dev/null 2>autopoint.err test $? = 0 || { cat autopoint.err; Exit 1; } -test -d intl || Exit 1 +test ! -d intl || Exit 1 test -d m4 || Exit 1 test -d po || Exit 1 @@ -109,9 +104,6 @@ test -f po/Makefile.in.in || Exit 1 cp -p po/Makevars.template po/Makevars echo hello.c > po/POTFILES.in -${LIBTOOLIZE} -f -i >/dev/null 2>autopoint.err -test $? = 0 || { cat autopoint.err; Exit 1; } - ${ACLOCAL} -I m4 >/dev/null 2>autopoint.err test $? = 0 || { cat autopoint.err; Exit 1; } @@ -125,9 +117,9 @@ test $? = 0 || { cat autopoint.err; Exit 1; } ${AUTOMAKE} -a -c >/dev/null 2>autopoint.err test $? = 0 || { cat autopoint.err; Exit 1; } -# Check if libintl compiles. +# Check that it all compiles. : ${CONFIG_SHELL=${SHELL-/bin/sh}} -${CONFIG_SHELL} ./configure --with-included-gettext >/dev/null 2>autpoint.err +${CONFIG_SHELL} ./configure >/dev/null 2>autpoint.err test $? = 0 || { cat autopoint.err; Exit 1; } ${MAKE} >/dev/null 2>autopoint.err