Merge branch 'msvc' into maint
[platform/upstream/automake.git] / tests / conffile-leading-dot.test
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 # Automake must complain if AC_CONFIG_FILES is passed something starting
18 # with a dot (like "./Makefile"), since the remake rules might be subtly
19 # broken in that case.
20
21 required=GNUmake
22 . ./defs || Exit 1
23
24 set -e
25
26 cat > configure.in << END
27 AC_INIT([$me], [1.0])
28 AM_INIT_AUTOMAKE
29 AC_CONFIG_FILES([./Makefile])
30 AC_CONFIG_FILES([./foo:a.in:b.in:c.in])
31 AC_OUTPUT
32 END
33
34 echo foo = barbarbar > Makefile.am
35
36 touch a.in b.in c.in
37
38 $ACLOCAL
39
40 AUTOMAKE_fails -Wnone -Wunsupported
41 grep "^configure\.in:3:.*'\\./Makefile'" stderr
42 grep "^configure\.in:3:.* omit leading '\\./'" stderr
43 grep "^configure\.in:3:.*remake rules might be subtly broken" stderr
44 grep "^configure\.in:4:.*'\\./foo'" stderr
45 grep "^configure\.in:4:.* omit leading '\\./'" stderr
46 grep "^configure\.in:4:.*remake rules might be subtly broken" stderr
47
48 # Check that our warning was actually justified.
49 $AUTOCONF
50 $AUTOMAKE -Wall -Wno-unsupported
51 ./configure
52 $MAKE
53 grep barbarbar Makefile
54 # No need to sleep here, configure did that for us already.
55 echo foo = bazbazbaz > Makefile.am
56 # Check that remake rules do truly break -- otherwise automake is
57 # giving a bogus warning.
58 $MAKE 2>stderr && { cat stderr >&2 Exit 1; }
59 cat stderr >&2
60 grep "config\\.status:.*invalid argument.*[\`\"']Makefile[\`\"']" stderr
61
62 :