fixes for sparc, cant set LD or AS for sparc64
authorBrad House <brad_mssw@gentoo.org>
Tue, 9 Dec 2003 01:48:36 +0000 (01:48 +0000)
committerBrad House <brad_mssw@gentoo.org>
Tue, 9 Dec 2003 01:48:36 +0000 (01:48 +0000)
git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/genkernel/trunk@6 67a159dc-881f-0410-a524-ba9dfbe2cb84

gen_compile.sh
gen_determineargs.sh

index 25dd2ba49e91bf909a522d5f52e5a728556e5354..9e91ddeb0b8346cdbebc068d141a5b54ab88da94 100644 (file)
@@ -1,5 +1,27 @@
 #!/bin/bash
 
+compile_args()
+{
+       local ARGS
+
+       ARGS=""
+       if [ "${CC}" != "" ]
+       then
+               ARGS="CC=\"${CC}\""
+       fi
+       if [ "${LD}" != "" ]
+       then
+               ARGS="${ARGS} LD=\"${LD}\""
+       fi
+
+       if [ "${AS}" != "" ]
+       then
+               ARGS="${ARGS} AS=\"${AS}\""
+       fi
+       
+       echo -n "${ARGS}"
+}
+
 compile_generic() {
        local RET
        if [ "$#" -lt "1" ]
@@ -7,14 +29,18 @@ compile_generic() {
                gen_die "compile_generic(): improper usage"
        fi
 
+       ARGS=`compile_args`
+
        if [ "${DEBUGLEVEL}" -gt "1" ]
        then
                # Output to stdout and debugfile
-               ${MAKE} CC="${CC}" AS="${AS}" LD="${LD}" ${MAKEOPTS} ${1} 2>&1 | tee -a ${DEBUGFILE}
+               print_info 2 "COMMAND: ${MAKE} ${ARGS} ${MAKEOPTS} ${1}" 1 0
+               ${MAKE} ${ARGS} ${MAKEOPTS} ${1} 2>&1 | tee -a ${DEBUGFILE}
                RET=$?
        else
                # Output to debugfile only
-               ${MAKE} CC="${CC}" AS="${AS}" LD="${LD}" ${MAKEOPTS} ${1} >> ${DEBUGFILE} 2>&1
+               print_info 2 "COMMAND: ${MAKE} ${ARGS} ${MAKEOPTS} ${1}" 1 0
+               ${MAKE} ${ARGS} ${MAKEOPTS} ${1} >> ${DEBUGFILE} 2>&1
                RET=$?
        fi
        [ "${RET}" -ne "0" ] && gen_die "compile of failed"
@@ -92,7 +118,7 @@ compile_modutils() {
                [ ! -d "${MODUTILS_DIR}" ] && gen_die "Modutils directory ${MODUTILS_DIR} invalid"
                cd "${MODUTILS_DIR}"
                print_info 1 "modutils: configure"
-               CC="${CC}" LD="${LD}" AS="${AS}" ./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"
                compile_generic "all"
                print_info 1 "modutils: copying to bincache"
@@ -116,7 +142,7 @@ 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"
-               CC="${CC}" LD="${LD}" AS="${AS}" ./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"
                compile_generic "all"
                print_info 1 "module-init-tools: copying to bincache"
index 6ae2d2a4c5fb76101507f2080cf05dab5f58d8ce..87a175f5fc5dd7056e8f3613a393144b9e16d53c 100644 (file)
@@ -30,26 +30,17 @@ determine_real_args() {
 
        if [ "${CMD_CC}" != "" ]
        then
-               CC=${CMD_CC}
-       elif [ "${CC}" = "" ]
-       then
-               CC="gcc"
+               CC="${CMD_CC}"
        fi
 
        if [ "${CMD_LD}" != "" ]
        then
-               LD=${CMD_LD}
-       elif [ "${LD}" = "" ]
-       then
-               LD="ld"
+               LD="${CMD_LD}"
        fi
 
        if [ "${CMD_AS}" != "" ]
        then
-               AS=${CMD_AS}
-       elif [ "${AS}" = "" ]
-       then
-               AS="as"
+               AS="${CMD_AS}"
        fi
 
        DEFAULT_KERNEL_CONFIG=`arch_replace "${DEFAULT_KERNEL_CONFIG}"`