Skip to contentSkip to conversation

Cross compile helper patch

PATCH Allen Curtis 4 participants 7 messages Aug 28, 2002 Kbuild

lore
Share & tools
lore
#0 lore raw

I am not sure where to send these so here it goes.

--
All things come to those who wait. Some of us just have to wait a little longer...

# This is a BitKeeper generated patch for the following project:
# Project Name: Linux 2.4 for PowerPC development tree
# This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas:
# ChangeSet 1.1114 -> 1.1115
# Makefile 1.164 -> 1.165
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 02/08/26 [email protected] 1.1115
# Make update for cross development.
# --------------------------------------------
#

Makefile +9 -2
diff -Nru a/Makefile b/Makefile
@@ -5,7 +5,12 @@
 
 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 if [ -f Make.arch ]; then \
+			cat Make.arch; \
+		else \
+			uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ -e s/arm.*/arm/ -e s/sa110/arm/; \
+		fi)
+
 KERNELPATH=kernel-$(shell echo $(KERNELRELEASE) | sed -e "s/-//g")
 
 CONFIG_SHELL := $(shell if [ -x "$$BASH" ]; then echo $$BASH; \
@@ -19,7 +24,9 @@
 HOSTCC  	= gcc
 HOSTCFLAGS	= -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer
 
-CROSS_COMPILE 	=
+CROSS_COMPILE 	= $(shell if [ -f Make.crosscompiler ]; then \
+			          cat Make.crosscompiler; \
+			  fi)
 
 #
 # Include the make variables (CC, etc...)
#1 lore raw
Quoted 1 line · Allen Curtis

I am not sure where to send these so here it goes.

It only goes in your local version of this file. Everyone has a different way they want their cross compilation to work, and those of us that use native systems don't like this in the Makefile. This is the historically consistent response to everyone that has submitted a similar patch over the years.

Thanks.

	-- Dan

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

#2 lore raw
Quoted 6 lines

It only goes in your local version of this file. Everyone has a different way they want their cross compilation to work, and those of us that use native systems don't like this in the Makefile. This is the historically consistent response to everyone that has submitted a similar patch over the years.

A two line change to a make file is not exactly cluttering anything up. If you are doing native development then you use the distribution as it is provided. Only if you are doing cross development do you need to create these files. Just a nice logical in the developers face solution to a problem that has been solved a 1000 time before.

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

#3 lore raw
Quoted 3 lines · Allen Curtis

.....Only if you are doing cross development do you need to create these files. Just a nice logical in the developers face solution to a problem that has been solved a 1000 time before.

In 1000 different ways. Like I said, this patch has been submitted by others in many different forms, and we have politely asked they keep this local. I don't do my cross compile Makefile changes like you do, so your changes aren't useful to me, nor to I expect you to want to this this they way I do.

Thanks.

	-- Dan

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

#4 lore raw
In reply to Allen Curtis
Quoted 7 lines · Allen Curtis
Quoted 6 lines

It only goes in your local version of this file. Everyone has a different way they want their cross compilation to work, and those of us that use native systems don't like this in the Makefile. This is the historically consistent response to everyone that has submitted a similar patch over the years.

Quoted 6 lines

A two line change to a make file is not exactly cluttering anything up. If you are doing native development then you use the distribution as it is provided. Only if you are doing cross development do you need to create these files. Just a nice logical in the developers face solution to a problem that has been solved a 1000 time before.

This is what I do when cross compiling

make ARCH=ppc CROSS_COMPILE=powerpc-linux-

Needs no changes to the makefile.

--
Kenneth Johansson

Ericsson AB                       Tel: +46 8 404 71 83
Borgafjordsgatan 9                Fax: +46 8 404 72 72
164 80 Stockholm                  [email protected]

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

#5 lore raw
Quoted 4 lines

This is what I do when cross compiling

make ARCH=ppc CROSS_COMPILE=powerpc-linux-

Duh, that was an easy solution! Thanks, why didn't I think of that?

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

#6 lore raw
Quoted 6 lines · Allen Curtis
Quoted 3 lines

This is what I do when cross compiling

make ARCH=ppc CROSS_COMPILE=powerpc-linux-

Duh, that was an easy solution! Thanks, why didn't I think of that?

...and if you are REALLY lazy (like me) and only use one cross development toolset, you can define and export CROSS_COMPILE and ARCH (I haven't needed ARCH) in your .bashrc (or equiv.) and "make" will Do The Right Thing (TM).

gvb

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/