Merge branch 'maint'
[platform/upstream/automake.git] / tests / stamph2.test
1 #! /bin/sh
2 # Copyright (C) 2001, 2002, 2003, 2010, 2011 Free Software Foundation,
3 # Inc.
4 #
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 2, or (at your option)
8 # any later version.
9 #
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 # GNU General Public License for more details.
14 #
15 # You should have received a copy of the GNU General Public License
16 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
17
18 # Make sure stamp-h* files are created where we expect
19 . ./defs || Exit 1
20
21 cat >> configure.in << END
22 AM_CONFIG_HEADER([1.h
23                   2.h:config.hin
24                   3.h:sdir1/config1.hin])
25 # AM_CONFIG_HEADER and AC_CONFIG_HEADERS should be synonyms.
26 AC_CONFIG_HEADERS([sdir1/4.h
27                    sdir1/5.h:config.hin
28                    sdir1/6.h:sdir1/config1.hin
29                    sdir1/7.h:sdir2/config2.hin])
30 AC_OUTPUT
31 END
32
33 : > Makefile.am
34 mkdir sdir1
35 mkdir sdir2
36 : > config.hin
37 : > 1.h.in
38 : > sdir1/4.h.in
39 : > sdir1/config1.hin
40 : > sdir2/config2.hin
41
42 $ACLOCAL
43 $AUTOCONF
44 $AUTOMAKE
45 ./configure
46
47 test -f stamp-h1
48 test -f stamp-h2
49 test -f stamp-h3
50 test -f sdir1/stamp-h4
51 test -f sdir1/stamp-h5
52 test -f sdir1/stamp-h6
53 test -f sdir1/stamp-h7
54
55 # Make sure `./config.status foo' creates the right stamp file.
56 # Report from Sander Niemeijer.
57
58 rm -f stamp-h*
59 rm -f sdir1/stamp-h*
60
61 ./config.status sdir1/7.h 2.h sdir1/4.h
62 test ! -f stamp-h1
63 test -f stamp-h2
64 test ! -f stamp-h3
65 test -f sdir1/stamp-h4
66 test ! -f sdir1/stamp-h5
67 test ! -f sdir1/stamp-h6
68 test -f sdir1/stamp-h7
69
70 :