summaryrefslogtreecommitdiffstats
path: root/scripts/Kbuild.include
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/Kbuild.include')
-rw-r--r--scripts/Kbuild.include7
1 files changed, 6 insertions, 1 deletions
diff --git a/scripts/Kbuild.include b/scripts/Kbuild.include
index 85d758233483..f641bb0aa63f 100644
--- a/scripts/Kbuild.include
+++ b/scripts/Kbuild.include
@@ -74,8 +74,13 @@ endef
74# Usage: CROSS_COMPILE := $(call cc-cross-prefix, m68k-linux-gnu- m68k-linux-) 74# Usage: CROSS_COMPILE := $(call cc-cross-prefix, m68k-linux-gnu- m68k-linux-)
75# Return first <prefix> where a <prefix>gcc is found in PATH. 75# Return first <prefix> where a <prefix>gcc is found in PATH.
76# If no gcc found in PATH with listed prefixes return nothing 76# If no gcc found in PATH with listed prefixes return nothing
77#
78# Note: '2>/dev/null' is here to force Make to invoke a shell. Otherwise, it
79# would try to directly execute the shell builtin 'command'. This workaround
80# should be kept for a long time since this issue was fixed only after the
81# GNU Make 4.2.1 release.
77cc-cross-prefix = $(firstword $(foreach c, $(filter-out -%, $(1)), \ 82cc-cross-prefix = $(firstword $(foreach c, $(filter-out -%, $(1)), \
78 $(if $(shell which $(c)gcc), $(c)))) 83 $(if $(shell command -v $(c)gcc 2>/dev/null), $(c))))
79 84
80# output directory for tests below 85# output directory for tests below
81TMPOUT := $(if $(KBUILD_EXTMOD),$(firstword $(KBUILD_EXTMOD))/) 86TMPOUT := $(if $(KBUILD_EXTMOD),$(firstword $(KBUILD_EXTMOD))/)