Reword the copyright notices to match what's suggested in GPLv3.
[platform/upstream/automake.git] / tests / fn99subdir.test
1 #! /bin/sh
2 # Copyright (C) 2006  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 3, 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 # PR 507: Check the filename-length-max=99 option
18 # in conjunction with AC_CONFIG_SUBDIRS.
19
20 . ./defs || exit 1
21
22 set -e
23
24 # The name is so that 99 is exactly hit (including final \0).
25 subdirname='cnfsubdir'
26
27 cat >>configure.in <<END
28 AC_CONFIG_SUBDIRS([${subdirname}])
29 AC_OUTPUT
30 END
31
32 cat >Makefile.am <<END
33 AUTOMAKE_OPTIONS = filename-length-max=99
34 SUBDIRS = ${subdirname}
35 END
36
37 mkdir ${subdirname} || exit 1
38
39 cat >> ${subdirname}/configure.in <<EOF
40 AC_INIT([${subdirname}], [1.0])
41 AM_INIT_AUTOMAKE
42 AC_CONFIG_FILES([Makefile])
43 AC_OUTPUT
44 EOF
45
46 cat >${subdirname}/Makefile.am <<'END'
47 AUTOMAKE_OPTIONS = filename-length-max=99
48 EXTRA_DIST = 12345678
49 END
50
51 (cd ${subdirname}; for i in 1 2 3 4 5 6 7 8
52 do
53   mkdir -p 12345678 || exit 77
54   cd 12345678
55   touch x
56 done)
57
58 for init_dir in ${subdirname} .; do
59         (
60                 cd ${init_dir} || exit 1
61                 $ACLOCAL
62                 $AUTOCONF
63                 $AUTOMAKE
64         ) || exit 1
65 done
66 ./configure
67 $MAKE distcheck
68
69 (cd ${subdirname}; for i in 1 2 3 4 5 6 7 8 9
70 do
71   mkdir -p 12345678 || exit 77
72   cd 12345678
73   touch x
74 done)
75
76 $MAKE dist 2>stderr && exit 1
77 cat stderr
78 grep 'filenames are too long' stderr
79 test 1 = `grep 12345678 stderr | wc -l`
80 :