All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Daniel P. Berrange" <berrange@redhat.com>
To: qemu-devel@nongnu.org
Cc: Peter Maydell <peter.maydell@linaro.org>,
	Gerd Hoffmann <kraxel@redhat.com>,
	"Dr. David Alan Gilbert" <dgilbert@redhat.com>
Subject: [Qemu-devel] [PATCH] configure: preserve various environment variables in config.status
Date: Tue, 17 Nov 2015 17:59:45 +0000	[thread overview]
Message-ID: <1447783185-32019-1-git-send-email-berrange@redhat.com> (raw)

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 <berrange@redhat.com>
---

Open question: are there more env vars we should preserve ?

 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 <<EOD >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
+    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
-- 
2.5.0

             reply	other threads:[~2015-11-17 17:59 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-17 17:59 Daniel P. Berrange [this message]
2015-11-17 18:37 ` [Qemu-devel] [PATCH] configure: preserve various environment variables in config.status Stefan Weil
2015-11-17 19:06 ` Eric Blake
2015-11-18 10:03   ` Daniel P. Berrange
2015-11-18 15:40     ` Eric Blake
2015-11-18 15:52   ` Stefan Weil

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1447783185-32019-1-git-send-email-berrange@redhat.com \
    --to=berrange@redhat.com \
    --cc=dgilbert@redhat.com \
    --cc=kraxel@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.