X-Git-Url: http://pilppa.org/gitweb/?a=blobdiff_plain;f=scripts%2FKbuild.include;h=b96ea8d6a5ed0eb375a4db068cdb2c564407cd42;hb=d31c7b8fa303eb81311f27b80595b8d2cbeef950;hp=b1a7c7d42e15facc076559913a7c9ce00de37ef9;hpb=a0f97e06a43cf524e616f09e6af3398e1e9c1c5b;p=linux-2.6-omap-h63xx.git diff --git a/scripts/Kbuild.include b/scripts/Kbuild.include index b1a7c7d42e1..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))/) @@ -81,7 +92,7 @@ as-option = $(call try-run,\ # Usage: cflags-y += $(call as-instr,instr,option1,option2) as-instr = $(call try-run,\ - echo -e "$(1)" | $(CC) $(AFLAGS) -c -xassembler -o "$$TMP" -,$(2),$(3)) + echo -e "$(1)" | $(CC) $(KBUILD_AFLAGS) -c -xassembler -o "$$TMP" -,$(2),$(3)) # cc-option # Usage: cflags-y += $(call cc-option,-march=winchip-c6,-march=i586)