qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Gabriel Kerneis <gabriel@kerneis.info>
Cc: qemu-trivial@nongnu.org, Peter Maydell <peter.maydell@linaro.org>,
	qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] Quote extra_cflags in config-host.mak
Date: Wed, 11 Sep 2013 16:53:35 +0200	[thread overview]
Message-ID: <523083EF.7050203@redhat.com> (raw)
In-Reply-To: <20130911144230.GA15227@kerneis.info>

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

  reply	other threads:[~2013-09-11 14:53 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-11 13:41 [Qemu-devel] [PATCH] Quote extra_cflags in config-host.mak Gabriel Kerneis
2013-09-11 14:01 ` Paolo Bonzini
2013-09-11 14:42   ` Gabriel Kerneis
2013-09-11 14:53     ` Paolo Bonzini [this message]
2013-09-11 15:01       ` Gabriel Kerneis
2013-09-11 15:06         ` Paolo Bonzini
2013-09-11 15:16           ` Gabriel Kerneis
2013-09-11 15:23             ` Gabriel Kerneis
2013-09-11 15:29               ` Paolo Bonzini
2013-09-11 15:14         ` Gabriel Kerneis
2013-09-11 15:55       ` Eric Blake

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=523083EF.7050203@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=gabriel@kerneis.info \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-trivial@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).