1 | #! /bin/sh
|
---|
2 | # Copyright (C) 2004 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 2, 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., 59 Temple Place - Suite 330,
|
---|
19 | # Boston, MA 02111-1307, USA.
|
---|
20 |
|
---|
21 | # Check that installation to directory with spaces succeed.
|
---|
22 | # Report from James Amundson.
|
---|
23 |
|
---|
24 | # This is mostly the same input as nobase.test, but we do not use
|
---|
25 | # libtool libraries, because Libtool does not preserve space in
|
---|
26 | # filenames (Issue observed with ltmain.sh (GNU libtool) 1.5a (1.1323
|
---|
27 | # 2003/11/10 21:06:47))
|
---|
28 |
|
---|
29 |
|
---|
30 | required='gcc'
|
---|
31 | . ./defs || exit 1
|
---|
32 |
|
---|
33 | set -e
|
---|
34 |
|
---|
35 | # Make sure this system supports spaces in filenames.
|
---|
36 | mkdir 'a b' || exit 77
|
---|
37 |
|
---|
38 | cat >> configure.in <<'EOF'
|
---|
39 | AC_PROG_CC
|
---|
40 | AC_PROG_RANLIB
|
---|
41 | AC_OUTPUT
|
---|
42 | EOF
|
---|
43 |
|
---|
44 | cat > Makefile.am << 'EOF'
|
---|
45 | foodir = $(prefix)/foo
|
---|
46 | fooexecdir = $(prefix)/foo
|
---|
47 |
|
---|
48 | foo_HEADERS = sub/base.h
|
---|
49 | nobase_foo_HEADERS = sub/nobase.h
|
---|
50 |
|
---|
51 | dist_foo_DATA = sub/base.dat
|
---|
52 | nobase_dist_foo_DATA = sub/nobase.dat
|
---|
53 |
|
---|
54 | dist_fooexec_SCRIPTS = sub/base.sh
|
---|
55 | nobase_dist_fooexec_SCRIPTS = sub/nobase.sh
|
---|
56 |
|
---|
57 | fooexec_PROGRAMS = sub/base
|
---|
58 | nobase_fooexec_PROGRAMS = sub/nobase
|
---|
59 | sub_base_SOURCES = source.c
|
---|
60 | sub_nobase_SOURCES = source.c
|
---|
61 |
|
---|
62 | fooexec_LIBRARIES = sub/libbase.a
|
---|
63 | nobase_fooexec_LIBRARIES = sub/libnobase.a
|
---|
64 | sub_libbase_a_SOURCES = source.c
|
---|
65 | sub_libnobase_a_SOURCES = source.c
|
---|
66 |
|
---|
67 | test-install-space: install
|
---|
68 | test -f "$(DESTDIR)/more space/foo/sub/nobase.h"
|
---|
69 | test ! -f "$(DESTDIR)/more space/foo/nobase.h"
|
---|
70 | test -f "$(DESTDIR)/more space/foo/base.h"
|
---|
71 | test -f "$(DESTDIR)/more space/foo/sub/nobase.dat"
|
---|
72 | test ! -f "$(DESTDIR)/more space/foo/nobase.dat"
|
---|
73 | test -f "$(DESTDIR)/more space/foo/base.dat"
|
---|
74 | test -f "$(DESTDIR)/more space/foo/sub/nobase.sh"
|
---|
75 | test ! -f "$(DESTDIR)/more space/foo/nobase.sh"
|
---|
76 | test -f "$(DESTDIR)/more space/foo/base.sh"
|
---|
77 | test -f "$(DESTDIR)/more space/foo/sub/nobase$(EXEEXT)"
|
---|
78 | test ! -f "$(DESTDIR)/more space/foo/nobase$(EXEEXT)"
|
---|
79 | test -f "$(DESTDIR)/more space/foo/base$(EXEEXT)"
|
---|
80 | test -f "$(DESTDIR)/more space/foo/sub/libnobase.a"
|
---|
81 | test ! -f "$(DESTDIR)/more space/foo/libnobase.a"
|
---|
82 | test -f "$(DESTDIR)/more space/foo/libbase.a"
|
---|
83 | EOF
|
---|
84 |
|
---|
85 | mkdir sub
|
---|
86 |
|
---|
87 | : > sub/base.h
|
---|
88 | : > sub/nobase.h
|
---|
89 | : > sub/base.dat
|
---|
90 | : > sub/nobase.dat
|
---|
91 | : > sub/base.sh
|
---|
92 | : > sub/nobase.sh
|
---|
93 |
|
---|
94 | cat >source.c <<'EOF'
|
---|
95 | int
|
---|
96 | main (int argc, char *argv[])
|
---|
97 | {
|
---|
98 | return 0;
|
---|
99 | }
|
---|
100 | EOF
|
---|
101 | cp source.c source2.c
|
---|
102 |
|
---|
103 | $ACLOCAL
|
---|
104 | $AUTOCONF
|
---|
105 | $AUTOMAKE -a
|
---|
106 |
|
---|
107 | mkdir build
|
---|
108 | cd build
|
---|
109 |
|
---|
110 | ../configure --prefix '/more space'
|
---|
111 | $MAKE
|
---|
112 | dest=`pwd`/'with space';
|
---|
113 | DESTDIR="$dest" $MAKE -e test-install-space
|
---|