Hi Gavin,

> Thanks for the fixes; I have committed them to "master" in your name
> with minor modifications.  I have checked that "make dist" works without
> "make" being run first.

There are two problems with commit cd7a003d9fce67866745e718ff97e09ad689cf3c:

1) The ChangeLog entry regarding info/Makefile.am is duplicated.

2) "make distcheck" fails. (Reported by the weekly CI. It was fine a week ago.)

How to reproduce:
$ git pull
$ ./autogen.sh
$ ./configure CPPFLAGS="-Wall"
$ make
$ make check
$ make distcheck
...
ERROR: files left in build directory after distclean:
./doc/tp_api/texi2any_internals.texi
./doc/tp_api/api_includes/Texinfo-Convert-Plaintext.texi
./doc/tp_api/api_includes/Texinfo-Transformations.texi
./doc/tp_api/api_includes/Texinfo-Document.texi
./doc/tp_api/api_includes/Texinfo-OutputUnits.texi
./doc/tp_api/api_includes/Texinfo-Convert-HTML.texi
./doc/tp_api/api_includes/Texinfo-Indices.texi
./doc/tp_api/api_includes/Texinfo-ManipulateTree.texi
./doc/tp_api/api_includes/Texinfo-Commands.texi
./doc/tp_api/api_includes/Texinfo-Convert-NodeNameNormalization.texi
./doc/tp_api/api_includes/Texinfo-Convert-Info.texi
./doc/tp_api/api_includes/Texinfo-Report.texi
./doc/tp_api/api_includes/Texinfo-Convert-TexinfoMarkup.texi
./doc/tp_api/api_includes/Texinfo-Structuring.texi
./doc/tp_api/api_includes/Texinfo-Convert-Unicode.texi
./doc/tp_api/api_includes/Texinfo-Convert-Utils.texi
./doc/tp_api/api_includes/Texinfo-Common.texi
./doc/tp_api/api_includes/Texinfo-Convert-Text.texi
./doc/tp_api/api_includes/Texinfo-Convert-TexinfoXML.texi
./doc/tp_api/api_includes/Texinfo-Parser.texi
./doc/tp_api/api_includes/Texinfo-Convert-Texinfo.texi
./doc/tp_api/api_includes/Texinfo-Convert-DocBook.texi
./doc/tp_api/api_includes/Texinfo-Translations.texi
./doc/tp_api/api_includes/Texinfo-Convert-Converter.texi
make[1]: *** [Makefile:2213: distcleancheck] Error 1
make[1]: Leaving directory '/TEXINFO/texinfo/texinfo-7.1.90/_build/sub'
make: *** [Makefile:2142: distcheck] Error 1

The problem is that these files, while present in the tarball, have been
regenerated in the build dir. But the GNU Coding Standards
<https://www.gnu.org/prep/standards/html_node/Makefile-Basics.html>
specify that such files should be regenerated in the source dir.
This eliminates possible confusion between the same file being present
(in different versions) in the source dir and in the build dir.

The attached patch fixes it. Tested.

Bruno

>From 09c76d3172ed0246e5a5f5bc2b1a214c65f48298 Mon Sep 17 00:00:00 2001
From: Bruno Haible <br...@clisp.org>
Date: Mon, 5 Aug 2024 13:39:31 +0200
Subject: [PATCH] build: Fix a "make distcheck" failure.

* doc/tp_api/Makefile.am (texi2any_internals_byproducts): New variable.
(texi2any_internals.texi): Depend on ModulePath.pm in the source dir,
not in thebuild dir. After generating texi2any_internals.texi in the
build dir, move it and its byproducts to the source dir.
---
 doc/tp_api/Makefile.am | 45 ++++++++++++++++++++++++++++++++++++++----
 1 file changed, 41 insertions(+), 4 deletions(-)

