linux-mips
[Top] [All Lists]

Re: MIPS Makefile not picking up CROSS_COMPILE from environment setting

To: wd@denx.de
Subject: Re: MIPS Makefile not picking up CROSS_COMPILE from environment setting
From: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Date: Fri, 19 Oct 2007 11:47:16 +0900 (JST)
Cc: linux-mips@linux-mips.org
In-reply-to: <20071018184636.48637242E9@gemini.denx.de>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <20071018184636.48637242E9@gemini.denx.de>
Sender: linux-mips-bounce@linux-mips.org
On Thu, 18 Oct 2007 20:46:36 +0200, Wolfgang Denk <wd@denx.de> wrote:
> diff --git a/arch/mips/Makefile b/arch/mips/Makefile
> index 08355eb..caa04a0 100644
> --- a/arch/mips/Makefile
> +++ b/arch/mips/Makefile
> @@ -43,7 +43,7 @@ UTS_MACHINE         := mips64
>  endif
>  
>  ifdef CONFIG_CROSSCOMPILE
> -CROSS_COMPILE                := $(tool-prefix)
> +CROSS_COMPILE                ?= $(tool-prefix)
>  endif
>  
>  ifdef CONFIG_32BIT

This would not work as expected if CROSS_COMPILE environment variable
did not exist.  The toplevel Makefile always assigns an empty string
to CROSS_COMPILE before this, so $(tool-prefix) would not be used at
all.

If we needed to keep CONFIG_CROSSCOMPILE as is and needed
CROSS_COMPILE environment variable, something like this might work.

ifdef CONFIG_CROSSCOMPILE
ifndef CROSS_COMPILE
CROSS_COMPILE           := $(tool-prefix)
endif
endif

---
Atsushi Nemoto

<Prev in Thread] Current Thread [Next in Thread>