Fix bug 68903; Allows the CROSS_COMPILE env to be set for kernel compiles. Added...
authorEric Edgar <rocket@gentoo.org>
Wed, 22 Jun 2005 14:24:05 +0000 (14:24 +0000)
committerEric Edgar <rocket@gentoo.org>
Wed, 22 Jun 2005 14:24:05 +0000 (14:24 +0000)
git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/genkernel/trunk@215 67a159dc-881f-0410-a524-ba9dfbe2cb84

gen_cmdline.sh
gen_compile.sh
gen_determineargs.sh

index f03522f369b0d77fb957e1d254adfede1141cfee..09b2df2110cae1c5fcc2e751675e5cefb714547d 100755 (executable)
@@ -50,6 +50,7 @@ longusage() {
   echo "       --kernel-cc=<compiler>  Compiler to use for kernel (e.g. distcc)"
   echo "       --kernel-as=<assembler> Assembler to use for kernel"
   echo "       --kernel-ld=<linker>    Linker to use for kernel"
+  echo "       --kernel-cross-compile=<cross var> CROSS_COMPILE kernel variable"
   echo "       --kernel-make=<makeprg> GNU Make to use for kernel"
   echo "       --utils-cc=<compiler>   Compiler to use for utilities"
   echo "       --utils-as=<assembler>  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"
index 5c3e2fb957d568afc44e21990f579ee57cfdaada..7b69e468a9a6ba5c29aab0c06f5df2943a4385db 100644 (file)
@@ -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() {
index b84d15ecab0b7e3a9d155215456c655daa3d576f..a5eac73ba40292110a5f8f50f2cde54346443ec6 100644 (file)
@@ -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