+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
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'
* 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
@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}
$(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:
@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
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}).
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
* 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
@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
@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}
}
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.
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
ammissing.test \
amopt.test \
amsubst.test \
+ansi2knr-deprecation.test \
ansi.test \
ansi2.test \
ansi3.test \
ammissing.test \
amopt.test \
amsubst.test \
+ansi2knr-deprecation.test \
ansi.test \
ansi2.test \
ansi3.test \
: > ansi2knr.1
$ACLOCAL
-$AUTOCONF
-$AUTOMAKE
+$AUTOCONF -Wno-obsolete
+$AUTOMAKE -Wno-obsolete
./configure
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
: > ansi2knr.1
$ACLOCAL
-$AUTOMAKE
+$AUTOMAKE -Wno-obsolete
grep '^all[-a-z]*:.*ANSI2KNR' Makefile.in
--- /dev/null
+#! /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
+
+:
# 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
# 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
: > hello.c
$ACLOCAL
-$AUTOMAKE
+$AUTOMAKE -Wno-obsolete
$FGREP 'ansi2knr.$(' Makefile.in
set -e
$ACLOCAL
-$AUTOCONF
-$AUTOMAKE -a
+$AUTOCONF -Wno-obsolete
+$AUTOMAKE -Wno-obsolete -a
# Ignore user CFLAGS.
CFLAGS=
export CFLAGS
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
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
END
$ACLOCAL
-AUTOMAKE_fails -a
+AUTOMAKE_fails -Wno-obsolete -a
grep AM_C_PROTOTYPES stderr
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
: > jane.C
$ACLOCAL
-$AUTOMAKE
+$AUTOMAKE -Wno-obsolete
$FGREP 'jane$U' Makefile.in && Exit 1
$FGREP 'doe$U' Makefile.in
: > ansi2knr.c
$ACLOCAL || Exit 1
-$AUTOMAKE || Exit 1
+$AUTOMAKE -Wno-obsolete || Exit 1
grep 'strsignal_.c:' Makefile.in