From patchwork Wed Nov 18 10:31:44 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= X-Patchwork-Id: 545948 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 99B6214145C for ; Wed, 18 Nov 2015 21:32:14 +1100 (AEDT) Received: from localhost ([::1]:35027 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zz028-00044p-JR for incoming@patchwork.ozlabs.org; Wed, 18 Nov 2015 05:32:12 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49841) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zz01n-0003d6-7P for qemu-devel@nongnu.org; Wed, 18 Nov 2015 05:31:55 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zz01m-0002wq-9Q for qemu-devel@nongnu.org; Wed, 18 Nov 2015 05:31:51 -0500 Received: from mx1.redhat.com ([209.132.183.28]:50046) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zz01m-0002wm-2d for qemu-devel@nongnu.org; Wed, 18 Nov 2015 05:31:50 -0500 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (Postfix) with ESMTPS id B7617E7077; Wed, 18 Nov 2015 10:31:49 +0000 (UTC) Received: from localhost.localdomain.com (vpn1-5-158.ams2.redhat.com [10.36.5.158]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id tAIAVlLb009445; Wed, 18 Nov 2015 05:31:48 -0500 From: "Daniel P. Berrange" To: qemu-devel@nongnu.org Date: Wed, 18 Nov 2015 10:31:44 +0000 Message-Id: <1447842704-4759-1-git-send-email-berrange@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.27 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: Peter Maydell , "Dr. David Alan Gilbert" , Gerd Hoffmann Subject: [Qemu-devel] [PATCH v2] configure: preserve various environment variables in config.status X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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. Most commands have env variables that will override the name/path of the default version configure finds. All these key env variables should be recorded in the config.status script. Signed-off-by: Daniel P. Berrange Reviewed-by: Eric Blake --- configure | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/configure b/configure index d7472d7..09a503c 100755 --- a/configure +++ b/configure @@ -5925,6 +5925,44 @@ cat <config.status # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. EOD + +preserve_env() { + envname=$1 + + eval envval=\$$envname + + if test -n "$envval" + then + echo "$envname='$envval'" >> config.status + echo "export $envname" >> config.status + fi +} + +# Preserve various env variables that influence what +# features/build target configure will detect +preserve_env AR +preserve_env AS +preserve_env CC +preserve_env CPP +preserve_env CXX +preserve_env INSTALL +preserve_env LD +preserve_env LD_LIBRARY_PATH +preserve_env LIBTOOL +preserve_env MAKE +preserve_env NM +preserve_env OBJCOPY +preserve_env PATH +preserve_env PKG_CONFIG +preserve_env PKG_CONFIG_LIBDIR +preserve_env PKG_CONFIG_PATH +preserve_env PYTHON +preserve_env SDL_CONFIG +preserve_env SDL2_CONFIG +preserve_env SMBD +preserve_env STRIP +preserve_env WINDRES + printf "exec" >>config.status printf " '%s'" "$0" "$@" >>config.status echo >>config.status