2 # Copyright (C) 2011 Free Software Foundation, Inc.
4 # This program is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation; either version 2, or (at your option)
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
14 # You should have received a copy of the GNU General Public License
15 # along with this program. If not, see <http://www.gnu.org/licenses/>.
17 # Check that the use of automatic de-ANSI-fication feature is deprecated.
18 # That feature will be removed in the next major Automake release.
24 warn_rx='automatic de-ANSI-fication.*deprecated'
26 cat >> configure.in <<'END'
33 $AUTOCONF -Wall -Werror -Wno-obsolete
34 $AUTOCONF -Wnone -Wobsolete -Werror 2>stderr && { cat stderr >&2; Exit 1; }
36 grep "^configure\\.in:5:.* AM_C_PROTOTYPES:.*$warn_rx" stderr
38 sed '/AM_C_PROTOTYPES/d' configure.in > config.stub
39 diff configure.in config.stub && fatal_ "failed to edit configure.in"
42 cat > Makefile.stub <<'END'
47 for opt in ansi2knr lib/ansi2knr; do
48 # ansi2knr option in Makefile.am
49 cp config.stub configure.in
50 cp Makefile.stub Makefile.am
51 echo "AUTOMAKE_OPTIONS = $opt" >> Makefile.am
52 cat Makefile.am # For debugging.
53 $AUTOMAKE -Wno-obsolete
55 grep "^Makefile\.am:3:.*$warn_rx" stderr
56 AUTOMAKE_fails -Wnone -Wobsolete
57 grep "^Makefile\.am:3:.*$warn_rx" stderr
58 # ansi2knr option in configure.in
59 cp Makefile.stub Makefile.am
60 sed "s|^\\(AM_INIT_AUTOMAKE\\).*|\1([$opt])|" config.stub > configure.in
61 cat configure.in # For debugging.
62 $AUTOMAKE -Wno-obsolete
64 grep "^configure\.in:2:.*$warn_rx" stderr
65 AUTOMAKE_fails -Wnone -Wobsolete
66 grep "^configure\.in:2:.*$warn_rx" stderr