need seperate toolkit for compilation of kernel and utils on sparc64
authorBrad House <brad_mssw@gentoo.org>
Tue, 9 Dec 2003 02:12:36 +0000 (02:12 +0000)
committerBrad House <brad_mssw@gentoo.org>
Tue, 9 Dec 2003 02:12:36 +0000 (02:12 +0000)
git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/genkernel/trunk@7 67a159dc-881f-0410-a524-ba9dfbe2cb84

gen_cmdline.sh
gen_compile.sh
gen_configkernel.sh
gen_determineargs.sh
x86/config.sh
x86_64/config.sh

index 1431d0d7d01560b5458fd7775808908f79cf62f9..d5503a89e46af4acd410aade9e0f6e679b716b1f 100755 (executable)
@@ -23,9 +23,12 @@ usage() {
   echo "       --kerneldir=<dir>       Location of kernel source"
   echo "       --kernel-config=<file>  Kernel configuration file to use for compilation"
   echo "  Low-Level Compile settings"
-  echo "       --cc=<compiler>         Compiler to use (e.g. distcc)"
-  echo "       --ld=<linker>           Linker to use"
-  echo "       --as=<assembler>        Assembler to use"
+  echo "       --kernel-cc=<compiler>  Compiler to use for kernel (e.g. distcc)"
+  echo "       --kernel-ld=<linker>    Linker to use for kernel"
+  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 "       --arch-override=<arch>  Force to arch instead of autodetect (cross-compile?)"
   echo "       --busybox-config=<file> Busybox configuration file to use"
@@ -49,18 +52,31 @@ parse_cmdline() {
        for x in $*
        do
                case "${x}" in
-                       --cc*)
-                               CMD_CC=`parse_opt "${x}"`
-                               print_info 2 "CMD_CC: $CMD_CC"
+                       --kernel-cc*)
+                               CMD_KERNEL_CC=`parse_opt "${x}"`
+                               print_info 2 "CMD_KERNEL_CC: $CMD_KERNEL_CC"
                        ;;
-                       --ld*)
-                               CMD_LD=`parse_opt "${x}"`
-                               print_info 2 "CMD_LD: $CMD_LD"
+                       --kernel-ld*)
+                               CMD_KERNEL_LD=`parse_opt "${x}"`
+                               print_info 2 "CMD_KERNEL_LD: $CMD_KERNEL_LD"
                        ;;
-                       --as*)
-                               CMD_AS=`parse_opt "${x}"`
-                               print_info 2 "CMD_AS: $CMD_AS"
+                       --kernel-as*)
+                               CMD_KERNEL_AS=`parse_opt "${x}"`
+                               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*)
                                CMD_DEBUGLEVEL=`parse_opt "${x}"`
                                DEBUGLEVEL="${CMD_DEBUGLEVEL}"
index 9e91ddeb0b8346cdbebc068d141a5b54ab88da94..063839517791fee48d752e9d5ec62ae2c92759ad 100644 (file)
@@ -1,35 +1,63 @@
 #!/bin/bash
 
