Hi,

According to the GNU Coding Standard
https://www.gnu.org/prep/standards/html_node/Standard-Targets.html
  "The dist target should explicitly depend on all non-source files
   that are in the distribution, to make sure they are up to date
   in the distribution."

An easy way to test whether the 'dist' target has this property
is to run

   $ ./configure
   $ make dist

or (in a VPATH build)

   $ ../configure
   $ make dist

without doing "make" before "make dist".

Distributed non-source files that make this difficult are the man pages
for programs, that are generated from the '--help' output using help2man.

While packages that only have a top-level Makefile.am (such as GNU sed
or GNU coreutils) get this right, it is a little bit more complicated
in packages with a Makefile.am per directory (such as GNU texinfo and
GNU gettext). Originally reported for GNU gettext at
<https://lists.gnu.org/archive/html/bug-gettext/2024-07/msg00010.html>.

In GNU texinfo
  $ ./configure; make dist
fails like this:

$ make dist
...
 (cd info && make  top_distdir=../texinfo-7.1.90 distdir=../texinfo-7.1.90/info 
\
     am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)
make[3]: Entering directory '/TEXINFO/texinfo/info'
gcc -DHAVE_CONFIG_H -I. -I..  -I.. -I../gnulib/lib -I../gnulib/lib 
-DLOCALEDIR=\"/usr/local/share/locale\" -DINFODIR=\"/usr/local/share/info\" 
-DINFODIR2=\"/usr/local/share/info\"   -g -O2 -MT makedoc.o -MD -MP -MF 
.deps/makedoc.Tpo -c -o makedoc.o makedoc.c
mv -f .deps/makedoc.Tpo .deps/makedoc.Po
make[3]: *** No rule to make target '../gnulib/lib/libgnu.a', needed by 
'makedoc'.  Stop.
make[3]: Leaving directory '/TEXINFO/texinfo/info'
make[2]: *** [Makefile:2025: distdir-am] Error 1
make[2]: Leaving directory '/TEXINFO/texinfo'
make[1]: *** [Makefile:2019: distdir] Error 2

Find attached a patch that fixes this error.


Then, there is another error:

$ make dist
...
make  distdir-am
make[6]: Entering directory '/TEXINFO/texinfo/doc/tp_api'
if /usr/bin/perl -I ../../tp -I ../../Pod-Simple-Texinfo/lib/ -I ../../tp/ -I 
../../tp/maintain/lib/Text-Unidecode/lib/ -I 
../../tp/maintain/lib/libintl-perl/lib/ -I 
../../tp/maintain/lib/Unicode-EastAsianWidth/lib/ 
../../Pod-Simple-Texinfo/pod2texi.pl --base-level=section --preamble - 
--subdir=api_includes ../../tp/Texinfo/Commands.pod ../../tp/Texinfo/Common.pm 
../../tp/Texinfo/ParserNonXS.pm ../../tp/Texinfo/Document.pm 
../../tp/Texinfo/ManipulateTree.pm ../../tp/Texinfo/Structuring.pm 
../../tp/Texinfo/Report.pm ../../tp/Texinfo/Translations.pm 
../../tp/Texinfo/Transformations.pm ../../tp/Texinfo/Indices.pm 
../../tp/Texinfo/OutputUnits.pm ../../tp/Texinfo/Convert/Texinfo.pm 
../../tp/Texinfo/Convert/Utils.pm ../../tp/Texinfo/Convert/Unicode.pm 
../../tp/Texinfo/Convert/NodeNameNormalization.pm 
../../tp/Texinfo/Convert/Text.pm ../../tp/Texinfo/Convert/Converter.pm 
../../tp/Texinfo/Convert/Info.pm ../../tp/Texinfo/Convert/HTML.pm 
../../tp/Texinfo/Convert/DocBook.pm ../../tp/Texinfo/Convert/TexinfoMarkup.pm 
../../tp/Texinfo/Convert/TexinfoXML.pm ../../tp/Texinfo/Convert/Plaintext.pm < 
./texi2any_internals_preamble.texi >texi2any_internals.texi.tmp ; then \
  cat texi2any_internals.texi.tmp  | sed -e 's/^@bye/@__bye/' | sed -e 
'/^@__bye/r ./texi2any_internals_indices.texi' | sed -e 's/^@__bye//' > 
texi2any_internals.texi ; \
fi ; rm texi2any_internals.texi.tmp
Can't locate Texinfo/ModulePath.pm in @INC (you may need to install the 
Texinfo::ModulePath module) (@INC contains: ../../Pod-Simple-Texinfo/../tp 
../../tp ../../Pod-Simple-Texinfo/lib/ ../../tp/ 
../../tp/maintain/lib/Text-Unidecode/lib/ 
../../tp/maintain/lib/libintl-perl/lib/ 
../../tp/maintain/lib/Unicode-EastAsianWidth/lib/ /etc/perl 
/usr/local/lib/x86_64-linux-gnu/perl/5.34.0 /usr/local/share/perl/5.34.0 
/usr/lib/x86_64-linux-gnu/perl5/5.34 /usr/share/perl5 
/usr/lib/x86_64-linux-gnu/perl-base /usr/lib/x86_64-linux-gnu/perl/5.34 
/usr/share/perl/5.34 /usr/local/lib/site_perl) at 
../../Pod-Simple-Texinfo/pod2texi.pl line 75.
BEGIN failed--compilation aborted at ../../Pod-Simple-Texinfo/pod2texi.pl line 
112.
make[6]: *** No rule to make target 'api_includes', needed by 'distdir-am'.  
Stop.
make[6]: Leaving directory '/TEXINFO/texinfo/doc/tp_api'
make[5]: *** [Makefile:2025: distdir] Error 2
make[5]: Leaving directory '/TEXINFO/texinfo/doc/tp_api'
make[4]: *** [Makefile:2350: distdir-am] Error 1
make[4]: Leaving directory '/TEXINFO/texinfo/doc'
make[3]: *** [Makefile:2346: distdir] Error 2
make[3]: Leaving directory '/TEXINFO/texinfo/doc'
make[2]: *** [Makefile:2028: distdir-am] Error 1
make[2]: Leaving directory '/TEXINFO/texinfo'
make[1]: *** [Makefile:2022: distdir] Error 2

but I'm not proposing a fix for this one since I am not familiar with
this part of GNU texinfo.


>From f1313176678e0f35759a5a8d1e95a57806fcd6ca Mon Sep 17 00:00:00 2001
From: Bruno Haible <br...@clisp.org>
Date: Mon, 22 Jul 2024 03:39:54 +0200
Subject: [PATCH] build: Fix an error during "./configure; make dist".

* Makefile.am (BUILT_SOURCES): Add gnulib/lib/libgnu.a.
(gnulib/lib/libgnu.a): New target.
---
 Makefile.am | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/Makefile.am b/Makefile.am
index a509ec3f16..f385511107 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -27,6 +27,11 @@ EXTRA_DIST = ChangeLog.46 ChangeLog.65 ChangeLog.70 \
 # distribution directory.
 TEXINFO_TEX = doc/texinfo.tex
 
+# Ensure that the prerequisites of info/makedoc are built when "make dist" runs.
+BUILT_SOURCES = gnulib/lib/libgnu.a
+gnulib/lib/libgnu.a:
+	cd gnulib/lib && $(MAKE) $(AM_MAKEFLAGS)
+
 # One special target for installers to use by hand if desired.
 install-tex:
 	cd doc && $(MAKE) TEXMF=$(TEXMF) install-tex
-- 
2.34.1

Reply via email to