[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 09/10] Change signature of 'Automake::Options::process_option_lis
From: |
stefano . lattarini |
Subject: |
[PATCH 09/10] Change signature of 'Automake::Options::process_option_list()'. |
Date: |
Thu, 23 Dec 2010 12:27:45 +0100 |
From: Stefano Lattarini <address@hidden>
This only modifies internal details in the automake implementation,
bearing no externally visible effect, but preparing the way for the
final fix of Automake bug#7669 a.k.a. PR/547.
* lib/Automake/Options.pm (process_option_list): Now accept takes as
arguments a list of hash references with keys 'option' and 'where',
where 'option' is an option as might occur in AUTOMAKE_OPTIONS or
M_INIT_AUTOMAKE, and 'where' is the location where that occurred.
* automake.in (handle_options, scan_autoconf_traces): Update.
---
ChangeLog | 12 ++++++++++++
automake.in | 9 +++++----
lib/Automake/Options.pm | 25 ++++++++++++++-----------
3 files changed, 31 insertions(+), 15 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 67e7be0..dd31019 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,17 @@
2010-12-20 Stefano Lattarini <address@hidden>
+ Change signature of 'Automake::Options::process_option_list()'.
+ This only modifies internal details in the automake implementation,
+ bearing no externally visible effect, but preparing the way for the
+ final fix of Automake bug#7669 a.k.a. PR/547.
+ * lib/Automake/Options.pm (process_option_list): Now accept takes as
+ arguments a list of hash references with keys 'option' and 'where',
+ where 'option' is an option as might occur in AUTOMAKE_OPTIONS or
+ M_INIT_AUTOMAKE, and 'where' is the location where that occurred.
+ * automake.in (handle_options, scan_autoconf_traces): Update.
+
+2010-12-20 Stefano Lattarini <address@hidden>
+
Add more tests about AUTOMAKE_OPTIONS.
In view of soon-to-follow refactorings (still in the pursuit of a
fix for Automake bug#7669 a.k.a. PR/547), we add some more tests
diff --git a/automake.in b/automake.in
index d320ebd..9fd018c 100644
--- a/automake.in
+++ b/automake.in
@@ -1252,8 +1252,9 @@ sub handle_options
foreach my $locvals ($var->value_as_list_recursive (cond_filter => TRUE,
location => 1))
{
- my ($loc, $value) = @$locvals;
- return 1 if (process_option_list ($loc, $value))
+ my ($where, $value) = @$locvals;
+ return 1 if process_option_list ({ option => $value,
+ where => $where});
}
}
@@ -5471,8 +5472,8 @@ sub scan_autoconf_traces ($)
$am_remake_options{ignore_deps} = 1
if $opt eq 'no-dependencies';
}
- exit $exit_code
- if (process_option_list ($where, @opts));
+ @opts = map { { option => $_, where => $where } } @opts;
+ exit $exit_code if process_option_list (@opts);
}
}
elsif ($macro eq 'AM_MAINTAINER_MODE')
diff --git a/lib/Automake/Options.pm b/lib/Automake/Options.pm
index 5728895..5091c24 100644
--- a/lib/Automake/Options.pm
+++ b/lib/Automake/Options.pm
@@ -178,23 +178,25 @@ sub unset_option ($)
delete $_options{$name};
}
-=item C<process_option_list ($where, @options)>
+=item C<process_option_list (@options)>
-Process Automake's option lists. C<@options> should be a list of
-words, as they occur in C<AUTOMAKE_OPTIONS> or C<AM_INIT_AUTOMAKE>.
-C<$where> is the location where @OPTIONS occurred.
+Process Automake's option lists. C<@options> should be a list of hash
+references with keys C<option> and C<where>, where C<option> is an option
+as might occur in C<AUTOMAKE_OPTIONS> or C<AM_INIT_AUTOMAKE>, and
+C<where> is the location where that option occurred.
Return 1 on error, 0 otherwise.
=cut
-sub process_option_list ($@)
+sub process_option_list (@)
{
- my ($where, @list) = @_;
my @warnings = ();
- foreach (@list)
+ foreach my $h (@_)
{
+ my $_ = $h->{option};
+ my $where = $h->{where};
$_options{$_} = $where;
if ($_ eq 'gnits' || $_ eq 'gnu' || $_ eq 'foreign')
{
@@ -263,7 +265,8 @@ sub process_option_list ($@)
}
elsif (/^(?:--warnings=|-W)(.*)$/)
{
- push @warnings, split (',', $1);
+ my @w = map { { cat => $_, loc => $where} } split (',', $1);
+ push @warnings, @w;
}
else
{
@@ -275,10 +278,10 @@ sub process_option_list ($@)
# We process warnings here, so that any explicitly-given warning setting
# will take precedence over warning settings defined implicitly by the
# strictness.
- foreach my $cat (@warnings)
+ foreach my $w (@warnings)
{
- msg 'unsupported', $where, "unknown warning category `$cat'"
- if switch_warning $cat;
+ msg 'unsupported', $w->{loc}, "unknown warning category `$w->{cat}'"
+ if switch_warning $w->{cat};
}
return 0;
}
--
1.7.2.3
- [PATCH 02/10] New test on silent-rules mode and portability warnings., (continued)
- [PATCH 02/10] New test on silent-rules mode and portability warnings., stefano . lattarini, 2010/12/23
- [PATCH 03/10] Warnings win over strictness on command line., stefano . lattarini, 2010/12/23
- [PATCH 01/10] Add new tests on strictness and warnings precedence and overriding., stefano . lattarini, 2010/12/23
- [PATCH 05/10] Remove global/local distinction for automake options., stefano . lattarini, 2010/12/23
- [PATCH 04/10] Refactoring: new $automake_remake_options global variable., stefano . lattarini, 2010/12/23
- [PATCH 06/10] Cleanup in module Automake::Options., stefano . lattarini, 2010/12/23
- [PATCH 07/10] Warnings win over strictness in AM_INIT_AUTOMAKE., stefano . lattarini, 2010/12/23
- [PATCH 08/10] Add more tests about AUTOMAKE_OPTIONS., stefano . lattarini, 2010/12/23
- [PATCH 09/10] Change signature of 'Automake::Options::process_option_list()'.,
stefano . lattarini <=
- [PATCH 10/10] Warnings win over strictness in AUTOMAKE_OPTIONS., stefano . lattarini, 2010/12/23
- [PATCH 11/10] Update NEWS about the warnings-over-strictness precedence., Stefano Lattarini, 2010/12/24
- [PATCH 12/10] More checks on warnings/strictness in precedence ("metawarnings")., Stefano Lattarini, 2010/12/24