Reset critical environment variables
authorDaniel Nyström <daniel.nystrom@timeterminal.se>
Sat, 25 Dec 2010 23:29:42 +0000 (00:29 +0100)
committerPeter Korsgaard <jacmet@sunsite.dk>
Wed, 29 Dec 2010 22:35:52 +0000 (23:35 +0100)
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>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
Makefile
toolchain/dependencies/dependencies.sh

index 9ba80a68988f67229070d35e5e83de1c74048459..6d6e83630ca77970bcf12d26850648bd05528a6b 100644 (file)
--- 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)
 
index c5552cae0f6685aff567301b6c3dedb200b97410..74ab2137abb732bce584f4a07aebad8939e14a04 100755 (executable)
@@ -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