ansi2knr: deprecate, it will go away in the next major release
authorStefano Lattarini <stefano.lattarini@gmail.com>
Mon, 13 Jun 2011 19:27:35 +0000 (21:27 +0200)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Mon, 20 Jun 2011 07:38:08 +0000 (09:38 +0200)
* doc/automake.texi: Loudly and repeatedly state that the old
de-ANSI-fication features are now deprecated and will be removed
in the next major Automake release.  Other related adjustments.
* lib/Automake/Options.pm (_process_option_list ): Give a warning
in the `obsolete' category when the `ansi2knr' option is used.
* m4/protos.m4 (AM_C_PROTOTYPES): Deprecate this macro: a warning
in the `obsolete' category will be emitted it if is used.
* tests/ansi2knr-deprecation.test: New test.
* tests/Makefile.am (TESTS): Update.
* tests/ansi.test: Adjust, by calling autoconf and/or automake
with the `-Wno-obsolete' flag.
* tests/ansi10.test: Likewise.
* tests/ansi2.test: Likewise.
* tests/ansi3.test: Likewise.
* tests/ansi3b.test: Likewise.
* tests/ansi4.test: Likewise.
* tests/ansi5.test: Likewise.
* tests/ansi6.test: Likewise.
* tests/ansi7.test: Likewise.
* tests/ansi8.test: Likewise.
* tests/ansi9.test: Likewise.
* tests/cxxansi.test: Likewise.
* tests/libobj8.test: Likewise.
* NEWS: Update about the future planned backward-incompatibility
due to the removal of de-ANSI-fication feature.

21 files changed:
ChangeLog
NEWS
doc/automake.texi
lib/Automake/Options.pm
m4/protos.m4
tests/Makefile.am
tests/Makefile.in
tests/ansi.test
tests/ansi10.test
tests/ansi2.test
tests/ansi2knr-deprecation.test [new file with mode: 0755]
tests/ansi3.test
tests/ansi3b.test
tests/ansi4.test
tests/ansi5.test
tests/ansi6.test
tests/ansi7.test
tests/ansi8.test
tests/ansi9.test
tests/cxxansi.test
tests/libobj8.test

index 917c2d4..fb96549 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,32 @@
+2011-06-14  Stefano Lattarini  <stefano.lattarini@gmail.com>
+
+       ansi2knr: deprecate, it will go away in the next major release
+       * doc/automake.texi: Loudly and repeatedly state that the old
+       de-ANSI-fication features are now deprecated and will be removed
+       in the next major Automake release.  Other related adjustments.
+       * lib/Automake/Options.pm (_process_option_list ): Give a warning
+       in the `obsolete' category when the `ansi2knr' option is used.
+       * m4/protos.m4 (AM_C_PROTOTYPES): Deprecate this macro: a warning
+       in the `obsolete' category will be emitted it if is used.
+       * tests/ansi2knr-deprecation.test: New test.
+       * tests/Makefile.am (TESTS): Update.
+       * tests/ansi.test: Adjust, by calling autoconf and/or automake
+       with the `-Wno-obsolete' flag.
+       * tests/ansi10.test: Likewise.
+       * tests/ansi2.test: Likewise.
+       * tests/ansi3.test: Likewise.
+       * tests/ansi3b.test: Likewise.
+       * tests/ansi4.test: Likewise.
+       * tests/ansi5.test: Likewise.
+       * tests/ansi6.test: Likewise.
+       * tests/ansi7.test: Likewise.
+       * tests/ansi8.test: Likewise.
+       * tests/ansi9.test: Likewise.
+       * tests/cxxansi.test: Likewise.
+       * tests/libobj8.test: Likewise.
+       * NEWS: Update about the future planned backward-incompatibility
+       due to the removal of de-ANSI-fication feature.
+
 2011-06-19  Stefano Lattarini  <stefano.lattarini@gmail.com>
 
        docs: primary/prefix combination "pkglib_PROGRAMS" is now invalid
