aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Burgess <aburgess@redhat.com>2024-05-30 17:08:31 +0100
committerAndrew Burgess <aburgess@redhat.com>2024-06-24 12:13:51 +0100
commitf31b12c215571ee2348d20cd0cbc065ea631a765 (patch)
tree9467c2d81ca589342718c9503d2bbcb5149e47e0
parent1a5dfba4efc892d5e8659bc51fb9f57ed28eaa16 (diff)
downloadbinutils-f31b12c215571ee2348d20cd0cbc065ea631a765.zip
binutils-f31b12c215571ee2348d20cd0cbc065ea631a765.tar.gz
binutils-f31b12c215571ee2348d20cd0cbc065ea631a765.tar.bz2
gdb/doc: also look in srcdir when running TEXI2POD
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. Approved-By: Tom Tromey <tom@tromey.com>
-rw-r--r--gdb/doc/Makefile.in2
1 files changed, 1 insertions, 1 deletions
diff --git a/gdb/doc/Makefile.in b/gdb/doc/Makefile.in
index effd0f4..d0489c4 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"