Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH v2] [gdb/build] Require makeinfo 5.0
@ 2026-02-04 15:22 Tom de Vries
  2026-02-04 15:36 ` Eli Zaretskii
  0 siblings, 1 reply; 5+ messages in thread
From: Tom de Vries @ 2026-02-04 15:22 UTC (permalink / raw)
  To: gdb-patches

Building GDB documentation in the info format requires makeinfo 5.0 [1].

Bail out when trying to use an older makeinfo version.

I tested this by requiring 7.0 in two setups that have respectively makeinfo
7.1 and 6.5.

In the 7.1 case I got (make output):
...
makeinfo-wrapper.sh 7 0 makeinfo ... -o gdb.info gdb/doc/gdb.texinfo
makeinfo-wrapper.sh 7 0 makeinfo ... -o annotate.info gdb/doc/annotate.texinfo
rluser.texi:2: warning: @setfilename after the first element
...
and in the 6.5 case I got instead:
...
makeinfo-wrapper.sh 7 0 makeinfo ... -o gdb.info gdb/doc/gdb.texinfo
makeinfo-wrapper.sh 7 0 makeinfo ... -o annotate.info gdb/doc/annotate.texinfo
makeinfo is too old, have 6.5, require 7.0.  Info documentation will not be build.
makeinfo is too old, have 6.5, require 7.0.  Info documentation will not be build.
...

Checked new file gdb/doc/makeinfo-wrapper.sh with shellcheck.

Changes in v2:
- handle version line 'texi2any (GNU texinfo) 7.2.90+nc'

Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=33870
---
 gdb/doc/Makefile.in         |  4 +++-
 gdb/doc/makeinfo-wrapper.sh | 44 +++++++++++++++++++++++++++++++++++++
 2 files changed, 47 insertions(+), 1 deletion(-)
 create mode 100755 gdb/doc/makeinfo-wrapper.sh

diff --git a/gdb/doc/Makefile.in b/gdb/doc/Makefile.in
index 05548aab5f6..09afc86de2f 100644
--- a/gdb/doc/Makefile.in
+++ b/gdb/doc/Makefile.in
@@ -58,7 +58,9 @@ TEXIDIR=${gdbdir}/../texinfo
 MAKEINFO = @MAKEINFO@
 MAKEINFOFLAGS = @MAKEINFOFLAGS@
 MAKEINFO_EXTRA_FLAGS = @MAKEINFO_EXTRA_FLAGS@
-MAKEINFO_CMD = $(MAKEINFO) $(MAKEINFOFLAGS) $(MAKEINFO_EXTRA_FLAGS)
+# Check required makeinfo version in makeinfo-wrapper.sh.
+MAKEINFO_CMD = $(srcdir)/makeinfo-wrapper.sh 5 0 $(MAKEINFO) \
+  $(MAKEINFOFLAGS) $(MAKEINFO_EXTRA_FLAGS)
 
 MAKEHTML = $(MAKEINFO_CMD) --html
 MAKEHTMLFLAGS =
diff --git a/gdb/doc/makeinfo-wrapper.sh b/gdb/doc/makeinfo-wrapper.sh
new file mode 100755
index 00000000000..6123d60dfc7
--- /dev/null
+++ b/gdb/doc/makeinfo-wrapper.sh
@@ -0,0 +1,44 @@
+#!/bin/sh
+
+# Copyright (C) 2026 Free Software Foundation, Inc.
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# Wrapper around makeinfo to check makeinfo version.
+
+required_major="$1"
+required_minor="$2"
+prog="$3"
+
+shift 3
+
+major=$("$prog" --version \
+	    | grep "GNU texinfo" \
+	    | sed 's/^.* \([0-9][0-9]*\)\.[0-9][0-9]*\(\..*\)\?$/\1/')
+minor=$("$prog" --version \
+	    | grep "GNU texinfo" \
+	    | sed 's/^.* [0-9][0-9]*\.\([0-9][0-9]*\)\(\..*\)\?$/\1/')
+
+if [ "$major" = "" ] || [ "$major" = "" ]; then
+    echo "Cannot determine makeinfo version for $prog.  Info documentation will not be build."
+    exit
+fi
+
+if [ "$major" -lt "$required_major" ] \
+       || { [ "$major" -eq "$required_major" ] \
+		&& [ "$minor" -lt "$required_minor" ]; }; then
+    echo "$prog is too old, have $major.$minor, require $required_major.$required_minor.  Info documentation will not be build."
+    exit
+fi
+
+exec "$prog" "$@"

base-commit: 2eba2726b3f57be086bca44c5694b9faf9396cef
-- 
2.51.0


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-02-17 14:33 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-02-04 15:22 [PATCH v2] [gdb/build] Require makeinfo 5.0 Tom de Vries
2026-02-04 15:36 ` Eli Zaretskii
2026-02-04 15:44   ` Tom de Vries
2026-02-04 15:49     ` Eli Zaretskii
2026-02-17 14:32       ` Tom de Vries

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox