From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39182) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VJlnZ-0002dY-JP for qemu-devel@nongnu.org; Wed, 11 Sep 2013 10:53:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VJlnT-0002Si-KG for qemu-devel@nongnu.org; Wed, 11 Sep 2013 10:53:41 -0400 Message-ID: <523083EF.7050203@redhat.com> Date: Wed, 11 Sep 2013 16:53:35 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1378906912-14015-1-git-send-email-gabriel@kerneis.info> <523077CE.6070303@redhat.com> <20130911144230.GA15227@kerneis.info> In-Reply-To: <20130911144230.GA15227@kerneis.info> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] Quote extra_cflags in config-host.mak List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gabriel Kerneis Cc: qemu-trivial@nongnu.org, Peter Maydell , qemu-devel@nongnu.org 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