summaryrefslogtreecommitdiff
path: root/toolchain.inc
diff options
context:
space:
mode:
authorMartin Roth <martinroth@google.com>2015-12-04 14:29:37 -0700
committerMartin Roth <martinroth@google.com>2015-12-08 16:47:39 +0100
commitc989e07fe6d2630613f7047dd2136dfd9926da2e (patch)
tree5e14ca286499b1e707e62787c1d20ede9bd91f5d /toolchain.inc
parentdb557477a2ee5432cfa42ab9cacccc71e2ddcb0c (diff)
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 <martinroth@google.com> Reviewed-on: https://review.coreboot.org/12649 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi <pgeorgi@google.com>
Diffstat (limited to 'toolchain.inc')
-rw-r--r--toolchain.inc4
1 files changed, 2 insertions, 2 deletions
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