automake-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Automake-commit] [SCM] GNU Automake branch, msvc, updated. v1.11-550-gd


From: Stefano Lattarini
Subject: [Automake-commit] [SCM] GNU Automake branch, msvc, updated. v1.11-550-gdb93b31
Date: Sat, 05 Nov 2011 09:17:26 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Automake".

http://git.sv.gnu.org/gitweb/?p=automake.git;a=commitdiff;h=db93b31d81c7809e49fa874acfd5e3aa3504dc48

The branch, msvc has been updated
       via  db93b31d81c7809e49fa874acfd5e3aa3504dc48 (commit)
       via  f23d5a15269c722c8cd136827a3b021a29814cb0 (commit)
      from  005000e7a47e75d051473ad326983be6448738b6 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit db93b31d81c7809e49fa874acfd5e3aa3504dc48
Author: Stefano Lattarini <address@hidden>
Date:   Fri Nov 4 12:50:49 2011 +0100

    warnings: fix buglets for portability warnings
    
    * lib/Automake/ChannelDefs.pm (switch_warning): Ensure the
    correct implications and inter-dependencies between warnings
    in the categories `portability', `extra-portability' and
    `recursive-portability' are respected.  Also add detailed
    explicative comments, and references to the relevant tests.
    * tests/dollarvar2.test: Update and extend.  Also, remove
    some unnecessary uses of `--force' option in automake calls.
    * tests/extra-portability3.test: New test.
    * tests/Makefile.am (TESTS): Add it.

