Subject: bug#53780: Automake failing with conditional AC_CONFIG_FILES

From: Nick Bowler <[email-masked]>
Date: Fri, 4 Feb 2022 17:10:59 -0500

On 2022-02-04, Valio Valtokari <[email-masked]> wrote:
> Hello,
>
> I have a project that supports multiple platforms (windows and linux as of
> right now). To implement testing functionality I use a library that I
> haven't configured for windows in my project yet. As such, my configure.ac
> has these lines:
>
> AC_CONFIG_FILES([Makefile:src/Makefile])

Automake probably shouldn't crash but this line is a very unusual way to
tell configure to prepare the toplevel Makefile... it says the input to
generate it is src/Makefile (as opposed to the default Makefile.in).
Basically, this tells configure to copy src/Makefile to Makefile (and
apply substitutions).

Automake will not recognize this as something it should do anything with
(it only looks for matching .am files if it sees an input file that ends
with ".in").

I can only reproduce the crash if there is a file named "Makefile.am" in
the both the toplevel directory and in the "tests" directory.  The
conditional is irrelevant: this will crash just the same:

  AC_CONFIG_FILES([Makefile:src/Makefile tests/Makefile])

Given that, without knowing anything else about your project, I suspect
you probably meant to write:

  AC_CONFIG_FILES([Makefile src/Makefile])

to have configure and/or automake prepare two different Makefiles.

Hope that helps,
  Nick