diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/.gitignore | 8 | ||||
-rwxr-xr-x | tests/gettext-macros.test | 26 |
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 |