Linux MIPS Architecture development
 help / color / mirror / Atom feed
From: Ralf Baechle <ralf@linux-mips.org>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Wolfgang Denk <wd@denx.de>, linux-mips@linux-mips.org
Subject: Re: MIPS Makefile not picking up CROSS_COMPILE from environment setting
Date: Mon, 22 Oct 2007 14:21:31 +0100	[thread overview]
Message-ID: <20071022132131.GA31311@linux-mips.org> (raw)
In-Reply-To: <Pine.LNX.4.64.0710211036540.6155@anakin>

On Sun, Oct 21, 2007 at 10:37:29AM +0200, Geert Uytterhoeven wrote:

> > BTW, currently there's a discussion about such things on lkml under the
> > subject `Make m68k cross compile like every other architecture.'.
> > 
> > As you can probably guess, MIPS is unlike every other architecture, too ;-)
> 
> cc-cross-prefix got into mainline:
> 910b40468a9ce3f2f5d48c5d260329c27d45adb5

So then here is a followup patch also unlike any other ;-)

As a convenience for MIPS hacking I keep ARCH hardweired to mips though.

  Ralf

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
---

 Makefile           |    7 +++++--
 arch/mips/Makefile |    6 ++++--
 2 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/Makefile b/Makefile
index 94b8705..6ad9eda 100644
--- a/Makefile
+++ b/Makefile
@@ -165,7 +165,10 @@ export srctree objtree VPATH TOPDIR
 # then ARCH is assigned, getting whatever value it gets normally, and 
 # SUBARCH is subsequently ignored.
 
-SUBARCH := mips
+SUBARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ \
+				  -e s/arm.*/arm/ -e s/sa110/arm/ \
+				  -e s/s390x/s390/ -e s/parisc64/parisc/ \
+				  -e s/ppc.*/powerpc/ -e s/mips.*/mips/ )
 
 # Cross compiling and selecting different set of gcc/bin-utils
 # ---------------------------------------------------------------------------
@@ -186,7 +189,7 @@ SUBARCH := mips
 # Default value for CROSS_COMPILE is not to prefix executables
 # Note: Some architectures assign CROSS_COMPILE in their arch/*/Makefile
 
-ARCH		?= $(SUBARCH)
+ARCH		?= mips
 CROSS_COMPILE	?=
 
 # Architecture as present in compile.h
diff --git a/arch/mips/Makefile b/arch/mips/Makefile
index 14164c2..00a3033 100644
--- a/arch/mips/Makefile
+++ b/arch/mips/Makefile
@@ -42,8 +42,10 @@ tool-prefix		= $(64bit-tool-prefix)
 UTS_MACHINE		:= mips64
 endif
 
-ifdef CONFIG_CROSSCOMPILE
-CROSS_COMPILE		:= $(tool-prefix)
+ifneq ($(SUBARCH),$(ARCH))
+  ifeq ($(CROSS_COMPILE),)
+    CROSS_COMPILE := $(call cc-cross-prefix, $(tool-prefix))
+  endif
 endif
 
 ifdef CONFIG_32BIT

  reply	other threads:[~2007-10-22 13:22 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-18 18:46 MIPS Makefile not picking up CROSS_COMPILE from environment setting Wolfgang Denk
2007-10-19  2:47 ` Atsushi Nemoto
2007-10-19  7:16 ` Geert Uytterhoeven
2007-10-21  8:37   ` Geert Uytterhoeven
2007-10-22 13:21     ` Ralf Baechle [this message]
2007-10-22 14:30       ` Geert Uytterhoeven
2007-10-19 11:18 ` Ralf Baechle
2007-10-19 12:39   ` Maciej W. Rozycki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20071022132131.GA31311@linux-mips.org \
    --to=ralf@linux-mips.org \
    --cc=geert@linux-m68k.org \
    --cc=linux-mips@linux-mips.org \
    --cc=wd@denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox