[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-trivial] [PATCH] Quote extra_cflags in config-host.mak
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-trivial] [PATCH] Quote extra_cflags in config-host.mak |
Date: |
Wed, 11 Sep 2013 16:53:35 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130805 Thunderbird/17.0.8 |
Il 11/09/2013 16:42, Gabriel Kerneis ha scritto:
> On Wed, Sep 11, 2013 at 04:01:50PM +0200, Paolo Bonzini wrote:
>>> ./configure --extra-cflags="-Dcoroutine_fn='__attribute__((coroutine_fn))'"
>>
>> Where does the shell read config-host.mak? Make does not need the quotes.
>
> I might have been confused about the shell vs. make interpreting the
> string, but I am positive that without the patch, the following fails:
>
> mkdir bin/test
> cd bin/test
> ../../configure \
> --extra-cflags="-Dcoroutine_fn='__attribute__((coroutine_fn))' -w"
> make tests/test-coroutine
> touch ../../configure
> make tests/test-coroutine
>
> with the following error message:
>
> config-host.mak is out-of-date, running configure
> sh: 1: Syntax error: "(" unexpected
> make: *** [config-host.mak] Error 2
>
> My patch fixes this issue.
Oh, then it's this line in configure that has to be changed to do proper
quoting.
printf "# Configured with:" >> $config_host_mak
printf " '%s'" "$0" "$@" >> $config_host_mak
Something like
for arg in "$0" "$@"; do
quoted_arg=$(echo "$i" | sed 's/[$\\"]/\\&/g')
printf ' "%s"' "$quoted_arg"
done >> $config_host_mak
could replace the second line. Adding Eric Blake in case he knows some
extra trick.
Paolo
- [Qemu-trivial] [PATCH] Quote extra_cflags in config-host.mak, Gabriel Kerneis, 2013/09/11
- Re: [Qemu-trivial] [PATCH] Quote extra_cflags in config-host.mak, Paolo Bonzini, 2013/09/11
- Re: [Qemu-trivial] [PATCH] Quote extra_cflags in config-host.mak, Gabriel Kerneis, 2013/09/11
- Re: [Qemu-trivial] [PATCH] Quote extra_cflags in config-host.mak,
Paolo Bonzini <=
- Re: [Qemu-trivial] [PATCH] Quote extra_cflags in config-host.mak, Gabriel Kerneis, 2013/09/11
- Re: [Qemu-trivial] [PATCH] Quote extra_cflags in config-host.mak, Paolo Bonzini, 2013/09/11
- Re: [Qemu-trivial] [Qemu-devel] [PATCH] Quote extra_cflags in config-host.mak, Gabriel Kerneis, 2013/09/11
- Re: [Qemu-trivial] [Qemu-devel] [PATCH] Quote extra_cflags in config-host.mak, Gabriel Kerneis, 2013/09/11
- Re: [Qemu-trivial] [Qemu-devel] [PATCH] Quote extra_cflags in config-host.mak, Paolo Bonzini, 2013/09/11
- Re: [Qemu-trivial] [Qemu-devel] [PATCH] Quote extra_cflags in config-host.mak, Gabriel Kerneis, 2013/09/11
- Re: [Qemu-trivial] [PATCH] Quote extra_cflags in config-host.mak, Eric Blake, 2013/09/11