[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: AM_SILENT_RULES has no effect
From: |
Ralf Wildenhues |
Subject: |
Re: AM_SILENT_RULES has no effect |
Date: |
Sat, 23 May 2009 23:17:32 +0200 |
User-agent: |
Mutt/1.5.18 (2008-05-17) |
Hello Bruno,
* Bruno Haible wrote on Fri, May 22, 2009 at 12:50:11PM CEST:
> So there's definitely two things to fix:
Yep; thank you for persevering.
> 1) The error message is misleading. It is even claiming wrong facts. In this
> case, I do have 'silent-rules' as an argument of AM_INIT_AUTOMAKE, and
> automake tells me that I should use 'silent-rules' as an argument of
> AM_INIT_AUTOMAKE:
[...]
> The error message should say to *remove* 'silent-rules' from the
> Makefile.am
> in the first place.
> 2) The 'silent-rules' option is described in an 'info' section that starts
> like
> this:
>
> Various features of Automake can be controlled by options in the
> `Makefile.am'. Such options are applied on a per-`Makefile' basis when
> listed in a special `Makefile' variable named `AUTOMAKE_OPTIONS'. They
> are applied globally to all processed `Makefiles' when listed in the
> first argument of `AM_INIT_AUTOMAKE' in `configure.ac'. Currently
> understood options are:
>
> So it is the most natural thing for a user to try to enable it in a
> Makefile.am. 'silent-rules' is probably the only automake option that
> cannot be used in a Makefile.am? The doc should be explicit about this.
It is not the only one, but the others (tar-v7, tar-ustar, tar-pax) are
probably used rather less often. And yes, the Options introduction is
misleading.
> The documentation paragraph cited above gave me the impression that
> - The silent-rules feature can be enabled on a per-Makefile basis,
> - An additional modification of configure.ac is needed for it to take
> effect.
>
> Just like for the 'subdir-objects' option, which
> - can be enabled on a per-Makefile basis,
> - requires the use of AM_PROG_CC_C_O in configure.ac.
I understand that it is easy to come to this conclusion. However, the
subdir-objects/AM_PROG_CC_C_O situation is a bit different: There are
several reasons why AM_PROG_CC_C_O may be needed, for example per-target
compile flags, subdir-objects or compile rules added by the developer
which use "-c" and "-o" together. Then, it is very useful in practice
to be able to specify subdir-objects on a per-Makefile.am basis.
With silent-rules, the situation is simpler: the support needed in the
configure script is merely the --enable-silent-rules switch, and
changing the verbosity of the makefiles on a per-makefile basis did not
seem like an important feature to have. So it seemed to me to be more
important to not have to change the package in more than one place in
order to enable the feature.
But of course you are right in that the alternative of using
AM_INIT_AUTOMAKE([silent-rules]) vs.
AM_INIT_AUTOMAKE
...
AM_SILENT_RULES
has no direct precedent with the other options. Not having to specify
things in two separate places seemed important enough for me to
introduce this slight inconsistency in semantics.
> So I got the impression that the normal way of using the feature is the one
> which you say is impossible. Please fix the documentation! The doc and the
> error message completely misled me.
I'm applying the following patch to improve the situation. Hope this
will cause less users to stumble over this.
Cheers, and thanks again!
Ralf
Clarify how to enable `silent-rules' and other global options.
* doc/automake.texi (Options): When introducing options, be more
careful to note that not all of them can be specified in
AUTOMAKE_OPTIONS statements, and that some do not make sense in
subdirectories. Note more prominently that `silent-rules' can
only be specified in configure.ac.
* lib/Automake/Options.pm (_process_option_list): Improve error
message for `silent-rules', `tar-v7', `tar-ustar', `tar-pax'
options specified in Makefile.am files.
Report by Bruno Haible.
diff --git a/doc/automake.texi b/doc/automake.texi
index 1c93024..6c6765f 100644
--- a/doc/automake.texi
+++ b/doc/automake.texi
@@ -8912,13 +8912,18 @@ will now be rerun each time the version number is
bumped, when only
@node Options
@chapter Changing Automake's Behavior
-Various features of Automake can be controlled by options in the
address@hidden Such options are applied on a address@hidden
-basis when listed in a special @file{Makefile} variable named
address@hidden They are applied globally to all processed
address@hidden when listed in the first argument of
address@hidden in @file{configure.ac}. Currently understood
-options are:
+Various features of Automake can be controlled by options. Except where
+noted otherwise, options can be specified in one of several ways: Most
+options can be applied on a address@hidden basis when listed in a
+special @file{Makefile} variable named @code{AUTOMAKE_OPTIONS}. Some
+of these options only make sense when specified in the toplevel
address@hidden file. Options are applied globally to all processed
address@hidden files when listed in the first argument of
address@hidden in @file{configure.ac}, and some options which
+require changes to the @command{configure} script can only be specified
+there. These are annotated below.
+
+Currently understood options are:
@vindex AUTOMAKE_OPTIONS
@table @asis
@@ -9121,6 +9126,9 @@ Call the @code{AM_SILENT_RULES} macro from within the
@file{configure.ac}
file.
@end itemize
+It is not possible to instead specify @option{silent-rules} in a
address@hidden file.
+
@cindex default verbosity for silent-rules
If the developer has done either of the above, then the user of the
package may influence the verbosity at @command{configure} run time as
diff --git a/lib/Automake/Options.pm b/lib/Automake/Options.pm
index d104414..cacc7d2 100644
--- a/lib/Automake/Options.pm
+++ b/lib/Automake/Options.pm
@@ -279,13 +279,15 @@ sub _process_option_list (\%$@)
elsif ($_ eq 'silent-rules')
{
error ($where,
- "option `$_' must be an argument of AM_INIT_AUTOMAKE")
+ "option `$_' can only be used as argument to
AM_INIT_AUTOMAKE\n"
+ . "but not in AUTOMAKE_OPTIONS makefile statements")
if $where->get !~ /^configure\./;
}
elsif ($_ eq 'tar-v7' || $_ eq 'tar-ustar' || $_ eq 'tar-pax')
{
error ($where,
- "option `$_' must be an argument of AM_INIT_AUTOMAKE")
+ "option `$_' can only be used as argument to
AM_INIT_AUTOMAKE\n"
+ . "but not in AUTOMAKE_OPTIONS makefile statements")
if $where->get !~ /^configure\./;
for my $opt ('tar-v7', 'tar-ustar', 'tar-pax')
{