commit f23d5a15269c722c8cd136827a3b021a29814cb0
Author: Stefano Lattarini <address@hidden>
Date:   Fri Nov 4 12:15:33 2011 +0100

    tests: extend tests on 'extra-portability' warning category
    
    * tests/extra-portability.test: Redefine `$AUTOMAKE' to ensure we
    have complete control over the automake options.  Extend by using
    also a setup where no `portability' warning is present (only an
    `extra-portability' warning is).  Other minor extensions.  Remove
    some redundant, verbose comments about the expected diagnostic.

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog                     |   22 ++++++++++++++
 lib/Automake/ChannelDefs.pm   |   38 ++++++++++++++++++++----
 tests/Makefile.am             |    1 +
 tests/Makefile.in             |    1 +
 tests/dollarvar2.test         |   65 +++++++++++++++++++++++++++++++++++++---
 tests/extra-portability.test  |   58 ++++++++++++++++++++++++++----------
 tests/extra-portability3.test |   63 +++++++++++++++++++++++++++++++++++++++
 7 files changed, 221 insertions(+), 27 deletions(-)
 create mode 100755 tests/extra-portability3.test

diff --git a/ChangeLog b/ChangeLog
index 0688736..d3e3502 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,25 @@
+2011-11-04  Stefano Lattarini  <address@hidden>
+
+       warnings: fix buglets for portability warnings
+       * lib/Automake/ChannelDefs.pm (switch_warning): Ensure the
+       correct implications and inter-dependencies between warnings
+       in the categories `portability', `extra-portability' and
+       `recursive-portability' are respected.  Also add detailed
+       explicative comments, and references to the relevant tests.
+       * tests/dollarvar2.test: Update and extend.  Also, remove
+       some unnecessary uses of `--force' option in automake calls.
+       * tests/extra-portability3.test: New test.
+       * tests/Makefile.am (TESTS): Add it.
+
+2011-11-04  Stefano Lattarini  <address@hidden>
+
+       tests: extend tests on 'extra-portability' warning category
+       * tests/extra-portability.test: Redefine `$AUTOMAKE' to ensure we
+       have complete control over the automake options.  Extend by using
+       also a setup where no `portability' warning is present (only an
+       `extra-portability' warning is).  Other minor extensions.  Remove
+       some redundant, verbose comments about the expected diagnostic.
+
 2011-11-03  Stefano Lattarini  <address@hidden>
 
        tests: various minor tweakings, mostly related to AM_PROG_AR
diff --git a/lib/Automake/ChannelDefs.pm b/lib/Automake/ChannelDefs.pm
index 61b4ed4..f9f63fc 100644
--- a/lib/Automake/ChannelDefs.pm
+++ b/lib/Automake/ChannelDefs.pm
@@ -288,12 +288,38 @@ sub switch_warning ($)
   elsif (channel_type ($cat) eq 'warning')
     {
       setup_channel $cat, silent => $has_no;
-      setup_channel 'portability-recursive', silent => $has_no
-        if $cat eq 'portability';
-      setup_channel 'extra-portability', silent => $has_no
-        if ($cat eq 'portability' && $has_no);
-      setup_channel 'portability', silent => $has_no
-        if ($cat eq 'extra-portability' && ! $has_no);
+      #
+      # Handling of portability warnings is trickier.  For relevant tests,
+      # see `dollarvar2', `extra-portability' and `extra-portability3'.
+      #
+      # -Wportability-recursive and -Wno-portability-recursive should not
+      # have any effect on other 'portability' or 'extra-portability'
+      # warnings, so there's no need to handle them separately or ad-hoc.
+      #
+      if ($cat eq 'extra-portability' && ! $has_no) # -Wextra-portability
+        {
+          # -Wextra-portability must enable 'portability' and
+          # 'portability-recursive' warnings.
+          setup_channel 'portability', silent => 0;
+          setup_channel 'portability-recursive', silent => 0;
+        }
+      if ($cat eq 'portability') # -Wportability or -Wno-portability
+        {
+          if ($has_no) # -Wno-portability
+            {
+              # -Wno-portability must disable 'extra-portability' and
+              # 'portability-recursive' warnings.
+              setup_channel 'portability-recursive', silent => 1;
+              setup_channel 'extra-portability', silent => 1;
+            }
+          else # -Wportability
+            {
+              # -Wportability must enable 'portability-recursive'
+              # warnings.  But it should have no influence over the
+              # 'extra-portability' warnings.
+              setup_channel 'portability-recursive', silent => 0;
+            }
+        }
     }
   else
     {
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 8056f2d..a27cdaf 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -398,6 +398,7 @@ extra11.test \
 extra12.test \
 extra-portability.test \
 extra-portability2.test \
+extra-portability3.test \
 f90only.test \
 flavor.test \
 flibs.test \
diff --git a/tests/Makefile.in b/tests/Makefile.in
index 8e6eb4c..cdd8de2 100644
--- a/tests/Makefile.in
+++ b/tests/Makefile.in
@@ -682,6 +682,7 @@ extra11.test \
 extra12.test \
 extra-portability.test \
 extra-portability2.test \
+extra-portability3.test \
 f90only.test \
 flavor.test \
 flibs.test \
diff --git a/tests/dollarvar2.test b/tests/dollarvar2.test
index 6fc2737..7a6db37 100755
--- a/tests/dollarvar2.test
+++ b/tests/dollarvar2.test
@@ -21,6 +21,11 @@
 
 set -e
 
+#
+# First, try a setup where we have a `portability-recursive' warning,
+# but no "simple" `portability' warning.
+#
+
 cat >Makefile.am <<'EOF'
 x = 1
 bla = $(foo$(x))
@@ -28,11 +33,61 @@ EOF
 
 $ACLOCAL
 
-# $AUTOMAKE already contains -Wall -Werror.
-AUTOMAKE_fails -Wportability
-$AUTOMAKE --force -Wno-all
-$AUTOMAKE --force -Wno-portability
+# Enabling `portability' warnings should enable `portability-recursive'
+# warnings.
+AUTOMAKE_fails -Wnone -Wportability
+grep 'recursive variable expansion' stderr
+# `portability-recursive' warnings can be enabled by themselves.
+AUTOMAKE_fails -Wnone -Wportability-recursive
+grep 'recursive variable expansion' stderr
+
+# Various ways to disable `portability-recursive'.
+$AUTOMAKE -Wno-all
+$AUTOMAKE -Wno-portability
+$AUTOMAKE -Wall -Wno-portability-recursive
+
+# `-Wno-portability-recursive' after `-Wportability' correctly disables
+# `portability-recursive' warnings.
+$AUTOMAKE -Wportability -Wno-portability-recursive
+
+# `-Wno-portability' disables `portability-recursive' warnings; but
+# a later `-Wportability-recursive' re-enables them.  This time, we
+# use AUTOMAKE_OPTIONS to specify the warning levels.
 echo 'AUTOMAKE_OPTIONS = -Wno-portability' >> Makefile.am
