]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
silent-rules reorganization, --enable-silent-rules switch.
authorRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Mon, 13 Apr 2009 21:17:39 +0000 (23:17 +0200)
committerRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Mon, 13 Apr 2009 21:17:39 +0000 (23:17 +0200)
This patch introduces a configure-time option to set the default
verbosity.  Since configure now needs to know whether the
`silent-rules' automake option was set, the latter can only be
set within AM_INIT_AUTOMAKE, or with a new AM_SILENT_RULES macro
but not any more through AUTOMAKE_OPTIONS or the automake
command line option `--silent-rules'.

* automake.in (define_verbose_var): Define the default verbose
variable in terms of `$(AM_DEFAULT_VERBOSITY)'.
(handle_configure): Do not pass `--silent-rules' to automake.
(scan_autoconf_traces): Trace `AM_SILENT_RULES'.  If seen,
enable global `silent-rules' option.
(usage): Do not document `--silent-rules'.
(parse_arguments): Do not accept `--silent-rules'.
* doc/automake.texi (Options): Overhaul.  Document
AM_SILENT_RULES, --enable-silent-rules, --disable-silent-rules,
AM_DEFAULT_VERBOSITY.  Show an example for user-added variables
for less verbose output.
(Invoking Automake): Remove documentation for `--silent-rules'.
(Public Macros): Document `AM_SILENT_RULES'.
* NEWS: Update.
* lib/Automake/Options.pm (_process_option_list): Accept
`silent-rules' only as option in configure.ac.
* m4/init.m4 (AM_INIT_AUTOMAKE): If the `silent-rules' option
was enabled, require `AM_SILENT_RULES'; move AM_BACKSLASH
initialization to ...
* m4/silent.m4 (AM_SILENT_RULES): ... this new file, new macro.
Deal with `--enable-silent-rules' switch; define
AM_DEFAULT_VERBOSITY.
* m4/Makefile.am (dist_m4data_DATA): Add silent.m4.
* tests/dollarvar.test: Remove tests for `--silent-rules', use
`AM_SILENT_RULES'.
* tests/flavor.test: Remove test for `--silent-rules'.
* tests/silent.test: Use `AM_SILENT_RULES' instead of
`AUTOMAKE_OPTIONS = silent-rules'; use `--enable-silent-rules'.
* tests/silent2.test: Likewise.
* tests/silent3.test: Likewise.
* tests/silent4.test: Likewise.
* tests/silent5.test: Likewise.
* tests/silent6.test: Likewise. Test `AM_SILENT_RULES' as well
as `AM_INIT_AUTOMAKE([silent-rules])' instead of
`--silent-rules'.
* tests/silent7.test: Use `AM_SILENT_RULES' instead of
`AUTOMAKE_OPTIONS = silent-rules'; ensure the latter is rejected.
Test combinations of --enable-silent-rules and
--disable-silent-rules with `make V=0' and `make V=1'.
Suggestion for configure-time switch by Bob Friesenhahn.

Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
19 files changed:
ChangeLog
NEWS
automake.in
configure
doc/automake.texi
lib/Automake/Options.pm
m4/Makefile.am
m4/Makefile.in
m4/init.m4
m4/silent.m4 [new file with mode: 0644]
tests/dollarvar.test
tests/flavor.test
tests/silent.test
tests/silent2.test
tests/silent3.test
tests/silent4.test
tests/silent5.test
tests/silent6.test
tests/silent7.test

index 0737903c9978612d790a3f535528a6c2cbbfbddd..5d872eea687681051fc615102b9403f7ba2d374b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,53 @@
 2009-04-13  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
 
