diff options
author | Stefano Lattarini <stefano.lattarini@gmail.com> | 2010-12-20 18:29:50 +0100 |
---|---|---|
committer | Stefano Lattarini <stefano.lattarini@gmail.com> | 2011-01-15 15:27:16 +0100 |
commit | 1609491e95df66d8119ada02eeeb4070ca3a9a28 (patch) | |
tree | 04b2f6f8dc28f8908cb675b6a5b8a306116a3501 /lib/Automake/Options.pm | |
parent | f90a06c1eb001d03366b3bd50699d0672ca2cbdb (diff) | |
download | automake-1609491e95df66d8119ada02eeeb4070ca3a9a28.tar.gz |
Warnings win over strictness in AUTOMAKE_OPTIONS.
Ensure that, for what concerns the options specified in
AUTOMAKE_OPTIONS, explicitly-defined warnings always take
precedence over implicit strictness-implied warnings.
This finally fixes Automake bug#7669 a.k.a. PR/547.
* automake.in (handle_options): Call 'process_option_list'
only once per set of options.
* lib/Automake/Options.pm (process_global_option_list,
process_option_list): Add sanity checks.
($_options_processed, $_global_options_processed): New
internal variables, used by the sanity checks above.
* tests/warnings-win-over-strictness.test: Extend.
Diffstat (limited to 'lib/Automake/Options.pm')
-rw-r--r-- | lib/Automake/Options.pm | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/Automake/Options.pm b/lib/Automake/Options.pm index 9f221784a..31052c070 100644 --- a/lib/Automake/Options.pm +++ b/lib/Automake/Options.pm @@ -76,6 +76,12 @@ F<Makefile.am>s. use vars '%_options'; # From AUTOMAKE_OPTIONS use vars '%_global_options'; # from AM_INIT_AUTOMAKE or the command line. +# Whether process_option_list has already been called for the current +# Makefile.am. +use vars '$_options_processed'; +# Whether process_global_option_list has already been called. +use vars '$_global_options_processed'; + =head2 Constants =over 4 @@ -135,6 +141,7 @@ previous F<Makefile.am>. sub reset () { + $_options_processed = 0; %_options = %_global_options; # The first time we are run, # remember the current setting as the default. @@ -347,12 +354,18 @@ sub _process_option_list (\%@) sub process_option_list (@) { + prog_error "local options already processed" + if $_options_processed; return _process_option_list (%_options, @_); + $_options_processed = 1; } sub process_global_option_list (@) { + prog_error "global options already processed" + if $_global_options_processed; return _process_option_list (%_global_options, @_); + $_global_options_processed = 1; } =item C<set_strictness ($name)> |