]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
autoreconf: Support AM_GNU_GETTEXT_REQUIRE_VERSION
authorMichał Górny <mgorny@gentoo.org>
Fri, 16 Oct 2015 10:53:55 +0000 (12:53 +0200)
committerZack Weinberg <zackw@panix.com>
Mon, 9 Nov 2020 18:22:28 +0000 (13:22 -0500)
As reported in https://github.com/gentoo/gentoo/pull/163, gettext 0.19.6
supports using AM_GNU_GETTEXT_REQUIRE_VERSION (specifying a *minimum*
required version of gettext) instead of AM_GNU_GETTEXT_VERSION
(which specifies a *fixed* required version of gettext).
Update autoreconf to support both.

 * bin/autoreconf.in (autoreconf_current_directory): Check for
   AM_GNU_GETTEXT_REQUIRE_VERSION as well as AM_GNU_GETTEXT_VERSION.
   Update diagnostics about using AM_GNU_GETTEXT_VERSION but not
   AM_GNU_GETTEXT, or vice versa, to match.
 * doc/autoconf.texi (autoreconf Invocation): Update to match.

bin/autoreconf.in
doc/autoconf.texi

index ccbd6c47488868a75bc90c113f59e2f7046c1b01..ec0a12e2b9f417d673c6389ca56aaea792449c3e 100644 (file)
@@ -414,7 +414,7 @@ sub autoreconf_current_directory ($)
          s/dnl.*//;
          $uses_autoconf = 1 if /AC_INIT/;
          # See below for why we look for gettext here.
-         $uses_gettext = 1  if /^AM_GNU_GETTEXT_VERSION/;
+         $uses_gettext = 1  if /^AM_GNU_GETTEXT_(?:REQUIRE_)?VERSION/;
        }
       if (!$uses_autoconf)
         {
@@ -442,12 +442,12 @@ sub autoreconf_current_directory ($)
   # not.  I guess that once Gettext move to 2.5x we will be able to,
   # but in the meanwhile forget it.
   #
-  # We can only grep for AM_GNU_GETTEXT_VERSION in configure.ac.  You
-  # might think this approach is naive, and indeed it is, as it
-  # prevents one to embed AM_GNU_GETTEXT_VERSION in another *.m4, but
-  # anyway we don't limit the generality, since... that's what
-  # autopoint does.  Actually, it is even more restrictive, as it
-  # greps for '^AM_GNU_GETTEXT_VERSION('.  We did this above, while
+  # We can only grep for AM_GNU_GETTEXT_(REQUIRE_)?VERSION in configure.ac.
+  # You might think this approach is naive, and indeed it is, as it prevents
+  # one to embed AM_GNU_GETTEXT_(REQUIRE_)?VERSION in another *.m4, but
+  # anyway we don't limit the generality, since... that's what autopoint does.
+  # Actually, it is even more restrictive, as it greps for
+  # '^AM_GNU_GETTEXT_(REQUIRE_)?VERSION('.  We did this above, while
   # scanning configure.ac.
   if (!$uses_gettext)
     {
@@ -611,9 +611,13 @@ sub autoreconf_current_directory ($)
     }
 
   # Gettext consistency checks...
-  error $configure_ac, "AM_GNU_GETTEXT is used, but not AM_GNU_GETTEXT_VERSION"
+  error($configure_ac,
+        "AM_GNU_GETTEXT is used, but not AM_GNU_GETTEXT_VERSION"
+        . " or AM_GNU_GETTEXT_REQUIRE_VERSION")
     if $uses_gettext_via_traces && ! $uses_gettext;
-  error $configure_ac, "AM_GNU_GETTEXT_VERSION is used, but not AM_GNU_GETTEXT"
+  error($configure_ac,
+        "AM_GNU_GETTEXT_VERSION or AM_GNU_GETTEXT_REQUIRE_VERSION is used,"
+        . " but not AM_GNU_GETTEXT")
     if $uses_gettext && ! $uses_gettext_via_traces;
 
 
index 69c52e49980223d916e9ae6937fb194c6209b8db..b875c25a2e105e79d7db780b736ae4f082b794d6 100644 (file)
@@ -1706,10 +1706,11 @@ properly, but does not pass @option{--autoconf-dir=@var{dir}} or
 @cindex @command{autopoint}
 Gettext supplies the @command{autopoint} command to add translation
 infrastructure to a source package.  If you use @command{autopoint},
-your @file{configure.ac} should invoke both @code{AM_GNU_GETTEXT} and
-@code{AM_GNU_GETTEXT_VERSION(@var{gettext-version})}.  @xref{autopoint
-Invocation, , Invoking the @code{autopoint} Program, gettext,
-GNU @code{gettext} utilities}, for further details.
+your @file{configure.ac} should invoke @code{AM_GNU_GETTEXT} and
+one of @code{AM_GNU_GETTEXT_VERSION(@var{gettext-version})} or
+@code{AM_GNU_GETTEXT_REQUIRE_VERSION(@var{min-gettext-version})}.
+@xref{autopoint Invocation, , Invoking the @code{autopoint} Program,
+gettext, GNU @code{gettext} utilities}, for further details.
 
 @noindent
 @command{autoreconf} accepts the following options: