From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47314) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VJkgd-0000jd-Q8 for qemu-devel@nongnu.org; Wed, 11 Sep 2013 09:42:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VJkgX-0003bg-Qf for qemu-devel@nongnu.org; Wed, 11 Sep 2013 09:42:27 -0400 Received: from wanbli.kerneis.info ([2001:41d0:8:38ad::1]:42007) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VJkgX-0003YY-Hb for qemu-devel@nongnu.org; Wed, 11 Sep 2013 09:42:21 -0400 From: Gabriel Kerneis Date: Wed, 11 Sep 2013 14:41:52 +0100 Message-Id: <1378906912-14015-1-git-send-email-gabriel@kerneis.info> Subject: [Qemu-devel] [PATCH] Quote extra_cflags in config-host.mak List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: qemu-trivial@nongnu.org, Peter Maydell , Gabriel Kerneis 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 --- 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