diff --git a/NEWS b/NEWS
index fd7dd53..29c552b 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,10 @@
 New in 1.11.0a:
 
+* WARNING: Future backward-incompatibilities!
+
+  - The Automake support for automatic de-ANSI-fication will be removed in
+    the next major Automake release (1.12).
+
 * Miscellaneous changes:
 
   - The `lzma' compression scheme and associated automake option `dist-lzma'
index 4209c07..52e8cc3 100644 (file)
@@ -232,7 +232,7 @@ Building Programs and Libraries
 * Java Support::                Compiling Java sources
 * Vala Support::                Compiling Vala sources
 * Support for Other Languages::  Compiling other languages
-* ANSI::                        Automatic de-ANSI-fication (obsolete)
+* ANSI::                        Automatic de-ANSI-fication (deprecated, soon to be removed)
 * Dependencies::                Automatic dependency tracking
 * EXEEXT::                      Support for executable extensions
 
@@ -2226,8 +2226,9 @@ source in case you need more recent versions.
 @table @code
 @item ansi2knr.c
 @itemx ansi2knr.1
-These two files are used for de-ANSI-fication support (obsolete
-@pxref{ANSI}).
+These two files are used for de-ANSI-fication support (they are
+deprecated now, and @emph{will be removed} in the next major Automake
+release; @pxref{ANSI}).
 
 @item compile
 This is a wrapper for compilers that do not accept options @option{-c}
@@ -2447,20 +2448,8 @@ false.o: true.c
         $(COMPILE) -DEXIT_CODE=1 -c true.c && mv true.o false.o
 @end example
 
-Also, these explicit rules do not work if the obsolete de-ANSI-fication feature
-is used (@pxref{ANSI}).  Supporting de-ANSI-fication requires a little
-more work:
-
-@example
-true_.o: true_.c false_.o
-        $(COMPILE) -DEXIT_CODE=0 -c true_.c
-
-false_.o: true_.c
-        $(COMPILE) -DEXIT_CODE=1 -c true_.c && mv true_.o false_.o
-@end example
-
 As it turns out, there is also a much easier way to do this same task.
-Some of the above techniques are useful enough that we've kept the
+Some of the above technique is useful enough that we've kept the
 example in the manual.  However if you were to build @code{true} and
 @code{false} in real life, you would probably use per-program
 compilation flags, like so:
@@ -2476,10 +2465,9 @@ true_CPPFLAGS = -DEXIT_CODE=0
 @end example
 
 In this case Automake will cause @file{true.c} to be compiled twice,
-with different flags.  De-ANSI-fication will work automatically.  In
-this instance, the names of the object files would be chosen by
-automake; they would be @file{false-true.o} and @file{true-true.o}.
-(The name of the object files rarely matters.)
+with different flags.  In this instance, the names of the object files
+would be chosen by automake; they would be @file{false-true.o} and
+@file{true-true.o}. (The name of the object files rarely matters.)
 
 
 @node Invoking Automake
@@ -3033,8 +3021,8 @@ this way, e.g., @code{AC_PATH_XTRA} defines @code{X_CFLAGS} and
 if @code{AC_PATH_XTRA} is called.
 
 @item AM_C_PROTOTYPES
-This is required when using the obsolete de-ANSI-fication feature; see
-@ref{ANSI}.
+This is required when using the deprecated de-ANSI-fication feature; see
+@ref{ANSI}.  @emph{It will be removed} in the next major Automake release.
 
 @item AM_CONDITIONAL
 This introduces an Automake conditional (@pxref{Conditionals}).
@@ -4010,8 +3998,10 @@ Autoconf Manual}).
 Check to see if function prototypes are understood by the compiler.  If
 so, define @samp{PROTOTYPES} and set the output variables @code{U} and
 @code{ANSI2KNR} to the empty string.  Otherwise, set @code{U} to
