Patchwork toolchain-scripts.bbclass:Add CROSS_COMPILE variable to environment-setup file

login
register
mail settings
Submitter Zongchun Yu
Date May 14, 2013, 6:43 a.m.
Message ID <1368513794-20427-1-git-send-email-b40527@freescale.com>
Download mbox | patch
Permalink /patch/49871/
State Accepted
Commit b66ec45e5dd9418a6568c04ef30854531a4b66f3
Headers show

Comments

Zongchun Yu - May 14, 2013, 6:43 a.m.
From: Zongchun Yu <b40527@freescale.com>

when compiling the linux kernel manually. users need to set CROSS_COMPILE separately.
adding the CROSS_COMPILE variable will be nice for using.

Signed-off-by: Zongchun Yu <b40527@freescale.com>
---
 meta/classes/toolchain-scripts.bbclass |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
Otavio Salvador - May 14, 2013, 9:09 p.m.
On Tue, May 14, 2013 at 3:43 AM,  <b40527@freescale.com> wrote:
> From: Zongchun Yu <b40527@freescale.com>
>
> when compiling the linux kernel manually. users need to set CROSS_COMPILE separately.
> adding the CROSS_COMPILE variable will be nice for using.
>
> Signed-off-by: Zongchun Yu <b40527@freescale.com>

I agree; it makes it easy to use with many make based projects (kernel
and u-boot, for example).

--
Otavio Salvador                             O.S. Systems
E-mail: otavio@ossystems.com.br  http://www.ossystems.com.br
Mobile: +55 53 9981-7854              http://projetos.ossystems.com.br

Patch

diff --git a/meta/classes/toolchain-scripts.bbclass b/meta/classes/toolchain-scripts.bbclass
index 050e799..be5623b 100644
--- a/meta/classes/toolchain-scripts.bbclass
+++ b/meta/classes/toolchain-scripts.bbclass
@@ -47,6 +47,7 @@  toolchain_create_sdk_env_script () {
 	echo 'export OECORE_SDK_VERSION="${SDK_VERSION}"' >> $script
 	echo 'export PYTHONHOME=${SDKPATHNATIVE}${prefix_nativesdk}' >> $script
 	echo 'export ARCH=${ARCH}' >> $script
+	echo 'export CROSS_COMPILE=${TARGET_PREFIX}' >> $script
 }
 
 # This function creates an environment-setup-script in the TMPDIR which enables
@@ -92,6 +93,7 @@  toolchain_create_tree_env_script () {
 	echo 'export OECORE_DISTRO_VERSION="${DISTRO_VERSION}"' >> $script
 	echo 'export OECORE_SDK_VERSION="${SDK_VERSION}"' >> $script
 	echo 'export ARCH=${ARCH}' >> $script
+	echo 'export CROSS_COMPILE=${TARGET_PREFIX}' >> $script
 }
 
 # This function creates an environment-setup-script for use by the ADT installer
@@ -137,6 +139,7 @@  toolchain_create_sdk_env_script_for_installer () {
 	echo 'export OECORE_SDK_VERSION="${SDK_VERSION}"' >> $script
 	echo 'export PYTHONHOME=${SDKPATHNATIVE}${prefix_nativesdk}' >> $script
 	echo 'export ARCH=${ARCH}' >> $script
+	echo 'export CROSS_COMPILE=${TARGET_PREFIX}' >> $script
 }
 
 #we get the cached site config in the runtime