qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Gabriel Kerneis <gabriel@kerneis.info>
To: qemu-devel@nongnu.org
Cc: qemu-trivial@nongnu.org, Peter Maydell <peter.maydell@linaro.org>,
	Gabriel Kerneis <gabriel@kerneis.info>
Subject: [Qemu-devel] [PATCH] Quote extra_cflags in config-host.mak
Date: Wed, 11 Sep 2013 14:41:52 +0100	[thread overview]
Message-ID: <1378906912-14015-1-git-send-email-gabriel@kerneis.info> (raw)

The variable extra_cflags needs to be quoted in config-host.mak,
in particular because it might contain parentheses that would
otherwise be interpreted by the shell when reloading the file.

For instance, if one wants to define some attribute with configure:

./configure --extra-cflags="-Dcoroutine_fn='__attribute__((coroutine_fn))'"

A more robust approach would be to escape every variable properly, but
there is no portable equivalent to bash's "printf %q" solution. The
current patch, while not bullet-proof, works well in the common case.

Signed-off-by: Gabriel Kerneis <gabriel@kerneis.info>
---
 configure |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/configure b/configure
index e989609..23114de 100755
--- a/configure
+++ b/configure
@@ -3681,7 +3681,7 @@ if test "$mingw32" = "no" ; then
   echo "qemu_localstatedir=$local_statedir" >> $config_host_mak
 fi
 echo "qemu_helperdir=$libexecdir" >> $config_host_mak
-echo "extra_cflags=$EXTRA_CFLAGS" >> $config_host_mak
+echo "extra_cflags=\"$EXTRA_CFLAGS\"" >> $config_host_mak
 echo "extra_ldflags=$EXTRA_LDFLAGS" >> $config_host_mak
 echo "qemu_localedir=$qemu_localedir" >> $config_host_mak
 echo "libs_softmmu=$libs_softmmu" >> $config_host_mak
-- 
1.7.10.4

             reply	other threads:[~2013-09-11 13:42 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-11 13:41 Gabriel Kerneis [this message]
2013-09-11 14:01 ` [Qemu-devel] [PATCH] Quote extra_cflags in config-host.mak Paolo Bonzini
2013-09-11 14:42   ` Gabriel Kerneis
2013-09-11 14:53     ` Paolo Bonzini
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=1378906912-14015-1-git-send-email-gabriel@kerneis.info \
    --to=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).