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
cleanup-cruft
Chris Gianelloni 19 years ago
parent 286cdf75c9
commit f3ce3d4c4f

@ -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}"
}

@ -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"

@ -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

@ -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}"`

@ -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.

Loading…
Cancel
Save