From c989e07fe6d2630613f7047dd2136dfd9926da2e Mon Sep 17 00:00:00 2001 From: Martin Roth Date: Fri, 4 Dec 2015 14:29:37 -0700 Subject: toolchain.inc: verify tool variable validity before using it. If the toolchain for a stage/architecture wasn't present, we'd call the shell with '-v', generating an ugly warning: /bin/sh: - : invalid option Usage: /bin/sh [GNU long option] [option] ... /bin/sh [GNU long option] [option] script-file ... GNU long options: ... Change-Id: Icd6d7a00083ee1695591ff96da36b7868be0c2f0 Signed-off-by: Martin Roth Reviewed-on: https://review.coreboot.org/12649 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi --- toolchain.inc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'toolchain.inc') diff --git a/toolchain.inc b/toolchain.inc index 1b73ce9a89..724658010e 100644 --- a/toolchain.inc +++ b/toolchain.inc @@ -155,10 +155,10 @@ IASLFAIL:=0 ifeq ($(CONFIG_COMPILER_GCC),y) ifneq ($(CONFIG_ANY_TOOLCHAIN),y) $(foreach arch,$(sort $(foreach stage,$(COREBOOT_STANDARD_STAGES),$(ARCH-$(stage)-y))), \ - $(if $(shell $(CC_$(arch)) -v 2>&1 |grep -q "gcc version .*coreboot toolchain" || echo not-coreboot), \ + $(if $(shell if [ -n "$(CC_$(arch))" ]; then $(CC_$(arch)) -v 2>&1 |grep -q "gcc version .*coreboot toolchain" || echo not-coreboot; else echo not-coreboot; fi), \ $(eval COMPILERFAIL:=1)$(warning Please use the coreboot toolchain for '$(arch)'))) #if iasl doesn't match the current coreboot version, fail the test -$(if $(shell $(IASL) -v 2>&1 | grep -q "$(shell util/crossgcc/buildgcc -s iasl)" || echo not-coreboot), \ +$(if $(shell if [ -n "$(IASL)" ]; then $(IASL) -v 2>&1 | grep -q "$(shell util/crossgcc/buildgcc -s iasl)" || echo not-coreboot; else echo not-coreboot; fi), \ $(eval COMPILERFAIL:=1)$(eval IASLFAIL:=1)$(warning Please use the coreboot toolchain version of iasl - $(shell util/crossgcc/buildgcc -s iasl))) endif endif -- cgit v1.2.3