public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Andrew Burgess <aburgess@redhat.com>
To: gdb-patches@sourceware.org
Cc: Andrew Burgess <aburgess@redhat.com>
Subject: [PATCHv3 4/6] gdb/doc: also look in srcdir when running TEXI2POD
Date: Thu,  6 Jun 2024 18:49:56 +0100	[thread overview]
Message-ID: <6ffc9bcbb47ea2022d06e388f2ff3682d1e610ad.1717696065.git.aburgess@redhat.com> (raw)
In-Reply-To: <cover.1717696065.git.aburgess@redhat.com>

In gdb/doc/Makefile.in the TEXI2POD variable is used to invoke
texi2pod.pl, which process the .texinfo files.  This also handles the
'include' directives within the .texinfo files.

Like the texi2dvi and texi2pdf tools, texi2pod.pl handles the -I flag
to add search directories for resolving 'include' directives within
.texinfo files.

When GDB runs TEXI2POD we include gdb-cfg.texi, which then includes
GDBvn.texi.

When building from a git checkout the gdb-cfg.texi files and
GDBvn.texi files will be created in the build directory, which is
where texi2pod.pl is invoked, so the files will be found just fine.

However, for a GDB release we ship gdb-cfg.texi and GDBvn.texi in the
source tree, along with the generated manual (.1 and .5) files.

So when building a release, what normally happens is that we spot that
the .1 and .5 man files are up to date, and don't run the recipe to
regenerate these files.

However, if we deliberately touch the *.texinfo files in a release
source tree, and then try to rebuild the man files, we'll get an error
like this:

  make: Entering directory '/tmp/release-build/build/gdb/doc'
    TEXI2POD gdb.1
  cannot find GDBvn.texi at ../../../gdb-16.0.50.20240529/gdb/doc/../../etc/texi2pod.pl line 251, <GEN0> line 16.
  make: *** [Makefile:664: gdb.1] Error 2
  make: Leaving directory '/tmp/release-build/build/gdb/doc'

The problem is that texi2pod.pl doesn't know to look in the source
tree for the GDBvn.texi file.

If we compare this to the recipe for creating (for example) gdb.dvi,
which uses texi2dvi, this recipe adds '-I $(srcdir)' to the texi2dvi
command line, which allows texi2dvi to find GDBvn.texi in the source
tree.

In this commit I add a similar -I option to the texi2pod.pl command
line.  After this, given a GDB release, it is possible to edit (or
just touch) the gdb.texinfo file and rebuild the man pages, the
GDBvn.texi will be picked up from the source tree.

If however a dependency for GDBvn.texi is changed in a release tree
then GDBvn.texi will be regenerated into the build directory and this
will be picked up in preference to the GDBvn.texi in the source tree,
just as you would want.
---
 gdb/doc/Makefile.in | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gdb/doc/Makefile.in b/gdb/doc/Makefile.in
index eb800bf3848..7b7b85dae10 100644
--- a/gdb/doc/Makefile.in
+++ b/gdb/doc/Makefile.in
@@ -176,7 +176,7 @@ ANNOTATE_DOC_FILES = \
 MANCONF = -Dman
 
 TEXI2POD = perl $(srcdir)/../../etc/texi2pod.pl \
-		$(MAKEINFOFLAGS) $(MAKEINFO_EXTRA_FLAGS)
+		$(MAKEINFOFLAGS) $(MAKEINFO_EXTRA_FLAGS) -I $(srcdir)
 
 
 POD2MAN = pod2man --center="GNU Development Tools"
-- 
2.25.4


  parent reply	other threads:[~2024-06-06 17:50 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-11  9:37 [PATCH 0/4] gdb/doc: build fixes and improvements Andrew Burgess
2024-05-11  9:37 ` [PATCH 1/4] gdb/doc: don't delete *.pod files too early Andrew Burgess
2024-05-13 16:13   ` Tom Tromey
2024-05-14 15:53     ` Andrew Burgess
2024-05-11  9:37 ` [PATCH 2/4] gdb/doc: don't try to copy GDBvn.texi from the source tree Andrew Burgess
2024-05-13 16:12   ` Tom Tromey
2024-05-13 17:33     ` Eli Zaretskii
2024-05-14 13:32       ` Andrew Burgess
2024-06-14 19:06     ` Pedro Alves
2024-05-11  9:37 ` [PATCH 3/4] gdb/doc: fix parallel build of refcard related targets Andrew Burgess
2024-05-13 16:13   ` Tom Tromey
2024-05-11  9:37 ` [PATCH 4/4] gdb/doc: fix parallel build of pdf and dvi files Andrew Burgess
2024-05-13 16:18   ` Tom Tromey
2024-05-14 13:40     ` Andrew Burgess
2024-05-31  8:18 ` [PATCHv2 0/5] gdb/doc: parallel build fixes and improvements Andrew Burgess
2024-05-31  8:18   ` [PATCHv2 1/5] gdb/doc: don't try to copy GDBvn.texi from the source tree Andrew Burgess
2024-05-31  8:18   ` [PATCHv2 2/5] gdb/doc: allow for version.subst in " Andrew Burgess
2024-05-31 10:40     ` Eli Zaretskii
2024-06-03 14:22       ` Andrew Burgess
2024-06-06 11:59         ` Eli Zaretskii
2024-06-06 17:52           ` Andrew Burgess
2024-05-31  8:18   ` [PATCHv2 3/5] gdb/doc: also look in srcdir when running TEXI2POD Andrew Burgess
2024-05-31  8:18   ` [PATCHv2 4/5] gdb/doc: fix parallel build of refcard related targets Andrew Burgess
2024-05-31  8:18   ` [PATCHv2 5/5] gdb/doc: fix parallel build of pdf and dvi files Andrew Burgess
2024-06-06 17:49   ` [PATCHv3 0/6] gdb/doc: parallel build fixes and improvements Andrew Burgess
2024-06-06 17:49     ` [PATCHv3 1/6] gdb/doc: don't try to copy GDBvn.texi from the source tree Andrew Burgess
2024-06-14 18:45       ` Pedro Alves
2024-06-06 17:49     ` [PATCHv3 2/6] gdb/doc: merge rules for building .1 and .5 man pages Andrew Burgess
2024-06-06 17:49     ` [PATCHv3 3/6] gdb/doc: allow for version.subst in the source tree Andrew Burgess
2024-06-14 18:44       ` Pedro Alves
2024-06-06 17:49     ` Andrew Burgess [this message]
2024-06-06 17:49     ` [PATCHv3 5/6] gdb/doc: fix parallel build of refcard related targets Andrew Burgess
2024-06-06 17:49     ` [PATCHv3 6/6] gdb/doc: fix parallel build of pdf and dvi files Andrew Burgess
2024-06-14 19:00       ` Pedro Alves
2024-06-15  9:44         ` Andrew Burgess
2024-06-15 12:40           ` Eli Zaretskii
2024-06-15 14:59             ` Andrew Burgess
2024-06-15 15:04             ` Andrew Burgess
2024-06-21 15:35               ` Pedro Alves
2024-06-24 11:16                 ` Andrew Burgess
2024-06-25 13:39               ` Andrew Burgess
2024-06-14 18:14     ` [PATCHv3 0/6] gdb/doc: parallel build fixes and improvements Tom Tromey

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=6ffc9bcbb47ea2022d06e388f2ff3682d1e610ad.1717696065.git.aburgess@redhat.com \
    --to=aburgess@redhat.com \
    --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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).