* 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.
+2015-07-28 Daiki Ueno <ueno@gnu.org>
+
+ * gettext.m4 (AM_GNU_GETTEXT_REQUIRE_VERSION): New macro. Bump
+ serial to 67.
+
2015-07-10 Daiki Ueno <ueno@gnu.org>
* gettext 0.19.5 released.
-# gettext.m4 serial 66 (gettext-0.18.2)
+# gettext.m4 serial 67 (gettext-0.19.6)
dnl Copyright (C) 1995-2014 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl Usage: AM_GNU_GETTEXT_VERSION([gettext-version])
AC_DEFUN([AM_GNU_GETTEXT_VERSION], [])
+
+
+dnl Usage: AM_GNU_GETTEXT_REQUIRE_VERSION([gettext-version])
+AC_DEFUN([AM_GNU_GETTEXT_REQUIRE_VERSION], [])
+2015-07-28 Daiki Ueno <ueno@gnu.org>
+
+ * autopoint.texi: Mention AM_GNU_GETTEXT_REQUIRE_VERSION.
+
2015-07-10 Daiki Ueno <ueno@gnu.org>
* gettext 0.19.5 released.
used by the package, and copies the infrastructure files belonging to
this version into the package.
+To extract the latest available infrastructure which satisfies a version
+requirement, then you can use the form
+@code{AM_GNU_GETTEXT_REQUIRE_VERSION(@var{version})} instead. For example, if
+gettext @value{VERSION} is installed on your system and @code{0.19.1} is
+requested, then the infrastructure files of version @value{VERSION} will
+be copied into a source package.
+
@subsubsection Options
@table @samp
+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
progname=$0
package=@PACKAGE@
version=@VERSION@
+archive_version=@ARCHIVE_VERSION@
# Set variables
# - gettext_datadir directory where the data files are stored.
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 | \
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.
+2015-07-28 Daiki Ueno <ueno@gnu.org>
+
+ * autopoint-2: Add checks for AM_GNU_GETTEXT_REQUIRE_VERSION.
+
2015-07-28 Daiki Ueno <ueno@gnu.org>
* init-env.in (ARCHIVE_VERSION): New substituted variable.
test -f po/Makefile.in.in || exit 1
rm -fr m4 po
+
+# Check for AM_GNU_GETTEXT_REQUIRE_VERSION.
+cat <<EOF >configure.ac
+AC_INIT
+AC_CONFIG_SRCDIR(hello.c)
+
+AC_PROG_CC
+AM_GNU_GETTEXT_REQUIRE_VERSION([0.19])
+AM_GNU_GETTEXT([external])
+
+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; }
+
+test ! -d intl || exit 1
+test -d m4 || exit 1
+test -d po || exit 1
+
+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.
+cat <<EOF >configure.ac
+AC_INIT
+AC_CONFIG_SRCDIR(hello.c)
+
+AC_PROG_CC
+AM_GNU_GETTEXT
+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 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