need seperate toolkit for compilation of kernel and utils on sparc64

git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/genkernel/trunk@7 67a159dc-881f-0410-a524-ba9dfbe2cb84
cleanup-cruft
Brad House 21 years ago
parent 927327933d
commit 377a301fef

@ -23,9 +23,12 @@ usage() {
echo " --kerneldir=<dir> Location of kernel source" echo " --kerneldir=<dir> Location of kernel source"
echo " --kernel-config=<file> Kernel configuration file to use for compilation" echo " --kernel-config=<file> Kernel configuration file to use for compilation"
echo " Low-Level Compile settings" echo " Low-Level Compile settings"
echo " --cc=<compiler> Compiler to use (e.g. distcc)" echo " --kernel-cc=<compiler> Compiler to use for kernel (e.g. distcc)"
echo " --ld=<linker> Linker to use" echo " --kernel-ld=<linker> Linker to use for kernel"
echo " --as=<assembler> Assembler to use" echo " --kernel-as=<assembler> Assembler to use for kernel"
echo " --utils-cc=<compiler> Compiler to use for utils (e.g. busybox, modutils)"
echo " --utils-ld=<linker> Linker to use for utils"
echo " --utils-as=<assembler> Assembler to use for utils"
echo " Internals" echo " Internals"
echo " --arch-override=<arch> Force to arch instead of autodetect (cross-compile?)" echo " --arch-override=<arch> Force to arch instead of autodetect (cross-compile?)"
echo " --busybox-config=<file> Busybox configuration file to use" echo " --busybox-config=<file> Busybox configuration file to use"
@ -49,18 +52,31 @@ parse_cmdline() {
for x in $* for x in $*
do do
case "${x}" in case "${x}" in
--cc*) --kernel-cc*)
CMD_CC=`parse_opt "${x}"` CMD_KERNEL_CC=`parse_opt "${x}"`
print_info 2 "CMD_CC: $CMD_CC" print_info 2 "CMD_KERNEL_CC: $CMD_KERNEL_CC"
;; ;;
--ld*) --kernel-ld*)
CMD_LD=`parse_opt "${x}"` CMD_KERNEL_LD=`parse_opt "${x}"`
print_info 2 "CMD_LD: $CMD_LD" print_info 2 "CMD_KERNEL_LD: $CMD_KERNEL_LD"
;; ;;
--as*) --kernel-as*)
CMD_AS=`parse_opt "${x}"` CMD_KERNEL_AS=`parse_opt "${x}"`
print_info 2 "CMD_AS: $CMD_AS" print_info 2 "CMD_KERNEL_AS: $CMD_KERNEL_AS"
;; ;;
--utils-cc*)
CMD_UTILS_CC=`parse_opt "${x}"`
print_info 2 "CMD_UTILS_CC: $CMD_UTILS_CC"
;;
--utils-ld*)
CMD_UTILS_LD=`parse_opt "${x}"`
print_info 2 "CMD_UTILS_LD: $CMD_UTILS_LD"
;;
--utils-as*)
CMD_UTILS_AS=`parse_opt "${x}"`
print_info 2 "CMD_UTILS_AS: $CMD_UTILS_AS"
;;
--debuglevel*) --debuglevel*)
CMD_DEBUGLEVEL=`parse_opt "${x}"` CMD_DEBUGLEVEL=`parse_opt "${x}"`
DEBUGLEVEL="${CMD_DEBUGLEVEL}" DEBUGLEVEL="${CMD_DEBUGLEVEL}"

