readme: fixlets to HACKING
[automake.git] / t / distcom4.sh
blob400533c27ab05b682ab2c0dc8443838b9b7d39d6
1 #! /bin/sh
2 # Copyright (C) 2003-2012 Free Software Foundation, Inc.
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.
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.
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/>.
17 # Test to make sure config files are distributed, and only once.
18 # This tries to distribute a file from a subdirectory, without
19 # Makefile in that directory. distcom5.test performs the same
20 # test with a Makefile in the directory.
21 # Also make sure that README appears first in DIST_COMMON.
23 . ./defs || exit 1
25 cat >> configure.ac << 'END'
26 AC_CONFIG_FILES([tests/autoconf:tests/wrapper.in],
27 [chmod +x tests/autoconf])
28 AC_CONFIG_FILES([tests/autoheader:tests/wrapper.in],
29 [chmod +x tests/autoheader])
30 AC_CONFIG_FILES([tests/autom4te:tests/wrapper.in],
31 [chmod +x tests/autom4te])
32 AC_CONFIG_FILES([tests/autoreconf:tests/wrapper.in],
33 [chmod +x tests/autoreconf])
34 AC_CONFIG_FILES([tests/autoscan:tests/wrapper.in],
35 [chmod +x tests/autoscan])
36 AC_CONFIG_FILES([tests/autoupdate:tests/wrapper.in],
37 [chmod +x tests/autoupdate])
38 AC_CONFIG_FILES([tests/ifnames:tests/wrapper.in],
39 [chmod +x tests/ifnames])
40 AC_OUTPUT
41 END
43 mkdir tests
44 : > README
45 : > tests/wrapper.in
46 cat > Makefile.am << 'END'
47 .PHONY: test
48 test: distdir
49 test -f $(distdir)/tests/wrapper.in
50 END
52 $ACLOCAL
53 $AUTOCONF
54 $AUTOMAKE --add-missing
55 ./configure
56 $MAKE test
58 sed -n -e '/^DIST_COMMON =.*\\$/ {
59 :loop
62 t clear
63 :clear
64 s/\\$/\\/
65 t loop
68 }' -e '/^DIST_COMMON =/ p' Makefile.in > dc.txt
70 cat dc.txt # For debugging.
72 test 1 -eq $(grep -c tests dc.txt)
73 grep configure dc.txt
74 # README must come first.
75 grep 'DIST_COMMON = README' Makefile.in