From 64942ddeb005bd7b8bce20ae42619b945d22b1c2 Mon Sep 17 00:00:00 2001 From: Ralf Wildenhues Date: Wed, 11 Mar 2009 20:53:24 +0100 Subject: [PATCH] `silent' mode unconditionally overrides portability-recursive. * automake.in (parse_arguments): Don't handle a global `silent' option here; instead, ... (handle_options): ... handle the "normal" `silent' option here. Override `portability-recursive' here, at the last point we deal with options, instead ... * lib/Automake/Options.pm (_process_option_list): ... of here. * tests/silent6.test: Replace unportable make snippet, remove FIXME note, add more test cases of options passed in the various locations. Signed-off-by: Ralf Wildenhues --- ChangeLog | 11 +++++++++++ automake.in | 8 ++++---- lib/Automake/Options.pm | 5 +---- tests/silent6.test | 31 ++++++++++++++++++++++++++++--- 4 files changed, 44 insertions(+), 11 deletions(-) diff --git a/ChangeLog b/ChangeLog index d61403018..bed1374c0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,16 @@ 2009-03-11 Ralf Wildenhues + `silent' mode unconditionally overrides portability-recursive. + * automake.in (parse_arguments): Don't handle a global `silent' + option here; instead, ... + (handle_options): ... handle the "normal" `silent' option here. + Override `portability-recursive' here, at the last point we deal + with options, instead ... + * lib/Automake/Options.pm (_process_option_list): ... of here. + * tests/silent6.test: Replace unportable make snippet, remove + FIXME note, add more test cases of options passed in the various + locations. + Drop extra line from compile rules when `silent' is not used. * lib/am/depend2.am [!%FASTDEP%]: Only use the `%VERBOSE% @AM_BACKSLASH@' extra line if ?VERBOSE?. diff --git a/automake.in b/automake.in index fac2313a3..9ee9dfd86 100755 --- a/automake.in +++ b/automake.in @@ -1214,6 +1214,10 @@ sub handle_options } } + # Override portability-recursive warning. + switch_warning ('no-portability-recursive') + if option 'silent'; + if ($strictness == GNITS) { set_option ('readme-alpha', INTERNAL); @@ -8189,10 +8193,6 @@ sub parse_arguments () $output_directory = '.'; } - # Override portability-recursive warning. - process_global_option_list ($cli_where, 'silent') - if global_option 'silent'; - return unless @ARGV; if ($ARGV[0] =~ /^-./) diff --git a/lib/Automake/Options.pm b/lib/Automake/Options.pm index 3c152dfd6..10fd00f67 100644 --- a/lib/Automake/Options.pm +++ b/lib/Automake/Options.pm @@ -267,6 +267,7 @@ sub _process_option_list (\%$@) || $_ eq 'no-exeext' || $_ eq 'no-define' || $_ eq 'std-options' || $_ eq 'color-tests' + || $_ eq 'silent' || $_ eq 'cygnus' || $_ eq 'no-dependencies') { # Explicitly recognize these. @@ -310,10 +311,6 @@ sub _process_option_list (\%$@) if switch_warning $cat; } } - elsif ($_ eq 'silent') - { - switch_warning ('no-portability-recursive'); - } else { error ($where, "option `$_' not recognized", diff --git a/tests/silent6.test b/tests/silent6.test index 2bc2f8fb8..103cd3423 100755 --- a/tests/silent6.test +++ b/tests/silent6.test @@ -30,7 +30,7 @@ EOF cat > Makefile.am <<'EOF' if SILENT -my_verbose = $(my_verbose_$V) +my_verbose = $(my_verbose_$(V)) my_verbose_ = $(my_verbose_0) my_verbose_0 = @echo GEN $@; endif @@ -46,8 +46,7 @@ EOF : >foo.in $ACLOCAL -# FIXME: it should not be necessary to disable Wportability here. -$AUTOMAKE --add-missing -Wno-portability --silent-rules +$AUTOMAKE --add-missing --silent-rules $AUTOCONF ./configure silent_rules=yes @@ -70,4 +69,30 @@ cat stdout grep 'GEN foo' stdout && Exit 1 grep 'cp ' stdout +$MAKE distclean + +# 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' >> Makefile.am +$AUTOMAKE --force +grep 'AM_V_GEN' Makefile.in +$AUTOMAKE --force -Wno-all -Wportability +grep 'AM_V_GEN' Makefile.in + : -- 2.47.2