-@samp{_} and @code{ANSI2KNR} to @samp{./ansi2knr}.  Automake uses these
-values to implement the obsolete de-ANSI-fication feature.
+@samp{_} and @code{ANSI2KNR} to @samp{./ansi2knr}.  Automake used these
+values to implement the deprecated de-ANSI-fication feature; however,
+support for @emph{that feature will be removed} in the next major Automake
+release, and then @emph{these macros and variables will go away as well}.
 
 @item AM_CONFIG_HEADER
 @acindex AM_CONFIG_HEADER
@@ -4611,7 +4601,7 @@ to build programs and libraries.
 * Java Support::                Compiling Java sources
 * Vala Support::                Compiling Vala sources
 * Support for Other Languages::  Compiling other languages
-* ANSI::                        Automatic de-ANSI-fication (obsolete)
+* ANSI::                        Automatic de-ANSI-fication (deprecated, soon to be removed)
 * Dependencies::                Automatic dependency tracking
 * EXEEXT::                      Support for executable extensions
 @end menu
@@ -6760,13 +6750,14 @@ suffix rule handling (@pxref{Suffixes}).
 
 
 @node ANSI
-@section Automatic de-ANSI-fication
+@section Automatic de-ANSI-fication (deprecated, soon to be removed)
 
 @cindex de-ANSI-fication, defined
 
-The features described in this section are obsolete; you should not
-used any of them in new code, and they may be withdrawn in future
-Automake releases.
+@emph{The features described in this section are deprecated; you must
+not use any of them in new code, and remove their use from older but
+still maintained code: they will be withdrawn in the next major
+Automake release.}
 
 When the C language was standardized in 1989, there was a long
 transition period where package developers needed to worry about
@@ -9063,11 +9054,15 @@ implies options @option{readme-alpha} and @option{check-news}.
 @itemx @option{@var{path}/ansi2knr}
 @cindex Option, @option{ansi2knr}
 @opindex ansi2knr
-Turn on the obsolete de-ANSI-fication feature.  @xref{ANSI}.  If preceded by a
+Turn on the deprecated de-ANSI-fication feature (@xref{ANSI}).  Note
+that that feature and this option @emph{will be removed} in the next
+major Automake release.
+
+If preceded by a
 path, the generated @file{Makefile.in} will look in the specified
 directory to find the @file{ansi2knr} program.  The path should be a
 relative path to another directory in the same distribution (Automake
-currently does not check this).
+does not check this).
 
 @item @option{check-news}
 @cindex Option, @option{check-news}
