From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Campbell Subject: Re: [PATCH 2/2] tools: Clear private variables from configure --with-opt Date: Thu, 23 Oct 2014 11:13:26 +0100 Message-ID: <1414059206.19198.34.camel@citrix.com> References: <1413899584-26484-1-git-send-email-olaf@aepfle.de> <1413899584-26484-2-git-send-email-olaf@aepfle.de> <21575.44007.860491.53690@mariner.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <21575.44007.860491.53690@mariner.uk.xensource.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Ian Jackson Cc: Olaf Hering , Stefano Stabellini , Wei Liu , xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org On Wed, 2014-10-22 at 14:06 +0100, Ian Jackson wrote: > Olaf Hering writes ("[PATCH 2/2] tools: Clear private variables from configure --with-opt"): > > Configure will use variables from environment when substituting a > > private variable if the corresponding --with*-foo option is omited. > > This happens for seabios_path, ovmf_path and EXTRA_QEMUU_CONFIGURE_ARGS: > > > > git clean -dfx > > env EXTRA_QEMUU_CONFIGURE_ARGS=XXXXXXXXXXXXXXXX ./configure > > grep XXXXXXXXXXXXXXXX config/Tools.mk > > CONFIG_QEMUU_EXTRA_ARGS:= XXXXXXXXXXXXXXXX > > > > The reason is the empty "action-if-not-given" case. Fix the bug by > > clearing the variables in this case. > > Why on earth is this a problem ? My answer is `don't do that then'. Is the patch harmful though? Do you think people are relying on this behaviour? The autoconf docs for AC_ARG_WITH don't really say what the default is if you omit one of the option shell scripts, presumably it is to do nothing. https://autotools.io/autoconf/arguments.html talks about AC_ARG_VAR which is supposed to be used for this sort of thing. I've not confirmed this but http://stackoverflow.com/questions/13848154/passing-environment-variables-to-autoconfs-configure suggests that passing something via the env causes config.status --recheck to do the wrong thing, which seems very plausible. Ian.