Subject: bug#32868: Check if make supports nested variables is done twice when using silent rules

From: Mike Frysinger <[email-masked]>
Date: Sun, 20 Feb 2022 15:30:33 -0500

On 28 Sep 2018 20:47, Jacob Kroon wrote:
> If I use AM_SILENT_RULES([yes]) in my configure.ac, when I run the
> configure scripts I see this:
> ...
> checking whether make supports nested variables... yes
> checking whether make supports nested variables... (cached) yes
> ...
> 
> If I remove AM_SILENT_RULES, the test is only done once.
> 
> Is this intended behaviour ?

it's because of how silent rules are integrated.  AM_INIT_AUTOMAKE has:
	AC_REQUIRE([AM_SILENT_RULES])
which makes the silent rules framework always available.

but if you want to opt-in to silent-by-default, you have to call that
same macro:
	AM_SILENT_RULES([yes])

and then all the logic is expanded twice, not just that autoconf check.

we could refactor AM_SILENT_RULES internally to minimize the amount of
duplicated logic (just setup AM_DEFAULT_VERBOSITY and related vars).

but i've also always found this config interface to be weird.  most
automake options are controlled by AM_INIT_AUTOMAKE, except for this.
the original implementation had a "silent-rules" option, but that set
whether the logic was included, not the default yes/no.  with automake
1.13, this option was turned into a no-op since it's always enabled.
i'm inclined to bring this back as the way to opt-in to silent-rules
by default.  that would address by not needing multiple calls to the
AM_SILENT_RULES macro in the first place.
-mike