@ -1,22 +1,44 @@
#!/bin/bash #!/bin/bash
compile_args() compile_kernel_args()
{ {
local ARGS local ARGS
ARGS="" ARGS=""
if [ "${CC}" != "" ] if [ "${KERNEL_CC}" != "" ]
then then
ARGS="CC=\"${CC}\"" ARGS="CC=\"${KERNEL_CC}\""
fi fi
if [ "${LD}" != "" ] if [ "${KERNEL_LD}" != "" ]
then then
ARGS="${ARGS} LD=\"${LD}\"" ARGS="${ARGS} LD=\"${KERNEL_LD}\""
fi fi
if [ "${AS}" != "" ] if [ "${KERNEL_AS}" != "" ]
then then
ARGS="${ARGS} AS=\"${AS}\"" ARGS="${ARGS} AS=\"${KERNEL_AS}\""
fi
echo -n "${ARGS}"
}
compile_utils_args()
{
local ARGS
ARGS=""
if [ "${UTILS_CC}" != "" ]
then
ARGS="CC=\"${UTILS_CC}\""
fi
if [ "${UTILS_LD}" != "" ]
then
ARGS="${ARGS} LD=\"${UTILS_LD}\""
fi
if [ "${UTILS_AS}" != "" ]
then
ARGS="${ARGS} AS=\"${UTILS_AS}\""
fi fi
echo -n "${ARGS}" echo -n "${ARGS}"
@ -24,12 +46,18 @@ compile_args()
compile_generic() { compile_generic() {
local RET local RET
if [ "$#" -lt "1" ] if [ "$#" -lt "2" ]
then then
gen_die "compile_generic(): improper usage" gen_die "compile_generic(): improper usage"
fi fi
ARGS=`compile_args` if [ "${2}" = "kernel" ]
then
ARGS=`compile_kernel_args`
elif [ "${2}" = "utils" ]
then
ARGS=`compile_utils_args`
fi
if [ "${DEBUGLEVEL}" -gt "1" ] if [ "${DEBUGLEVEL}" -gt "1" ]
then then
@ -54,22 +82,22 @@ compile_dep() {
else else
print_info 1 "kernel: Making dependancies for linux ${KV}" print_info 1 "kernel: Making dependancies for linux ${KV}"
cd ${KERNEL_DIR} cd ${KERNEL_DIR}
compile_generic "dep" compile_generic "dep" kernel
fi fi
} }
compile_modules() { compile_modules() {
print_info 1 "kernel: Starting compile of linux ${KV} modules" print_info 1 "kernel: Starting compile of linux ${KV} modules"
cd ${KERNEL_DIR} cd ${KERNEL_DIR}
compile_generic "modules" compile_generic "modules" kernel
compile_generic "modules_install" compile_generic "modules_install" kernel
} }
compile_kernel() { compile_kernel() {
[ "${KERNEL_MAKE}" = "" ] && gen_die "KERNEL_MAKE undefined. Don't know how to compile kernel for arch." [ "${KERNEL_MAKE}" = "" ] && gen_die "KERNEL_MAKE undefined. Don't know how to compile kernel for arch."
cd ${KERNEL_DIR} cd ${KERNEL_DIR}
print_info 1 "kernel: Starting compile of linux ${KV} ${KERNEL_MAKE}" print_info 1 "kernel: Starting compile of linux ${KV} ${KERNEL_MAKE}"
compile_generic "${KERNEL_MAKE}" compile_generic "${KERNEL_MAKE}" kernel
cp "${KERNEL_BINARY}" "/boot/kernel-${KV}" || gen_die "Could not copy kernel binary to boot" cp "${KERNEL_BINARY}" "/boot/kernel-${KV}" || gen_die "Could not copy kernel binary to boot"
} }
@ -86,16 +114,16 @@ compile_busybox() {
cd "${BUSYBOX_DIR}" cd "${BUSYBOX_DIR}"
if [ "${USE_DIETLIBC}" -eq "1" ] if [ "${USE_DIETLIBC}" -eq "1" ]
then then
OLD_CC="${CC}" OLD_CC="${UTILS_CC}"
CC="${TEMP}/diet/bin/diet ${CC}" UTILS_CC="${TEMP}/diet/bin/diet ${CC}"
fi fi
print_info 1 "Busybox: make oldconfig" print_info 1 "Busybox: make oldconfig"
compile_generic "oldconfig" compile_generic "oldconfig" utils
print_info 1 "Busybox: make all" print_info 1 "Busybox: make all"
compile_generic "all" compile_generic "all" utils
if [ "${USE_DIETLIBC}" -eq "1" ] if [ "${USE_DIETLIBC}" -eq "1" ]
then then
CC="${OLD_CC}" UTILS_CC="${OLD_CC}"
fi fi
print_info 1 "Busybox: copying to bincache" print_info 1 "Busybox: copying to bincache"
[ ! -f "${TEMP}/${BUSYBOX_DIR}/busybox" ] && gen_die "busybox executable does not exist after compile, error" [ ! -f "${TEMP}/${BUSYBOX_DIR}/busybox" ] && gen_die "busybox executable does not exist after compile, error"
@ -118,9 +146,10 @@ compile_modutils() {
[ ! -d "${MODUTILS_DIR}" ] && gen_die "Modutils directory ${MODUTILS_DIR} invalid" [ ! -d "${MODUTILS_DIR}" ] && gen_die "Modutils directory ${MODUTILS_DIR} invalid"
cd "${MODUTILS_DIR}" cd "${MODUTILS_DIR}"
print_info 1 "modutils: configure" print_info 1 "modutils: configure"
ARGS=`compile_utils_args`
${ARGS} ./configure --disable-combined --enable-insmod-static >> ${DEBUGFILE} 2>&1 || gen_die "Configure of modutils failed" ${ARGS} ./configure --disable-combined --enable-insmod-static >> ${DEBUGFILE} 2>&1 || gen_die "Configure of modutils failed"
print_info 1 "modutils: make all" print_info 1 "modutils: make all"
compile_generic "all" compile_generic "all" utils
print_info 1 "modutils: copying to bincache" print_info 1 "modutils: copying to bincache"
[ ! -f "${TEMP}/${MODUTILS_DIR}/insmod/insmod.static" ] && gen_die "insmod.static does not exist after compilation of modutils" [ ! -f "${TEMP}/${MODUTILS_DIR}/insmod/insmod.static" ] && gen_die "insmod.static does not exist after compilation of modutils"
strip "${TEMP}/${MODUTILS_DIR}/insmod/insmod.static" || gen_die "could not strip insmod.static" strip "${TEMP}/${MODUTILS_DIR}/insmod/insmod.static" || gen_die "could not strip insmod.static"
@ -142,9 +171,10 @@ compile_module_init_tools() {
[ ! -d "${MODULE_INIT_TOOLS_DIR}" ] && gen_die "Module-init-tools directory ${MODULE_INIT_TOOLS_DIR} invalid" [ ! -d "${MODULE_INIT_TOOLS_DIR}" ] && gen_die "Module-init-tools directory ${MODULE_INIT_TOOLS_DIR} invalid"
cd "${MODULE_INIT_TOOLS_DIR}" cd "${MODULE_INIT_TOOLS_DIR}"
print_info 1 "module-init-tools: configure" print_info 1 "module-init-tools: configure"
ARGS=`compile_utils_args`
${ARGS} ./configure >> ${DEBUGFILE} 2>&1 || gen_die "Configure of module-init-tools failed" ${ARGS} ./configure >> ${DEBUGFILE} 2>&1 || gen_die "Configure of module-init-tools failed"
print_info 1 "module-init-tools: make all" print_info 1 "module-init-tools: make all"
compile_generic "all" compile_generic "all" utils
print_info 1 "module-init-tools: copying to bincache" print_info 1 "module-init-tools: copying to bincache"
[ ! -f "${TEMP}/${MODULE_INIT_TOOLS_DIR}/insmod.static" ] && gen_die "insmod.static does not exist after compilation of module-init-tools" [ ! -f "${TEMP}/${MODULE_INIT_TOOLS_DIR}/insmod.static" ] && gen_die "insmod.static does not exist after compilation of module-init-tools"
strip "${TEMP}/${MODULE_INIT_TOOLS_DIR}/insmod.static" || gen_die "could not strip insmod.static" strip "${TEMP}/${MODULE_INIT_TOOLS_DIR}/insmod.static" || gen_die "could not strip insmod.static"
@ -182,9 +212,9 @@ compile_dietlibc() {
[ ! -d "${DIETLIBC_DIR}" ] && gen_die "Dietlibc directory ${DIETLIBC_DIR} invalid" [ ! -d "${DIETLIBC_DIR}" ] && gen_die "Dietlibc directory ${DIETLIBC_DIR} invalid"
cd "${DIETLIBC_DIR}" cd "${DIETLIBC_DIR}"
print_info 1 "Dietlibc: make" print_info 1 "Dietlibc: make"
compile_generic "prefix=${TEMP}/diet" compile_generic "prefix=${TEMP}/diet" utils
print_info 1 "Dietlibc: installing" print_info 1 "Dietlibc: installing"
compile_generic "prefix=${TEMP}/diet install" compile_generic "prefix=${TEMP}/diet install" utils
print_info 1 "Dietlibc: copying to bincache" print_info 1 "Dietlibc: copying to bincache"
cd ${TEMP} cd ${TEMP}
tar -jcpf "${DIETLIBC_BINCACHE}" diet || gen_die "Could not tar up dietlibc bin" tar -jcpf "${DIETLIBC_BINCACHE}" diet || gen_die "Could not tar up dietlibc bin"

@ -28,7 +28,7 @@ config_kernel() {
if isTrue ${MRPROPER} if isTrue ${MRPROPER}
then then
print_info 1 "kernel: running mrproper" print_info 1 "kernel: running mrproper"
compile_generic "mrproper" compile_generic "mrproper" kernel
fi fi
# If we're not cleaning, then we don't want to try to overwrite the configs there # If we're not cleaning, then we don't want to try to overwrite the configs there
@ -39,7 +39,7 @@ config_kernel() {
cp "${KERNEL_CONFIG}" "${KERNEL_DIR}/.config" || gen_die "could not copy config file" cp "${KERNEL_CONFIG}" "${KERNEL_DIR}/.config" || gen_die "could not copy config file"
print_info 1 "kernel: running oldconfig" print_info 1 "kernel: running oldconfig"
yes "" | compile_generic "oldconfig" yes "" | compile_generic "oldconfig" kernel
if isTrue ${MENUCONFIG} if isTrue ${MENUCONFIG}
then then
@ -48,7 +48,7 @@ config_kernel() {
fi fi
print_info 1 "kernel: running clean" print_info 1 "kernel: running clean"
compile_generic "clean" compile_generic "clean" kernel
else else
print_info 1 "kernel: skipping copy of config. CLEAN is OFF" print_info 1 "kernel: skipping copy of config. CLEAN is OFF"
fi fi

@ -28,19 +28,34 @@ determine_real_args() {
get_KV get_KV
if [ "${CMD_CC}" != "" ] if [ "${CMD_KERNEL_CC}" != "" ]
then then
CC="${CMD_CC}" KERNEL_CC="${CMD_KERNEL_CC}"
fi fi
if [ "${CMD_LD}" != "" ] if [ "${CMD_KERNEL_LD}" != "" ]
then then
LD="${CMD_LD}" KERNEL_LD="${CMD_KERNEL_LD}"
fi fi
if [ "${CMD_AS}" != "" ] if [ "${CMD_KERNEL_AS}" != "" ]
then then
AS="${CMD_AS}" KERNEL_AS="${CMD_KERNEL_AS}"
fi
if [ "${CMD_UTILS_CC}" != "" ]
then
UTILS_CC="${CMD_UTILS_CC}"
fi
if [ "${CMD_UTILS_LD}" != "" ]
then
UTILS_LD="${CMD_UTILS_LD}"
fi
if [ "${CMD_UTILS_AS}" != "" ]
then
UTILS_AS="${CMD_UTILS_AS}"
fi fi
DEFAULT_KERNEL_CONFIG=`arch_replace "${DEFAULT_KERNEL_CONFIG}"` DEFAULT_KERNEL_CONFIG=`arch_replace "${DEFAULT_KERNEL_CONFIG}"`

@ -1,5 +1,5 @@
#!/bin/bash #!/bin/bash
# x86-config.sh # x86/config.sh
KERNEL_MAKE="bzImage" KERNEL_MAKE="bzImage"
KERNEL_BINARY="arch/i386/boot/bzImage" KERNEL_BINARY="arch/i386/boot/bzImage"
@ -8,9 +8,13 @@ KERNEL_BINARY="arch/i386/boot/bzImage"
# can turn this flag on # can turn this flag on
USE_DIETLIBC=0 USE_DIETLIBC=0
CC=gcc KERNEL_CC=gcc
AS=as KERNEL_AS=as
LD=ld KERNEL_LD=ld
UTILS_CC=gcc
UTILS_AS=as
UTILS_LD=ld
COMPRESS_INITRD=yes COMPRESS_INITRD=yes

@ -8,9 +8,13 @@ KERNEL_BINARY="arch/x86_64/boot/bzImage"
# can turn this flag on # can turn this flag on
USE_DIETLIBC=0 USE_DIETLIBC=0
CC=gcc KERNEL_CC=gcc
AS=as KERNEL_AS=as
LD=ld KERNEL_LD=ld
UTILS_CC=gcc
UTILS_AS=as
UTILS_LD=ld
COMPRESS_INITRD=yes COMPRESS_INITRD=yes

Loading…
Cancel
Save