maint: Update HACKING
[automake.git] / t / ansi2knr-no-more.sh
bloba3436750c34ae01f9abc1cbdb4bac3138800367e
1 #! /bin/sh
2 # Copyright (C) 2011-2017 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)
7 # any later version.
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 <https://www.gnu.org/licenses/>.
17 # Check that any attempt to use the obsolete de-ANSI-fication support
18 # is diagnosed.
20 . test-init.sh
22 warn_rx='automatic de-ANSI-fication.*removed'
24 echo AC_PROG_CC >> configure.ac
25 $ACLOCAL
26 mv aclocal.m4 aclocal.sav
27 cp configure.ac configure.sav
29 echo AM_C_PROTOTYPES >> configure.ac
31 $ACLOCAL -Wnone 2>stderr && { cat stderr >&2; exit 1; }
32 cat stderr >&2
33 grep "^configure\\.ac:5:.*$warn_rx" stderr
35 cat aclocal.sav "$am_top_srcdir"/m4/obsolete.m4 > aclocal.m4
36 $AUTOCONF -Wnone 2>stderr && { cat stderr >&2; exit 1; }
37 cat stderr >&2
38 grep "^configure\\.ac:5:.*$warn_rx" stderr
40 for opt in ansi2knr lib/ansi2knr; do
41 # ansi2knr option in Makefile.am
42 cp configure.sav configure.ac
43 echo "AUTOMAKE_OPTIONS = $opt" > Makefile.am
44 rm -rf autom4te*.cache
45 AUTOMAKE_fails -Wnone
46 grep "^Makefile\.am:1:.*$warn_rx" stderr
47 # ansi2knr option in configure.ac
48 : > Makefile.am
49 sed "s|^\\(AM_INIT_AUTOMAKE\\).*|\1([$opt])|" configure.sav >configure.ac
50 cat configure.ac # For debugging.
51 rm -rf autom4te*.cache
52 AUTOMAKE_fails -Wnone
53 grep "^configure\\.ac:2:.*$warn_rx" stderr
54 done