On 12/06/11 11:02, Stefano Lattarini wrote:
> If you are interested in accomodating this fringe situation, I will
> then accept a patch on the lines Paul has proposed (with a mandatory
> testcase, otherwise it would be far too easy to regress in such a
> almost-never-excercised corner case).
OK, a proposed patch is below. It changes the silent-rules test case
to check the new behavior; hope that's what you're asking for.
Comments are welcome.
The patch below is just the human-edited parts. A full patch
(including the autogenerated parts) is attached, as a compressed file.
automake: port silent-rules option to POSIX make
This fixes two problems reported for Automake (Bug#9928, Bug#10237)
and is in response to a bug report for building coreutils on
HP NonStop OS (Bug#10234). The basic idea is that instead of
generating Makefile.in lines like "AM_V_CC = $(am__v_CC_$(V))",
we generate "AM_V_CC = $(am__v_CC_@am__V@)". We then AC_SUBST
$(V) for @am__V@ in the usual case where `make' supports
nested variables, and substitute 1 (or 0) otherwise.
Similarly for usages like $(am__v_CC_$(AM_DEFAULT_VERBOSITY)).
* NEWS: Document this.
* automake.in (define_verbose_var): When defining the variable,
use @am__V@ rather than $(V), and likewise for
@am__DEFAULT_VERBOSITY@ and $(AM_DEFAULT_VERBOSITY).
(handle_options): silent-rules no longer overrides
portability-recursive.
* doc/automake.texi (Invoking Automake): silent-rules no longer
overrides portability-recursive.
(Automake silent-rules Option): Explain new system.
* m4/silent.m4 (AM_SILENT_RULES): Check whether `make' supports
nested variables, and substitute am__V and am__DEFAULT_VERBOSITY
accordingly.
* tests/silent-nowarn.test: Check that silent-rules no longer
overrides portability-recursive.
diff --git a/NEWS b/NEWS
index da9af08..615f420 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,14 @@
+* Changes to automake:
+
+ - The `silent-rules' option now generates working makefiles even for
+the uncommon `make' implementations that do not support the
+nested-variables extension to POSIX 2008. For such `make'
+implementations, whether a build is silent is determined at
+configure time, and cannot be overridden at make time with `make
+V=0' or `make V=1'. Since the `silent-rules' option no longer
+requires nested variables, it no longer disables the
+nested-variables warning.
+
New in 1.11a:
* Changes to automake:
diff --git a/automake.in b/automake.in
index 0b6d014..d61af86 100644
--- a/automake.in
+++ b/automake.in
@@ -1141,9 +1141,8 @@ sub define_verbose_var ($$)
my $silent_var = $pvar . '_0';
if (option 'silent-rules')
{
- # Using `$V' instead of `$(V)' breaks IRIX make.
- define_variable ($var, '$(' . $pvar . '_$(V))', INTERNAL);
- define_variable ($pvar . '_', '$(' . $pvar .
'_$(AM_DEFAULT_VERBOSITY))', INTERNAL);
+ define_variable ($var, '$(' . $pvar . '_@'.'am__V'.'@)', INTERNAL);
+ define_variable ($pvar . '_', '$(' . $pvar .
'_@'.'am__DEFAULT_VERBOSITY'.'@)', INTERNAL);
Automake::Variable::define ($silent_var, VAR_AUTOMAKE, '', TRUE, $val,
'', INTERNAL, VAR_ASIS)
if (! vardef ($silent_var, TRUE));
@@ -1236,10 +1235,6 @@ sub handle_options
return 1 if process_option_list (@options);
}
- # Override portability-recursive warning.
- switch_warning ('no-portability-recursive')
-if option 'silent-rules';
-
if ($strictness == GNITS)
{
set_option ('readme-alpha', INTERNAL);
diff --git a/doc/automake.texi b/doc/automake.texi
index e937715..8214787 100644
--- a/doc/automake.texi
+++ b/doc/automake.texi
@@ -2702,8 +2702,6 @@ variables.
The categories output by default are @samp{syntax} and
@samp{unsupported}. Additionally, @samp{gnu} and @samp{portability}
are enabled in @option{--gnu} and @option{--gnits} strictness.
-On the other hand, the @option{silent-rules} options (@pxref{Options})
-turns off portability warnings about recursive variable expansions.
@c Checked by extra-portability.test
Turning off @samp{portability} will also turn off @samp{extra-portability},
@@ -10141,19 +10139,14 @@ Users who prefer to have silent rules enabled by
default can edit their
default to @samp{yes}. This should still allow disabling silent rules
at @command{configure} time and at @command{make} time.
-@c FIXME: there's really a need to specify this explicitly?
-For portability to different @command{make} implementations, package authors
-are advised to not set the variable @code{V} inside the @file{Makefile.am}
-file, to allow the user to override the value for subdirectories as well.
-
-The current implementation of this feature relies on a non-POSIX, but in
-practice rather widely supported @file{Makefile} construct of nested
-variable expansion @samp{$(@var{var1}$(V))}. Do not use the
-@option{silent-rules} option if your package needs to build with
-@command{make} implementations that do not support i