diff --git a/doc/tp_api/Makefile.am b/doc/tp_api/Makefile.am
index c6124d4623..90f1919f45 100644
--- a/doc/tp_api/Makefile.am
+++ b/doc/tp_api/Makefile.am
@@ -78,14 +78,51 @@ texi2any_internals_dependencies = \
   $(top_srcdir)/tp/Texinfo/Convert/TexinfoXML.pm \
   $(top_srcdir)/tp/Texinfo/Convert/Plaintext.pm
 
+# All the .texi files generated as a byproduct of generating
+# texi2any_internals.texi, in the order in which they get generated.
+texi2any_internals_byproducts = \
+  api_includes/Texinfo-Commands.texi \
+  api_includes/Texinfo-Common.texi \
+  api_includes/Texinfo-Parser.texi \
+  api_includes/Texinfo-Document.texi \
+  api_includes/Texinfo-ManipulateTree.texi \
+  api_includes/Texinfo-Structuring.texi \
+  api_includes/Texinfo-Report.texi \
+  api_includes/Texinfo-Translations.texi \
+  api_includes/Texinfo-Transformations.texi \
+  api_includes/Texinfo-Indices.texi \
+  api_includes/Texinfo-OutputUnits.texi \
+  api_includes/Texinfo-Convert-Texinfo.texi \
+  api_includes/Texinfo-Convert-Utils.texi \
+  api_includes/Texinfo-Convert-Unicode.texi \
+  api_includes/Texinfo-Convert-NodeNameNormalization.texi \
+  api_includes/Texinfo-Convert-Text.texi \
+  api_includes/Texinfo-Convert-Converter.texi \
+  api_includes/Texinfo-Convert-Info.texi \
+  api_includes/Texinfo-Convert-HTML.texi \
+  api_includes/Texinfo-Convert-DocBook.texi \
+  api_includes/Texinfo-Convert-TexinfoMarkup.texi \
+  api_includes/Texinfo-Convert-TexinfoXML.texi \
+  api_includes/Texinfo-Convert-Plaintext.texi
+
 # Needed if make has not run in the "tp" directory yet
-$(top_builddir)/tp/Texinfo/ModulePath.pm:
+$(top_srcdir)/tp/Texinfo/ModulePath.pm:
 	cd $(top_builddir)/tp && $(MAKE) $(AM_MAKEFLAGS) Texinfo/ModulePath.pm
 
-texi2any_internals.texi: $(texi2any_internals_dependencies) texi2any_internals_indices.texi texi2any_internals_preamble.texi $(top_builddir)/tp/Texinfo/ModulePath.pm
+texi2any_internals.texi: $(texi2any_internals_dependencies) texi2any_internals_indices.texi texi2any_internals_preamble.texi $(top_srcdir)/tp/Texinfo/ModulePath.pm
 	if $(MAKEINFO_ENVIRONMENT) $(PERL) -I $(top_srcdir)/Pod-Simple-Texinfo/lib/ $(top_srcdir)/Pod-Simple-Texinfo/pod2texi.pl --base-level=section --preamble - --subdir=api_includes $(texi2any_internals_dependencies) < $(srcdir)/texi2any_internals_preamble.texi >$@.tmp ; then \
-	  cat $@.tmp  | sed -e 's/^@bye/@__bye/' | sed -e '/^@__bye/r $(srcdir)/texi2any_internals_indices.texi' | sed -e 's/^@__bye//' > $@ ; \
-	fi ; rm -f $@.tmp
+	  cat $@.tmp | sed -e 's/^@bye/@__bye/' | sed -e '/^@__bye/r $(srcdir)/texi2any_internals_indices.texi' | sed -e 's/^@__bye//' > $@ ; \
+	  if test '$(srcdir)' != '.' ; then \
+	    for file in $(texi2any_internals_byproducts) texi2any_internals.texi ; do \
+	      if cmp $$file $(srcdir)/$$file >/dev/null 2>&1 ; then \
+	        rm -f $$file ; \
+	      else \
+	        mv $$file $(srcdir)/$$file ; \
+	      fi ; \
+	    done ; \
+	  fi ; \
+	fi ; \
+	rm -f $@.tmp
 
 endif
 
-- 
2.34.1

Reply via email to