]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
autopoint: Don't fail if no gettext version is specified.
authorBruno Haible <bruno@clisp.org>
Tue, 1 Jul 2025 13:00:27 +0000 (15:00 +0200)
committerBruno Haible <bruno@clisp.org>
Tue, 1 Jul 2025 13:54:56 +0000 (15:54 +0200)
Rationale: https://lists.gnu.org/archive/html/bug-gettext/2025-06/msg00009.html

* gettext-tools/misc/autopoint.in: Instead of failing with "Missing version",
use version 0.23.1. Set omitintl=yes if there is no AM_GNU_GETTEXT invocation.

gettext-tools/misc/autopoint.in

index 4f2bdb4d58e6ec19bb20d8e08c3f98dc57de57e0..ef60783f4fad3eb6e4f13f105598469f199e348c 100644 (file)
@@ -374,7 +374,12 @@ else
 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"
+  # The $configure_in does not specify an AM_GNU_GETTEXT_VERSION.
+  # This is OK in two cases:
+  #   - The package uses an old gettext infrastructure (from 2024 or earlier).
+  #   - The package merely uses AM_ICONV, not AM_GNU_GETTEXT.
+  # Use the last version whose po.m4 is nearly identical to the older ones.
+  ver=0.23.1
 fi
 
 # Check whether the version number is supported.
@@ -445,15 +450,20 @@ fi
 omitintl=
 # Need to use func_trace_sed instead of $func_trace, since
 # AM_GNU_GETTEXT is not a standard Autoconf trace.
-xargs=`func_trace_sed AM_GNU_GETTEXT "$configure_in"`
-save_IFS="$IFS"; IFS=:
-for arg in $xargs; do
-  if test 'external' = "$arg"; then
-    omitintl=yes
-    break
-  fi
-done
-IFS="$save_IFS"
+if test `func_trace_sed AM_GNU_GETTEXT "$configure_in" | wc -l` = 0; then
+  # No AM_GNU_GETTEXT invocation.
+  omitintl=yes
+else
+  xargs=`func_trace_sed AM_GNU_GETTEXT "$configure_in"`
+  save_IFS="$IFS"; IFS=:
+  for arg in $xargs; do
+    if test 'external' = "$arg"; then
+      omitintl=yes
+      break
+    fi
+  done
+  IFS="$save_IFS"
+fi
 
 if test -z "$omitintl"; then
   case "$ver" in