summaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure59
1 files changed, 58 insertions, 1 deletions
diff --git a/configure b/configure
index 787bf38e5b..a92137ec7b 100755
--- a/configure
+++ b/configure
@@ -26,6 +26,7 @@ ranlib="ranlib"
make="make"
strip="strip"
cpu=`uname -m`
+tune="generic"
mmx="default"
altivec="default"
mmi="default"
@@ -272,6 +273,8 @@ for opt do
;;
--cpu=*) cpu=`echo $opt | cut -d '=' -f 2`
;;
+ --tune=*) tune=`echo $opt | cut -d '=' -f 2`
+ ;;
--disable-mmx) mmx="no"
;;
--disable-altivec) altivec="no"
@@ -351,6 +354,58 @@ if test $altivec = "default"; then
fi
fi
+# Add processor-specific flags
+TUNECPU="generic"
+if test $tune != "generic"; then
+ case $tune in
+ 601|ppc601|PowerPC601)
+ CFLAGS="$CFLAGS -mcpu=601"
+ if test $altivec = "yes"; then
+ echo "WARNING: tuning for PPC601 but altivec enabled !";
+ fi
+ TUNECPU=ppc601
+ ;;
+ 603*|ppc603*|PowerPC603*)
+ CFLAGS="$CFLAGS -mcpu=603"
+ if test $altivec = "yes"; then
+ echo "WARNING: tuning for PPC603 but altivec enabled !";
+ fi
+ TUNECPU=ppc603
+ ;;
+ 604*|ppc604*|PowerPC604*)
+ CFLAGS="$CFLAGS -mcpu=604"
+ if test $altivec = "yes"; then
+ echo "WARNING: tuning for PPC604 but altivec enabled !";
+ fi
+ TUNECPU=ppc604
+ ;;
+ G3|75*|ppc75*|PowerPC75*)
+ CFLAGS="$CFLAGS -mcpu=750"
+ if test $altivec = "yes"; then
+ echo "WARNING: tuning for PPC75x but altivec enabled !";
+ fi
+ TUNECPU=ppc750
+ ;;
+ G4|74*|ppc74*|PowerPC74*)
+ CFLAGS="$CFLAGS -mcpu=7400"
+ if test $altivec = "no"; then
+ echo "WARNING: tuning for PPC74xx but altivec disabled !";
+ fi
+ TUNECPU=ppc7400
+ ;;
+ G5|970|ppc970|PowerPC970|power4*|Power4*)
+ CFLAGS="$CFLAGS -mcpu=970 -mtune=970 -mpowerpc64 -force_cpusubtype_ALL "
+ if test $altivec = "no"; then
+ echo "WARNING: tuning for PPC970 but altivec disabled !";
+ fi
+ TUNECPU=ppc970
+ ;;
+ *)
+ echo "WARNING: unknown CPU "$tune", ignored"
+ ;;
+ esac
+fi
+
# See if we have <altivec.h>
cat > $TMPC << EOF
#include <altivec.h>
@@ -686,6 +741,7 @@ echo " --extra-cflags=ECFLAGS add ECFLAGS to CFLAGS [$CFLAGS]"
echo " --extra-ldflags=ELDFLAGS add ELDFLAGS to LDFLAGS [$LDFLAGS]"
echo " --extra-libs=ELIBS add ELIBS [$ELIBS]"
echo " --cpu=CPU force cpu to CPU [$cpu]"
+echo " --tune=PROCESSOR tune code for a particular CPU (may fails or misperforms on other CPUs)"
echo " --disable-mmx disable mmx usage"
echo " --disable-altivec disable AltiVec usage"
echo " --disable-audio-oss disable OSS audio support [default=no]"
@@ -712,7 +768,7 @@ echo "Install prefix $prefix"
echo "Source path $source_path"
echo "C compiler $cc"
echo "make $make"
-echo "CPU $cpu"
+echo "CPU $cpu ($tune)"
echo "Big Endian $bigendian"
if test $cpu = "x86"; then
echo "MMX enabled $mmx"
@@ -792,6 +848,7 @@ elif test "$cpu" = "mips" ; then
echo "TARGET_ARCH_MIPS=yes" >> config.mak
echo "#define ARCH_MIPS 1" >> $TMPH
fi
+echo "#define TUNECPU $TUNECPU" >> $TMPH
if test "$bigendian" = "yes" ; then
echo "WORDS_BIGENDIAN=yes" >> config.mak
echo "#define WORDS_BIGENDIAN 1" >> $TMPH