X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=util%2Fxcompile%2Fxcompile;h=fd4dbeb278e7a261fe5ad02dd44c06c2aa8b8bf7;hb=2aac3f6c51d6eb13da97f801d00bb73a2cdd4fdd;hp=65e6e704f72a9334a0cfa25d330ef02873c41bf9;hpb=23d89ccfd2444c9784e6a27256012f71f8e609dd;p=coreboot.git diff --git a/util/xcompile/xcompile b/util/xcompile/xcompile index 65e6e704f..fd4dbeb27 100644 --- a/util/xcompile/xcompile +++ b/util/xcompile/xcompile @@ -35,19 +35,20 @@ for make in make gmake gnumake; do done GCCPREFIX=invalid -TMP=`mktemp /tmp/temp.XXXX 2>/dev/null || echo /tmp/temp.78gOIUGz` -touch $TMP +XGCCPATH="`pwd`/util/crossgcc/xgcc/bin/" +TMPFILE=`mktemp /tmp/temp.XXXX 2>/dev/null || echo /tmp/temp.78gOIUGz` +touch $TMPFILE # This should be a loop over all supported architectures TARCH=i386 TWIDTH=32 -for gccprefixes in `pwd`/util/crossgcc/xgcc/bin/${TARCH}-elf- ${TARCH}-elf- ""; do +for gccprefixes in ${XGCCPATH}${TARCH}-elf- ${TARCH}-elf- ""; do if ! which ${gccprefixes}as 2>/dev/null >/dev/null; then continue fi - rm -f ${TMP}.o - if ${gccprefixes}as -o ${TMP}.o ${TMP}; then - TYPE=`${gccprefixes}objdump -p ${TMP}.o` + rm -f ${TMPFILE}.o + if ${gccprefixes}as -o ${TMPFILE}.o ${TMPFILE}; then + TYPE=`${gccprefixes}objdump -p ${TMPFILE}.o` if [ ${TYPE##* } == "elf${TWIDTH}-${TARCH}" ]; then GCCPREFIX=$gccprefixes ASFLAGS= @@ -56,8 +57,8 @@ for gccprefixes in `pwd`/util/crossgcc/xgcc/bin/${TARCH}-elf- ${TARCH}-elf- ""; break fi fi - if ${gccprefixes}as --32 -o ${TMP}.o ${TMP}; then - TYPE=`${gccprefixes}objdump -p ${TMP}.o` + if ${gccprefixes}as --32 -o ${TMPFILE}.o ${TMPFILE}; then + TYPE=`${gccprefixes}objdump -p ${TMPFILE}.o` if [ ${TYPE##* } == "elf${TWIDTH}-${TARCH}" ]; then GCCPREFIX=$gccprefixes ASFLAGS=--32 @@ -67,7 +68,7 @@ for gccprefixes in `pwd`/util/crossgcc/xgcc/bin/${TARCH}-elf- ${TARCH}-elf- ""; fi fi done -rm -f $TMP ${TMP}.o +rm -f $TMPFILE ${TMPFILE}.o if [ "$GCCPREFIX" = "invalid" ]; then echo '$(error no suitable gcc found)' @@ -75,6 +76,7 @@ if [ "$GCCPREFIX" = "invalid" ]; then fi CC="${GCCPREFIX}gcc" +testcc "$CC" "$CFLAGS-Wa,--divide " && CFLAGS="$CFLAGS-Wa,--divide " testcc "$CC" "$CFLAGS-fno-stack-protector " && CFLAGS="$CFLAGS-fno-stack-protector " testcc "$CC" "$CFLAGS-Wl,--build-id=none " && CFLAGS="$CFLAGS-Wl,--build-id=none " @@ -84,11 +86,16 @@ else HOSTCC=cc fi +if [ "`${XGCCPATH}/iasl 2>/dev/null | grep -c ACPI`" -gt 0 ]; then + IASL=${XGCCPATH}iasl +else + IASL=iasl +fi + cat << EOF # elf${TWIDTH}-${TARCH} toolchain AS:=${GCCPREFIX}as ${ASFLAGS} CC:=${GCCPREFIX}gcc ${CFLAGS} -CPP:=${GCCPREFIX}cpp AR:=${GCCPREFIX}ar LD:=${GCCPREFIX}ld ${LDFLAGS} STRIP:=${GCCPREFIX}strip @@ -96,6 +103,8 @@ NM:=${GCCPREFIX}nm OBJCOPY:=${GCCPREFIX}objcopy OBJDUMP:=${GCCPREFIX}objdump +IASL:=${IASL} + # native toolchain HOSTCC:=${HOSTCC} EOF