summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorStefano Lattarini <stefano.lattarini@gmail.com>2011-12-24 10:45:46 +0100
committerStefano Lattarini <stefano.lattarini@gmail.com>2011-12-24 10:45:46 +0100
commitd2fc8246603a665891b673d4a3b759e846232ff0 (patch)
treefc9f4b20ec7a0f13f5ac788519de4bcdcabfb2c4 /tests
parent54af9ca84664208507afed2ee2707145b2d2890a (diff)
parentbfc83bdec2e6e39a3275ae0c51b29a86603b49ad (diff)
downloadautomake-d2fc8246603a665891b673d4a3b759e846232ff0.tar.gz
Merge branch 'maint' into msvc
* maint: gitignore: use only one .gitignore file, in the top-level directory tests: one more fixlet for gettext macros requirement tests: fix handling of gettext macros requirement
Diffstat (limited to 'tests')
-rw-r--r--tests/.gitignore8
-rwxr-xr-xtests/gettext-macros.test26
2 files changed, 21 insertions, 13 deletions
diff --git a/tests/.gitignore b/tests/.gitignore
deleted file mode 100644
index 3c1f9903f..000000000
--- a/tests/.gitignore
+++ /dev/null
@@ -1,8 +0,0 @@
-aclocal-*
-automake-*
-defs
-parallel-tests.am
-*.dir
-*.log
-*.log-t
-*-p.test
diff --git a/tests/gettext-macros.test b/tests/gettext-macros.test
index 5dd3a79d9..03efe8568 100755
--- a/tests/gettext-macros.test
+++ b/tests/gettext-macros.test
@@ -20,17 +20,17 @@
. ./defs || Exit 1
+extract_program_version ()
+{
+ "$1" --version | sed 1q | $PERL -ne '/(\d(?:\.\d+)+)/ and print "$1\n"'
+}
+
echo "# Automatically generated by $me." > get.sh
echo : >> get.sh
# The `gettextize' and `autopoint' scripts will look into Makefile.am.
echo ACLOCAL_AMFLAGS = -I m4 > Makefile.am
-# Required by autopoint.
-echo 'AM_GNU_GETTEXT' > configure.in
-# Likewise; and older version specified here *won't* work!
-echo 'AM_GNU_GETTEXT_VERSION([0.10.35])' >> configure.in
-
# Prefer autopoint to gettextize, since the more modern versions of the
# latter might unconditionally require user interaction to complete;
# yes, this means confirmation from /dev/tty (!) -- see:
@@ -45,6 +45,22 @@ else
am_gettextize_command=gettextize
fi
+# We will need to specify the correct autopoint (or gettextize) version
+# in the AM_GNU_GETTEXT_VERSION call in configure.in if we want autopoint
+# (or gettextize) to setup the correct infrastructure -- in particular,
+# for what concerns us, to bring in all the required .m4 files.
+autopoint_version=`extract_program_version $am_gettextize_command` \
+ && test -n "$autopoint_version" \
+ || autopoint_version=0.10.35
+
+cat > configure.in <<END
+AC_INIT([foo], [1.0])
+AC_PROG_CC
+# Both required by autopoint.
+AM_GNU_GETTEXT
+AM_GNU_GETTEXT_VERSION([$autopoint_version])
+END
+
if $am_gettextize_command --force && test -f m4/gettext.m4; then
echo "ACLOCAL_PATH='`pwd`/m4':\$ACLOCAL_PATH" >> get.sh
echo "export ACLOCAL_PATH" >> get.sh