-$AUTOMAKE --force
+$AUTOMAKE
+echo 'AUTOMAKE_OPTIONS += -Wportability-recursive' >> Makefile.am
+AUTOMAKE_fails
+grep 'recursive variable expansion' stderr
+
+#
+# Now try a setup where we have both a `portability' warning and
+# a `portability-recursive' one.
+#
+
+cat >Makefile.am <<'EOF'
+x = 1
+bla = $(foo$(x))
+noinst_PROGRAMS = foo
+foo_CPPFLAGS = -Dwhatever
+EOF
+
+echo AC_PROG_CC >> configure.in
+
+$ACLOCAL --force
+
+# Can disable both `portability' and `portability-recursive' warnings.
+$AUTOMAKE -Wno-portability
+
+# Disabling `portability-recursive' warnings should not disable
+# `portability' warnings.
+AUTOMAKE_fails -Wportability -Wno-portability-recursive
+grep AM_PROG_CC_C_O stderr
+grep 'recursive variable expansion' stderr && Exit 1
+
+# Enabling `portability-recursive' warnings should not enable
+# all the `portability' warning.
+AUTOMAKE_fails -Wno-portability -Wportability-recursive
+grep AM_PROG_CC_C_O stderr && Exit 1
+grep 'recursive variable expansion' stderr
 
 :
diff --git a/tests/extra-portability.test b/tests/extra-portability.test
index 191dcb4..51a9b4f 100755
--- a/tests/extra-portability.test
+++ b/tests/extra-portability.test
@@ -18,52 +18,78 @@
 # warning categories:
 #   1. `-Wextra-portability' must imply `-Wportability'.
 #   2. `-Wno-portability' must imply `-Wno-extra-portability'.
+#   3. `-Wall' must imply `-Wextra-portability'.
 
 . ./defs || Exit 1
 
 set -e
 
+# We want (almost) complete control over automake options.
+# FIXME: use $original_AUTOMAKE here once we are merged into master.
+AUTOMAKE="`(set $AUTOMAKE && echo $1)` --foreign -Werror"
+
 cat >>configure.in <<END
 AC_PROG_CC
 AC_PROG_RANLIB
 AC_OUTPUT
 END
 
+$ACLOCAL
+
+#
+# First, a setup where only an extra-portability warning is present
+# (no "simple" portability-warnings are).
+#
+
 cat >Makefile.am <<END
 EXTRA_LIBRARIES = libfoo.a
 libfoo_a_SOURCES = sub/foo.c
-libfoo_a_CPPFLAGS = -Dwhatever
 END
 
-$ACLOCAL
+# Sanity check: extra-portability warnings causes the expected error.
+AUTOMAKE_fails -Wextra-portability
+grep 'requires.*AM_PROG_AR' stderr
+
+# Warnings in extra-portability category are not enabled by default.
+$AUTOMAKE
 
