fixes for sparc, cant set LD or AS for sparc64

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

@ -1,5 +1,27 @@
#!/bin/bash #!/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() { compile_generic() {
local RET local RET
if [ "$#" -lt "1" ] if [ "$#" -lt "1" ]
@ -7,14 +29,18 @@ compile_generic() {
gen_die "compile_generic(): improper usage" gen_die "compile_generic(): improper usage"
fi fi
ARGS=`compile_args`
if [ "${DEBUGLEVEL}" -gt "1" ] if [ "${DEBUGLEVEL}" -gt "1" ]
then then
# Output to stdout and debugfile # 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=$? RET=$?
else else
# Output to debugfile only # 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=$? RET=$?
fi fi
[ "${RET}" -ne "0" ] && gen_die "compile of failed" [ "${RET}" -ne "0" ] && gen_die "compile of failed"
@ -92,7 +118,7 @@ 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"
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" print_info 1 "modutils: make all"
compile_generic "all" compile_generic "all"
print_info 1 "modutils: copying to bincache" 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" [ ! -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"
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" print_info 1 "module-init-tools: make all"
compile_generic "all" compile_generic "all"
print_info 1 "module-init-tools: copying to bincache" print_info 1 "module-init-tools: copying to bincache"

@ -30,26 +30,17 @@ determine_real_args() {
if [ "${CMD_CC}" != "" ] if [ "${CMD_CC}" != "" ]
then then
CC=${CMD_CC} CC="${CMD_CC}"
elif [ "${CC}" = "" ]
then
CC="gcc"
fi fi
if [ "${CMD_LD}" != "" ] if [ "${CMD_LD}" != "" ]
then then
LD=${CMD_LD} LD="${CMD_LD}"
elif [ "${LD}" = "" ]
then
LD="ld"
fi fi
if [ "${CMD_AS}" != "" ] if [ "${CMD_AS}" != "" ]
then then
AS=${CMD_AS} AS="${CMD_AS}"
elif [ "${AS}" = "" ]
then
AS="as"
fi fi
DEFAULT_KERNEL_CONFIG=`arch_replace "${DEFAULT_KERNEL_CONFIG}"` DEFAULT_KERNEL_CONFIG=`arch_replace "${DEFAULT_KERNEL_CONFIG}"`

Loading…
Cancel
Save