Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Daniel Nyström" <daniel.nystrom@timeterminal.se>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH] Reset critical environment variables
Date: Sun, 26 Dec 2010 00:29:42 +0100	[thread overview]
Message-ID: <1293319782-5813-1-git-send-email-daniel.nystrom@timeterminal.se> (raw)

Reset them early in top-level Makefile to ensure they're keept unset
all the way through the build process.

This also removes the requirement of these variables being unset
globally prior the build.

Signed-off-by: Daniel Nystr?m <daniel.nystrom@timeterminal.se>
---
 Makefile                               |    6 ++++++
 toolchain/dependencies/dependencies.sh |    9 ---------
 2 files changed, 6 insertions(+), 9 deletions(-)

diff --git a/Makefile b/Makefile
index f6ab07e..1974e1c 100644
--- a/Makefile
+++ b/Makefile
@@ -186,6 +186,12 @@ cc-option=$(shell if $(TARGET_CC) $(TARGET_CFLAGS) $(1) -S -o /dev/null -xc /dev
 #############################################################
 unexport CROSS_COMPILE
 unexport ARCH
+unexport CC
+unexport CXX
+unexport CPP
+unexport CFLAGS
+unexport CXXFLAGS
+unexport GREP_OPTIONS
 
 GNU_HOST_NAME:=$(shell package/gnuconfig/config.guess)
 
diff --git a/toolchain/dependencies/dependencies.sh b/toolchain/dependencies/dependencies.sh
index a152d4b..766a478 100755
--- a/toolchain/dependencies/dependencies.sh
+++ b/toolchain/dependencies/dependencies.sh
@@ -4,15 +4,6 @@
 
 export LC_ALL=C
 
-# Verify that critical environment variables aren't set
-for var in CC CXX CPP CFLAGS CXXFLAGS GREP_OPTIONS CROSS_COMPILE ARCH ; do
-    if test -n "$(eval echo '$'$var)" ; then
-	/bin/echo -e "\nYou must run 'unset $var' so buildroot can run with";
-	/bin/echo -e "a clean environment on your build machine\n";
-	exit 1;
-    fi
-done
-
 # Verify that grep works
 echo "WORKS" | grep "WORKS" >/dev/null 2>&1
 if test $? != 0 ; then
-- 
1.7.1

             reply	other threads:[~2010-12-25 23:29 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-25 23:29 Daniel Nyström [this message]
2010-12-29 22:37 ` [Buildroot] [PATCH] Reset critical environment variables Peter Korsgaard

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=1293319782-5813-1-git-send-email-daniel.nystrom@timeterminal.se \
    --to=daniel.nystrom@timeterminal.se \
    --cc=buildroot@busybox.net \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox