Added nice and fun patch from dostrow for building on ppc64 (and possibly others...
authorChris Gianelloni <wolf31o2@gentoo.org>
Tue, 24 Jan 2006 18:53:43 +0000 (18:53 +0000)
committerChris Gianelloni <wolf31o2@gentoo.org>
Tue, 24 Jan 2006 18:53:43 +0000 (18:53 +0000)
git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/genkernel/trunk@358 67a159dc-881f-0410-a524-ba9dfbe2cb84

gen_arch.sh
gen_cmdline.sh
gen_compile.sh
gen_determineargs.sh
genkernel

index c5901ecc3c5e02be4741afb1667f4a711d28a556..44de8755c37fbd9dc6152d34ce1c2935fb5744b8 100755 (executable)
@@ -23,6 +23,16 @@ get_official_arch() {
                fi
        fi
 
+       if [ "${CMD_UTILS_ARCH}" != '' ]
+       then
+               UTILS_ARCH=${CMD_UTILS_ARCH}
+       else
+               if [ "${UTILS_ARCH}" != '' ]
+               then
+                       UTILS_ARCH=${UTILS_ARCH}
+               fi
+       fi
+       
        ARCH_CONFIG="${GK_SHARE}/${ARCH}/config.sh"
        [ -f "${ARCH_CONFIG}" ] || gen_die "${ARCH} not yet supported by genkernel. Please add the arch-specific config file, ${ARCH_CONFIG}"
 }
index f8d2854932c12a0d1a5affd4d077782ac62278c6..dabb2d48e0eac7b0d8486b34a15e37f59841d39b 100755 (executable)
@@ -57,6 +57,8 @@ longusage() {
   echo "       --utils-as=<assembler>  Assembler to use for utils"
   echo "       --utils-ld=<linker>     Linker to use for utils"
   echo "       --utils-make=<makeprog> GNU Make to use for utils"
+  echo "       --utils-cross-compile=<cross var> CROSS_COMPILE utils variable"
+  echo "       --utils-arch=<arch>     Force to arch for utils only instead of autodetect."
   echo "       --makeopts=<makeopts>   Make options such as -j2, etc..."
   echo "       --mountboot             Mount /boot automatically"
   echo "       --no-mountboot          Don't mount /boot automatically"  
@@ -159,6 +161,15 @@ parse_cmdline() {
                      CMD_UTILS_MAKE=`parse_opt "$*"`
                      print_info 2 "CMD_UTILS_MAKE: $CMD_UTILS_MAKE"
              ;;
+             --utils-cross-compile=*)
+                     CMD_UTILS_CROSS_COMPILE=`parse_opt "$*"`
+                     CMD_UTILS_CROSS_COMPILE=$(echo ${CMD_UTILS_CROSS_COMPILE}|sed -e 's/.*[^-]$/&-/g')
+                     print_info 2 "CMD_UTILS_CROSS_COMPILE: $CMD_UTILS_CROSS_COMPILE"
+             ;;
+             --utils-arch=*)
+                     CMD_UTILS_ARCH=`parse_opt "$*"`
+                     print_info 2 "CMD_UTILS_ARCH: $CMD_ARCHOVERRIDE"
+             ;;
              --makeopts=*)
                      CMD_MAKEOPTS=`parse_opt "$*"`
                      print_info 2 "CMD_MAKEOPTS: $CMD_MAKEOPTS"
index 7604f2e35efa2c93da204bf00342f165d603903c..bbce545b053b1b3861915b7a472c7499ee342177 100644 (file)
@@ -30,6 +30,10 @@ compile_utils_args()
        local ARGS
 
        ARGS=''
+       if [ "${UTILS_ARCH}" != '' ]
+       then
+               ARGS="ARCH=\"${UTILS_ARCH}\""
+       fi
        if [ "${UTILS_CC}" != '' ]
        then
                ARGS="CC=\"${UTILS_CC}\""
@@ -48,6 +52,10 @@ compile_utils_args()
 
 export_utils_args()
 {
+       if [ "${UTILS_ARCH}" != '' ]
+       then
+               export ARCH="${UTILS_ARCH}"
+       fi
        if [ "${UTILS_CC}" != '' ]
        then
                export CC="${UTILS_CC}"
@@ -64,6 +72,10 @@ export_utils_args()
 
 unset_utils_args()
 {
+       if [ "${UTILS_ARCH}" != '' ]
+       then
+               unset ARCH
+       fi
        if [ "${UTILS_CC}" != '' ]
        then
                unset CC
@@ -720,6 +732,10 @@ compile_klibc() {
        print_info 1 'klibc: >> Compiling...'
        ln -snf "${KERNEL_DIR}" linux || gen_die "Could not link to ${KERNEL_DIR}"
        sed -i Makefile -e "s|prefix      = /usr|prefix      = ${TEMP}/klibc-build|g"
+       if [ "${UTILS_ARCH}" != '' ]
+       then
+               sed -i Makefile -e "s|export ARCH.*|export ARCH := ${UTILS_ARCH}|g"
+       fi
        if [ "${ARCH}" = 'um' ]
        then
                compile_generic "ARCH=um" utils
@@ -729,9 +745,9 @@ compile_klibc() {
        elif [ "${ARCH}" = 'x86' ]
        then
                compile_generic "ARCH=i386" utils
-       elif [ "${KERNEL_CROSS_COMPILE}" != '' ]
+       elif [ "${UTILS_CROSS_COMPILE}" != '' ]
        then
-               compile_generic "CROSS=${KERNEL_CROSS_COMPILE}" utils
+               compile_generic "CROSS=${UTILS_CROSS_COMPILE}" utils
        else
                compile_generic "" utils
        fi
index f4db5adf1e3282935901cf260ca35da400b89044..f9c7ac245253f0bf6de26f3a24c7d9186bb46d84 100644 (file)
@@ -167,6 +167,11 @@ determine_real_args() {
                UTILS_AS="${CMD_UTILS_AS}"
        fi
        
+       if [ "${CMD_UTILS_CROSS_COMPILE}" != '' ]
+       then
+               UTILS_CROSS_COMPILE="${CMD_UTILS_CROSS_COMPILE}"
+       fi
+
        CACHE_DIR=`arch_replace "${CACHE_DIR}"`
        CACHE_CPIO_DIR="${CACHE_DIR}/cpio"
        BUSYBOX_BINCACHE=`cache_replace "${BUSYBOX_BINCACHE}"`
index e4f5dfe9004db79adde1a02d5fde0d317a38713f..00f201fb52f6df252c05148cc590e0b08986bb65 100755 (executable)
--- a/genkernel
+++ b/genkernel
@@ -2,7 +2,7 @@
 # Genkernel v3
 
 PATH="/bin:/usr/bin:/sbin:/usr/sbin"
-GK_V='3.3.11_pre3'
+GK_V='3.3.11_pre4'
 
 TMPDIR='/var/tmp/genkernel'
 TODEBUGCACHE=1 # Until an error occurs or DEBUGFILE is fully qualified.