All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-trivial] [PATCH] Quote extra_cflags in config-host.mak
@ 2013-09-11 13:41 ` Gabriel Kerneis
  0 siblings, 0 replies; 22+ messages in thread
From: Gabriel Kerneis @ 2013-09-11 13:41 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-trivial, Peter Maydell

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



^ permalink raw reply related	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2013-09-11 15:56 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-11 13:41 [Qemu-trivial] [PATCH] Quote extra_cflags in config-host.mak Gabriel Kerneis
2013-09-11 13:41 ` [Qemu-devel] " Gabriel Kerneis
2013-09-11 14:01 ` [Qemu-trivial] " Paolo Bonzini
2013-09-11 14:01   ` [Qemu-devel] " Paolo Bonzini
2013-09-11 14:42   ` [Qemu-trivial] " Gabriel Kerneis
2013-09-11 14:42     ` [Qemu-devel] " Gabriel Kerneis
2013-09-11 14:53     ` [Qemu-trivial] " Paolo Bonzini
2013-09-11 14:53       ` [Qemu-devel] " Paolo Bonzini
2013-09-11 15:01       ` [Qemu-trivial] " Gabriel Kerneis
2013-09-11 15:01         ` [Qemu-devel] " Gabriel Kerneis
2013-09-11 15:06         ` [Qemu-trivial] " Paolo Bonzini
2013-09-11 15:06           ` [Qemu-devel] " Paolo Bonzini
2013-09-11 15:16           ` [Qemu-trivial] " Gabriel Kerneis
2013-09-11 15:16             ` Gabriel Kerneis
2013-09-11 15:23             ` [Qemu-trivial] " Gabriel Kerneis
2013-09-11 15:23               ` Gabriel Kerneis
2013-09-11 15:29               ` [Qemu-trivial] " Paolo Bonzini
2013-09-11 15:29                 ` Paolo Bonzini
2013-09-11 15:14         ` [Qemu-trivial] " Gabriel Kerneis
2013-09-11 15:14           ` Gabriel Kerneis
2013-09-11 15:55       ` [Qemu-trivial] " Eric Blake
2013-09-11 15:55         ` [Qemu-devel] " Eric Blake

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.