2 # Copyright (C) 2004, 2005, 2011 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)
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 # Check that installation to directory with shell metacharacters succeed.
18 # Original report from James Amundson about file names with spaces.
19 # Other characters added by Paul Eggert.
21 # This is mostly the same input as nobase.test, but we do not use
22 # libtool libraries, because Libtool does not preserve space in
23 # file names (Issue observed with ltmain.sh (GNU libtool) 1.5a (1.1323
24 # 2003/11/10 21:06:47))
32 # Set up files that won't change each time through the loop.
34 cat >> configure.in <<'EOF'
52 main (int argc, char **argv)
59 cat > Makefile.am << 'EOF'
60 foodir = $(prefix)/foo
61 fooexecdir = $(prefix)/foo
63 foo_HEADERS = sub/base.h
64 nobase_foo_HEADERS = sub/nobase.h
66 dist_foo_DATA = sub/base.dat
67 nobase_dist_foo_DATA = sub/nobase.dat
69 dist_fooexec_SCRIPTS = sub/base.sh
70 nobase_dist_fooexec_SCRIPTS = sub/nobase.sh
72 fooexec_PROGRAMS = sub/base
73 nobase_fooexec_PROGRAMS = sub/nobase
74 sub_base_SOURCES = source.c
75 sub_nobase_SOURCES = source.c
77 fooexec_LIBRARIES = sub/libbase.a
78 nobase_fooexec_LIBRARIES = sub/libnobase.a
79 sub_libbase_a_SOURCES = source.c
80 sub_libnobase_a_SOURCES = source.c
82 test-install-sep: install
83 test -f '$(DESTDIR)/$(file)-prefix/foo/sub/nobase.h'
84 test ! -f '$(DESTDIR)/$(file)-prefix/foo/nobase.h'
85 test -f '$(DESTDIR)/$(file)-prefix/foo/base.h'
86 test -f '$(DESTDIR)/$(file)-prefix/foo/sub/nobase.dat'
87 test ! -f '$(DESTDIR)/$(file)-prefix/foo/nobase.dat'
88 test -f '$(DESTDIR)/$(file)-prefix/foo/base.dat'
89 test -f '$(DESTDIR)/$(file)-prefix/foo/sub/nobase.sh'
90 test ! -f '$(DESTDIR)/$(file)-prefix/foo/nobase.sh'
91 test -f '$(DESTDIR)/$(file)-prefix/foo/base.sh'
92 test -f '$(DESTDIR)/$(file)-prefix/foo/sub/nobase$(EXEEXT)'
93 test ! -f '$(DESTDIR)/$(file)-prefix/foo/nobase$(EXEEXT)'
94 test -f '$(DESTDIR)/$(file)-prefix/foo/base$(EXEEXT)'
95 test -f '$(DESTDIR)/$(file)-prefix/foo/sub/libnobase.a'
96 test ! -f '$(DESTDIR)/$(file)-prefix/foo/libnobase.a'
97 test -f '$(DESTDIR)/$(file)-prefix/foo/libbase.a'
104 # Some control characters that are white space:
105 # back space, carriage return, form feed, horizontal tab, line feed, space
118 '!' '"' '#' '$' '%' '&' \' '(' ')' '*' '+' ',' '-' ':' ';' \
119 '<' '=' '>' '?' '@' '[' '\' ']' '^' '`' '{' '|' '}' '~' \
120 "$bs" "$cr" "$ff" "$ht" "$lf" "$sp" \
121 '@<:@' '@:>@' '@S|@' '@%:@' '@&t@' \
122 "a${sp}b" "a${sp}${sp}b" "a${lf}b" ... a:
124 for test in build install; do
134 # Make sure this system supports this character in file names.
135 mkdir sub1 "./$file" || Exit 77
139 # Some make implementations eliminate leading and trailing whitespace
140 # from macros passed on the command line, and some eliminate leading
141 # whitespace from macros set from environment variables, so prepend
142 # './' and use the latter here.
143 ../configure --prefix "/$file-prefix" &&
145 DESTDIR=$dest file=./$file $MAKE -e test-install-sep ||
146 eval "${test}_failures=\"\$${test}_failures$lf\$file\""
150 rm -fr sub1 "./$file"
154 # The list of the above file names that cannot be used as a build directory
155 # on a POSIX host. This list should be empty, but is not due to limitations
156 # in Autoconf, Automake, Make, M4, or the shell.
157 expected_build_failures='
169 # Similarly, the list of file names that cannot be used as an install directory
170 # on a POSIX host. This list should also be empty.
171 expected_install_failures='
181 for test in build install; do
182 eval failures=\$${test}_failures
186 $0: $test test failed for the following file names:$failures
188 eval test \"\$failures\" = \"\$expected_${test}_failures\" || fail=1