index 9543aa5..b7ff3d1 100644 (file)
@@ -252,6 +252,10 @@ sub _process_option_list (\%$@)
        }
       elsif (/^(.*\/)?ansi2knr$/)
        {
+          # This feature is deprecated, will be removed in the next
+          # Automake major release.
+          msg 'obsolete', $where,
+              "automatic de-ANSI-fication support is deprecated\n";
          # An option like "../lib/ansi2knr" is allowed.  With no
          # path prefix, we assume the required programs are in this
          # directory.  We save the actual option for later.
index 427193b..f710293 100644 (file)
@@ -13,6 +13,8 @@
 
 AC_DEFUN([AM_C_PROTOTYPES],
 [AC_REQUIRE([AC_C_PROTOTYPES])
+AC_DIAGNOSE([obsolete],
+            [$0: automatic de-ANSI-fication support is deprecated])
 if test "$ac_cv_prog_cc_stdc" != no; then
   U= ANSI2KNR=
 else
index bd3f99c..28196f8 100644 (file)
@@ -89,6 +89,7 @@ amassign.test \
 ammissing.test \
 amopt.test \
 amsubst.test \
+ansi2knr-deprecation.test \
 ansi.test \
 ansi2.test \
 ansi3.test \
index b810963..5ca3f6a 100644 (file)
@@ -360,6 +360,7 @@ amassign.test \
 ammissing.test \
 amopt.test \
 amsubst.test \
+ansi2knr-deprecation.test \
 ansi.test \
 ansi2.test \
 ansi3.test \
index 7795f48..0aa000e 100755 (executable)
@@ -42,8 +42,8 @@ END
 : > ansi2knr.1
 
 $ACLOCAL
-$AUTOCONF
-$AUTOMAKE
+$AUTOCONF -Wno-obsolete
+$AUTOMAKE -Wno-obsolete
 
 ./configure
 
index 88b8618..4ff2c86 100755 (executable)
@@ -55,8 +55,8 @@ main (int argc, char **argv)
 END
 
 $ACLOCAL
-$AUTOCONF
-$AUTOMAKE -a
+$AUTOCONF -Wno-obsolete
+$AUTOMAKE -Wno-obsolete -a
 
 # Sanity check: make sure it's ok to set ac_cv_prog_cc_stdc as we do.
 test `grep -c ac_cv_prog_cc_stdc configure` -gt 1
index 77ca2c6..504c8c3 100755 (executable)
@@ -35,6 +35,6 @@ END
 : > ansi2knr.1
 
 $ACLOCAL
-$AUTOMAKE
+$AUTOMAKE -Wno-obsolete
 
 grep '^all[-a-z]*:.*ANSI2KNR' Makefile.in
diff --git a/tests/ansi2knr-deprecation.test b/tests/ansi2knr-deprecation.test
new file mode 100755 (executable)
index 0000000..543d9c6
--- /dev/null
@@ -0,0 +1,69 @@
+#! /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 that the use of automatic de-ANSI-fication feature is deprecated.
+# That feature will be removed in the next major Automake release.
+
+. ./defs || Exit 1
+
+set -e
+
+warn_rx='automatic de-ANSI-fication.*deprecated'
+
+cat >> configure.in <<'END'
+AC_PROG_CC
+AM_C_PROTOTYPES
+END
+
+$ACLOCAL
+
+$AUTOCONF -Wall -Werror -Wno-obsolete
+$AUTOCONF -Wnone -Wobsolete -Werror 2>stderr && { cat stderr >&2; Exit 1; }
+cat stderr >&2
+grep "^configure\\.in:5:.* AM_C_PROTOTYPES:.*$warn_rx" stderr
+
+sed '/AM_C_PROTOTYPES/d' configure.in > config.stub
+diff configure.in config.stub && fatal_ "failed to edit configure.in"
+rm -f configure.in
+
+cat > Makefile.stub <<'END'
+ANSI2KNR = :
+U =
+END
+
+for opt in ansi2knr lib/ansi2knr; do
+  # ansi2knr option in Makefile.am
+  cp config.stub configure.in
+  cp Makefile.stub Makefile.am
+  echo "AUTOMAKE_OPTIONS = $opt" >> Makefile.am
+  cat Makefile.am # For debugging.
+  $AUTOMAKE -Wno-obsolete
+  AUTOMAKE_fails
+  grep "^Makefile\.am:3:.*$warn_rx" stderr
+  AUTOMAKE_fails -Wnone -Wobsolete
+  grep "^Makefile\.am:3:.*$warn_rx" stderr
+  # ansi2knr option in configure.in
+  cp Makefile.stub Makefile.am
+  sed "s|^\\(AM_INIT_AUTOMAKE\\).*|\1([$opt])|" config.stub > configure.in
+  cat configure.in # For debugging.
+  $AUTOMAKE -Wno-obsolete
+  AUTOMAKE_fails
+  grep "^configure\.in:2:.*$warn_rx" stderr
+  AUTOMAKE_fails -Wnone -Wobsolete
+  grep "^configure\.in:2:.*$warn_rx" stderr
+done
+
+:
index e1e0c42..22ef485 100755 (executable)
@@ -51,8 +51,8 @@ export CFLAGS
 # We use gcc and not gcc -traditional as the latter fails on some
 # Linux boxes (Red Hat 5.1 in particular).
 $ACLOCAL
-$AUTOCONF
-$AUTOMAKE -a 2>stderr || { cat stderr >&2; Exit 1; }
+$AUTOCONF -Wno-obsolete
+$AUTOMAKE -Wno-obsolete -a 2>stderr || { cat stderr >&2; Exit 1; }
 cat stderr >&2
 grep 'Makefile.am:1:.*ansi2knr\.c' stderr
 CC='gcc' ./configure
index ad222ff..0688781 100755 (executable)
@@ -52,8 +52,8 @@ export CFLAGS
 # We use gcc and not gcc -traditional as the latter fails on some
 # Linux boxes (Red Hat 5.1 in particular).
 $ACLOCAL
-$AUTOCONF
-$AUTOMAKE -a 2>stderr || { cat stderr >&2; Exit 1; }
+$AUTOCONF -Wno-obsolete
+$AUTOMAKE -Wno-obsolete -a 2>stderr || { cat stderr >&2; Exit 1; }
 cat stderr >&2
 grep 'configure.in:2:.*ansi2knr\.1' stderr
 CC='gcc' ./configure
index 63250a9..0c0d339 100755 (executable)
@@ -37,6 +37,6 @@ END
 : > hello.c
 
 $ACLOCAL
-$AUTOMAKE
+$AUTOMAKE -Wno-obsolete
 
 $FGREP 'ansi2knr.$(' Makefile.in
index 2652cb7..d152be0 100755 (executable)
@@ -66,8 +66,8 @@ END
 set -e
 
 $ACLOCAL
-$AUTOCONF
-$AUTOMAKE -a
+$AUTOCONF -Wno-obsolete
+$AUTOMAKE -Wno-obsolete -a
 # Ignore user CFLAGS.
 CFLAGS=
 export CFLAGS
index 10196ea..691614d 100755 (executable)
@@ -61,8 +61,8 @@ END
 set -e
 
 $ACLOCAL
-$AUTOCONF
-$AUTOMAKE -a
+$AUTOCONF -Wno-obsolete
+$AUTOMAKE -Wno-obsolete -a
 
 # Sanity check: make sure it's ok to set ac_cv_prog_cc_stdc as we do.
 test `grep -c ac_cv_prog_cc_stdc configure` -gt 1
index e97f517..9eae26b 100755 (executable)
@@ -63,8 +63,8 @@ END
 set -e
 
 $ACLOCAL
-$AUTOCONF
-$AUTOMAKE -a
+$AUTOCONF -Wno-obsolete
+$AUTOMAKE -Wno-obsolete -a
 
 # Sanity check: make sure it's ok to set ac_cv_prog_cc_stdc as we do.
 test `grep -c ac_cv_prog_cc_stdc configure` -gt 1
index 33f17dc..bcf99b1 100755 (executable)
@@ -26,5 +26,5 @@ bin_PROGRAMS = hello
 END
 
 $ACLOCAL
-AUTOMAKE_fails -a
+AUTOMAKE_fails -Wno-obsolete -a
 grep AM_C_PROTOTYPES stderr
index 4eb1820..ab78dda 100755 (executable)
@@ -50,8 +50,8 @@ mkdir sub
 cp loadavg.c sub/sub.c
 
 $ACLOCAL
-$AUTOCONF
-$AUTOMAKE --add-missing -Wno-override
+$AUTOCONF -Wno-obsolete
+$AUTOMAKE --add-missing -Wno-override -Wno-obsolete
 
 $FGREP 'loadavg-loadavg$U.o: loadavg$U.c' Makefile.in
 # The following rule should not exist, because the
index 8bbe9b2..9d6fd6e 100755 (executable)
@@ -39,7 +39,7 @@ END
 : > jane.C
 
 $ACLOCAL
-$AUTOMAKE
+$AUTOMAKE -Wno-obsolete
 
 $FGREP 'jane$U' Makefile.in && Exit 1
 $FGREP 'doe$U' Makefile.in
index c06746b..206bca6 100755 (executable)
@@ -45,6 +45,6 @@ END
 : > ansi2knr.c
 
 $ACLOCAL || Exit 1
-$AUTOMAKE || Exit 1
+$AUTOMAKE  -Wno-obsolete || Exit 1
 
 grep 'strsignal_.c:' Makefile.in