+       silent-rules reorganization, --enable-silent-rules switch.
+       This patch introduces a configure-time option to set the default
+       verbosity.  Since configure now needs to know whether the
+       `silent-rules' automake option was set, the latter can only be
+       set within AM_INIT_AUTOMAKE, or with a new AM_SILENT_RULES macro
+       but not any more through AUTOMAKE_OPTIONS or the automake
+       command line option `--silent-rules'.
+       * automake.in (define_verbose_var): Define the default verbose
+       variable in terms of `$(AM_DEFAULT_VERBOSITY)'.
+       (handle_configure): Do not pass `--silent-rules' to automake.
+       (scan_autoconf_traces): Trace `AM_SILENT_RULES'.  If seen,
+       enable global `silent-rules' option.
+       (usage): Do not document `--silent-rules'.
+       (parse_arguments): Do not accept `--silent-rules'.
+       * doc/automake.texi (Options): Overhaul.  Document
+       AM_SILENT_RULES, --enable-silent-rules, --disable-silent-rules,
+       AM_DEFAULT_VERBOSITY.  Show an example for user-added variables
+       for less verbose output.
+       (Invoking Automake): Remove documentation for `--silent-rules'.
+       (Public Macros): Document `AM_SILENT_RULES'.
+       * NEWS: Update.
+       * lib/Automake/Options.pm (_process_option_list): Accept
+       `silent-rules' only as option in configure.ac.
+       * m4/init.m4 (AM_INIT_AUTOMAKE): If the `silent-rules' option
+       was enabled, require `AM_SILENT_RULES'; move AM_BACKSLASH
+       initialization to ...
+       * m4/silent.m4 (AM_SILENT_RULES): ... this new file, new macro.
+       Deal with `--enable-silent-rules' switch; define
+       AM_DEFAULT_VERBOSITY.
+       * m4/Makefile.am (dist_m4data_DATA): Add silent.m4.
+       * tests/dollarvar.test: Remove tests for `--silent-rules', use
+       `AM_SILENT_RULES'.
+       * tests/flavor.test: Remove test for `--silent-rules'.
+       * tests/silent.test: Use `AM_SILENT_RULES' instead of
+       `AUTOMAKE_OPTIONS = silent-rules'; use `--enable-silent-rules'.
+       * tests/silent2.test: Likewise.
+       * tests/silent3.test: Likewise.
+       * tests/silent4.test: Likewise.
+       * tests/silent5.test: Likewise.
+       * tests/silent6.test: Likewise. Test `AM_SILENT_RULES' as well
+       as `AM_INIT_AUTOMAKE([silent-rules])' instead of
+       `--silent-rules'.
+       * tests/silent7.test: Use `AM_SILENT_RULES' instead of
+       `AUTOMAKE_OPTIONS = silent-rules'; ensure the latter is rejected.
+       Test combinations of --enable-silent-rules and
+       --disable-silent-rules with `make V=0' and `make V=1'.
+       Suggestion for configure-time switch by Bob Friesenhahn.
+
        manual: Add note about parallelism and tests ordering.
        * doc/automake.texi (Simple Tests using parallel-tests):
        Dependencies between test logs work for tests with known
diff --git a/NEWS b/NEWS
index 64756fe5911123f210445f4eb7fc7db8cec1490d..db639f98450c59d9405f27731d4f855b0dfd5a6e 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -17,6 +17,14 @@ New in 1.10c:
   - The new `parallel-tests' targets `recheck' and `recheck-html' will not run
     any tests that have not run yet.
 
+  - The `silent-rules' mode introduces a configure-time `--enable-silent-rules'
+    option to specify the default build verbosity; it can still be overridden
+    with an explicit `make V=[0|1]'.  The configure switch necessitated to
+    remove the automake command-line switch `--silent-rules' and per-Makefile.am
+    settings `AUTOMAKE_OPTIONS = silent-rules', so the feature needs to be
+    enabled in configure.ac now, either by adding the `silent-rules' option
+    to `AM_INIT_AUTOMAKE', or by calling the new `AM_SILENT_RULES' macro.
+
 Bugs fixed in 1.10c:
 
 * Long standing bugs:
index 10927a1fe4dae86d6684cc72138eb60ade13acdd..137b8da7f5e1bd36844198231d07f28f3f670f27 100755 (executable)
@@ -1144,7 +1144,7 @@ sub define_verbose_var ($$)
       {
        # Using `$V' instead of `$(V)' breaks IRIX make.
        define_variable ($var, '$(' . $pvar . '_$(V))', INTERNAL);
-       define_variable ($pvar . '_', $val, INTERNAL);
+       define_variable ($pvar . '_', '$(' . $pvar . '_$(AM_DEFAULT_VERBOSITY))', INTERNAL);
        define_variable ($pvar . '_0', $val, INTERNAL);
       }
 }
