On Mon, Jul 22, 2024 at 03:44:34AM +0200, Bruno Haible wrote:
> 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.

I suppose the help2man output depends on the programs being built, so
"make dist" depends on all of the programs being built, which is the
result of "make" or "make all".

It's long been the case that there is a dependency between the
subdirectories underneath the top level of the Texinfo sources, with
"gnulib" requiring to be built first.  This is taken care of in the
SUBDIRS setting in Makefile.am.

>From README-hacking in the Texinfo sources:

  Running make in one particular subdirectory is possible, for example
  make -C info.  However there are interdependencies between the 
  subdirectories, notably on gnulib, so if you don't want to run "make", 
  you may have to run "make -C gnulib/lib" first.
  
  Additionally, make dist may not work until make has been run at least 
  once, because of rules to create man pages under the man/ directory.
  
  "make dist" will fail if the use of Perl XS extension modules is 
  disabled and there is no Makefile in the XS subdirectory.

It seems that there is no risk of "make dist" distributing an out-of-date
non-source file (which is what the excerpt from the GNU Coding Standards
was about) so the problem is minor.

If there was some way to make "make dist" depend on "make all" this
should also solve this issue.

> Find attached a patch that fixes this error.

> 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


Thanks for sending the patch, but I don't know if it is worth it.
It seems tricky.  It may not be even enough to solve the problem fully.

If it is just those lines, it may be an acceptable way to make "make dist"
work without running "make" first, but I would want to investigate the
problem with Texinfo/ModulePath.pm first.

Reply via email to