--- popt-1.7-r2/config.guess 2005-03-13 09:34:41 +0000 +++ popt-1.7-r2/config.guess.new 2005-03-13 09:40:31 +0000 @@ -776,10 +776,30 @@ echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; mips:Linux:*:*) - case `sed -n '/^byte/s/^.*: \(.*\) endian/\1/p' < /proc/cpuinfo` in - big) echo mips-unknown-linux-gnu && exit 0 ;; - little) echo mipsel-unknown-linux-gnu && exit 0 ;; - esac +# doesn't work from 2.4.20 onwards, remove from cpuinfo +# case `sed -n '/^byte/s/^.*: \(.*\) endian/\1/p' < /proc/cpuinfo` in +# big) echo mips-unknown-linux-gnu && exit 0 ;; +# little) echo mipsel-unknown-linux-gnu && exit 0 ;; +# stolen from sudo patch by: martin schulze (joey@infodrom.org) +# esac + + eval $set_cc_for_build + sed 's/^ //' << EOF > $dummy.c + #undef CPU + #undef mips + #undef mipsel + if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) + CPU=mipsel + #else + #if defined(_MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) + CPU=mips + #else + CPU= + #endif + #endif +EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` + test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0 ;; ppc:Linux:*:*) echo powerpc-unknown-linux-gnu