-# Enabling extra-portability enables portability.
-AUTOMAKE_fails -Wnone -Wextra-portability
-# The expected diagnostic is
-#    Makefile.am:2: compiling `foo.c' with per-target flags requires 
`AM_PROG_CC_C_O' in `configure.in'
-#    .../lib/am/library.am: `libfoo.a': linking libraries using a non-POSIX
-#    .../lib/am/library.am: archiver requires `AM_PROG_AR' in `configure.in'
-#    Makefile.am:1:   while processing library `libfoo.a'
+# -Wall enables extra-portability.
+AUTOMAKE_fails -Wall
+grep 'requires.*AM_PROG_AR' stderr
+
+# Disabling portability disables extra-portability as well.
+$AUTOMAKE -Wextra-portability -Wno-portability
+$AUTOMAKE -Wall -Wno-portability
+
+#
+# Now, a setup where also a "simple" portability warning is present.
+#
+
+# Per-target flags require the use of AM_PROG_CC_C_O in configure.ac.
+echo libfoo_a_CPPFLAGS = -Dwhatever >> Makefile.am
+
+# Enabling extra-portability enables portability as well ...
+AUTOMAKE_fails -Wextra-portability
+grep 'requires.*AM_PROG_CC_C_O' stderr
+grep 'requires.*AM_PROG_AR' stderr
+# ... even if it had been previously disabled.
+AUTOMAKE_fails -Wno-portability -Wextra-portability
 grep 'requires.*AM_PROG_CC_C_O' stderr
 grep 'requires.*AM_PROG_AR' stderr
 
 # Disabling extra-portability leaves portability intact.
-AUTOMAKE_fails -Wno-extra-portability
-# The expected diagnostic is
-#    Makefile.am:2: compiling `foo.c' with per-target flags requires 
`AM_PROG_CC_C_O' in `configure.in'
-#    Makefile.am:1:   while processing library `libfoo.a'
+AUTOMAKE_fails -Wportability -Wno-extra-portability
 grep 'requires.*AM_PROG_CC_C_O' stderr
 grep 'requires.*AM_PROG_AR' stderr && Exit 1
 
 # Enabling portability does not enable extra-portability.
 AUTOMAKE_fails -Wnone -Wportability
-# The expected diagnostic is
-#    Makefile.am:2: compiling `foo.c' with per-target flags requires 
`AM_PROG_CC_C_O' in `configure.in'
-#    Makefile.am:1:   while processing library `libfoo.a'
 grep 'requires.*AM_PROG_CC_C_O' stderr
 grep 'requires.*AM_PROG_AR' stderr && Exit 1
 
 # Disabling portability disables extra-portability.
 $AUTOMAKE -Wno-portability
+$AUTOMAKE -Wextra-portability -Wno-portability
+$AUTOMAKE -Wall -Wno-portability
 
 :
diff --git a/tests/extra-portability3.test b/tests/extra-portability3.test
new file mode 100755
index 0000000..7ca19b1
--- /dev/null
+++ b/tests/extra-portability3.test
@@ -0,0 +1,63 @@
+#! /bin/sh
+# Copyright (C) 2011 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# Check interactions between the `portability-recursive' and
+# `extra-portability' warning categories.
+
+. ./defs || Exit 1
+
+set -e
+
+# We want (almost) complete control over automake options.
+# FIXME: use $original_AUTOMAKE here once we are merged into master.
+AUTOMAKE="`(set $AUTOMAKE && echo $1)` --foreign -Werror"
+
+cat >>configure.in <<END
+AC_PROG_CC
+AC_PROG_RANLIB
+AC_OUTPUT
+END
+
+$ACLOCAL
+
+cat >Makefile.am <<'END'
+baz = $(foo$(bar))
+lib_LIBRARIES = libfoo.a
+libfoo_a_SOURCES = foo.c
+END
+
+# 'extra-portability' implies 'portability-recursive'.
+AUTOMAKE_fails -Wextra-portability
+grep 'requires.*AM_PROG_AR' stderr
+grep 'recursive variable expansion' stderr
+
+# We can disable 'extra-portability' while leaving
+# 'portability-recursive' intact.
+AUTOMAKE_fails -Wportability-recursive -Wno-extra-portability
+grep 'requires.*AM_PROG_AR' stderr && Exit 1
+grep 'recursive variable expansion' stderr
+
+# We can disable 'portability-recursive' while leaving
+# 'extra-portability' intact.
+AUTOMAKE_fails -Wextra-portability -Wno-portability-recursive
+grep 'requires.*AM_PROG_AR' stderr
+grep 'recursive variable expansion' stderr && Exit 1
+
+# Disabling 'portability' disables 'portability-recursive' and
+# 'extra-portability'.
+$AUTOMAKE -Wextra-portability -Wno-portability
+
+:


hooks/post-receive
-- 
GNU Automake



reply via email to

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