From cf41f5af46f715077219cd2ec86471021e782937 Mon Sep 17 00:00:00 2001 From: Stefano Lattarini Date: Tue, 4 Sep 2012 14:50:49 +0200 Subject: 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 --- NEWS | 11 ++++++++++- doc/automake.texi | 2 +- lib/Automake/ChannelDefs.pm | 2 +- t/backcompat.sh | 4 ++-- t/backcompat2.sh | 12 ++++++------ t/backcompat3.sh | 12 ++++++------ t/backcompat5.sh | 5 +++-- t/backcompat6.sh | 5 +++-- t/cygnus-imply-foreign.sh | 2 +- t/list-of-tests.mk | 1 + t/warnings-obsolete-default.sh | 39 +++++++++++++++++++++++++++++++++++++++ 11 files changed, 73 insertions(+), 22 deletions(-) create mode 100755 t/warnings-obsolete-default.sh 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 < configure.ac < 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 < configure.ac < configure.in < configure.ac < configure.in < configure.ac < 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 < configure.ac <. # 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 . # 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 . + +# 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 + +: -- cgit v1.2.1