>Here is my first try. We only touch CROSS_COMPILE is empty and building for another arch. I can obviously move crossgcc part of this to core kbuild. Any better name? Sam diff --git a/arch/m68k/Makefile b/arch/m68k/Makefile index 4a1bd44..6465bbe 100644 --- a/arch/m68k/Makefile +++ b/arch/m68k/Makefile @@ -13,17 +13,26 @@ # Copyright (C) 1994 by Hamish Macdonald # -# test for cross compiling -COMPILE_ARCH = $(shell uname -m) +# usage: +# CROSS_COMPILE := $(call crossgcc, foo bar /usr/bin/) +# CROSS_COMPILE will be assinged the first prefix that point +# to a gcc in the path +crossgcc = $(word 1, $(foreach c,$(1), \ + $(shell set -e; \ + if (which $(strip $(c))$(CC)) > /dev/null 2>&1 ; then \ + echo $(c); \ + fi))) + +ifneq ($(SUBARCH),$(ARCH)) + ifeq ($(CROSS_COMPILE),) + CROSS_COMPILE := $(call crossgcc, m68k-linux-gnu-) + endif +endif # override top level makefile AS += -m68020 LDFLAGS := -m m68kelf LDFLAGS_MODULE += -T $(srctree)/arch/m68k/kernel/module.lds -ifneq ($(COMPILE_ARCH),$(ARCH)) - # prefix for cross-compiling binaries - CROSS_COMPILE = m68k-linux-gnu- -endif ifdef CONFIG_SUN3 LDFLAGS_vmlinux = -N -
| debian developer | Re: Dual-Licensing Linux Kernel with GPL V2 and GPL V3 |
| Greg Kroah-Hartman | [PATCH 001/196] Chinese: Add the known_regression URI to the HOWTO |
| Linus Torvalds | Re: Slow DOWN, please!!! |
| Tony Lindgren | [PATCH 37/90] ARM: OMAP: MPUIO wake updates |
git: | |
| Jarek Poplawski | [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock(). |
| Gerrit Renker | [PATCH 15/37] dccp: Set per-connection CCIDs via socket options |
| Alexey Dobriyan | Re: [GIT]: Networking |
| Dushan Tcholich | Re: ksoftirqd high cpu load on kernels 2.6.24 to 2.6.27-rc1-mm1 |