-compile_args()
+compile_kernel_args()
 {
        local ARGS
 
        ARGS=""
-       if [ "${CC}" != "" ]
+       if [ "${KERNEL_CC}" != "" ]
        then
-               ARGS="CC=\"${CC}\""
+               ARGS="CC=\"${KERNEL_CC}\""
        fi
-       if [ "${LD}" != "" ]
+       if [ "${KERNEL_LD}" != "" ]
        then
-               ARGS="${ARGS} LD=\"${LD}\""
+               ARGS="${ARGS} LD=\"${KERNEL_LD}\""
        fi
 
-       if [ "${AS}" != "" ]
+       if [ "${KERNEL_AS}" != "" ]
        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
+
        echo -n "${ARGS}"
 }
 
 compile_generic() {
        local RET
-       if [ "$#" -lt "1" ]
+       if [ "$#" -lt "2" ]
        then
                gen_die "compile_generic(): improper usage"
        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" ]
        then
@@ -54,22 +82,22 @@ compile_dep() {
        else
                print_info 1 "kernel: Making dependancies for linux ${KV}"
                cd ${KERNEL_DIR}
-               compile_generic "dep"
+               compile_generic "dep" kernel
        fi
 }
 
 compile_modules() {
        print_info 1 "kernel: Starting compile of linux ${KV} modules"
        cd ${KERNEL_DIR}
-       compile_generic "modules"
-       compile_generic "modules_install"
+       compile_generic "modules" kernel
+       compile_generic "modules_install" kernel
 }
 
 compile_kernel() {
        [ "${KERNEL_MAKE}" = "" ] && gen_die "KERNEL_MAKE undefined. Don't know how to compile kernel for arch."
        cd ${KERNEL_DIR}
        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"
 }
 
@@ -86,16 +114,16 @@ compile_busybox() {
                cd "${BUSYBOX_DIR}"
                if [ "${USE_DIETLIBC}" -eq "1" ]
                then
-                       OLD_CC="${CC}"
-                       CC="${TEMP}/diet/bin/diet ${CC}"
+                       OLD_CC="${UTILS_CC}"
+                       UTILS_CC="${TEMP}/diet/bin/diet ${CC}"
                fi
                print_info 1 "Busybox: make oldconfig"
-               compile_generic "oldconfig"
+               compile_generic "oldconfig" utils
                print_info 1 "Busybox: make all"
-               compile_generic "all"
+               compile_generic "all" utils
                if [ "${USE_DIETLIBC}" -eq "1" ]
                then
-                       CC="${OLD_CC}"
+                       UTILS_CC="${OLD_CC}"
                fi
                print_info 1 "Busybox: copying to bincache"
                [ ! -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"
                cd "${MODUTILS_DIR}"
                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"
                print_info 1 "modutils: make all"
-               compile_generic "all"
+               compile_generic "all" utils
                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"
                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"
                cd "${MODULE_INIT_TOOLS_DIR}"
                print_info 1 "module-init-tools: configure"
+               ARGS=`compile_utils_args`
                ${ARGS} ./configure >> ${DEBUGFILE} 2>&1 || gen_die "Configure of module-init-tools failed"
                print_info 1 "module-init-tools: make all"
-               compile_generic "all"
+               compile_generic "all" utils
                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"
                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"
                cd "${DIETLIBC_DIR}"
                print_info 1 "Dietlibc: make"
-               compile_generic "prefix=${TEMP}/diet"
+               compile_generic "prefix=${TEMP}/diet" utils
                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"
                cd ${TEMP}
                tar -jcpf "${DIETLIBC_BINCACHE}" diet || gen_die "Could not tar up dietlibc bin"
index 8368645ff328006da27790e0d286977652d3eb8b..bcaff5a8652e995510469074a742ee88589bfbff 100644 (file)
@@ -28,7 +28,7 @@ config_kernel() {
        if isTrue ${MRPROPER}
        then
                print_info 1 "kernel: running mrproper"
-               compile_generic "mrproper"
+               compile_generic "mrproper" kernel
        fi
 
        # 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"
 
                print_info 1 "kernel: running oldconfig"
-               yes "" | compile_generic "oldconfig"
+               yes "" | compile_generic "oldconfig" kernel
 
                if isTrue ${MENUCONFIG}
                then
@@ -48,7 +48,7 @@ config_kernel() {
                fi
 
                print_info 1 "kernel: running clean"
-               compile_generic "clean"
+               compile_generic "clean" kernel
        else
                print_info 1 "kernel: skipping copy of config. CLEAN is OFF"
        fi
index 87a175f5fc5dd7056e8f3613a393144b9e16d53c..b89c6c09cd9b75428133699f3b20abdf0cf1b1dd 100644 (file)
@@ -28,19 +28,34 @@ determine_real_args() {
 
        get_KV
 
-       if [ "${CMD_CC}" != "" ]
+       if [ "${CMD_KERNEL_CC}" != "" ]
        then
-               CC="${CMD_CC}"
+               KERNEL_CC="${CMD_KERNEL_CC}"
        fi
 
-       if [ "${CMD_LD}" != "" ]
+       if [ "${CMD_KERNEL_LD}" != "" ]
        then
-               LD="${CMD_LD}"
+               KERNEL_LD="${CMD_KERNEL_LD}"
        fi
 
-       if [ "${CMD_AS}" != "" ]
+       if [ "${CMD_KERNEL_AS}" != "" ]
        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
 
        DEFAULT_KERNEL_CONFIG=`arch_replace "${DEFAULT_KERNEL_CONFIG}"`
index e5194b704691800fcb55782cb4ed52560406466d..03fbffea10d558c69ec8e1d653a9960de88f2af8 100644 (file)
@@ -1,5 +1,5 @@
 #!/bin/bash
-# x86-config.sh
+# x86/config.sh
 
 KERNEL_MAKE="bzImage"
 KERNEL_BINARY="arch/i386/boot/bzImage"
@@ -8,9 +8,13 @@ KERNEL_BINARY="arch/i386/boot/bzImage"
 # can turn this flag on
 USE_DIETLIBC=0
 
-CC=gcc
-AS=as
-LD=ld
+KERNEL_CC=gcc
+KERNEL_AS=as
+KERNEL_LD=ld
+
+UTILS_CC=gcc
+UTILS_AS=as
+UTILS_LD=ld
 
 COMPRESS_INITRD=yes
 
index dc7ea6b7b63ab19f20c1c403962cf500448c2f18..30078029928f61e116e10dff3e53d6324164284b 100644 (file)
@@ -8,9 +8,13 @@ KERNEL_BINARY="arch/x86_64/boot/bzImage"
 # can turn this flag on
 USE_DIETLIBC=0
 
-CC=gcc
-AS=as
-LD=ld
+KERNEL_CC=gcc
+KERNEL_AS=as
+KERNEL_LD=ld
+
+UTILS_CC=gcc
+UTILS_AS=as
+UTILS_LD=ld
 
 COMPRESS_INITRD=yes