automake-patches
[Top][All Lists]
Advanced

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

[FYI] warns: enable category 'obsolete' by default


From: Stefano Lattarini
Subject: [FYI] warns: enable category 'obsolete' by default
Date: Tue, 4 Sep 2012 15:41:49 +0200

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 <address@hidden>
---

 This change is IMHO enough to warrant a 1.12.4 release.  I plan to
 do that in a week or so; if anyone has objections, suggestions or
 patches: please speak up soon.

 Regards,
   Stefano

 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 1d54541..ccdf0df 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 416fa6d..db90c65 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 02ce849..a465cbc 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 fa83687..214515d 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 84bf642..109483b 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 e00992b..f25bd57 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 a5ab70c..caeac07 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 30403dd..ee86e36 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 9a5ef7f..4612650 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 ff4448e..8e1093a 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 0000000..fc439ea
--- /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
+
+:
-- 
1.7.12




reply via email to

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