summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefano Lattarini <stefano.lattarini@gmail.com>2012-09-04 14:50:49 +0200
committerStefano Lattarini <stefano.lattarini@gmail.com>2012-09-04 15:14:22 +0200
commitcf41f5af46f715077219cd2ec86471021e782937 (patch)
tree0a7edb142936da3ed3b62b8542924ff2cf446132
parentd343f7af1481ecb017dbf2aefd7b7c66622d2d33 (diff)
downloadautomake-cf41f5af46f715077219cd2ec86471021e782937.tar.gz
warns: enable category 'obsolete' by default
No surprise that our users were bitten by backward-incompatible changes especially hard: the warnings in the 'obsolete' category, that might have informed them of the upcoming incompatibilities, and help them to prepare for the transition, where not enabled by default! * NEWS, doc/automake.texi: Update. * lib/Automake/ChannelDefs.pm: Enable warnings in the category 'obsolete' by default. * t/warnings-obsolete-default.sh: New test. * t/list-of-tests.mk: Add it. * t/backcompat.sh: Use 'configure.ac' rather than 'configure.in' as autoconf input file, to avoid spurious aclocal errors. * t/backcompat2.sh: Likewise. * t/backcompat3.sh: Likewise. * t/backcompat5.sh: Add '-Wno-obsolete' when invoking aclocal. Adjust heading comments. * t/backcompat6.sh: Likewise. * t/cygnus-imply-foreign.sh: Add '-Wno-obsolete' when invoking automake. Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
-rw-r--r--NEWS11
-rw-r--r--doc/automake.texi2
-rw-r--r--lib/Automake/ChannelDefs.pm2
-rwxr-xr-xt/backcompat.sh4
-rwxr-xr-xt/backcompat2.sh12
-rwxr-xr-xt/backcompat3.sh12
-rwxr-xr-xt/backcompat5.sh5
-rwxr-xr-xt/backcompat6.sh5
-rwxr-xr-xt/cygnus-imply-foreign.sh2
-rw-r--r--t/list-of-tests.mk1
-rwxr-xr-xt/warnings-obsolete-default.sh39
11 files changed, 73 insertions, 22 deletions
diff --git a/NEWS b/NEWS
index 1d5454156..ccdf0df06 100644
--- a/NEWS
+++ b/NEWS
@@ -1,4 +1,4 @@
-New in 1.12.3:
+New in 1.12.4:
* WARNING: Future backward-incompatibilities!
@@ -66,6 +66,15 @@ New in 1.12.3:
giving more useful warnings than a bare "command not found" from a
make recipe would.
+* Warnings and deprecations:
+
+ - Warnings in the 'obsolete' category are enabled by default both in
+ automake and aclocal.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+New in 1.12.3:
+
* Miscellaneous changes:
- The '.m4' files provided by Automake does not define serial numbers
diff --git a/doc/automake.texi b/doc/automake.texi
index 416fa6d5b..db90c65e2 100644
--- a/doc/automake.texi
+++ b/doc/automake.texi
@@ -2709,7 +2709,7 @@ A category can be turned off by prefixing its name with @samp{no-}. For
instance, @option{-Wno-syntax} will hide the warnings about unused
variables.
-The categories output by default are @samp{syntax} and
+The categories output by default are @samp{obsolete}, @samp{syntax} and
@samp{unsupported}. Additionally, @samp{gnu} and @samp{portability}
are enabled in @option{--gnu} and @option{--gnits} strictness.
On the other hand, the @option{silent-rules} options (@pxref{Options})
diff --git a/lib/Automake/ChannelDefs.pm b/lib/Automake/ChannelDefs.pm
index 02ce8493f..a465cbc6d 100644
--- a/lib/Automake/ChannelDefs.pm
+++ b/lib/Automake/ChannelDefs.pm
@@ -156,7 +156,7 @@ register_channel 'automake', type => 'fatal', backtrace => 1,
register_channel 'extra-portability', type => 'warning', silent => 1;
register_channel 'gnu', type => 'warning';
-register_channel 'obsolete', type => 'warning', silent => 1;
+register_channel 'obsolete', type => 'warning';
register_channel 'override', type => 'warning', silent => 1;
register_channel 'portability', type => 'warning', silent => 1;
register_channel 'portability-recursive', type => 'warning', silent => 1;
diff --git a/t/backcompat.sh b/t/backcompat.sh
index fa8368763..214515d17 100755
--- a/t/backcompat.sh
+++ b/t/backcompat.sh
@@ -46,13 +46,13 @@ END
for ac_init in 'AC_INIT' 'AC_INIT([Makefile.am])'; do
for am_extra_args in '' ', []' ', [:]' ', [false]'; do
rm -rf autom4te*.cache config* Makefile.in Makefile
- unindent > configure.in <<END
+ unindent > configure.ac <<END
$ac_init
AM_INIT_AUTOMAKE([FooBar], [0.7.1]$am_extra_args)
AC_CONFIG_FILES([Makefile])
AC_OUTPUT
END
- cat configure.in # For debugging.
+ cat configure.ac # For debugging.
$ACLOCAL
$AUTOCONF
$AUTOMAKE -Wno-obsolete
diff --git a/t/backcompat2.sh b/t/backcompat2.sh
index 84bf64235..109483b47 100755
--- a/t/backcompat2.sh
+++ b/t/backcompat2.sh
@@ -23,9 +23,9 @@ am_create_testdir=empty
# A trick to make the test run muuuch faster, by avoiding repeated
# runs of aclocal (one order of magnitude improvement in speed!).
-echo 'AC_INIT(x,0) AM_INIT_AUTOMAKE' > configure.in
+echo 'AC_INIT(x,0) AM_INIT_AUTOMAKE' > configure.ac
$ACLOCAL
-rm -rf configure.in autom4te.*
+rm -rf configure.ac autom4te.*
touch install-sh missing
@@ -35,13 +35,13 @@ cat > config.h.in <<'END'
END
for am_arg3 in ':' 'false' '#' ' '; do
- unindent > configure.in <<END
+ unindent > configure.ac <<END
AC_INIT
AC_CONFIG_HEADERS([config.h])
AM_INIT_AUTOMAKE([pkgname], [pkgversion], [$am_arg3])
AC_OUTPUT
END
- cat configure.in # For debugging.
+ cat configure.ac # For debugging.
$AUTOCONF
./configure
cat config.h # For debugging.
@@ -56,13 +56,13 @@ END
done
for am_extra_args in '' ',' ', []'; do
- unindent > configure.in <<END
+ unindent > configure.ac <<END
AC_INIT
AC_CONFIG_HEADERS([config.h])
AM_INIT_AUTOMAKE([pkgname], [pkgversion]$am_extra_args)
AC_OUTPUT
END
- cat configure.in # For debugging.
+ cat configure.ac # For debugging.
$AUTOCONF
./configure
cat config.h # For debugging.
diff --git a/t/backcompat3.sh b/t/backcompat3.sh
index e00992bb2..f25bd57c0 100755
--- a/t/backcompat3.sh
+++ b/t/backcompat3.sh
@@ -42,14 +42,14 @@ END
### Run 1 ###
-cat > configure.in <<END
+cat > configure.ac <<END
AC_INIT([ac_name], [ac_version])
AM_INIT_AUTOMAKE([am_name], [am_version])
AC_CONFIG_FILES([Makefile])
AC_OUTPUT
END
-cat configure.in
+cat configure.ac
$ACLOCAL
$AUTOCONF
@@ -75,7 +75,7 @@ diff exp got
### Run 2 ###
-cat > configure.in <<'END'
+cat > configure.ac <<'END'
dnl: 'AC_INIT' in Autoconf <= 2.63 doesn't have an URL argument.
dnl: Luckily, 'AC_AUTOCONF_VERSION' and 'm4_version_prereq' are
dnl: both present in autoconf 2.62, which we require; so that we
@@ -90,7 +90,7 @@ AC_CONFIG_FILES([Makefile])
AC_OUTPUT
END
-cat configure.in
+cat configure.ac
$ACLOCAL
$AUTOCONF
@@ -116,14 +116,14 @@ diff exp got
### Run 3 ###
-cat > configure.in <<END
+cat > configure.ac <<END
AC_INIT([ac_name], [ac_version])
AM_INIT_AUTOMAKE([am_name], [am_version], [am_foo_quux])
AC_CONFIG_FILES([Makefile])
AC_OUTPUT
END
-cat configure.in
+cat configure.ac
$ACLOCAL
$AUTOCONF
diff --git a/t/backcompat5.sh b/t/backcompat5.sh
index a5ab70caf..caeac07cf 100755
--- a/t/backcompat5.sh
+++ b/t/backcompat5.sh
@@ -15,7 +15,8 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# Backward-compatibility test: try to build and distribute a package
-# using obsoleted forms of AC_INIT, AM_INIT_AUTOMAKE and AC_OUTPUT.
+# using obsoleted forms of AC_INIT, AM_INIT_AUTOMAKE and AC_OUTPUT,
+# and configure.in as autoconf input file.
# This script can also serve as mild stress-testing for Automake.
# See also the similar test 'backcompat6.sh'.
@@ -92,7 +93,7 @@ TESTS = a.test
EXTRA_DIST = $(TESTS)
END
-$ACLOCAL
+$ACLOCAL -Wno-obsolete
$AUTOCONF
$AUTOMAKE -a -Wno-obsolete
test -f install-sh
diff --git a/t/backcompat6.sh b/t/backcompat6.sh
index 30403dd75..ee86e3644 100755
--- a/t/backcompat6.sh
+++ b/t/backcompat6.sh
@@ -15,7 +15,8 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# Backward-compatibility test: try to build and distribute a package
-# using obsoleted forms of AC_INIT, AM_INIT_AUTOMAKE and AC_OUTPUT.
+# using obsoleted forms of AC_INIT, AM_INIT_AUTOMAKE and AC_OUTPUT,
+# and 'configure.in' as autconf input file.
# This script can also serve as mild stress-testing for Automake.
# See also the similar test 'backcompat5.sh'.
@@ -77,7 +78,7 @@ int main (void)
}
END
-$ACLOCAL
+$ACLOCAL -Wno-obsolete
$AUTOMAKE -Wno-obsolete --add-missing
$AUTOCONF
diff --git a/t/cygnus-imply-foreign.sh b/t/cygnus-imply-foreign.sh
index 9a5ef7ff9..461265032 100755
--- a/t/cygnus-imply-foreign.sh
+++ b/t/cygnus-imply-foreign.sh
@@ -29,7 +29,7 @@ $ACLOCAL
# We want complete control automake flags, while honouring the
# user overrides for $AUTOMAKE.
-AUTOMAKE=$am_original_AUTOMAKE
+AUTOMAKE="$am_original_AUTOMAKE -Wno-obsolete"
# Sanity check: gnu mode must complain about missing files and
# portability problems.
diff --git a/t/list-of-tests.mk b/t/list-of-tests.mk
index ff4448e9b..8e1093a59 100644
--- a/t/list-of-tests.mk
+++ b/t/list-of-tests.mk
@@ -1231,6 +1231,7 @@ t/vtexi.sh \
t/vtexi2.sh \
t/vtexi3.sh \
t/vtexi4.sh \
+t/warnings-obsolete-default.sh \
t/warnings-override.sh \
t/warnings-precedence.sh \
t/warnings-strictness-interactions.sh \
diff --git a/t/warnings-obsolete-default.sh b/t/warnings-obsolete-default.sh
new file mode 100755
index 000000000..fc439eab9
--- /dev/null
+++ b/t/warnings-obsolete-default.sh
@@ -0,0 +1,39 @@
+#! /bin/sh
+# Copyright (C) 2011-2012 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 that automake warnings in the 'obsolete' category are enabled
+# by default.
+
+. ./defs || exit 1
+
+# We want (almost) complete control over automake options.
+AUTOMAKE="$am_original_AUTOMAKE --foreign -Werror"
+
+echo AC_PROG_CC >> configure.ac
+
+cat > Makefile.am <<'END'
+bin_PROGRAMS = foo
+INCLUDES = -Ibar
+END
+
+$ACLOCAL
+AUTOMAKE_fails
+grep '^Makefile\.am:2:.*INCLUDES.*AM_CPPFLAGS' stderr
+
+# Check that we can override warnings about obsolete stuff.
+$AUTOMAKE -Wno-obsolete
+
+: