cpu=`uname -m`
mmx="default"
altivec="default"
+mmi="default"
case "$cpu" in
i386|i486|i586|i686|i86pc|BePC)
cpu="x86"
"Power Macintosh"|ppc)
cpu="powerpc"
;;
+ mips)
+ cpu="mips"
+ ;;
*)
cpu="unknown"
;;
$cc -o $TMPO $TMPC -faltivec 2> /dev/null || altivec="no"
fi
+# Can only do mmi on mips
+if test $mmi = "default"; then
+ if test $cpu = "mips"; then
+ mmi="yes"
+ else
+ mmi="no"
+ fi
+fi
+
+# See does our compiler support mmi
+if test $mmi = "yes"; then
+cat > $TMPC << EOF
+int main(void) {
+ __asm__ ("lq \$2, 0(\$2)");
+ return 0;
+}
+EOF
+$cc -o $TMPO $TMPC 2> /dev/null || mmi="no"
+fi
+
# Checking for CFLAGS
if test -z "$CFLAGS"; then
CFLAGS="-O3"
ranlib="${cross_prefix}${ranlib}"
strip="${cross_prefix}${strip}"
+if test -z "$cross_prefix" ; then
+
# ---
# big/little endian test
cat > $TMPC << EOF
echo big/little test failed
fi
+else
+
+# if cross compiling, cannot launch a program, so make a static guess
+if test "$cpu" = "powerpc" -o "$cpu" = "mips" ; then
+ bigendian="yes"
+fi
+
+fi
+
# ---
# check availability of some header files
echo "make $make"
echo "CPU $cpu"
echo "Big Endian $bigendian"
+if test $cpu = "x86"; then
echo "MMX enabled $mmx"
+fi
+if test $cpu = "mips"; then
+echo "MMI enabled $mmi"
+fi
+if test $cpu = "powerpc"; then
echo "AltiVec enabled $altivec"
+fi
echo "gprof enabled $gprof"
echo "zlib enabled $zlib"
echo "mp3lame enabled $mp3lame"
elif test "$cpu" = "powerpc" ; then
echo "TARGET_ARCH_POWERPC=yes" >> config.mak
echo "#define ARCH_POWERPC 1" >> $TMPH
+elif test "$cpu" = "mips" ; then
+ echo "TARGET_ARCH_MIPS=yes" >> config.mak
+ echo "#define ARCH_MIPS 1" >> $TMPH
fi
if test "$bigendian" = "yes" ; then
echo "WORDS_BIGENDIAN=yes" >> config.mak
echo "TARGET_MMX=yes" >> config.mak
echo "#define HAVE_MMX 1" >> $TMPH
fi
+if test "$mmi" = "yes" ; then
+ echo "TARGET_MMI=yes" >> config.mak
+ echo "#define HAVE_MMI 1" >> $TMPH
+fi
if test "$altivec" = "yes" ; then
echo "TARGET_ALTIVEC=yes" >> config.mak
echo "#define HAVE_ALTIVEC 1" >> $TMPH