automake
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Filenames containing blanks


From: Guido Draheim
Subject: Re: Filenames containing blanks
Date: Wed, 23 Jul 2003 09:39:22 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.3) Gecko/20030313



Ralf Corsepius wrote:
Hi,

Simple question: Does automake support filenames containing blanks?

I fear, the answer is no:

# cat Makefile.am:
data_DATA = foo\ 1

# make DESTDIR=/tmp install
..
/bin/sh ./mkinstalldirs /tmp/usr/local/share
mkdir -p -- /tmp/usr/local/share
 /usr/bin/install -c -m 644 ./foo\ /tmp/usr/local/share/foo\
/usr/bin/install: cannot stat `./foo\\': No such file or directory
 /usr/bin/install -c -m 644 ./1 /tmp/usr/local/share/1
/usr/bin/install: cannot stat `./1': No such file or directory
make[1]: *** [install-dist_dataDATA] Error 1
..

Either I must be missing something (May-be I am quoting the blank
incorrectly?) or something is broken ...


# this is what we might expect...
$ for i in hello\ 1 2 ; do echo $i ; done
hello 1
2

# this is what is done for real...
v='hello\ 1 2' ; for i in $v ; do echo $i ; done
hello\
1
2

# changing any quotes does not help...
$ v='hello\ 1 2' ; for i in "$v" ; do echo $i ; done
hello\ 1 2
$ v="hello\ 1 2" ; for i in "$v" ; do echo $i ; done
hello\ 1 2
$ v="hello\ 1 2" ; for i in $v ; do echo $i ; done
hello\
1
2

the assignment to a variable before for-in might have
been introduced to avoid problems with an empty list
which results in a syntax error on some platforms
(try `for i in; do`) but I've seen other solutions that
work just as well, like
for i in $(libs) : ; test "$$i" != ":" || continue;...

Ooops, I just had a look into am/data.am, and there is
the very comment which I've just guessed above:
## Funny invocation because Makefile variable can be empty, leading to
## a syntax error in sh.
        @list='$(%DIR%_%PRIMARY%)'; for p in $$list; do \

cheers,
-- guido                                  http://google.de/search?q=guidod
GCS/E/S/P C++/++++$ ULHS L++w- N++@ d(+-) s+a- r+@>+++ y++ 5++X- (geekcode)





reply via email to

[Prev in Thread] Current Thread [Next in Thread]