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 13:24:29 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.3) Gecko/20030313



Ralf Corsepius wrote:
On Wed, 2003-07-23 at 09:39, Guido Draheim wrote:

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


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;...


Or may-be ..

test -n '$(libs)' && for i in '$(libs)'; do ...

I like that one :-) it's about as short as the current way
to guard against empty lists, but I am sure you meant not
to use single-ticks around the for-in argument, did ye.. ;-)


or
if test -n '$(libs)'; then for ...
else true; fi

I might be wrong, but IIRC automake once had used something similar to
this.


You are wrong, AFAICS, I've looked into automake 1.4-p6 and it's
about the same as the latest incarnation:

## Funny invocation because Makefile variable can be empty, leading to
## a syntax error in sh.
        @list='$(@address@hidden)'; for p in $$list; do \



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 \



Still, I'd vote for a change to pick up another syntax that
does use the resp. make-var as an unquoted item...

-- 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]