bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bootstrap: Avoid failure when gnulib-tool removed gettext.m4


From: Bruno Haible
Subject: bootstrap: Avoid failure when gnulib-tool removed gettext.m4
Date: Sun, 21 Jul 2024 14:05:39 +0200

Here's a case where bootstrap fails to rebuild a working 'configure'.

How to reproduce:
$ git clone git://git.savannah.gnu.org/hello.git
$ cd hello
Edit bootstrap.conf, replacing gettext-h with gettext.
$ ./bootstrap --no-git --gnulib-srcdir=$GNULIB_SRCDIR
$ ./configure && make && make distclean
Edit bootstrap.conf, reverting the last change.
$ ./bootstrap --no-git --gnulib-srcdir=$GNULIB_SRCDIR
=>
...
./bootstrap: autopoint --force
Copying file build-aux/config.rpath
Copying file m4/codeset.m4
Copying file m4/fcntl-o.m4
Copying file m4/gettext.m4
Copying file m4/iconv.m4
Copying file m4/intlmacosx.m4
Copying file m4/lib-ld.m4
Copying file m4/lib-link.m4
Copying file m4/lib-prefix.m4
Copying file m4/nls.m4
Copying file m4/po.m4
Copying file m4/progtest.m4
Copying file m4/threadlib.m4
Copying file m4/visibility.m4
Copying file m4/wint_t.m4
Copying file po/Makefile.in.in
...
Removing file m4/gettext.m4 (backup in m4/gettext.m4~)
...
running: AUTOPOINT=true LIBTOOLIZE=true autoreconf --verbose --install --force 
-I m4  --no-recursive
autoreconf: export WARNINGS=
autoreconf: Entering directory '.'
autoreconf: running: true --force
autoreconf: running: aclocal -I m4 --force -I m4
configure.ac:61: warning: macro 'AM_GNU_GETTEXT_VERSION' not found in library
configure.ac:62: warning: macro 'AM_GNU_GETTEXT' not found in library
autoreconf: configure.ac: tracing
configure.ac: warning: AM_GNU_GETTEXT_VERSION or AM_GNU_GETTEXT_REQUIRE_VERSION 
is used, but not AM_GNU_GETTEXT
autoreconf: configure.ac: not using Libtool
autoreconf: configure.ac: not using Intltool
autoreconf: configure.ac: not using Gtkdoc
autoreconf: running: /darch/x86_64-linux-gnu/gnu/bin/autoconf --include=m4 
--force
configure.ac:61: error: possibly undefined macro: AM_GNU_GETTEXT_VERSION
      If this token and others are legitimate, please use m4_pattern_allow.
      See the Autoconf documentation.
configure.ac:62: error: possibly undefined macro: AM_GNU_GETTEXT
autoreconf: error: /darch/x86_64-linux-gnu/gnu/bin/autoconf failed with exit 
status: 1
./bootstrap: autoreconf failed

The problem is that gnulib-tool removes gettext.m4.

Since the autoreconf invocation at the end must not call autopoint
(because that could install .m4 files that are older than the gnulib ones),
we must invoke autopoint + gnulib-tool again, and then only do the final
autoreconf.


2024-07-21  Bruno Haible  <bruno@clisp.org>

        bootstrap: Avoid failure when gnulib-tool removed gettext.m4.
        * top/bootstrap-funclib.sh (autogen): When gnulib-tool has removed
        gettext.m4 but the package needs gettext.m4, repeat the autopoint and
        gnulib-tool invocations.
        * build-aux/bootstrap: Regenerated.

diff --git a/build-aux/bootstrap b/build-aux/bootstrap
index d78c8c3064..3758683da4 100755
--- a/build-aux/bootstrap
+++ b/build-aux/bootstrap
@@ -37,7 +37,7 @@ medir=`dirname "$me"`
 
 # A library of shell functions for autopull.sh, autogen.sh, and bootstrap.
 
-scriptlibversion=2024-06-29.23; # UTC
+scriptlibversion=2024-07-21.12; # UTC
 
 # Copyright (C) 2003-2024 Free Software Foundation, Inc.
 #
@@ -1255,6 +1255,20 @@ autogen()
     $gnulib_tool $gnulib_tool_options --import $gnulib_modules \
       || die "gnulib-tool failed"
 
+    if test $with_gettext = yes && test ! -f $m4_base/gettext.m4; then
+      # The gnulib-tool invocation has removed $m4_base/gettext.m4, that the
+      # AUTOPOINT invocation had installed. This can occur when the gnulib
+      # module 'gettext' was previously present but is now not present any 
more.
+      # Repeat the AUTOPOINT invocation and the gnulib-tool invocation.
+
+      echo "$0: $AUTOPOINT --force"
+      $AUTOPOINT --force || return
+
+      echo "$0: $gnulib_tool $gnulib_tool_options --import ..."
+      $gnulib_tool $gnulib_tool_options --import $gnulib_modules \
+        || die "gnulib-tool failed"
+    fi
+
     for file in $gnulib_files; do
       symlink_to_dir "$GNULIB_SRCDIR" $file \
         || die "failed to symlink $file"
diff --git a/top/bootstrap-funclib.sh b/top/bootstrap-funclib.sh
index 226bc8f086..b29e2b49e1 100644
--- a/top/bootstrap-funclib.sh
+++ b/top/bootstrap-funclib.sh
@@ -1,6 +1,6 @@
 # A library of shell functions for autopull.sh, autogen.sh, and bootstrap.
 
-scriptlibversion=2024-07-04.10; # UTC
+scriptlibversion=2024-07-21.12; # UTC
 
 # Copyright (C) 2003-2024 Free Software Foundation, Inc.
 #
@@ -1218,6 +1218,20 @@ autogen()
     $gnulib_tool $gnulib_tool_options --import $gnulib_modules \
       || die "gnulib-tool failed"
 
+    if test $with_gettext = yes && test ! -f $m4_base/gettext.m4; then
+      # The gnulib-tool invocation has removed $m4_base/gettext.m4, that the
+      # AUTOPOINT invocation had installed. This can occur when the gnulib
+      # module 'gettext' was previously present but is now not present any 
more.
+      # Repeat the AUTOPOINT invocation and the gnulib-tool invocation.
+
+      echo "$0: $AUTOPOINT --force"
+      $AUTOPOINT --force || return
+
+      echo "$0: $gnulib_tool $gnulib_tool_options --import ..."
+      $gnulib_tool $gnulib_tool_options --import $gnulib_modules \
+        || die "gnulib-tool failed"
+    fi
+
     for file in $gnulib_files; do
       symlink_to_dir "$GNULIB_SRCDIR" $file \
         || die "failed to symlink $file"






reply via email to

[Prev in Thread] Current Thread [Next in Thread]