@@ -4197,8 +4197,7 @@ sub handle_configure ($$$@)
                          @configuredeps);
 
   my $automake_options = '--' . (global_option 'cygnus' ? 'cygnus' : $strictness_name)
-                        . (global_option 'no-dependencies' ? ' --ignore-deps' : '')
-                        . (global_option 'silent-rules' ? ' --silent-rules' : '');
+                        . (global_option 'no-dependencies' ? ' --ignore-deps' : '');
 
   $output_rules .= file_contents
     ('configure',
@@ -5212,6 +5211,7 @@ sub scan_autoconf_traces ($)
                AM_INIT_AUTOMAKE => 0,
                AM_MAINTAINER_MODE => 0,
                AM_PROG_CC_C_O => 0,
+               AM_SILENT_RULES => 0,
                _AM_SUBST_NOTMAKE => 1,
                _AM_COND_IF => 1,
                _AM_COND_ELSE => 1,
@@ -5405,6 +5405,10 @@ sub scan_autoconf_traces ($)
        {
          $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);
@@ -8158,9 +8162,6 @@ Dependency tracking:
   -i, --ignore-deps      disable dependency tracking code
       --include-deps     enable dependency tracking code
 
-Verbosity of generated rules:
-      --silent-rules     enable silent build rules
-
 Flavors:
       --cygnus           assume program is part of Cygnus-style tree
       --foreign          set strictness to foreign
@@ -8272,8 +8273,6 @@ sub parse_arguments ()
      'o|output-dir=s'  => \$output_directory,
      'a|add-missing'   => \$add_missing,
      'c|copy'          => \$copy_missing,
-     'silent-rules'    => sub { set_global_option ('silent-rules',
-                                                   $cli_where); },
      'v|verbose'       => sub { setup_channel 'verb', silent => 0; },
      'W|warnings=s'     => \&parse_warnings,
      # These long options (--Werror and --Wno-error) for backward
index 15ad6fd89d9ff7a9b19493249a0394e98019d11f..e73a0bdf9f861b6bd363cfa6d5748a057d70a8bd 100755 (executable)
--- a/configure
+++ b/configure
@@ -614,7 +614,6 @@ PERL_THREADS
 PERL
 pkgvdatadir
 APIVERSION
-AM_BACKSLASH
 am__untar
 am__tar
 AMTAR
@@ -2336,7 +2335,6 @@ am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'
 
 
 
-AM_BACKSLASH='\'
 
 
 # The API version is the base version.  We must guarantee
index 453fff940d74087fcab20c1687eca5ce008b99fd..0094fa01e3b50d652c03e300f53a7af26ec5181e 100644 (file)
@@ -2559,10 +2559,6 @@ Ordinarily each @file{Makefile.in} is created in the directory of the
 corresponding @file{Makefile.am}.  This option is deprecated and will be
 removed in a future release.
 
-@item --silent-rules
-@opindex --silent-rules
-Enable the @option{silent-rules} option globally (@pxref{Options}).
-
 @item -v
 @itemx --verbose
 @opindex -v
@@ -3889,6 +3885,10 @@ variable.  The default @var{compiler-search-list} is @samp{upcc upc}.
 This macro will abort @command{configure} if no Unified Parallel C
 compiler is found.
 
+@item AM_SILENT_RULES
+@acindex AM_SILENT_RULES
+Enable the machinery for less verbose build output (@pxref{Options}).
+
 @item AM_WITH_DMALLOC
 @acindex AM_WITH_DMALLOC
 @cindex @command{dmalloc}, support for
@@ -9022,8 +9022,8 @@ letter; it should be omitted for non-alpha releases.
 @item @option{silent-rules}
 @cindex Option, @option{silent-rules}
 @opindex silent-rules
-Enable silent build rules.  This will cause many build rules to output a
-status line of the form
+Enable less verbose build rules.  This can be used to let build rules
+output a status line of the form
 
 @example
   GEN @var{output-file}
@@ -9031,12 +9031,38 @@ status line of the form
 
 @noindent
 instead of printing the command that will be executed to update
-@var{output-file}.  It will also silence @command{libtool} output.
+@var{output-file}.  It can also silence @command{libtool} output.
+
+To enable less verbose build rules, both the developer and the user
+of the package have to take a number of steps.  The 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
 
+@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
+well as at @command{make} run time:
+
+@itemize @bullet
+@item
+@opindex --enable-silent-rules
+@opindex --disable-silent-rules
+Passing @option{--enable-silent-rules} to @command{configure} will cause
+build rules to be less verbose; the option @option{--disable-silent-rules}
+is the default and will cause normal verbose output.
+@item
 @vindex @code{V}
-The verbosity can be influenced at @command{make} run time by setting the
-variable @code{V}: @samp{make V=0} is equivalent to @code{V} being unset,
-while @samp{make V=1} will produce verbose output.
+At @command{make} run time, the default chosen at @command{configure}
+time may be overridden: @code{make V=1} will produce verbose output,
+@code{make V=0} less verbose output.
+@end itemize
 
 For portability to different @command{make} implementations, package authors
 are advised to not set the variable @code{V} inside the @file{Makefile.am}
@@ -9053,11 +9079,31 @@ expansion, which are in turn enabled by @option{-Wportability}
 
 @vindex @code{AM_V_GEN}
 @vindex @code{AM_V_at}
-To extend the silent mode to your own rules, you can use the predefined
-variable @code{AM_V_GEN} as a prefix to commands that should output a
-status line in silent mode, and @code{AM_V_at} as a prefix to commands
-that should not output anything in silent mode.  With @code{V=1}, these
-variables will expand to empty strings.
+@vindex @code{AM_DEFAULT_VERBOSITY}
+To extend the silent mode to your own rules, you have two choices:
+
+@itemize @bullet
+@item
+You can use the predefined variable @code{AM_V_GEN} as a prefix to
+commands that should output a status line in silent mode, and
+@code{AM_V_at} as a prefix to commands that should not output anything
+in silent mode.  When output is to be verbose, both of these variables
+will expand to the empty string.
+@item
+You can add your own variables, so strings of your own choice are shown.
+The following snippet shows how you would define your own equivalent of
+@code{AM_V_GEN}:
+
+@example
+pkg_verbose = $(pkg_verbose_$(V))
+pkg_verbose_ = $(pkg_verbose_$(AM_DEFAULT_VERBOSITY))
+pkg_verbose_0 = @@echo GEN $@@;
+
+foo: foo.in
+        $(pkg_verbose)cp $(srcdir)/foo.in $@@
+@end example
+@end itemize
+
 
 @item @option{std-options}
 @cindex Options, @option{std-options}
index 5e057925c76f8e124a5419e9e3d3613775233272..ea4e6bb7594555e7d186bad5408665a5d94cdc39 100644 (file)
@@ -265,7 +265,7 @@ sub _process_option_list (\%$@)
             || $_ eq 'readme-alpha' || $_ eq 'check-news'
             || $_ eq 'subdir-objects' || $_ eq 'nostdinc'
             || $_ eq 'no-exeext' || $_ eq 'no-define'
-            || $_ eq 'std-options' || $_ eq 'silent-rules'
+            || $_ eq 'std-options'
             || $_ eq 'color-tests' || $_ eq 'parallel-tests'
             || $_ eq 'cygnus' || $_ eq 'no-dependencies')
        {
@@ -276,6 +276,12 @@ sub _process_option_list (\%$@)
          delete $options->{$_};
          $options->{'filename-length-max'} = [$_, $1];
        }
