From 58fcd673e515218f957ec8809413002879f66eb1 Mon Sep 17 00:00:00 2001 From: Eric Edgar Date: Wed, 22 Jun 2005 14:24:05 +0000 Subject: [PATCH] Fix bug 68903; Allows the CROSS_COMPILE env to be set for kernel compiles. Added --kernel-cross-compile= option git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/genkernel/trunk@215 67a159dc-881f-0410-a524-ba9dfbe2cb84 --- gen_cmdline.sh | 6 ++++++ gen_compile.sh | 13 +++++++++++++ gen_determineargs.sh | 5 +++++ 3 files changed, 24 insertions(+) diff --git a/gen_cmdline.sh b/gen_cmdline.sh index f03522f..09b2df2 100755 --- a/gen_cmdline.sh +++ b/gen_cmdline.sh @@ -50,6 +50,7 @@ longusage() { echo " --kernel-cc= Compiler to use for kernel (e.g. distcc)" echo " --kernel-as= Assembler to use for kernel" echo " --kernel-ld= Linker to use for kernel" + echo " --kernel-cross-compile= CROSS_COMPILE kernel variable" echo " --kernel-make= GNU Make to use for kernel" echo " --utils-cc= Compiler to use for utilities" echo " --utils-as= Assembler to use for utils" @@ -133,6 +134,11 @@ parse_cmdline() { CMD_KERNEL_MAKE=`parse_opt "$*"` print_info 2 "CMD_KERNEL_MAKE: $CMD_KERNEL_MAKE" ;; + --kernel-cross-compile=*) + CMD_KERNEL_CROSS_COMPILE=`parse_opt "$*"` + CMD_KERNEL_CROSS_COMPILE=$(echo ${CMD_KERNEL_CROSS_COMPILE}|sed -e 's/.*[^-]$/&-/g') + print_info 2 "CMD_KERNEL_CROSS_COMPILE: $CMD_KERNEL_CROSS_COMPILE" + ;; --utils-cc=*) CMD_UTILS_CC=`parse_opt "$*"` print_info 2 "CMD_UTILS_CC: $CMD_UTILS_CC" diff --git a/gen_compile.sh b/gen_compile.sh index 5c3e2fb..7b69e46 100644 --- a/gen_compile.sh +++ b/gen_compile.sh @@ -18,6 +18,11 @@ compile_kernel_args() ARGS="${ARGS} AS=\"${KERNEL_AS}\"" fi + if [ "${KERNEL_CROSS_COMPILE}" != '' ] + then + ARGS="${ARGS} CROSS_COMPILE=\"${KERNEL_CROSS_COMPILE}\"" + fi + echo -n "${ARGS}" } @@ -88,6 +93,10 @@ export_kernel_args() then export AS="${KERNEL_AS}" fi + if [ "${KERNEL_CROSS_COMPILE}" != '' ] + then + export CROSS_COMPILE="${KERNEL_CROSS_COMPILE}" + fi } unset_kernel_args() @@ -104,6 +113,10 @@ unset_kernel_args() then unset AS fi + if [ "${KERNEL_CROSS_COMPILE}" != '' ] + then + unset CROSS_COMPILE + fi } compile_generic() { diff --git a/gen_determineargs.sh b/gen_determineargs.sh index b84d15e..a5eac73 100644 --- a/gen_determineargs.sh +++ b/gen_determineargs.sh @@ -132,6 +132,11 @@ determine_real_args() { then KERNEL_AS="${CMD_KERNEL_AS}" fi + + if [ "${CMD_KERNEL_CROSS_COMPILE}" != '' ] + then + KERNEL_CROSS_COMPILE="${CMD_KERNEL_CROSS_COMPILE}" + fi if [ "${CMD_UTILS_CC}" != '' ] then -- 2.26.2