]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
autopoint: Reject AM_GNU_GETTEXT without 'external' for versions >= 0.20.
authorBruno Haible <bruno@clisp.org>
Sun, 14 Apr 2019 01:58:21 +0000 (03:58 +0200)
committerBruno Haible <bruno@clisp.org>
Sun, 14 Apr 2019 02:01:00 +0000 (04:01 +0200)
* 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.

gettext-tools/misc/autopoint.in
gettext-tools/tests/autopoint-2
gettext-tools/tests/autopoint-3

index d872fd1cd355ef6ebfd67c65d22063a85d9d3b4a..4d1de70e390e01961a3cc5b55a20792cd8958a97 100644 (file)
@@ -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/
index e86a7f3671af4490230aa4a31794cb833ef6e297..8f2aaf305690f364d361bc72248b3f03a11918bc 100755 (executable)
@@ -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 <<EOF >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 <<EOF >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 <<EOF >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
 # <https://savannah.gnu.org/bugs/?40082>
@@ -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:
 # <https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=764580>
@@ -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 <<EOF >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 <<EOF >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 <<EOF >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 <<EOF
-GNU gettext library from gettext-$ARCHIVE_VERSION
-EOF
-: ${DIFF=diff}
-${DIFF} autopoint.ver intl/VERSION || Exit 1
 test -f m4/po.m4 || Exit 1
 test -f po/Makefile.in.in || Exit 1
index 722910b05879214e00827f6c196472ff750f5c0d..dc491a8ac8e6cf05db00ebc0bd8d6db17755caa2 100755 (executable)
@@ -39,10 +39,6 @@ ${AUTOMAKE} --add-missing >/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