From f90a06c1eb001d03366b3bd50699d0672ca2cbdb Mon Sep 17 00:00:00 2001 From: Stefano Lattarini Date: Mon, 20 Dec 2010 16:59:08 +0100 Subject: [PATCH] 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 accepts 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. (process_option_list, process_global_option_list): Update. * automake.in (handle_options, scan_autoconf_traces): Update. --- ChangeLog | 12 ++++++++++ automake.in | 11 ++++----- lib/Automake/Options.pm | 49 +++++++++++++++++++++++------------------ 3 files changed, 45 insertions(+), 27 deletions(-) diff --git a/ChangeLog b/ChangeLog index fbe930ac2..6c65edf38 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,17 @@ 2011-01-15 Stefano Lattarini + For PR automake/547: + 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): Accept as + arguments a list of hash references with keys 'option' and 'where', + where 'option' is an option as might occur in AUTOMAKE_OPTIONS or + AM_INIT_AUTOMAKE, and 'where' is the location where it occurred. + (process_option_list, process_global_option_list): Updated. + * automake.in (handle_options, scan_autoconf_traces): Update. + 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), add some more tests on diff --git a/automake.in b/automake.in index e80a7361b..5d5af933d 100644 --- a/automake.in +++ b/automake.in @@ -1247,8 +1247,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}); } } @@ -5469,9 +5470,9 @@ sub scan_autoconf_traces ($) } elsif (defined $args[1]) { - exit $exit_code - if (process_global_option_list ($where, - split (' ', $args[1]))); + my @opts = split (' ', $args[1]); + @opts = map { { option => $_, where => $where } } @opts; + exit $exit_code if process_global_option_list (@opts); } } elsif ($macro eq 'AM_MAINTAINER_MODE') diff --git a/lib/Automake/Options.pm b/lib/Automake/Options.pm index a3607c3f7..9f221784a 100644 --- a/lib/Automake/Options.pm +++ b/lib/Automake/Options.pm @@ -222,12 +222,14 @@ sub unset_global_option ($) } -=item C +=item C -=item C +=item C -Process Automake's option lists. C<@options> should be a list of -words, as they occur in C or C. +Process Automake's option lists. C<@list> should be a list of hash +references with keys C