automake-patches
[Top][All Lists]
Advanced

[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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]