cosmetics: remove trailing whitespace in some files
[platform/upstream/automake.git] / t / aminit-moreargs-no-more.sh
1 #! /bin/sh
2 # Copyright (C) 2012 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 automake error out (with an helpful error message) against
18 # old-style usages of AM_INIT_AUTOMAKE (i.e., calls with two or three
19 # arguments).
20
21 . ./defs || Exit 1
22
23 warn_rx='AM_INIT_AUTOMAKE.* old-style two-.* three-arguments form.*unsupported'
24
25 $ACLOCAL
26 mv aclocal.m4 aclocal.sav
27
28 cat > configure.ac <<'END'
29 AC_INIT([Makefile.am])
30 AM_INIT_AUTOMAKE([twoargs], [1.0])
31 AC_CONFIG_FILES([Makefile])
32 END
33
34 do_check()
35 {
36   rm -rf autom4te*.cache
37   for cmd in "$ACLOCAL" "$AUTOCONF" "$AUTOMAKE"; do
38     cp aclocal.sav aclocal.m4
39     $cmd -Wnone -Wno-error 2>stderr && { cat stderr; Exit 1; }
40     cat stderr >&2
41     grep "^configure\.ac:2:.*$warn_rx" stderr
42   done
43 }
44
45 : > Makefile.am
46 do_check
47
48 sed "/^AM_INIT_AUTOMAKE/s|)$|, [NODEFINE])|" configure.ac > t
49 diff configure.ac t && fatal_ "failed to edit configure.ac"
50 mv -f t configure.ac
51 do_check
52
53 :