Bruno Haible [2025-01-23 21:47 +0100] wrote:
> Yes, and I hope that once the approach to let 'git-version-gen' be run
> at configure time (as opposed to autoconf time) is more widely accepted,
You have my vote ;).
>> IIUC this is because Gnulib's build-aux/bootstrap looks at AC_INIT
>> arguments in order to construct the gnulib-tool --lib argument.
>
> Thanks for reporting this. Fixed through the patch below.
Thanks!
>> - The biggest consequence is that 'make' fails after editing
>> e.g. configure.ac:
>>
>> 0. git clean -fdx
>> 1. export GNULIB_SRCDIR='/dir/of/gnulib'
>> 2. ./bootstrap --no-git --skip-po
>> 3. ./configure
>> 4. echo >> configure.ac
>> 5. make
>>
>> CDPATH="${ZSH_VERSION+.}:" && cd . && /bin/bash
>> '/home/blc/src/foo/build-aux/missing' aclocal-1.16
>> configure.ac:10: error: AC_INIT should be called with package and
>> version arguments
>> /usr/share/aclocal-1.16/init.m4:29: AM_INIT_AUTOMAKE is expanded from...
>> configure.ac:10: the top level
>> autom4te: error: /usr/bin/m4 failed with exit status: 1
>> aclocal-1.16: error: autom4te failed with exit status: 1
>> make: *** [Makefile:1116: aclocal.m4] Error 1
>
> Here the cause is a missing -I option to 'aclocal'. It has not found the
> m4/*.m4 files, thus the error message from AM_INIT_AUTOMAKE.
>
> The fix is to add a definition
> ACLOCAL_AMFLAGS = -I m4
> to the top-level Makefile.am. Hmm. configure.ac already contains
> AC_CONFIG_MACRO_DIRS([m4])
> but Automake ignores it. The Automake documentation says that the
> ACLOCAL_AMFLAGS = -I m4
> line is redundant for Automake ≥ 1.13, but that is not the case.
Do you know what it is about the new git-version-gen approach that gives
rise to this? The redundant ACLOCAL_AMFLAGS were not needed with the
previously documented approach.
--
Basil