Before this change, support for silent rules was optional and activated only if the 'silent-rules' option was specified.
The rationale behind that behaviour was that the silent-rules machinery originally only worked with make implementations supporting nested variables expansions, which isn't (or wasn't) a POSIX-specified features; so that packages wanting to be "extra-portable" couldn't use the silent-rules machinery at all. But after Paul Eggert's commit 'v1.11-598-g8493499' of 25-12-2011, "silent-rules: fallback for makes without nested vars" (motivated by automake bugs #9928 and #10237), Makefiles generated when the 'silent-rules' option is enabled can work also with those make implementations that don't support nested variables expansion (albeit the configure-time selected verbosity cannot be overridden at make runtime in such case). In light of that, and since silent rules are disabled by default even when the 'silent-rules' option is given (unless the developer explicitly makes them enabled by default be calling "AM_SILENT_RULES([yes])" in configure.ac), we can now have the support for silent rules always enabled. The 'silent-rules' option will thus become a no-op, but will reaming a valid option for the time being, for better backward-compatibility. A collateral effect of this change is that the use of the 'silent-rules' option will not anymore automatically disable the warnings in the 'portability-recursive' category. The present change is basically a backport of the Automake-NG commit 'v1.11d-75-g61ca923' of 19-04-2012, "[ng] silent rules: support for them is always active now". Stemmed by this thread on the Automake-NG list: <http://lists.gnu.org/archive/html/automake-ng/2012-04/msg00027.html> * automake.in: Enable silent-rules machinery unconditionally. Reword some comments. Do not switch off warnings in the category 'portability-recursive' anymore if the 'silent-rules' option is given. * m4/init.m4: Call 'AC_REQUIRE' on 'AM_SILENT_RULES' unconditionally. * lib/Automake/Options.pm: Recognize 'silent-rules' as a dummy option. Do not bother anymore checking that it is set in 'configure.ac'. * t/silent.sh: Remove now-redundant calls to AM_SILENT_RULES. * t/silent2.sh: Likewise. * t/silent3.sh: Likewise. * t/silent4.sh: Likewise. * t/silent8.sh: Likewise. * t/silent9.sh: Likewise. * t/silent-lex.sh: Likewise. * t/silent-many-gcc.sh: Likewise. * t/silent-many-generic.sh: Likewise. * t/silent-yacc-headers.sh: Likewise. * t/silent-yacc.sh: Likewise. * t/silentcxx-gcc.sh: Likewise. * t/silentcxx.sh: Likewise. * t/silentf77.sh: Likewise. * t/silentf90.sh: Likewise. * t/help-silent.sh: Likewise. * t/silent-configsite.sh: Likewise, and other minor adjustments. * t/silent7.sh: Likewise. Also, extend to check that silent rules are disabled by default, and remove obsoleted checks about the 'silent-rules' option being rejected in 'AUTOMAKE_OPTIONS'. * t/silent6.sh: Remove now-redundant calls to 'AM_SILENT_RULES'. Call automake with '-Wno-portability-recursive'. Remove other obsoleted checks. * t/dollarvar.sh: Don't expect the use of 'AM_SILENT_RULES' in 'configure.ac' to disable warning in the 'portability-recursive' category anymore. * t/compile_f_c_cxx.sh: Adjust to avoid a spurious failure. * t/silent-amopts.sh: Remove as obsolete. * t/silent-nowarn.sh: Likewise. * t/list-of-tests.mk: Adjust. * NEWS: Update. * doc/automake.texi: Update and simplify accordingly. * configure.ac (AM_INIT_AUTOMAKE): Remove 'silent-rules' option. Signed-off-by: Stefano Lattarini <stefano.lattar...@gmail.com> --- I will push by tomorrow if there is no objection. Regards, Stefano NEWS | 11 +++++ automake.in | 62 ++++++++++----------------- configure.ac | 2 +- doc/automake.texi | 105 ++++++++++++++-------------------------------- lib/Automake/Options.pm | 5 +-- m4/init.m4 | 2 +- t/compile_f_c_cxx.sh | 6 +-- t/dollarvar.sh | 11 +---- t/help-silent.sh | 19 ++++----- t/list-of-tests.mk | 2 - t/silent-amopts.sh | 28 ------------- t/silent-configsite.sh | 12 +++--- t/silent-lex.sh | 1 - t/silent-many-gcc.sh | 1 - t/silent-many-generic.sh | 1 - t/silent-nowarn.sh | 44 ------------------- t/silent-yacc-headers.sh | 1 - t/silent-yacc.sh | 1 - t/silent.sh | 1 - t/silent2.sh | 1 - t/silent3.sh | 1 - t/silent4.sh | 1 - t/silent6.sh | 39 +---------------- t/silent7.sh | 14 +++---- t/silent8.sh | 5 +-- t/silent9.sh | 1 - t/silentcxx-gcc.sh | 1 - t/silentcxx.sh | 1 - t/silentf77.sh | 1 - t/silentf90.sh | 1 - 30 files changed, 96 insertions(+), 285 deletions(-) delete mode 100755 t/silent-amopts.sh delete mode 100755 t/silent-nowarn.sh diff --git a/NEWS b/NEWS index e7570d0..b56cd3d 100644 --- a/NEWS +++ b/NEWS @@ -60,6 +60,17 @@ New in 1.12.1: m4 macro are deprecated, eliciting a warning in the 'obsolete' category. They will be removed in the next major version (1.13). +* Silent rules support: + + - Support for silent rules is now always active in Automake-generated + Makefiles. So, although the verbose output is still the default, + the user can now always use "./configure --enable-silent-rules" or + "make V=0" to enable quieter output in the package he's building. + + - The 'silent-rules' option has now become a no-op, preserved for + backward-compatibility only. In particular, its use will not disable + the warnings in the 'portability-recursive' category anymore. + Bugs fixed in 1.12.1: * Bugs introduced by 1.12: diff --git a/automake.in b/automake.in index a993451..9f358ae 100644 --- a/automake.in +++ b/automake.in @@ -1100,11 +1100,11 @@ sub backname ($) ################################################################ -# 'silent-rules' mode handling functions. +# Silent rules handling functions. # verbose_var (NAME) # ------------------ -# The public variable stem used to implement 'silent-rules'. +# The public variable stem used to implement silent rules. sub verbose_var ($) { my ($name) = @_; @@ -1113,7 +1113,7 @@ sub verbose_var ($) # verbose_private_var (NAME) # -------------------------- -# The naming policy for the private variables for 'silent-rules'. +# The naming policy for the private variables for silent rules. sub verbose_private_var ($) { my ($name) = @_; @@ -1122,25 +1122,23 @@ sub verbose_private_var ($) # define_verbose_var (NAME, VAL) # ------------------------------ -# For 'silent-rules' mode, setup VAR and dispatcher, to expand to VAL if silent. +# For silent rules, setup VAR and dispatcher, to expand to VAL if silent. sub define_verbose_var ($$) { my ($name, $val) = @_; my $var = verbose_var ($name); my $pvar = verbose_private_var ($name); my $silent_var = $pvar . '_0'; - if (option 'silent-rules') - { - # For typical 'make's, 'configure' replaces AM_V (inside @@) with $(V) - # and AM_DEFAULT_V (inside @@) with $(AM_DEFAULT_VERBOSITY). - # For strict POSIX 2008 'make's, it replaces them with 0 or 1 instead. - # See AM_SILENT_RULES in m4/silent.m4. - define_variable ($var, '$(' . $pvar . '_@'.'AM_V'.'@)', INTERNAL); - define_variable ($pvar . '_', '$(' . $pvar . '_@'.'AM_DEFAULT_V'.'@)', INTERNAL); - Automake::Variable::define ($silent_var, VAR_AUTOMAKE, '', TRUE, $val, - '', INTERNAL, VAR_ASIS) - if (! vardef ($silent_var, TRUE)); - } + # For typical 'make's, 'configure' replaces AM_V (inside @@) with $(V) + # and AM_DEFAULT_V (inside @@) with $(AM_DEFAULT_VERBOSITY). + # For strict POSIX 2008 'make's, it replaces them with 0 or 1 instead. + # See AM_SILENT_RULES in m4/silent.m4. + define_variable ($var, '$(' . $pvar . '_@'.'AM_V'.'@)', INTERNAL); + define_variable ($pvar . '_', '$(' . $pvar . '_@'.'AM_DEFAULT_V'.'@)', + INTERNAL); + Automake::Variable::define ($silent_var, VAR_AUTOMAKE, '', TRUE, $val, + '', INTERNAL, VAR_ASIS) + if (! vardef ($silent_var, TRUE)); } # Above should not be needed in the general automake code. @@ -1151,17 +1149,13 @@ sub define_verbose_var ($$) sub verbose_flag ($) { my ($name) = @_; - return '$(' . verbose_var ($name) . ')' - if (option 'silent-rules'); - return ''; + return '$(' . verbose_var ($name) . ')'; } sub verbose_nodep_flag ($) { my ($name) = @_; - return '$(' . verbose_var ($name) . subst ('am__nodep') . ')' - if (option 'silent-rules'); - return ''; + return '$(' . verbose_var ($name) . subst ('am__nodep') . ')'; } # silent_flag @@ -1174,20 +1168,17 @@ sub silent_flag () # define_verbose_tagvar (NAME) # ---------------------------- -# Engage the needed 'silent-rules' machinery for tag NAME. +# Engage the needed silent rules machinery for tag NAME. sub define_verbose_tagvar ($) { my ($name) = @_; - if (option 'silent-rules') - { - define_verbose_var ($name, '@echo " '. $name . ' ' x (8 - length ($name)) . '" $@;'); - define_verbose_var ('at', '@'); - } + define_verbose_var ($name, '@echo " '. $name . ' ' x (8 - length ($name)) . '" $@;'); + define_verbose_var ('at', '@'); } # define_verbose_texinfo # ---------------------- -# Engage the needed 'silent-rules' machinery for assorted texinfo commands. +# Engage the needed silent rules machinery for assorted texinfo commands. sub define_verbose_texinfo () { my @tagvars = ('DVIPS', 'MAKEINFO', 'INFOHTML', 'TEXI2DVI', 'TEXI2PDF'); @@ -1201,7 +1192,7 @@ sub define_verbose_texinfo () # define_verbose_libtool # ---------------------- -# Engage the needed 'silent-rules' machinery for 'libtool --silent'. +# Engage the needed silent rules machinery for 'libtool --silent'. sub define_verbose_libtool () { define_verbose_var ('lt', '--silent'); @@ -1229,10 +1220,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); @@ -1566,7 +1553,7 @@ sub handle_languages define_linker_variable ($languages{'c'}); } - # Always provide the user with 'AM_V_GEN' for 'silent-rules' mode. + # Always provide the user with 'AM_V_GEN' for silent rules. define_verbose_tagvar ('GEN'); } @@ -5213,7 +5200,6 @@ sub scan_autoconf_traces ($) AM_MAINTAINER_MODE => 0, AM_PROG_AR => 0, AM_PROG_CC_C_O => 0, - AM_SILENT_RULES => 0, _AM_SUBST_NOTMAKE => 1, _AM_COND_IF => 1, _AM_COND_ELSE => 1, @@ -5413,10 +5399,6 @@ EOF { $seen_cc_c_o = $where; } - elsif ($macro eq 'AM_SILENT_RULES') - { - set_global_option ('silent-rules', $where); - } elsif ($macro eq '_AM_COND_IF') { cond_stack_if ('', $args[1], $where); diff --git a/configure.ac b/configure.ac index bda0328..80eb1bf 100644 --- a/configure.ac +++ b/configure.ac @@ -40,7 +40,7 @@ dnl We call AC_PROG_CC in an unusual way, and only for use in our dnl testsuite, so also use 'no-dependencies' and 'no-define' among dnl the automake options to avoid bloating and potential problems. AM_INIT_AUTOMAKE([dist-xz filename-length-max=99 color-tests - parallel-tests silent-rules no-define no-dependencies]) + parallel-tests no-define no-dependencies]) ## Keep this on a line of its own, since it must be found and processed ## by the 'update-copyright' rule in our Makefile. diff --git a/doc/automake.texi b/doc/automake.texi index c21a5b7..5bfc5f5 100644 --- a/doc/automake.texi +++ b/doc/automake.texi @@ -359,9 +359,9 @@ Conditionals Silencing Make -* Make verbosity:: Make is verbose by default -* Tricks For Silencing Make:: Standard and generic ways to silence make -* Automake silent-rules Option:: How Automake can help in silencing make +* Make verbosity:: Make is verbose by default +* Tricks For Silencing Make:: Standard and generic ways to silence make +* Automake Silent Rules:: How Automake can help in silencing make When Automake Isn't Enough @@ -2712,8 +2712,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.sh Turning off @samp{portability} will also turn off @samp{extra-portability}, @@ -4058,7 +4056,8 @@ compiler is found. @item AM_SILENT_RULES @acindex AM_SILENT_RULES -Enable the machinery for less verbose build output (@pxref{Options}). +Control the machinery for less verbose build output +(@pxref{Automake Silent Rules}). @item AM_WITH_DMALLOC @acindex AM_WITH_DMALLOC @@ -5480,9 +5479,8 @@ The libtool rules also use a @code{LIBTOOLFLAGS} variable that should not be set in @file{Makefile.am}: this is a user variable (@pxref{Flag Variables Ordering}. It allows users to run @samp{make LIBTOOLFLAGS=--silent}, for instance. Note that the verbosity of -@command{libtool} can also be influenced with the Automake -@option{silent-rules} option (@pxref{Options}). - +@command{libtool} can also be influenced by the Automake support +for silent rules (@pxref{Automake Silent Rules}). @node LTLIBOBJS, Libtool Issues, Libtool Flags, A Shared Library @subsection @code{LTLIBOBJS} and @code{LTALLOCA} @@ -10167,23 +10165,6 @@ non-alpha releases. The second form is @samp{@var{major}.@var{minor}@var{alpha}}, where @var{alpha} is a letter; it should be omitted for non-alpha releases. -@item @option{silent-rules} -@cindex Option, @option{silent-rules} -@opindex silent-rules -Enable less verbose build rules. This can be used to let build rules -output status lines of the form: -@example -GEN @var{output-file} - CC @var{object-file} -@end example -@noindent -instead of printing the command that will be executed to update -@var{output-file} or to compile @var{object-file}. It can also -silence @command{libtool} output. - -For more information about how to use, enable, or disable silent -rules, @pxref{Automake silent-rules Option}. - @item @option{std-options} @cindex Options, @option{std-options} @cindex @samp{make installcheck}, testing @option{--help} and @option{--version} @@ -10665,9 +10646,9 @@ Libtool Sources}). @cindex Silent @command{make} rules @menu -* Make verbosity:: Make is verbose by default -* Tricks For Silencing Make:: Standard and generic ways to silence make -* Automake silent-rules Option:: How Automake can help in silencing make +* Make verbosity:: Make is verbose by default +* Tricks For Silencing Make:: Standard and generic ways to silence make +* Automake Silent Rules:: How Automake can help in silencing make @end menu @node Make verbosity @@ -10702,8 +10683,8 @@ the easy detection of potentially important warning messages. Here we describe some common idioms/tricks to obtain a quieter make output, with their relative advantages and drawbacks. In the next -section (@ref{Automake silent-rules Option}) we'll see how Automake -can help in this respect. +section (@ref{Automake Silent Rules}) we'll see how Automake can help +in this respect, providing more elaborate and flexible idioms. @itemize @bullet @@ -10755,20 +10736,19 @@ automatically activated if the @option{-s} flag is used. @end itemize -@node Automake silent-rules Option +@node Automake Silent Rules @section How Automake can help in silencing make The tricks and idioms for silencing @command{make} described in the previous section can be useful from time to time, but we've seen that they all have their serious drawbacks and limitations. That's why automake provides support for a more advanced and flexible way of -obtaining quieter output from @command{make}: the @option{silent-rules} -mode. +obtaining quieter output from @command{make} (for most rules at least). @c TODO: Maybe describe in brief the precedent set by the build system @c of the Linux Kernel, from which Automake took inspiration ... Links? -To give the gist of what @option{silent-rules} can do, here is a simple +To give the gist of what Automake can do in this respect, here is a simple comparison between a typical @command{make} output (where silent rules are disabled) and one with silent rules enabled: @@ -10817,7 +10797,7 @@ func.c:4:3: warning: āiā used uninitialized in this function CCLD foo @end example -@cindex silent-rules and libtool +@cindex silent rules and libtool Also, in projects using @command{libtool}, the use of silent rules can automatically enable the @command{libtool}'s @option{--silent} option: @@ -10843,26 +10823,9 @@ libtool: link: cd .libs && rm -f libx.so && ln -s libx.so.0.0.0 libx.so CCLD libx.la @end example -Let's now see how the @option{silent-rules} mode interfaces with the -package developer and the package user. - -To enable the use of @option{silent-rules} in his package, a developer -needs to do either of the following: - -@itemize @bullet -@item -Add the @option{silent-rules} option as argument to @code{AM_INIT_AUTOMAKE}. -@item -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 -@file{Makefile.am} file. - -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 -well as at @command{make} run time: +For Automake-generated @file{Makefile}s, the user may influence the +verbosity at @command{configure} run time as well as at @command{make} +run time: @itemize @bullet @item @@ -10878,17 +10841,16 @@ time may be overridden: @code{make V=1} will produce verbose output, @code{make V=0} less verbose output. @end itemize -@cindex default verbosity for silent-rules +@cindex default verbosity for silent rules Note that silent rules are @emph{disabled} by default; the user must enable them explicitly at either @command{configure} run time or at @command{make} run time. We think that this is a good policy, since it provides the casual user with enough information to prepare a good bug report in case anything breaks. -Still, notwithstanding the rationales above, a developer who wants to -make silent rules enabled by default in his own package can do so by -adding a @samp{yes} argument to the @code{AM_SILENT_RULES} call in -@file{configure.ac}. We advise against this approach, though. +Still, notwithstanding the rationales above, a developer who really +wants to make silent rules enabled by default in his own package can +do so by calling @code{AM_SILENT_RULES([yes])} in @file{configure.ac}. @c Keep in sync with silent-configsite.sh Users who prefer to have silent rules enabled by default can edit their @@ -10901,16 +10863,13 @@ 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 normally uses nested -variable expansion @samp{$(@var{var1}$(V))}, a @file{Makefile} feature -that is not required by POSIX 2008 but is widely supported in -practice. The @option{silent-rules} option thus turns off warnings -about recursive variable expansion, which are in turn enabled by -@option{-Wportability} (@pxref{automake Invocation}). On the rare -@command{make} implementations that do not support nested variable -expansion, whether rules are silent is always determined at configure -time, and cannot be overridden at make time. Future versions of POSIX -are likely to require nested variable expansion, so this minor +To work at its best, the current implementation of this feature normally +uses nested variable expansion @samp{$(@var{var1}$(V))}, a @file{Makefile} +feature that is not required by POSIX 2008 but is widely supported in +practice. On the rare @command{make} implementations that do not support +nested variable expansion, whether rules are silent is always determined at +configure time, and cannot be overridden at make time. Future versions of +POSIX are likely to require nested variable expansion, so this minor limitation should go away with time. @vindex @code{AM_V_GEN} @@ -12980,8 +12939,8 @@ generated by @command{automake} effectively: @itemize @item -If less verbose output has been enabled in the package with the -@samp{silent-rules} option (@pxref{Options}), you can use +If less verbose output has been enabled in the package with the use +of silent rules (@pxref{Automake Silent Rules}), you can use @code{make V=1} to see the commands being executed. @item @code{make -n} can help show what would be done without actually doing diff --git a/lib/Automake/Options.pm b/lib/Automake/Options.pm index 2f977bd..af0e220 100644 --- a/lib/Automake/Options.pm +++ b/lib/Automake/Options.pm @@ -287,6 +287,7 @@ sub _is_valid_easy_option ($) no-texinfo.tex nostdinc readme-alpha + silent-rules std-options subdir-objects ); @@ -338,10 +339,6 @@ sub _process_option_list (\%@) delete $options->{$_}; $options->{'filename-length-max'} = [$_, $1]; } - elsif ($_ eq 'silent-rules') - { - _option_must_be_from_configure ($_, $where); - } elsif ($_ eq 'tar-v7' || $_ eq 'tar-ustar' || $_ eq 'tar-pax') { _option_must_be_from_configure ($_, $where); diff --git a/m4/init.m4 b/m4/init.m4 index 3520dcb..9731527 100644 --- a/m4/init.m4 +++ b/m4/init.m4 @@ -101,7 +101,7 @@ AC_PROVIDE_IFELSE([AC_PROG_OBJC], [define([AC_PROG_OBJC], defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl ]) -_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl +AC_REQUIRE([AM_SILENT_RULES])dnl dnl The 'parallel-tests' driver may need to know about EXEEXT, so add the dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This macro dnl is hooked onto _AC_COMPILER_EXEEXT early, see below. diff --git a/t/compile_f_c_cxx.sh b/t/compile_f_c_cxx.sh index 99893d8..2f093ba 100755 --- a/t/compile_f_c_cxx.sh +++ b/t/compile_f_c_cxx.sh @@ -39,8 +39,8 @@ $ACLOCAL $AUTOMAKE # Look for the macros at the beginning of rules. -$FGREP "$tab\$(COMPILE)" Makefile.in -$FGREP "$tab\$(CXXCOMPILE)" Makefile.in -$FGREP "$tab\$(F77COMPILE)" Makefile.in +$FGREP "$tab\$(AM_V_CC)\$(COMPILE)" Makefile.in +$FGREP "$tab\$(AM_V_CXX)\$(CXXCOMPILE)" Makefile.in +$FGREP "$tab\$(AM_V_F77)\$(F77COMPILE)" Makefile.in : diff --git a/t/dollarvar.sh b/t/dollarvar.sh index 940ef23..f39fc85 100755 --- a/t/dollarvar.sh +++ b/t/dollarvar.sh @@ -35,6 +35,7 @@ blo = $(foo${x}) EOF $ACLOCAL + AUTOMAKE_fails -Wportability grep 'Makefile.am:2' stderr grep 'Makefile.am:3' stderr @@ -43,15 +44,7 @@ grep 'Makefile.am:5' stderr grep 'Makefile.am:6' stderr grep 'Makefile.am:7' stderr -# On the other hand, if we allow 'silent-rules' mode, then we need to -# allow recursive variable expansion, too. - -# This should work with the AM_SILENT_RULES macro. -$sleep -echo 'AM_SILENT_RULES' >> configure.ac - -$ACLOCAL --force -AUTOMAKE_fails -Wportability +AUTOMAKE_fails -Wportability -Wno-portability-recursive grep 'Makefile.am:2' stderr grep 'Makefile.am:3' stderr grep 'Makefile.am:4' stderr diff --git a/t/help-silent.sh b/t/help-silent.sh index d5fc342..aaa6b6a 100755 --- a/t/help-silent.sh +++ b/t/help-silent.sh @@ -14,25 +14,22 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. -# Make sure that our macro 'AM_SILENT_RULES' adds proper text to -# the configure help screen. +# Make sure configure options relative to automake silent rules are +# added to the configure help screen. . ./defs || Exit 1 -cat > configure.ac <<END -AC_INIT([$me], [1.0]) -AM_SILENT_RULES -END - +: > Makefile.am $ACLOCAL -mv -f configure.ac configure.tmpl +cp configure.ac configure.tmpl q="[\`'\"]" -for args in '' '([])' '([yes])' '([no])'; do - sed "s/AM_SILENT_RULES.*/&$args/" configure.tmpl >configure.ac - cat configure.ac +for args in '' 'yes' 'no'; do + cp -f configure.tmpl configure.ac + test x"$args" = x || echo "AM_SILENT_RULES([$args])/" >> configure.ac + cat configure.ac # For debugging. $AUTOCONF --force grep_configure_help --enable-silent-rules \ " less verbose build.*\\(undo.*${q}make V=1${q}" diff --git a/t/list-of-tests.mk b/t/list-of-tests.mk index d692561..b8651a7 100644 --- a/t/list-of-tests.mk +++ b/t/list-of-tests.mk @@ -965,10 +965,8 @@ t/silentcxx.sh \ t/silentcxx-gcc.sh \ t/silentf77.sh \ t/silentf90.sh \ -t/silent-amopts.sh \ t/silent-many-gcc.sh \ t/silent-many-generic.sh \ -t/silent-nowarn.sh \ t/silent-configsite.sh \ t/silent-nested-vars.sh \ t/silent-lex.sh \ diff --git a/t/silent-amopts.sh b/t/silent-amopts.sh deleted file mode 100755 index f71ad13..0000000 --- a/t/silent-amopts.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/sh -# Copyright (C) 2012 Free Software Foundation, Inc. -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see <http://www.gnu.org/licenses/>. - -# Check that automake complaints if the 'silent-rules' option is -# used in AUTOMAKE_OPTIONS. - -. ./defs || Exit 1 - -echo AUTOMAKE_OPTIONS = silent-rules > Makefile.am - -$ACLOCAL -AUTOMAKE_fails -grep "^Makefile\.am:1:.*'silent-rules'.*AM_INIT_AUTOMAKE" stderr - -: diff --git a/t/silent-configsite.sh b/t/silent-configsite.sh index 813753b..d8c2b33 100755 --- a/t/silent-configsite.sh +++ b/t/silent-configsite.sh @@ -21,7 +21,7 @@ . ./defs || Exit 1 cat >> configure.ac <<'EOF' -AM_SILENT_RULES +# This line will be edited later to force silent-rules default. AC_OUTPUT EOF @@ -51,8 +51,9 @@ $MAKE distclean : 'Disable by default in configure.ac, enable by default in config.site' -sed 's/^AM_SILENT_RULES/&([no])/' configure.ac > configure.tmp -mv -f configure.tmp configure.ac +sed 's/.*silent-rules default.*/AM_SILENT_RULES([no])/' configure.ac > t +diff t configure.ac && fatal_ "editing configure.ac" +mv -f t configure.ac $ACLOCAL $AUTOCONF $AUTOMAKE --add-missing @@ -67,8 +68,9 @@ $MAKE distclean : 'Enable by default in configure.ac, disable by default in config.site' -sed 's/^AM_SILENT_RULES/&([yes])/' configure.ac > configure.tmp -mv -f configure.tmp configure.ac +sed 's/.*AM_SILENT_RULES.*/AM_SILENT_RULES([yes])/' configure.ac > t +diff t configure.ac && fatal_ "editing configure.ac" +mv -f t configure.ac $ACLOCAL $AUTOCONF $AUTOMAKE --add-missing diff --git a/t/silent-lex.sh b/t/silent-lex.sh index 2838d6e..0e7bca5 100755 --- a/t/silent-lex.sh +++ b/t/silent-lex.sh @@ -22,7 +22,6 @@ required=lex mkdir sub cat >>configure.ac <<'EOF' -AM_SILENT_RULES AM_PROG_CC_C_O AC_PROG_LEX AC_CONFIG_FILES([sub/Makefile]) diff --git a/t/silent-many-gcc.sh b/t/silent-many-gcc.sh index 8b457ca..8ad0720 100755 --- a/t/silent-many-gcc.sh +++ b/t/silent-many-gcc.sh @@ -95,7 +95,6 @@ do_and_check_verbose_build () mkdir sub cat >>configure.ac <<'EOF' -AM_SILENT_RULES AM_PROG_CC_C_O AC_PROG_CXX AC_PROG_F77 diff --git a/t/silent-many-generic.sh b/t/silent-many-generic.sh index 3949009..cd37672 100755 --- a/t/silent-many-generic.sh +++ b/t/silent-many-generic.sh @@ -96,7 +96,6 @@ do_and_check_verbose_build () mkdir sub cat >>configure.ac <<'EOF' -AM_SILENT_RULES AM_PROG_CC_C_O AC_PROG_F77 AC_PROG_FC diff --git a/t/silent-nowarn.sh b/t/silent-nowarn.sh deleted file mode 100755 index 5a547bc..0000000 --- a/t/silent-nowarn.sh +++ /dev/null @@ -1,44 +0,0 @@ -#!/bin/sh -# Copyright (C) 2011-2012 Free Software Foundation, Inc. -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see <http://www.gnu.org/licenses/>. - -# Check that the 'silent-rules' mode suppresses the warnings for recursive -# make variable expansions. This should happen regardless of whether and -# where these warnings are requested. - -. ./defs || Exit 1 - -cat > configure.ac <<END -AC_INIT([$me], [1.0]) -# Yes, we repeat the warnings two times, both before and after -# 'silent-rules'. This is deliberate. -AM_INIT_AUTOMAKE([gnu -Wall -Wportability-recursive - silent-rules - -Wall -Wportability-recursive]) -AC_CONFIG_FILES([Makefile]) -END - -cat > Makefile.am <<'END' -AUTOMAKE_OPTIONS = gnu -Wall -Wportability-recursive -foo = $($(v)) $(x$(v)) $($(v)x) $(y$(v)z) -END - -# Files required bu gnu strictness. -touch AUTHORS ChangeLog COPYING INSTALL NEWS README THANKS - -$ACLOCAL -$AUTOMAKE --gnu -Wall -Wportability-recursive - -: diff --git a/t/silent-yacc-headers.sh b/t/silent-yacc-headers.sh index 55ba247..5f12c18 100755 --- a/t/silent-yacc-headers.sh +++ b/t/silent-yacc-headers.sh @@ -23,7 +23,6 @@ required=yacc mkdir sub cat >>configure.ac <<'EOF' -AM_SILENT_RULES AC_PROG_YACC AC_PROG_CC AC_OUTPUT diff --git a/t/silent-yacc.sh b/t/silent-yacc.sh index 35415bf..5cb3abc 100755 --- a/t/silent-yacc.sh +++ b/t/silent-yacc.sh @@ -23,7 +23,6 @@ required=yacc mkdir sub cat >>configure.ac <<'EOF' -AM_SILENT_RULES AM_PROG_CC_C_O AC_PROG_YACC AC_CONFIG_FILES([sub/Makefile]) diff --git a/t/silent.sh b/t/silent.sh index f914c44..3cdbaff 100755 --- a/t/silent.sh +++ b/t/silent.sh @@ -24,7 +24,6 @@ required=cc mkdir sub cat >>configure.ac <<'EOF' -AM_SILENT_RULES AC_CONFIG_FILES([sub/Makefile]) AC_PROG_CC AM_PROG_CC_C_O diff --git a/t/silent2.sh b/t/silent2.sh index 6565a27..6270104 100755 --- a/t/silent2.sh +++ b/t/silent2.sh @@ -25,7 +25,6 @@ required=gcc mkdir sub cat >>configure.ac <<'EOF' -AM_SILENT_RULES AC_CONFIG_FILES([sub/Makefile]) AC_PROG_CC AM_PROG_CC_C_O diff --git a/t/silent3.sh b/t/silent3.sh index 564a490..cb3c629 100755 --- a/t/silent3.sh +++ b/t/silent3.sh @@ -24,7 +24,6 @@ required='cc libtoolize' mkdir sub cat >>configure.ac <<'EOF' -AM_SILENT_RULES AC_CONFIG_FILES([sub/Makefile]) AC_PROG_CC AM_PROG_AR diff --git a/t/silent4.sh b/t/silent4.sh index 44b7eb3..a44c718 100755 --- a/t/silent4.sh +++ b/t/silent4.sh @@ -25,7 +25,6 @@ required="libtoolize gcc" mkdir sub cat >>configure.ac <<'EOF' -AM_SILENT_RULES AC_CONFIG_FILES([sub/Makefile]) AC_PROG_CC AM_PROG_AR diff --git a/t/silent6.sh b/t/silent6.sh index 280d25a..f8ad681 100755 --- a/t/silent6.sh +++ b/t/silent6.sh @@ -19,11 +19,12 @@ . ./defs || Exit 1 cat >>configure.ac <<'EOF' -AM_SILENT_RULES AC_OUTPUT EOF cat > Makefile.am <<'EOF' +AUTOMAKE_OPTIONS = -Wno-portability-recursive + my_verbose = $(my_verbose_$(V)) my_verbose_ = $(my_verbose_$(AM_DEFAULT_VERBOSITY)) my_verbose_0 = @echo GEN $@; @@ -68,40 +69,4 @@ cat stdout grep '^ *GEN foo *$' stdout grep 'cp ' stdout && Exit 1 -$MAKE distclean - -$sleep -# Things should also work with -Wall in AM_INIT_AUTOMAKE. -cat > configure.ac <<'END' -AC_INIT([silent6], [1.0]) -AM_INIT_AUTOMAKE([-Wall]) -AC_CONFIG_FILES([Makefile]) -END - -$ACLOCAL -AUTOMAKE_fails -$AUTOMAKE -Wno-error - -# AM_SILENT_RULES should turn off the warning. -$sleep -echo 'AM_SILENT_RULES' >> configure.ac -$ACLOCAL -$AUTOMAKE -grep 'AM_V_GEN' Makefile.in -$AUTOMAKE --force -Wno-all -Wportability -grep 'AM_V_GEN' Makefile.in - -# The 'silent-rules' option to AM_INIT_AUTOMAKE should work likewise. -$sleep -cat > configure.ac <<'END' -AC_INIT([silent6], [1.0]) -AM_INIT_AUTOMAKE([silent-rules]) -AC_CONFIG_FILES([Makefile]) -END -$ACLOCAL -$AUTOMAKE -grep 'AM_V_GEN' Makefile.in -$AUTOMAKE --force -Wno-all -Wportability -grep 'AM_V_GEN' Makefile.in - : diff --git a/t/silent7.sh b/t/silent7.sh index 02ef287..716eada 100755 --- a/t/silent7.sh +++ b/t/silent7.sh @@ -15,13 +15,11 @@ # along with this program. If not, see <http://www.gnu.org/licenses/>. # Check user extensibility of silent-rules mode. +# Aslo check that silent rules are disabled by default. . ./defs || Exit 1 -cat >>configure.ac <<'EOF' -AM_SILENT_RULES -AC_OUTPUT -EOF +echo AC_OUTPUT >> configure.ac cat > Makefile.am <<'EOF' all-local: foo @@ -41,7 +39,9 @@ $ACLOCAL $AUTOMAKE --add-missing $AUTOCONF -./configure --disable-silent-rules +# Silent rules are disabled by default, since we haven't called +# "AM_SILENT_RULES([yes])" explicitly. +./configure $MAKE >stdout || { cat stdout; Exit 1; } cat stdout grep 'GEN ' stdout && Exit 1 @@ -85,8 +85,4 @@ grep 'GEN ' stdout && Exit 1 grep 'cp ' stdout grep 'echo ' stdout -# Ensure that setting 'silent-rules' in a Makefile.am produces an error. -echo 'AUTOMAKE_OPTIONS = silent-rules' >> Makefile.am -AUTOMAKE_fails --force - : diff --git a/t/silent8.sh b/t/silent8.sh index a2fdb44..f15e99f 100755 --- a/t/silent8.sh +++ b/t/silent8.sh @@ -19,10 +19,7 @@ required='makeinfo-html tex texi2dvi-o dvips' . ./defs || Exit 1 -cat >>configure.ac <<'EOF' -AM_SILENT_RULES -AC_OUTPUT -EOF +echo AC_OUTPUT >> configure.ac cat > Makefile.am <<'EOF' info_TEXINFOS = foo.texi diff --git a/t/silent9.sh b/t/silent9.sh index 70195a1..9b311c6 100755 --- a/t/silent9.sh +++ b/t/silent9.sh @@ -24,7 +24,6 @@ required='cc libtoolize' mkdir sub cat >>configure.ac <<'EOF' -AM_SILENT_RULES AC_CONFIG_FILES([sub/Makefile]) AC_PROG_CC AM_PROG_CC_C_O diff --git a/t/silentcxx-gcc.sh b/t/silentcxx-gcc.sh index d99f1e9..fff3f91 100755 --- a/t/silentcxx-gcc.sh +++ b/t/silentcxx-gcc.sh @@ -24,7 +24,6 @@ required=g++ mkdir sub cat >>configure.ac <<'EOF' -AM_SILENT_RULES AC_PROG_CXX AC_CONFIG_FILES([sub/Makefile]) AC_OUTPUT diff --git a/t/silentcxx.sh b/t/silentcxx.sh index a41cc2d..cc111d3 100755 --- a/t/silentcxx.sh +++ b/t/silentcxx.sh @@ -25,7 +25,6 @@ required=c++ mkdir sub cat >>configure.ac <<'EOF' -AM_SILENT_RULES AC_PROG_CXX AC_CONFIG_FILES([sub/Makefile]) AC_OUTPUT diff --git a/t/silentf77.sh b/t/silentf77.sh index ce6f6a0..87fbc23 100755 --- a/t/silentf77.sh +++ b/t/silentf77.sh @@ -23,7 +23,6 @@ required=fortran77 mkdir sub cat >>configure.ac <<'EOF' -AM_SILENT_RULES AC_PROG_F77 AC_CONFIG_FILES([sub/Makefile]) AC_OUTPUT diff --git a/t/silentf90.sh b/t/silentf90.sh index 8bb06b2..65a35ed 100755 --- a/t/silentf90.sh +++ b/t/silentf90.sh @@ -23,7 +23,6 @@ required=fortran mkdir sub cat >>configure.ac <<'EOF' -AM_SILENT_RULES AC_PROG_FC AC_CONFIG_FILES([sub/Makefile]) AC_OUTPUT -- 1.7.9.5