automake-patches
[Top][All Lists]
Advanced

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

[PATCH] {maint} Deprecate de-ansification support, it should go away in


From: Stefano Lattarini
Subject: [PATCH] {maint} Deprecate de-ansification support, it should go away in automake 1.12
Date: Tue, 14 Jun 2011 13:10:04 +0200
User-agent: KMail/1.13.3 (Linux/2.6.30-2-686; KDE/4.4.4; i686; ; )

Hello automakers.

I recall that we agreed, in an older thread I can't find anymore, that
the support for the automatic de-ANSI-fication features should be removed
in the next major Automake release (1.12).  The attached patch, for
maint, makes the first step in that direction, by deprecating the feature
both in the manual and by means of automake/autoconf warnings (in the
`obsolete' category).  Ideally, this change should end up into 1.11.2,
so that any "unlikely user" still using de-ANSI-fication support will be
given adequate notice about the oncoming removal.

Note that, in the manual, the de-ANSI-fication features are now declared
as "deprecated", not simply "obsoleted"; according to wikipedia entry
<http://en.wikipedia.org/wiki/Deprecation>, this seems the right thing
to do now that we plan to remove such features in the next major release.

I will push in 72 hours if there is no review nor objection by then.

Regards,
  Stefano
From 62c375d292b22ff206f85336ab7783719868d0f0 Mon Sep 17 00:00:00 2001
Message-Id: <address@hidden>
From: Stefano Lattarini <address@hidden>
Date: Tue, 14 Jun 2011 12:52:45 +0200
Subject: [PATCH] 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.
---
 ChangeLog                       |   32 +++++++++++++++---
 NEWS                            |    5 +++
 doc/automake.texi               |   57 ++++++++++++++-----------------
 lib/Automake/Options.pm         |    4 ++
 m4/protos.m4                    |    2 +
 tests/Makefile.am               |    1 +
 tests/Makefile.in               |    1 +
 tests/ansi.test                 |    4 +-
 tests/ansi10.test               |    4 +-
 tests/ansi2.test                |    2 +-
 tests/ansi2knr-deprecation.test |   69 +++++++++++++++++++++++++++++++++++++++
 tests/ansi3.test                |    4 +-
 tests/ansi3b.test               |    4 +-
 tests/ansi4.test                |    2 +-
 tests/ansi5.test                |    4 +-
 tests/ansi6.test                |    4 +-
 tests/ansi7.test                |    4 +-
 tests/ansi8.test                |    2 +-
 tests/ansi9.test                |    4 +-
 tests/cxxansi.test              |    2 +-
 tests/libobj8.test              |    2 +-
 21 files changed, 156 insertions(+), 57 deletions(-)
 create mode 100755 tests/ansi2knr-deprecation.test

diff --git a/ChangeLog b/ChangeLog
index e7219e3..d4bf641 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,9 +1,31 @@
-2011-06-13  Stefano Lattarini  <address@hidden>
-
-       ansi2knr: deprecate it
-       * doc/automake.texi:
-       * automake.in (): XXX -Wobsolete
-       * tests/ansi2knr-is-deprecated.test: New
+2011-06-14  Stefano Lattarini  <address@hidden>
+
+       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-10  Stefano Lattarini  <address@hidden>
 
diff --git a/NEWS b/NEWS
index 299ae00..2338884 100644
--- 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 version (1.12).
+
 * Miscellaneous changes:
 
   - The `lzma' compression scheme and associated automake option `dist-lzma'
diff --git a/doc/automake.texi b/doc/automake.texi
index e30266c..dcd0c9b 100644
--- a/doc/automake.texi
+++ b/doc/automake.texi
@@ -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
address@hidden).
+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:
-
address@hidden
-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
address@hidden 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
address@hidden (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
address@hidden
+This is required when using the deprecated de-ANSI-fication feature; see
address@hidden  @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
address@hidden and @code{ANSI2KNR} to @samp{./ansi2knr}.  Automake uses these
-values to implement the obsolete de-ANSI-fication feature.
address@hidden 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
address@hidden Automatic de-ANSI-fication
address@hidden 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.
address@hidden 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 @address@hidden/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}
diff --git a/lib/Automake/Options.pm b/lib/Automake/Options.pm
index 9543aa5..b7ff3d1 100644
--- a/lib/Automake/Options.pm
+++ b/lib/Automake/Options.pm
@@ -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.
diff --git a/m4/protos.m4 b/m4/protos.m4
index 427193b..f710293 100644
--- a/m4/protos.m4
+++ b/m4/protos.m4
@@ -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
diff --git a/tests/Makefile.am b/tests/Makefile.am
index bd3f99c..28196f8 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -89,6 +89,7 @@ amassign.test \
 ammissing.test \
 amopt.test \
 amsubst.test \
