[PATCH 2.4.25] enable cross-compilation from Mac OS X

From: Martin Schaffner
Date: Tue Feb 24 2004 - 09:03:53 EST


Hi,

After setting up a cross-compile toolchain (using http://vserver.13thfloor.at/Stuff/Cross/) on Mac OS X 10.3.2, and applying the following patch, I was able to compile a bootable linux kernel with the command:
make CROSS_COMPILE=/usr/local/bin/powerpc-linux-gnu-

Please consider applying the patch to the main 2.4 tree.

I was also able to compile 2.6.1 with basically the same patch, but it required some additional fiddling with the makefiles in not-entirely-clean ways.

--- Makefile.old Wed Feb 18 13:36:32 2004
+++ Makefile Tue Feb 24 11:36:13 2004
@@ -5,7 +5,7 @@

KERNELRELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)

-ARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ -e s/arm.*/arm/ -e s/sa110/arm/)
+ARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ -e s/arm.*/arm/ -e s/sa110/arm/ -e s/Power\ Macintosh/ppc/)
KERNELPATH=kernel-$(shell echo $(KERNELRELEASE) | sed -e "s/-//g")

CONFIG_SHELL := $(shell if [ -x "$$BASH" ]; then echo $$BASH; \
@@ -353,7 +353,7 @@
@rm -f .ver1

include/linux/version.h: ./Makefile
- @expr length "$(KERNELRELEASE)" \<= $(uts_len) > /dev/null || \
+ @expr "$(KERNELRELEASE)" : '.*' \<= $(uts_len) > /dev/null || \
(echo KERNELRELEASE \"$(KERNELRELEASE)\" exceeds $(uts_len) characters >&2; false)
@echo \#define UTS_RELEASE \"$(KERNELRELEASE)\" > .ver
@echo \#define LINUX_VERSION_CODE `expr $(VERSION) \\* 65536 + $(PATCHLEVEL) \\* 256 + $(SUBLEVEL)` >> .ver

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/