X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=scripts%2FKbuild.include;h=b96ea8d6a5ed0eb375a4db068cdb2c564407cd42;hb=313d8e57b074d5f03dfed2755f21ae41a6f0fd5a;hp=de7bb284c6116d8ea3997ae224a25e3081aaf619;hpb=222d394d30e74bb7a2a65029fcea68107b0d0eb6;p=linux-2.6 diff --git a/scripts/Kbuild.include b/scripts/Kbuild.include index de7bb284c6..b96ea8d6a5 100644 --- a/scripts/Kbuild.include +++ b/scripts/Kbuild.include @@ -56,6 +56,17 @@ endef # gcc support functions # See documentation in Documentation/kbuild/makefiles.txt +# cc-cross-prefix +# Usage: CROSS_COMPILE := $(call cc-cross-prefix, m68k-linux-gnu- m68k-linux-) +# Return first prefix where a prefix$(CC) is found in PATH. +# If no $(CC) found in PATH with listed prefixes return nothing +cc-cross-prefix = \ + $(word 1, $(foreach c,$(1), \ + $(shell set -e; \ + if (which $(strip $(c))$(CC)) > /dev/null 2>&1 ; then \ + echo $(c); \ + fi))) + # output directory for tests below TMPOUT := $(if $(KBUILD_EXTMOD),$(firstword $(KBUILD_EXTMOD))/)