Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Libtool/zsh quoting problem



    Hi David :)

 * David <david@xxxxxxxxxxxx> dixit:
> From some time till now i was having problems compiling certaing
> packages, in particular those ones that used macros in the command
> with spaces in it. I thought it was a libtool problem, but the
> culprit seems zsh ;).

    It's not exactly a "culprit" ;) In fact zsh is behaving
correctly according to the SUS standard, as far as I know. More
below.
 
> A example, with the littlecms source (http://www.littlecms.com):
[Non relevant parts of the command stripped]
> if /bin/sh ../libtool [...] -DPACKAGE_STRING=\"lcms\ 1.15\" 
>  gcc [...] -DPACKAGE_STRING=\"lcms 1.15\" cmscnvrt.c -o .libs/cmscnvrt.o
>  gcc: 1.15": No such file or directory
[...]
> Where -DPACKAGE_STRING=\"lcms 1.15\" in the gcc command should be
> quoted to avoid the error.

    Exactly. If it is not quoted (I mean, with additional double
quotes or something like that), gcc will do the above. The problem is
that libtool may be using some bash-only construct to do the
additional quoting. That's the standard (SUS/POSIX) behaviour: by
default unquoted strings are splitted in spaces.

    But the problem is a bit more subtle ;) Look at the "libtool"
invocation: there, the space is properly quoted with a backslash
that, after that, is lost. The "gcc" invocation no longer has that
backslash.

    This may be a problem in libtool, which is not correctly
propagating that backslash, or in the makefile, which is passing that
backslash to the shell invoking libtool so it is lost (the shell
strips it after processing the command line, so if the same string is
passed, unquoted, to another command (gcc in this case), it is
interpreted as TWO arguments.
 
> Is there any option in zsh to avoid this problem?

    Not that I know of, because I think that SH_WORDSPLIT doesn't
apply here.

    I can investigate (if you want), where the problem lies and why
Bash behaves differently from zsh to see if the culprit is zsh, bash
or libtool. I recently discovered that bash was the culprit because
it violates the standard and I thought that the problem was in zsh
O:)

    Raúl Núñez de Arenas Coronado

-- 
Linux Registered User 88736 | http://www.dervishd.net
http://www.pleyades.net & http://www.gotesdelluna.net
It's my PC and I'll cry if I want to... RAmen!



Messages sorted by: Reverse Date, Date, Thread, Author