2 for make in make gmake gnumake; do
3 if [ "`$make --version 2>/dev/null | grep -c GNU`" -gt 0 ]; then
10 TMP=`mktemp /tmp/temp.XXXX`
11 echo "mov %eax, %eax" > ${TMP}.s
12 printf "\x7fELF" > ${TMP}.compare
13 for gccprefixes in `pwd`/../crossgcc/xgcc/bin/i386-elf- i386-elf- ""; do
14 if which ${gccprefixes}as 2>/dev/null >/dev/null; then
20 if ${gccprefixes}as --32 -o ${TMP}.o ${TMP}.s; then
21 dd bs=4 count=1 if=${TMP}.o > ${TMP}.test 2>/dev/null
22 if cmp ${TMP}.test ${TMP}.compare; then
23 GCCPREFIX=$gccprefixes
28 rm -f $TMP ${TMP}.s ${TMP}.o ${TMP}.compare ${TMP}.test
30 if [ "$GCCPREFIX" = "invalid" ]; then
31 echo '$(error no suitable gcc found)'
36 AS:=${GCCPREFIX}as --32
37 CC:=${GCCPREFIX}gcc -m32
40 LD:=${GCCPREFIX}ld -b elf32-i386
41 STRIP:=${GCCPREFIX}strip
43 OBJCOPY:=${GCCPREFIX}objcopy
44 OBJDUMP:=${GCCPREFIX}objdump