[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 10/10] Warnings win over strictness in AUTOMAKE_OPTIONS.
From: |
stefano . lattarini |
Subject: |
[PATCH 10/10] Warnings win over strictness in AUTOMAKE_OPTIONS. |
Date: |
Thu, 23 Dec 2010 12:27:46 +0100 |
From: Stefano Lattarini <address@hidden>
This change ensures 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' (from
Automake::Option) in way that ensures that explicit warnings are
parsed only after the strictness level has been set.
* tests/warnings-win-over-strictness.test: Extend.
---
ChangeLog | 12 ++++++++++++
automake.in | 12 +++++-------
tests/warnings-win-over-strictness.test | 17 ++++++++++++++++-
3 files changed, 33 insertions(+), 8 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index dd31019..e1b23b2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,17 @@
2010-12-20 Stefano Lattarini <address@hidden>
+ Warnings win over strictness in AUTOMAKE_OPTIONS.
+ This change ensures 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' (from
+ Automake::Option) in way that ensures that explicit warnings are
+ parsed only after the strictness level has been set.
+ * tests/warnings-win-over-strictness.test: Extend.
+
+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
diff --git a/automake.in b/automake.in
index 9fd018c..41dd1f0 100644
--- a/automake.in
+++ b/automake.in
@@ -1249,13 +1249,11 @@ sub handle_options
msg_var ('unsupported', $var,
"`AUTOMAKE_OPTIONS' cannot have conditional contents");
}
- foreach my $locvals ($var->value_as_list_recursive (cond_filter => TRUE,
- location => 1))
- {
- my ($where, $value) = @$locvals;
- return 1 if process_option_list ({ option => $value,
- where => $where});
- }
+ my (@locvals, @options);
+ @locvals = $var->value_as_list_recursive (cond_filter => TRUE,
+ location => 1);
+ @options = map { { option => $_->[1], where => $_->[0] } } @locvals;
+ return 1 if process_option_list (@options);
}
# Override portability-recursive warning.
diff --git a/tests/warnings-win-over-strictness.test
b/tests/warnings-win-over-strictness.test
index 46df480..b4e688f 100755
--- a/tests/warnings-win-over-strictness.test
+++ b/tests/warnings-win-over-strictness.test
@@ -40,7 +40,8 @@ ko()
set_am_opts()
{
set +x
- sed -e "s|^\\(AM_INIT_AUTOMAKE\\).*|\\1([$1])|" <$2 >$2-t
+ sed <$2 >$2-t -e "s|^\\(AUTOMAKE_OPTIONS\\) *=.*|\\1 = $1|" \
+ -e "s|^\\(AM_INIT_AUTOMAKE\\).*|\\1([$1])|"
mv -f $2-t $2
set -x
cat $2
@@ -50,6 +51,7 @@ set_am_opts()
touch README INSTALL NEWS AUTHORS ChangeLog COPYING
cat > Makefile.am <<END
+AUTOMAKE_OPTIONS =
FOO := bar
END
@@ -60,6 +62,8 @@ ko -Wportability --foreign
ok --gnu -Wno-portability
ok -Wno-portability --gnu
+set_am_opts '' Makefile.am
+
set_am_opts 'foreign -Wportability' configure.in
ko
set_am_opts '-Wportability foreign' configure.in
@@ -69,4 +73,15 @@ ok
set_am_opts '-Wno-portability gnu' configure.in
ok
+set_am_opts '' configure.in
+
+set_am_opts 'foreign -Wportability' Makefile.am
+ko
+set_am_opts '-Wportability foreign' Makefile.am
+ko
+set_am_opts 'gnu -Wno-portability' Makefile.am
+ok
+set_am_opts '-Wno-portability gnu' Makefile.am
+ok
+
:
--
1.7.2.3
- [PATCH 03/10] Warnings win over strictness on command line., (continued)
- [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, 2010/12/23
- [PATCH 10/10] Warnings win over strictness in AUTOMAKE_OPTIONS.,
stefano . lattarini <=
- [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