X-Git-Url: http://pilppa.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=scripts%2FKbuild.include;h=b96ea8d6a5ed0eb375a4db068cdb2c564407cd42;hb=8547e583a1140698cab41bc3f687efe8f8b2bb41;hp=de7bb284c6116d8ea3997ae224a25e3081aaf619;hpb=222d394d30e74bb7a2a65029fcea68107b0d0eb6;p=linux-2.6-omap-h63xx.git diff --git a/scripts/Kbuild.include b/scripts/Kbuild.include index de7bb284c61..b96ea8d6a5e 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))/)