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
- 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:
{
# 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);
}
}
@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',
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,
{
$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);
-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
'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
PERL
pkgvdatadir
APIVERSION
-AM_BACKSLASH
am__untar
am__tar
AMTAR
-AM_BACKSLASH='\'
# The API version is the base version. We must guarantee
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
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
@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}
@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}
@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}
|| $_ 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')
{
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,
## 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
regex.m4 \
runlog.m4 \
sanity.m4 \
+silent.m4 \
strip.m4 \
substnot.m4 \
tar.m4 \
regex.m4 \
runlog.m4 \
sanity.m4 \
+silent.m4 \
strip.m4 \
substnot.m4 \
tar.m4 \
[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.
--- /dev/null
+## -*- 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
+])
# 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
$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
mkdir sub
cat >>configure.in <<'EOF'
+AM_SILENT_RULES
AC_CONFIG_FILES([sub/Makefile])
AC_PROG_CC
AM_PROG_CC_C_O
EOF
cat > Makefile.am <<'EOF'
-AUTOMAKE_OPTIONS = silent-rules
# Need generic and non-generic rules.
bin_PROGRAMS = foo bar
bar_CFLAGS = $(AM_CFLAGS)
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)
$AUTOMAKE --add-missing
$AUTOCONF
-./configure
+./configure --enable-silent-rules
$MAKE >stdout || { cat stdout; Exit 1; }
cat stdout
grep ' -c' stdout && Exit 1
mkdir sub
cat >>configure.in <<'EOF'
+AM_SILENT_RULES
AC_CONFIG_FILES([sub/Makefile])
AC_PROG_CC
AM_PROG_CC_C_O
EOF
cat > Makefile.am <<'EOF'
-AUTOMAKE_OPTIONS = silent-rules
# Need generic and non-generic rules.
bin_PROGRAMS = foo bar
bar_CFLAGS = $(AM_CFLAGS)
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)
$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
mkdir sub
cat >>configure.in <<'EOF'
+AM_SILENT_RULES
AC_CONFIG_FILES([sub/Makefile])
AC_PROG_CC
AM_PROG_CC_C_O
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)
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)
$AUTOMAKE --add-missing
$AUTOCONF
-./configure
+./configure --enable-silent-rules
$MAKE >stdout || { cat stdout; Exit 1; }
cat stdout
grep ' -c' stdout && Exit 1
mkdir sub
cat >>configure.in <<'EOF'
+AM_SILENT_RULES
AC_CONFIG_FILES([sub/Makefile])
AC_PROG_CC
AM_PROG_CC_C_O
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)
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)
$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
mkdir sub
cat >>configure.in <<'EOF'
+AM_SILENT_RULES
AM_PROG_CC_C_O
AC_PROG_CXX
AC_PROG_F77
EOF
cat > Makefile.am <<'EOF'
-AUTOMAKE_OPTIONS = silent-rules
# Need generic and non-generic rules.
bin_PROGRAMS = foo bar
bar_CFLAGS = $(AM_CFLAGS)
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)
# 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
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
: >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
$MAKE distclean
-./configure silent_rules=no
+./configure --disable-silent-rules
$MAKE >stdout || { cat stdout; Exit 1; }
cat stdout
grep 'GEN foo' stdout && Exit 1
$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
set -e
cat >>configure.in <<'EOF'
+AM_SILENT_RULES
AC_OUTPUT
EOF
$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
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
+
: