From nobody Thu Nov 6 01:10:29 2025 Delivered-To: importer@patchew.org Received-SPF: temperror (zoho.com: Error in retrieving data from DNS) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=temperror (zoho.com: Error in retrieving data from DNS) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1538296592478162.41796926394852; Sun, 30 Sep 2018 01:36:32 -0700 (PDT) Received: from localhost ([::1]:54334 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g6XDL-0006aL-7I for importer@patchew.org; Sun, 30 Sep 2018 04:36:31 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41290) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g6WrC-0002A7-Hq for qemu-devel@nongnu.org; Sun, 30 Sep 2018 04:13:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g6WrB-0000DC-MO for qemu-devel@nongnu.org; Sun, 30 Sep 2018 04:13:38 -0400 Received: from mail-wr1-x42a.google.com ([2a00:1450:4864:20::42a]:40718) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1g6WrB-0000BT-Cp for qemu-devel@nongnu.org; Sun, 30 Sep 2018 04:13:37 -0400 Received: by mail-wr1-x42a.google.com with SMTP id y8-v6so10477926wrh.7 for ; Sun, 30 Sep 2018 01:13:37 -0700 (PDT) Received: from 640k.lan (94-36-187-248.adsl-ull.clienti.tiscali.it. [94.36.187.248]) by smtp.gmail.com with ESMTPSA id u76-v6sm11369194wmd.10.2018.09.30.01.13.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 30 Sep 2018 01:13:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=uxX1m5CpZHeXXp6jRenCmv6cb+SJtyQfKz+ydh6bgN0=; b=MskZ2DuZ1N5pM4CqgReP9TbA9d42hYsjGtL3nqkopaF7sIKVekir/6ViV4nXzHaNTE BD0DoOB+BjuzKuixC42jJtpJ+8/OIMCuI/7iEfa6n2EvJACwuvqFA/JFewuipoQlWxim z+XVo/dVa6/ziW+LLkAYFmc48bT2IKTnEeJ7GiCtZXAB4GKOOKCHAlPXIR8J38sq0aWf A+vz5RfzRTROgjKgYQmLbT446sO6zbLOdMdG3+tRK9Fx1OV9fCVfqIhdSTGbIU+2Co7I QhvloyHrM6M7VCRWwbUMLjwmrnMlzgbS+ebEKCeqDa4gNaJqc2tcAf1CcHgICjr7FWat bR/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=uxX1m5CpZHeXXp6jRenCmv6cb+SJtyQfKz+ydh6bgN0=; b=KGLB5g61Fn23SMsEfsrrk2y+fn3VJassLqFpUFKo+9dipnFx8AgY9Z5Rt9IpusXPkD k9aWCPQhdANLf4Ex56sw6ioOfukcnuUNPhxmcWaOGSOJL+R2hdqV9JlYpQ7kAf30cvg8 7EAtPzD0bYrg75FA6xNo4B1yWiDDKjEwTwiWDA10TLEaD2ErU5PUaKO38l9pol7ebkRW yY/wXajzU0bqvW1Wm2yb1fOjgkug4ug8B/OmyKi49vG7rgaPxpvd6JrA2NnfJxJa1Zn+ lYHHOadbD3J4o9DGQJWkxfReIjfkg7rvXtja2fX1NVg0kJlNgjwhbJGbs0udGYzvb60p XFyA== X-Gm-Message-State: ABuFfog3I2OOHBjKJCTCkmhAN4XhZPgA8q7xbyWyklo9B7XAkc/nfsgY glQs5SoTccXEAuBx4QWRNNp3gW2F X-Google-Smtp-Source: ACcGV63eWnuE1FwzdF4iCOdaV+JRTZoah5j0sHJuymL9WWaSFTup3dGyubHmUSmg2QxUiuz5wjVkAw== X-Received: by 2002:a5d:5342:: with SMTP id t2-v6mr3646622wrv.257.1538295216015; Sun, 30 Sep 2018 01:13:36 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Sun, 30 Sep 2018 10:12:16 +0200 Message-Id: <1538295197-23704-19-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1538295197-23704-1-git-send-email-pbonzini@redhat.com> References: <1538295197-23704-1-git-send-email-pbonzini@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::42a Subject: [Qemu-devel] [PULL 18/79] configure: preserve various environment variables in config.status X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDMRC_1 RDKM_2 RSF_6 Z_629925259 SPT_0 From: Daniel P. Berrang=C3=A9 The config.status script is auto-generated by configure upon completion. The intention is that config.status can be later invoked by the developer directly, or by make indirectly, 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 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. Autoconf would also preserve CFLAGS, LDFLAGS, LIBS, CPPFLAGS, but QEMU deals with those differently, expecting extra flags to be set using configure args, rather than env variables. At the end of the script we also don't have the original values of those env vars, as we modify them during configure. Reviewed-by: Eric Blake Reviewed-by: Stefan Weil Signed-off-by: Daniel P. Berrange Message-Id: <20180904123603.10016-1-berrange@redhat.com> Reviewed-by: Thomas Huth Signed-off-by: Paolo Bonzini Signed-off-by: Daniel P. Berrang=C3=A9 --- configure | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/configure b/configure index 7fd989a..95462f8 100755 --- a/configure +++ b/configure @@ -7527,6 +7527,46 @@ cat <config.status # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. EOD + +preserve_env() { + envname=3D$1 + + eval envval=3D\$$envname + + if test -n "$envval" + then + echo "$envname=3D'$envval'" >> 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 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 --=20 1.8.3.1