Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom de Vries <tdevries@suse.de>
To: gdb-patches@sourceware.org
Subject: [PATCH v2] [gdb/build] Require makeinfo 5.0
Date: Wed,  4 Feb 2026 16:22:36 +0100	[thread overview]
Message-ID: <20260204152236.3546595-1-tdevries@suse.de> (raw)

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


             reply	other threads:[~2026-02-04 15:23 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-04 15:22 Tom de Vries [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260204152236.3546595-1-tdevries@suse.de \
    --to=tdevries@suse.de \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox