tests: cosmetic changes in t/extra-sources.sh
[platform/upstream/automake.git] / t / ansi2knr-no-more.sh
1 #! /bin/sh
2 # Copyright (C) 2011-2013 Free Software Foundation, Inc.
3 #
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.
8 #
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.
13 #
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/>.
16
17 # Check that any attempt to use the obsolete de-ANSI-fication support
18 # is diagnosed.
19
20 . test-init.sh
21
22 warn_rx='automatic de-ANSI-fication.*removed'
23
24 echo AC_PROG_CC >> configure.ac
25 $ACLOCAL
26 mv aclocal.m4 aclocal.sav
27 cp configure.ac configure.sav
28
29 echo AM_C_PROTOTYPES >> configure.ac
30
31 $ACLOCAL -Wnone 2>stderr && { cat stderr >&2; exit 1; }
32 cat stderr >&2
33 grep "^configure\\.ac:5:.*$warn_rx" stderr
34
35 cat aclocal.sav "$am_automake_acdir"/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
39
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
55
56 :