From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37619) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zyl8Z-0003Bu-1O for qemu-devel@nongnu.org; Tue, 17 Nov 2015 13:37:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zyl8U-0004gl-K5 for qemu-devel@nongnu.org; Tue, 17 Nov 2015 13:37:50 -0500 Received: from [2a03:4000:1::4e2f:c7ac:d] (port=57754 helo=v220110690675601.yourvserver.net) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zyl8U-0004fk-9f for qemu-devel@nongnu.org; Tue, 17 Nov 2015 13:37:46 -0500 Message-ID: <564B73F5.3000609@weilnetz.de> Date: Tue, 17 Nov 2015 19:37:41 +0100 From: Stefan Weil MIME-Version: 1.0 References: <1447783185-32019-1-git-send-email-berrange@redhat.com> In-Reply-To: <1447783185-32019-1-git-send-email-berrange@redhat.com> Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] configure: preserve various environment variables in config.status List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Daniel P. Berrange" , qemu-devel@nongnu.org Cc: Peter Maydell , Gerd Hoffmann , "Dr. David Alan Gilbert" -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 Am 17.11.2015 um 18:59 schrieb Daniel P. Berrange: > Suggested in > > https://lists.gnu.org/archive/html/qemu-devel/2015-11/msg03298.html > > The config.status script is auto-generated by configure upon > completion. The intention is that config.status can be later > invoked by the developer to re-detect the same environment > that configure originally used. The current config.status > script, however, only contains a record of the command line > arguments to configure. Various environment variables have > an effect on what configure will find. In particular the > PKG_CONFIG_LIBDIR & PKG_CONFIG_PATH vars will affect what > libraries pkg-config finds. The PATH var will affect what > toolchain binaries and XXXX-config scripts are found. The > LD_LIBRARY_PATH var will affect what libraries are found. > All these key env variables should be recorded in the > config.status script. > > Signed-off-by: Daniel P. Berrange > --- > > Open question: are there more env vars we should preserve ? Probably yes. They can be added as soon as we discover them. > > configure | 18 ++++++++++++++++++ > 1 file changed, 18 insertions(+) > > diff --git a/configure b/configure > index d7472d7..9c9f6ac 100755 > --- a/configure > +++ b/configure > @@ -5925,6 +5925,24 @@ cat <config.status > # Compiler output produced by configure, useful for debugging > # configure, is in config.log if it exists. > EOD > + > +preserve_env() { > + envname=$1 > + > + if test -n "${!envname}" > + then > + echo "$envname=\"${!envname}\"" >> config.status > + echo "export $envname" >> config.status else echo "unset $envname" >>config.status > > + fi > +} > + > +# Preserve various env variables that influence what > +# features/build target configure will detect > +preserve_env PATH > +preserve_env LD_LIBRARY_PATH > +preserve_env PKG_CONFIG_LIBDIR > +preserve_env PKG_CONFIG_PATH > + > printf "exec" >>config.status > printf " '%s'" "$0" "$@" >>config.status > echo >>config.status With the additional code for unset variables this patch is nearly perfect. Even without it, it is a reasonable improvement. Reviewed-by: Stefan Weil -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBCAAGBQJWS3P1AAoJEOCMIdVndFCttNMP/jhmKG7da1uAKk5+9YPWRrPr l+kpWW9CFYMvddTL1jdfjdgu3d+Pb8EMPcGRxdU01W8TNj6+4UuP9t1BxqG/TRNi kENa6czzJayY0c8axtgS24jGQfFo6b5zboH3TN+XOtK89SpwB+SXXGwglU/3/UNS cU/yrFpWrCDrsH4XwyTXlJb5870VcfFtO1584yLR1noaytYFz4tI1ihvyMdMc8pJ rTARuJkYRez+3oZGfF/GDfPZkfZeuxiYTdKgIfjLxUSRf5NO8+SMHY4jD3G/6eow iJWOjjB2A42mTcRenomuj0XoSt143UQOj67hsFvJt/3FMlBR7z4feUxydzHsIx34 LGDazNUo+eAxx0wWqP2/RtSRdU9rdzZR0pdkMwLJQd8zGlgXB9sIwcDggJE8CWIZ Mf05qCWGLkHbujFo3pkzJz71isOtBi8kCu+n09iK5DjIvSa4RwqPHyY5qGVrExmM lQe+GA9NGq23ceNaZDoTbpZhxzNcjvgKyiV19YkR971IQa7opR7BOn40iDD7upqL Nylw87TUPDAzqsc8i8fZaKo4bxUERqBJMsBzUZMGQMaUjAL5XC3TAWKMiT3boyZ3 +UlsC9yuSwGPGA7g/+mwxtB7aFvUwglt56JzCU1uWeWUEnjX4qrXpXwhB66RuyY+ lgt4QOEeUPwKAxvuv0dK =SenJ -----END PGP SIGNATURE-----