From: Chris Gianelloni Date: Tue, 24 Jan 2006 18:53:43 +0000 (+0000) Subject: Added nice and fun patch from dostrow for building on ppc64 (and possibly others... X-Git-Tag: v3.4.10.902~394 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=f3ce3d4c4f951aebe45644f71c06ffc73c242e50;p=genkernel.git Added nice and fun patch from dostrow for building on ppc64 (and possibly others) with mixed kernel/userland. git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/genkernel/trunk@358 67a159dc-881f-0410-a524-ba9dfbe2cb84 --- diff --git a/gen_arch.sh b/gen_arch.sh index c5901ec..44de875 100755 --- a/gen_arch.sh +++ b/gen_arch.sh @@ -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}" } diff --git a/gen_cmdline.sh b/gen_cmdline.sh index f8d2854..dabb2d4 100755 --- a/gen_cmdline.sh +++ b/gen_cmdline.sh @@ -57,6 +57,8 @@ longusage() { echo " --utils-as= Assembler to use for utils" echo " --utils-ld= Linker to use for utils" echo " --utils-make= GNU Make to use for utils" + echo " --utils-cross-compile= CROSS_COMPILE utils variable" + echo " --utils-arch= Force to arch for utils only instead of autodetect." echo " --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" diff --git a/gen_compile.sh b/gen_compile.sh index 7604f2e..bbce545 100644 --- a/gen_compile.sh +++ b/gen_compile.sh @@ -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 diff --git a/gen_determineargs.sh b/gen_determineargs.sh index f4db5ad..f9c7ac2 100644 --- a/gen_determineargs.sh +++ b/gen_determineargs.sh @@ -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}"` diff --git a/genkernel b/genkernel index e4f5dfe..00f201f 100755 --- 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.