summaryrefslogtreecommitdiffstats
path: root/gettext-tools/misc
diff options
context:
space:
mode:
authorDaiki Ueno <ueno@gnu.org>2015-08-21 15:19:21 +0900
committerDaiki Ueno <ueno@gnu.org>2015-08-21 15:42:48 +0900
commit50eae3f047204e270e0b70292810868c0dbf179c (patch)
tree585d0eb649113273f9b3ab0a8f95a9cca3a8d4f4 /gettext-tools/misc
parent15363cca838ff1d69f6e3bfbb47ecfe90c0f5000 (diff)
downloadexternal_gettext-50eae3f047204e270e0b70292810868c0dbf179c.zip
external_gettext-50eae3f047204e270e0b70292810868c0dbf179c.tar.gz
external_gettext-50eae3f047204e270e0b70292810868c0dbf179c.tar.bz2
autopoint: Respect AM_GNU_GETTEXT_REQUIRE_VERSION
* gettext-runtime/m4/gettext.m4 (AM_GNU_GETTEXT_REQUIRE_VERSION): New macro. Bump serial to 67. * gettext-tools/doc/autopoint.texi: Mention AM_GNU_GETTEXT_REQUIRE_VERSION. * gettext-tools/misc/gettextize.in: Check if AM_GNU_GETTEXT_VERSION is used. * gettext-tools/misc/autopoint.in: Respect AM_GNU_GETTEXT_REQUIRE_VERSION. * gettext-tools/tests/autopoint-2: Check AM_GNU_GETTEXT_REQUIRE_VERSION.
Diffstat (limited to 'gettext-tools/misc')
-rw-r--r--gettext-tools/misc/ChangeLog5
-rw-r--r--gettext-tools/misc/autopoint.in55
-rw-r--r--gettext-tools/misc/gettextize.in7
3 files changed, 53 insertions, 14 deletions
diff --git a/gettext-tools/misc/ChangeLog b/gettext-tools/misc/ChangeLog
index 53c25cc..a33b574 100644
--- a/gettext-tools/misc/ChangeLog
+++ b/gettext-tools/misc/ChangeLog
@@ -1,5 +1,10 @@
2015-07-28 Daiki Ueno <ueno@gnu.org>
+ * gettextize.in: Check if AM_GNU_GETTEXT_VERSION is used.
+ * autopoint.in: Respect AM_GNU_GETTEXT_REQUIRE_VERSION.
+
+2015-07-28 Daiki Ueno <ueno@gnu.org>
+
* gettextize.in (archive_version): New variable, set to
ARCHIVE_VERSION. Use it as the argument of
AM_GNU_GETTEXT_VERSION.
diff --git a/gettext-tools/misc/autopoint.in b/gettext-tools/misc/autopoint.in
index d7ce4f7..b443ff2 100644
--- a/gettext-tools/misc/autopoint.in
+++ b/gettext-tools/misc/autopoint.in
@@ -23,6 +23,7 @@
progname=$0
package=@PACKAGE@
version=@VERSION@
+archive_version=@ARCHIVE_VERSION@
# Set variables
# - gettext_datadir directory where the data files are stored.
@@ -313,29 +314,59 @@ else
func_trace=func_trace_sed
fi
-# Check whether the -V option and the version number in configure.in match.
-# At least one of the two must be given. If both are given, they must agree.
+# func_version_prereq required_version version
+# compares the required version and the latest archive version.
+func_version_prereq ()
+{
+ req="$1"
+ ver="$2"
+ echo "m4_if(m4_version_compare([$ver], [$req]), [-1], [m4_exit([1])])" \
+ | "$AUTOM4TE" --language=M4sugar 2>&1 >/dev/null
+}
+
+# If AM_GNU_GETTEXT_REQUIRE_VERSION is used and archive_version is newer than
+# that, use archive_version.
+xreq=`func_trace_sed AM_GNU_GETTEXT_REQUIRE_VERSION "$configure_in"`
# Need to use func_trace_sed instead of $func_trace, since
# AM_GNU_GETTEXT_VERSION is not a standard Autoconf trace.
xver=`func_trace_sed AM_GNU_GETTEXT_VERSION "$configure_in"`
-if test -z "$xver" && test -f intl/VERSION; then
- xver=`cat intl/VERSION | LC_ALL=C sed -n -e 's/^.*gettext-\([-+_.0-9A-Za-z]*\).*$/\1/p'`
+
+# Prefer AM_GNU_GETTEXT_REQUIRE_VERSION over AM_GNU_GETTEXT_VERSION if both are
+# specified.
+if test -n "$xreq" && test -n "$xver"; then
+ echo "autopoint: using AM_GNU_GETTEXT_REQUIRE_VERSION instead of AM_GNU_GETTEXT_VERSION"
fi
-if test -n "$xver"; then
- if test -n "$ver"; then
- if test "X$ver" != "X$xver"; then
- func_fatal_error "Version mismatch: specified -V $ver but the package uses gettext version $xver"
- fi
+
+if test -n "$xreq"; then
+ if func_version_prereq "$xreq" "$archive_version"; then
+ ver="$archive_version"
else
- ver="$xver"
+ func_fatal_error "gettext version $xreq or newer is required"
fi
else
- if test -z "$ver"; then
- func_fatal_error "Missing version: please specify in $configure_in through a line 'AM_GNU_GETTEXT_VERSION(x.yy.zz)' the gettext version the package is using"
+ if test -z "$xver" && test -f intl/VERSION; then
+ xver=`cat intl/VERSION | LC_ALL=C sed -n -e 's/^.*gettext-\([-+_.0-9A-Za-z]*\).*$/\1/p'`
+ fi
+
+ # Check whether the -V option and the version number in configure.in match.
+ # At least one of the two must be given. If both are given, they must agree.
+
+ if test -n "$xver"; then
+ if test -n "$ver"; then
+ if test "X$ver" != "X$xver"; then
+ func_fatal_error "Version mismatch: specified -V $ver but the package uses gettext version $xver"
+ fi
+ else
+ ver="$xver"
+ fi
fi
fi
+if test -z "$ver"; then
+ func_fatal_error "Missing version: please specify in $configure_in through a line 'AM_GNU_GETTEXT_VERSION(x.yy.zz)' the gettext version the package is using"
+fi
+
# Check whether the version number is supported.
case "$ver" in
0.10.35 | 0.10.36 | 0.10.37 | 0.10.38 | 0.10.39 | 0.10.40 | \
diff --git a/gettext-tools/misc/gettextize.in b/gettext-tools/misc/gettextize.in
index bd7eb92..286a253 100644
--- a/gettext-tools/misc/gettextize.in
+++ b/gettext-tools/misc/gettextize.in
@@ -1236,8 +1236,11 @@ sed -e 's%sed -e "/POTFILES =/r po/POTFILES" po/Makefile\.in > po/Makefile *;* *
func_modify_configure_in "(AC_OUTPUT): Remove command that created po/Makefile."
sed -e '/^\(dnl \|\)AC_LINK_FILES(\$nls_cv_header_libgt, \$nls_cv_header_intl)$/d' < "$srcdir/$configure_in" > "$srcdir/$configure_in.tmp"
func_modify_configure_in "(AC_LINK_FILES): Remove invocation."
-sed -e 's/^AM_GNU_GETTEXT_VERSION([^()]*)/AM_GNU_GETTEXT_VERSION(['"$archive_version"'])/' < "$srcdir/$configure_in" > "$srcdir/$configure_in.tmp"
-func_modify_configure_in "(AM_GNU_GETTEXT_VERSION): Bump to $archive_version."
+# AM_GNU_GETTEXT_VERSION may not be present, when AM_GNU_GETTEXT_REQUIRE_VERSION is used.
+if grep '^AM_GNU_GETTEXT_VERSION(' "$srcdir/$configure_in" 2>&1 >/dev/null; then
+ sed -e 's/^AM_GNU_GETTEXT_VERSION([^()]*)/AM_GNU_GETTEXT_VERSION(['"$archive_version"'])/' < "$srcdir/$configure_in" > "$srcdir/$configure_in.tmp"
+ func_modify_configure_in "(AM_GNU_GETTEXT_VERSION): Bump to $archive_version."
+fi
$do_changelog && func_ChangeLog_finish
# Recommend replacement for deprecated Makefile variables.