+      elsif ($_ eq  'silent-rules')
+        {
+         error ($where,
+                "option `$_' must be an argument of AM_INIT_AUTOMAKE")
+           if $where->get !~ /^configure\./;
+       }
       elsif ($_ eq 'tar-v7' || $_ eq 'tar-ustar' || $_ eq 'tar-pax')
        {
          error ($where,
index 9f5e1c27dbf240b4e085a896bf8c72e6673abbe2..0ce26d17c7e0d8beb2f2e332b3a14c9e44df3f85 100644 (file)
@@ -3,7 +3,7 @@
 ## Makefile for Automake m4.
 
 ## Copyright (C) 1996, 1997, 1998, 1999, 2001, 2002, 2003, 2004, 2006,
-## 2008 Free Software Foundation, Inc.
+## 2008, 2009 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
@@ -52,6 +52,7 @@ python.m4 \
 regex.m4 \
 runlog.m4 \
 sanity.m4 \
+silent.m4 \
 strip.m4 \
 substnot.m4 \
 tar.m4 \
index 9635c0731a972999a72a1a988f422a349c59782d..75c0909b8fb45997226f9ae3f87e5eeddc23e1ac 100644 (file)
@@ -197,6 +197,7 @@ python.m4 \
 regex.m4 \
 runlog.m4 \
 sanity.m4 \
+silent.m4 \
 strip.m4 \
 substnot.m4 \
 tar.m4 \
index 59785027374a55c61c0996f3074809d5493fc14e..365c9ac890d1056183904e2ce5a2738d61064d3a 100644 (file)
@@ -100,9 +100,7 @@ AC_PROVIDE_IFELSE([AC_PROG_OBJC],
                  [define([AC_PROG_OBJC],
                          defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
 ])
-AM_BACKSLASH='\'
-AC_SUBST([AM_BACKSLASH])dnl
-_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
+_AM_IF_OPTION([silent-rules], [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/m4/silent.m4 b/m4/silent.m4
new file mode 100644 (file)
index 0000000..6d2a1a2
--- /dev/null
@@ -0,0 +1,27 @@
+##                                                          -*- Autoconf -*-
+# Copyright (C) 2009  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 1
+
+# AM_SILENT_RULES([DEFAULT])
+# --------------------------
+# Enable less verbose build rules; with the default set to DEFAULT
+# (`yes' being less verbose, `no' or empty being verbose).
+AC_DEFUN([AM_SILENT_RULES],
+[AC_ARG_ENABLE([silent-rules],
+[  --enable-silent-rules          less verbose build output (undo: `make V=1')
+  --disable-silent-rules         verbose build output (undo: `make V=0')])
+case $enable_silent_rules in
+yes) AM_DEFAULT_VERBOSITY=0;;
+no)  AM_DEFAULT_VERBOSITY=1;;
+*)   AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
+esac
+AC_SUBST([AM_DEFAULT_VERBOSITY])dnl
+AM_BACKSLASH='\'
+AC_SUBST([AM_BACKSLASH])dnl
+_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
+])
index 8dc54f7ad18d0ad65bf9686c2db079d13d14df89..ea042b529c1bb625655954f4c841fa22fb9b814e 100755 (executable)
@@ -48,18 +48,11 @@ 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 `--silent-rules' command line switch.
-AUTOMAKE_fails -Wportability --silent-rules
-grep 'Makefile.am:2' stderr
-grep 'Makefile.am:3' stderr
-grep 'Makefile.am:4' stderr
-grep 'Makefile.am:5' stderr
-grep 'Makefile.am:6' stderr && Exit 1
-grep 'Makefile.am:7' stderr && Exit 1
-
-# This should work with AUTOMAKE_OPTIONS.
-echo 'AUTOMAKE_OPTIONS = silent-rules' >> Makefile.am
+# This should work with the AM_SILENT_RULES macro.
+$sleep
+echo 'AM_SILENT_RULES' >> configure.in
 
+$ACLOCAL --force
 AUTOMAKE_fails -Wportability
 grep 'Makefile.am:2' stderr
 grep 'Makefile.am:3' stderr
index 6c4756ba509e95db78f72091503e35be73664f41..c9ea97079456974d7474b5069d7e45d00b54470c 100755 (executable)
@@ -37,7 +37,7 @@ END
 $ACLOCAL
 $AUTOCONF
 # Order flavors so that all needed files are installed early.
-for flavor in --gnits --gnu --foreign --cygnus --ignore-deps --silent-rules
+for flavor in --gnits --gnu --foreign --cygnus --ignore-deps
 do
   $AUTOMAKE --add-missing $flavor
   ./configure --enable-maintainer-mode
index b39d49c0d5f2fda65aac33839b33ffdf531d7825..4eb11d5383cb940778a4e7969a01b9c728e147bc 100755 (executable)
@@ -25,6 +25,7 @@ set -e
 mkdir sub
 
 cat >>configure.in <<'EOF'
+AM_SILENT_RULES
 AC_CONFIG_FILES([sub/Makefile])
 AC_PROG_CC
 AM_PROG_CC_C_O
@@ -32,7 +33,6 @@ AC_OUTPUT
 EOF
 
 cat > Makefile.am <<'EOF'
-AUTOMAKE_OPTIONS = silent-rules
 # Need generic and non-generic rules.
 bin_PROGRAMS = foo bar
 bar_CFLAGS = $(AM_CFLAGS)
@@ -40,7 +40,7 @@ SUBDIRS = sub
 EOF
 
 cat > sub/Makefile.am <<'EOF'
-AUTOMAKE_OPTIONS = silent-rules subdir-objects
+AUTOMAKE_OPTIONS = subdir-objects
 # Need generic and non-generic rules.
 bin_PROGRAMS = baz bla
 bla_CFLAGS = $(AM_CFLAGS)
@@ -60,7 +60,7 @@ $ACLOCAL
 $AUTOMAKE --add-missing
 $AUTOCONF
 
-./configure
+./configure --enable-silent-rules
 $MAKE >stdout || { cat stdout; Exit 1; }
 cat stdout
 grep ' -c' stdout && Exit 1
index a1149f45b6f984edd9f32e93bf3665861f4328cf..a208151ca4b41311b93afcef2aadc85c1ba4df89 100755 (executable)
@@ -27,6 +27,7 @@ set -e
 mkdir sub
 
 cat >>configure.in <<'EOF'
+AM_SILENT_RULES
 AC_CONFIG_FILES([sub/Makefile])
 AC_PROG_CC
 AM_PROG_CC_C_O
@@ -34,7 +35,6 @@ AC_OUTPUT
 EOF
 
 cat > Makefile.am <<'EOF'
-AUTOMAKE_OPTIONS = silent-rules
 # Need generic and non-generic rules.
 bin_PROGRAMS = foo bar
 bar_CFLAGS = $(AM_CFLAGS)
@@ -42,7 +42,7 @@ SUBDIRS = sub
 EOF
 
 cat > sub/Makefile.am <<'EOF'
-AUTOMAKE_OPTIONS = silent-rules subdir-objects
+AUTOMAKE_OPTIONS = subdir-objects
 # Need generic and non-generic rules.
 bin_PROGRAMS = baz bla
 bla_CFLAGS = $(AM_CFLAGS)
@@ -62,7 +62,7 @@ $ACLOCAL
 $AUTOMAKE --add-missing
 $AUTOCONF
 
-./configure am_cv_CC_dependencies_compiler_type=gcc
+./configure am_cv_CC_dependencies_compiler_type=gcc --enable-silent-rules
 $MAKE >stdout || { cat stdout; Exit 1; }
 cat stdout
 grep ' -c' stdout && Exit 1
index 5e2ecda7580bb192f551f2a3ed66ed7c98bfd6c8..c1266b7696bde8c41158bc45be820d1d70a24c02 100755 (executable)
@@ -26,6 +26,7 @@ set -e
 mkdir sub
 
 cat >>configure.in <<'EOF'
+AM_SILENT_RULES
 AC_CONFIG_FILES([sub/Makefile])
 AC_PROG_CC
 AM_PROG_CC_C_O
@@ -34,7 +35,6 @@ AC_OUTPUT
 EOF
 
 cat > Makefile.am <<'EOF'
-AUTOMAKE_OPTIONS = silent-rules
 # Need generic and non-generic rules.
 lib_LTLIBRARIES = libfoo.la libbar.la
 libbar_la_CFLAGS = $(AM_CFLAGS)
@@ -42,7 +42,7 @@ SUBDIRS = sub
 EOF
 
 cat > sub/Makefile.am <<'EOF'
-AUTOMAKE_OPTIONS = silent-rules subdir-objects
+AUTOMAKE_OPTIONS = subdir-objects
 # Need generic and non-generic rules.
 lib_LTLIBRARIES = libbaz.la libbla.la
 libbla_la_CFLAGS = $(AM_CFLAGS)
@@ -63,7 +63,7 @@ $ACLOCAL
 $AUTOMAKE --add-missing
 $AUTOCONF
 
-./configure
+./configure --enable-silent-rules
 $MAKE >stdout || { cat stdout; Exit 1; }
 cat stdout
 grep ' -c' stdout && Exit 1
index 7ed8922a66105d2c66520022edcbfe553b97c1d4..7f96f6053e607ed3d36024ebe464a1b260b050e9 100755 (executable)
@@ -27,6 +27,7 @@ set -e
 mkdir sub
 
 cat >>configure.in <<'EOF'
+AM_SILENT_RULES
 AC_CONFIG_FILES([sub/Makefile])
 AC_PROG_CC
 AM_PROG_CC_C_O
@@ -35,7 +36,6 @@ AC_OUTPUT
 EOF
 
 cat > Makefile.am <<'EOF'
-AUTOMAKE_OPTIONS = silent-rules
 # Need generic and non-generic rules.
 lib_LTLIBRARIES = libfoo.la libbar.la
 libbar_la_CFLAGS = $(AM_CFLAGS)
@@ -43,7 +43,7 @@ SUBDIRS = sub
 EOF
 
 cat > sub/Makefile.am <<'EOF'
-AUTOMAKE_OPTIONS = silent-rules subdir-objects
+AUTOMAKE_OPTIONS = subdir-objects
 # Need generic and non-generic rules.
 lib_LTLIBRARIES = libbaz.la libbla.la
 libbla_la_CFLAGS = $(AM_CFLAGS)
@@ -64,7 +64,7 @@ $ACLOCAL
 $AUTOMAKE --add-missing
 $AUTOCONF
 
-./configure am_cv_CC_dependencies_compiler_type=gcc
+./configure am_cv_CC_dependencies_compiler_type=gcc --enable-silent-rules
 $MAKE >stdout || { cat stdout; Exit 1; }
 cat stdout
 grep ' -c' stdout && Exit 1
index 90e21b91ba626b3b141dfe1835af814129c7c5a6..08c22d8a92c3dd9941ae1123c652e5c716392a0e 100755 (executable)
@@ -24,6 +24,7 @@ set -e
 mkdir sub
 
 cat >>configure.in <<'EOF'
+AM_SILENT_RULES
 AM_PROG_CC_C_O
 AC_PROG_CXX
 AC_PROG_F77
@@ -35,7 +36,6 @@ AC_OUTPUT
 EOF
 
 cat > Makefile.am <<'EOF'
-AUTOMAKE_OPTIONS = silent-rules
 # Need generic and non-generic rules.
 bin_PROGRAMS = foo bar
 bar_CFLAGS = $(AM_CFLAGS)
@@ -47,7 +47,7 @@ BUILT_SOURCES = foo6.h
 EOF
 
 cat > sub/Makefile.am <<'EOF'
-AUTOMAKE_OPTIONS = silent-rules subdir-objects
+AUTOMAKE_OPTIONS = subdir-objects
 # Need generic and non-generic rules.
 bin_PROGRAMS = baz bla
 bla_CFLAGS = $(AM_CFLAGS)
@@ -103,7 +103,7 @@ $AUTOCONF
 # configure once for fastdep, once for non-fastdep
 for config_args in '' am_cv_CC_dependencies_compiler_type=gcc
 do
-  ./configure $config_args
+  ./configure $config_args --enable-silent-rules
   $MAKE >stdout || { cat stdout; Exit 1; }
   cat stdout
   grep ' -c' stdout && Exit 1
index b0cacc8b6dab6b3707996d2f869ac8fc43890fd1..1f6a71832965c6b1d6098ac320f7e791c996e65e 100755 (executable)
 set -e
 
 cat >>configure.in <<'EOF'
-# Layering violation: this conditional should be decided
-# by the package author, not the user.  We just do it here
-# for testing convenience.
-AM_CONDITIONAL([SILENT], [test "$silent_rules" = yes])
+AM_SILENT_RULES
 AC_OUTPUT
 EOF
 
 cat > Makefile.am <<'EOF'
-if SILENT
 my_verbose = $(my_verbose_$(V))
-my_verbose_ = $(my_verbose_0)
+my_verbose_ = $(my_verbose_$(AM_DEFAULT_VERBOSITY))
 my_verbose_0 = @echo GEN $@;
-endif
 
 all-local: foo
 
@@ -46,10 +41,10 @@ EOF
 : >foo.in
 
 $ACLOCAL
-$AUTOMAKE --add-missing --silent-rules
+$AUTOMAKE --add-missing
 $AUTOCONF
 
-./configure silent_rules=yes
+./configure --enable-silent-rules
 $MAKE >stdout || { cat stdout; Exit 1; }
 cat stdout
 grep 'GEN foo' stdout
@@ -63,7 +58,7 @@ grep 'cp ' stdout
 
 $MAKE distclean
 
-./configure silent_rules=no
+./configure --disable-silent-rules
 $MAKE >stdout || { cat stdout; Exit 1; }
 cat stdout
 grep 'GEN foo' stdout && Exit 1
@@ -71,26 +66,36 @@ grep 'cp ' stdout
 
 $MAKE distclean
 
+$sleep
 # Things should also work with -Wall in AM_INIT_AUTOMAKE.
 cat > configure.in <<'END'
 AC_INIT([silent6], [1.0])
 AM_INIT_AUTOMAKE([-Wall])
-AM_CONDITIONAL([SILENT], [:])
 AC_CONFIG_FILES([Makefile])
-AC_OUTPUT
 END
 
 $ACLOCAL
-AUTOMAKE_fails --force
-$AUTOMAKE --force -Wno-error
-grep ' --silent-rules' Makefile.in && Exit 1
-$AUTOMAKE --force --silent-rules
-grep ' --silent-rules' Makefile.in
-$AUTOMAKE --force -Wno-all -Wportability --silent-rules
-grep ' --silent-rules' Makefile.in
-
-echo 'AUTOMAKE_OPTIONS = silent-rules' >> Makefile.am
-$AUTOMAKE --force
+AUTOMAKE_fails
+$AUTOMAKE -Wno-error
+
+# AM_SILENT_RULES should turn off the warning
+$sleep
+echo 'AM_SILENT_RULES' >> configure.in
+$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.in <<'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
index 68a0e89ab04edf227f9fd0f02d327f91299f5766..cca264458a6595d155b1be1947ab6b60cc892207 100755 (executable)
@@ -21,6 +21,7 @@
 set -e
 
 cat >>configure.in <<'EOF'
+AM_SILENT_RULES
 AC_OUTPUT
 EOF
 
@@ -42,25 +43,44 @@ $ACLOCAL
 $AUTOMAKE --add-missing
 $AUTOCONF
 
-./configure
+./configure --disable-silent-rules
 $MAKE >stdout || { cat stdout; Exit 1; }
 cat stdout
 grep 'GEN.*foo' stdout && Exit 1
 grep 'cp ' stdout
 grep 'echo ' stdout
 
-$MAKE distclean
+$MAKE clean
+$MAKE V=1 >stdout || { cat stdout; Exit 1; }
+cat stdout
+grep 'GEN.*foo' stdout && Exit 1
+grep 'cp ' stdout
+grep 'echo ' stdout
 
-echo 'AUTOMAKE_OPTIONS = silent-rules' >> Makefile.am
-$AUTOMAKE
+$MAKE clean
+$MAKE V=0 >stdout || { cat stdout; Exit 1; }
+cat stdout
+grep 'GEN.*foo' stdout
+grep 'cp ' stdout && Exit 1
+grep 'echo ' stdout && Exit 1
+
+
+$MAKE distclean
 
-./configure
+./configure --enable-silent-rules
 $MAKE >stdout || { cat stdout; Exit 1; }
 cat stdout
 grep 'GEN.*foo' stdout
 grep 'cp ' stdout && Exit 1
 grep 'echo ' stdout && Exit 1
 
+$MAKE clean
+$MAKE V=0 >stdout || { cat stdout; Exit 1; }
+cat stdout
+grep 'GEN.*foo' stdout
+grep 'cp ' stdout && Exit 1
+grep 'echo ' stdout && Exit 1
+
 $MAKE clean
 $MAKE V=1 >stdout || { cat stdout; Exit 1; }
 cat stdout
@@ -68,4 +88,8 @@ grep 'GEN.*foo' 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
+
 :