+ansi2knr-deprecation.test \
 ansi.test \
 ansi2.test \
 ansi3.test \
diff --git a/tests/Makefile.in b/tests/Makefile.in
index b810963..5ca3f6a 100644
--- a/tests/Makefile.in
+++ b/tests/Makefile.in
@@ -360,6 +360,7 @@ amassign.test \
 ammissing.test \
 amopt.test \
 amsubst.test \
+ansi2knr-deprecation.test \
 ansi.test \
 ansi2.test \
 ansi3.test \
diff --git a/tests/ansi.test b/tests/ansi.test
index 7795f48..0aa000e 100755
--- a/tests/ansi.test
+++ b/tests/ansi.test
@@ -42,8 +42,8 @@ END
 : > ansi2knr.1
 
 $ACLOCAL
-$AUTOCONF
-$AUTOMAKE
+$AUTOCONF -Wno-obsolete
+$AUTOMAKE -Wno-obsolete
 
 ./configure
 
diff --git a/tests/ansi10.test b/tests/ansi10.test
index 88b8618..4ff2c86 100755
--- a/tests/ansi10.test
+++ b/tests/ansi10.test
@@ -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
diff --git a/tests/ansi2.test b/tests/ansi2.test
index 77ca2c6..504c8c3 100755
--- a/tests/ansi2.test
+++ b/tests/ansi2.test
@@ -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
index 0000000..543d9c6
--- /dev/null
+++ b/tests/ansi2knr-deprecation.test
@@ -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
+
+:
diff --git a/tests/ansi3.test b/tests/ansi3.test
index e1e0c42..22ef485 100755
--- a/tests/ansi3.test
+++ b/tests/ansi3.test
@@ -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
diff --git a/tests/ansi3b.test b/tests/ansi3b.test
index ad222ff..0688781 100755
--- a/tests/ansi3b.test
+++ b/tests/ansi3b.test
@@ -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
diff --git a/tests/ansi4.test b/tests/ansi4.test
index 63250a9..0c0d339 100755
--- a/tests/ansi4.test
+++ b/tests/ansi4.test
@@ -37,6 +37,6 @@ END
 : > hello.c
 
 $ACLOCAL
-$AUTOMAKE
+$AUTOMAKE -Wno-obsolete
 
 $FGREP 'ansi2knr.$(' Makefile.in
diff --git a/tests/ansi5.test b/tests/ansi5.test
index 2652cb7..d152be0 100755
--- a/tests/ansi5.test
+++ b/tests/ansi5.test
@@ -66,8 +66,8 @@ END
 set -e
 
 $ACLOCAL
-$AUTOCONF
-$AUTOMAKE -a
+$AUTOCONF -Wno-obsolete
+$AUTOMAKE -Wno-obsolete -a
 # Ignore user CFLAGS.
 CFLAGS=
 export CFLAGS
diff --git a/tests/ansi6.test b/tests/ansi6.test
index 10196ea..691614d 100755
--- a/tests/ansi6.test
+++ b/tests/ansi6.test
@@ -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
diff --git a/tests/ansi7.test b/tests/ansi7.test
index e97f517..9eae26b 100755
--- a/tests/ansi7.test
+++ b/tests/ansi7.test
@@ -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
diff --git a/tests/ansi8.test b/tests/ansi8.test
index 33f17dc..bcf99b1 100755
--- a/tests/ansi8.test
+++ b/tests/ansi8.test
@@ -26,5 +26,5 @@ bin_PROGRAMS = hello
 END
 
 $ACLOCAL
-AUTOMAKE_fails -a
+AUTOMAKE_fails -Wno-obsolete -a
 grep AM_C_PROTOTYPES stderr
diff --git a/tests/ansi9.test b/tests/ansi9.test
index 4eb1820..ab78dda 100755
--- a/tests/ansi9.test
+++ b/tests/ansi9.test
@@ -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
diff --git a/tests/cxxansi.test b/tests/cxxansi.test
index 8bbe9b2..9d6fd6e 100755
--- a/tests/cxxansi.test
+++ b/tests/cxxansi.test
@@ -39,7 +39,7 @@ END
 : > jane.C
 
 $ACLOCAL
-$AUTOMAKE
+$AUTOMAKE -Wno-obsolete
 
 $FGREP 'jane$U' Makefile.in && Exit 1
 $FGREP 'doe$U' Makefile.in
diff --git a/tests/libobj8.test b/tests/libobj8.test
index c06746b..206bca6 100755
--- a/tests/libobj8.test
+++ b/tests/libobj8.test
@@ -45,6 +45,6 @@ END
 : > ansi2knr.c
 
 $ACLOCAL || Exit 1
-$AUTOMAKE || Exit 1
+$AUTOMAKE  -Wno-obsolete || Exit 1
 
 grep 'strsignal_.c:' Makefile.in
-- 
1.7.2.3


reply via email to

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