Otherwise, if a multi-word $(CC) is provided by the user, such as
"gcc -m32", then we test each word as a compiler. "-m32" then gives
you an error from the shell about "-3" not being a valid option.
# Environment tests
ifeq (,$(CC))
- CC := gcc cc
+ CC_CANDIDATES := gcc cc
+ test_cc = $(shell $(cc) --version > /dev/null 2>&1 && echo $(cc))
+ CC := $(foreach cc,$(CC_CANDIDATES), $(test_cc))
+ CC := $(firstword $(CC))
+ ifeq (,$(CC))
+ $(error Compiler not found)
+ endif
endif
ifeq (,$(KSRC))
endif
-test_cc = $(shell $(cc) --version > /dev/null 2>&1 && echo $(cc))
-CC := $(foreach cc, $(CC), $(test_cc))
-CC := $(firstword $(CC))
-ifeq (,$(CC))
- $(error Compiler not found)
-endif
-
# we need to know what platform the driver is being built on
# some additional features are only built on Intel platforms
ifeq ($(ARCH),)