* COPYING, lib/COPYING: Update to GPLv3. All uses changed.
[platform/upstream/automake.git] / tests / distcom4.test
1 #! /bin/sh
2 # Copyright (C) 2003, 2006  Free Software Foundation, Inc.
3 #
4 # This file is part of GNU Automake.
5 #
6 # GNU Automake is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 3, or (at your option)
9 # any later version.
10 #
11 # GNU Automake is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 # GNU General Public License for more details.
15 #
16 # You should have received a copy of the GNU General Public License
17 # along with Automake; see the file COPYING.  If not, write to
18 # the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19 # Boston, MA 02110-1301, USA.
20
21 # Test to make sure config files are distributed, and only once.
22 # This tries to distribute a file from a subdirectory, without
23 # Makefile in that directory.  distcom5.test performs the same
24 # test with a Makefile in the directory.
25 # Also make sure that README appears first in DIST_COMMON.
26
27 . ./defs || exit 1
28
29 set -e
30
31 cat >> configure.in << 'END'
32    AC_CONFIG_FILES([tests/autoconf:tests/wrapper.in],
33                    [chmod +x tests/autoconf])
34    AC_CONFIG_FILES([tests/autoheader:tests/wrapper.in],
35                    [chmod +x tests/autoheader])
36    AC_CONFIG_FILES([tests/autom4te:tests/wrapper.in],
37                    [chmod +x tests/autom4te])
38    AC_CONFIG_FILES([tests/autoreconf:tests/wrapper.in],
39                    [chmod +x tests/autoreconf])
40    AC_CONFIG_FILES([tests/autoscan:tests/wrapper.in],
41                    [chmod +x tests/autoscan])
42    AC_CONFIG_FILES([tests/autoupdate:tests/wrapper.in],
43                    [chmod +x tests/autoupdate])
44    AC_CONFIG_FILES([tests/ifnames:tests/wrapper.in],
45                    [chmod +x tests/ifnames])
46    AC_OUTPUT
47 END
48
49 mkdir tests
50 : > README
51 : > tests/wrapper.in
52 cat > Makefile.am << 'END'
53 test: distdir
54         test -f $(distdir)/tests/wrapper.in
55 END
56
57 $ACLOCAL
58 $AUTOCONF
59 $AUTOMAKE --add-missing
60 ./configure
61 $MAKE test
62
63 sed -n -e '/^DIST_COMMON =.*\\$/ {
64    :loop
65    p
66    n
67    t clear
68    :clear
69    s/\\$/\\/
70    t loop
71    p
72    n
73    }' -e '/^DIST_COMMON =/ p' Makefile.in > dc.txt
74
75 test 1 = `grep tests dc.txt | wc -l`
76 grep configure dc.txt
77 # README must come first.
78 grep 'DIST_COMMON = README' Makefile.in