[PATCH 3/4] tools lib feature: Do not redefine compiler configuration

From: David Carrillo-Cisneros
Date: Thu Feb 02 2017 - 01:38:54 EST


Feature detection redefines CC, CCX and PKG_CONFIG, making the
output of feature detection inconsistent with the actual features
available during compilation when the above variables are used.

Fix it by using conditional assignment.

Signed-off-by: David Carrillo-Cisneros <davidcc@xxxxxxxxxx>
---
tools/build/feature/Makefile | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/tools/build/feature/Makefile b/tools/build/feature/Makefile
index 3dd2c600d250..d39e76f3a063 100644
--- a/tools/build/feature/Makefile
+++ b/tools/build/feature/Makefile
@@ -52,9 +52,9 @@ FILES= \

FILES := $(addprefix $(OUTPUT),$(FILES))

-CC := $(CROSS_COMPILE)gcc -MD
-CXX := $(CROSS_COMPILE)g++ -MD
-PKG_CONFIG := $(CROSS_COMPILE)pkg-config
+CC ?= $(CROSS_COMPILE)gcc -MD
+CXX ?= $(CROSS_COMPILE)g++ -MD
+PKG_CONFIG ?= $(CROSS_COMPILE)pkg-config
LLVM_CONFIG ?= llvm-config

all: $(FILES)
--
2.11.0.483.g087da7b7c-goog