2 # Copyright (C) 2006, 2008 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 3, or (at your option)
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 # PR 507: Check the filename-length-max=99 option
18 # in conjunction with AC_CONFIG_SUBDIRS.
24 # The name is so that 99 is exactly hit (including final \0).
25 subdirname
='cnfsubdir'
27 cat >>configure.
in <<END
28 AC_CONFIG_SUBDIRS([${subdirname}])
32 cat >Makefile.am
<<END
33 AUTOMAKE_OPTIONS = filename-length-max=99
34 SUBDIRS = ${subdirname}
37 mkdir
${subdirname} || Exit
1
39 cat >> ${subdirname}/configure.
in <<EOF
40 AC_INIT([${subdirname}], [1.0])
42 AC_CONFIG_FILES([Makefile])
46 cat >${subdirname}/Makefile.am
<<'END'
47 AUTOMAKE_OPTIONS = filename-length-max=99
51 (cd ${subdirname}; for i
in 1 2 3 4 5 6 7 8
53 mkdir
-p 12345678 || Exit
77
58 for init_dir
in ${subdirname} .
; do
60 cd ${init_dir} || Exit
1
69 (cd ${subdirname}; for i
in 1 2 3 4 5 6 7 8 9
71 mkdir
-p 12345678 || Exit
77
76 $MAKE dist
2>stderr
&& { cat stderr
>&2; Exit
1; }
78 grep 'filenames are too long' stderr
79 test 1 = `grep 12345678 stderr | wc -l`