[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Automake-commit] [SCM] GNU Automake branch, master, updated. v1.11-1114
From: |
Stefano Lattarini |
Subject: |
[Automake-commit] [SCM] GNU Automake branch, master, updated. v1.11-1114-g97cbf15 |
Date: |
Sat, 05 Nov 2011 10:13:39 +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=97cbf15b81c6276cb76eefce4cb15c88e12f9a47
The branch, master has been updated
via 97cbf15b81c6276cb76eefce4cb15c88e12f9a47 (commit)
via db93b31d81c7809e49fa874acfd5e3aa3504dc48 (commit)
via f23d5a15269c722c8cd136827a3b021a29814cb0 (commit)
from 8355b2b59221c58b33d686a0a2b4f22a19a3c330 (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 97cbf15b81c6276cb76eefce4cb15c88e12f9a47
Merge: 8355b2b db93b31
Author: Stefano Lattarini <address@hidden>
Date: Sat Nov 5 10:43:27 2011 +0100
Merge branch 'msvc' into master
Commits merged from msvc:
- warnings: fix buglets for portability warnings
- tests: extend tests on 'extra-portability' warning category
Extra testsuite edits:
* tests/extra-portability3.test: Use `$original_AUTOMAKE' instead
of hackishly extracting the first component of `$AUTOMAKE'.
* tests/extra-portability.test: Likewise. Also, since we are at
it, throw in a couple of small extensions and tweakings (suggested
by the minor merge conflicts).
-----------------------------------------------------------------------
Summary of changes:
ChangeLog | 31 +++++++++++++++++++
lib/Automake/ChannelDefs.pm | 38 ++++++++++++++++++++----
tests/Makefile.am | 1 +
tests/Makefile.in | 1 +
tests/dollarvar2.test | 65 +++++++++++++++++++++++++++++++++++++---
tests/extra-portability.test | 63 +++++++++++++++++++++++++++++-----------
tests/extra-portability3.test | 62 +++++++++++++++++++++++++++++++++++++++
7 files changed, 233 insertions(+), 28 deletions(-)
create mode 100755 tests/extra-portability3.test
diff --git a/ChangeLog b/ChangeLog
index f22fa84..2b83724 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,34 @@
+2011-11-05 Stefano Lattarini <address@hidden>
+
+ Merge branch 'msvc' into master
+ * tests/extra-portability3.test: Use `$original_AUTOMAKE' instead
+ of hackishly extracting the first component of `$AUTOMAKE'.
+ * tests/extra-portability.test: Likewise. Also, since we are at
+ it, throw in a couple of small extensions and tweakings (suggested
+ by the minor merge conflicts).
+
+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-04 Stefano Lattarini <address@hidden>
test defs: new functions to analyze configure help screen
diff --git a/lib/Automake/ChannelDefs.pm b/lib/Automake/ChannelDefs.pm
index de3970c..3e9fd1b 100644
--- a/lib/Automake/ChannelDefs.pm
+++ b/lib/Automake/ChannelDefs.pm
@@ -292,12 +292,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 00af436..471b340 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -480,6 +480,7 @@ extradep.test \
extradep2.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 1179ed2..1fe51cd 100644
--- a/tests/Makefile.in
+++ b/tests/Makefile.in
@@ -756,6 +756,7 @@ extradep.test \
extradep2.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 e1ac766..cda9605 100755
--- a/tests/dollarvar2.test
+++ b/tests/dollarvar2.test
@@ -19,6 +19,11 @@
. ./defs || Exit 1
+#
+# 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))
@@ -26,11 +31,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 353141f..edfbf69 100755
--- a/tests/extra-portability.test
+++ b/tests/extra-portability.test
@@ -18,52 +18,81 @@
# 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.
+AUTOMAKE="$original_AUTOMAKE --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
+
+# -Wall enables extra-portability.
+AUTOMAKE_fails -Wall
+grep 'requires.*AM_PROG_AR' stderr
-# 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'
+# 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.
+# Disabling extra-portability leaves portability intact (1).
+AUTOMAKE_fails -Wportability -Wno-extra-portability
+grep 'requires.*AM_PROG_CC_C_O' stderr
+grep 'requires.*AM_PROG_AR' stderr && Exit 1
+# Disabling extra-portability leaves portability intact (2).
AUTOMAKE_fails -Wall -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'
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'
+AUTOMAKE_fails -Wportability
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..573ec2f
--- /dev/null
+++ b/tests/extra-portability3.test
@@ -0,0 +1,62 @@
+#! /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.
+AUTOMAKE="$original_AUTOMAKE --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
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Automake-commit] [SCM] GNU Automake branch, master, updated. v1.11-1114-g97cbf15,
Stefano Lattarini <=