@@ -41,6 +41,15 @@ config TPL
prompt "Build TPL image" if !SPL_BUILD
default y if TPL_BUILD
+config CROSS_COMPILE
+ string "Cross-compiler tool prefix"
+ depends on !SPL_BUILD
+ help
+ Same as running 'make CROSS_COMPILE=prefix-' but stored for
+ default make runs in this U-Boot build directory. You don't
+ need to set this unless you want the configured U-Boot build
+ directory to select the cross-compiler automatically.
+
endmenu # General setup
source "arch/Kconfig"
@@ -188,12 +188,20 @@ HOSTOS := $(shell uname -s | tr '[:upper:]' '[:lower:]' | \
export HOSTARCH HOSTOS
-#########################################################################
-
-# set default to nothing for native builds
-ifeq ($(HOSTARCH),$(ARCH))
-CROSS_COMPILE ?=
-endif
+# Cross compiling and selecting different set of gcc/bin-utils
+# ---------------------------------------------------------------------------
+#
+# CROSS_COMPILE specify the prefix used for all executables used
+# during compilation. Only gcc and related bin-utils executables
+# are prefixed with $(CROSS_COMPILE).
+# CROSS_COMPILE can be set on the command line
+# make CROSS_COMPILE=ia64-linux-
+# Alternatively CROSS_COMPILE can be set in the environment.
+# A third alternative is to store a setting in .config so that plain
+# "make" in the configured kernel build directory always uses that.
+# Default value for CROSS_COMPILE is not to prefix executables
+# Note: Some architectures assign CROSS_COMPILE in their arch/*/config.mk
+CROSS_COMPILE ?= $(CONFIG_CROSS_COMPILE:"%"=%)
KCONFIG_CONFIG ?= .config
export KCONFIG_CONFIG
Copy from Linux Kernel (with a few adjustments in comments). Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> --- Kconfig | 9 +++++++++ Makefile | 20 ++++++++++++++------ 2 files changed, 23 insertions(+), 6 deletions(-)