summaryrefslogtreecommitdiff
path: root/BUILD/check-cpu
diff options
context:
space:
mode:
authorMikael Ronstrom <mikael@dator8>2010-09-16 10:04:10 +0200
committerMikael Ronstrom <mikael@dator8>2010-09-16 10:04:10 +0200
commit5f2bfccec41d0b5d693355628a1c51c66b47b75b (patch)
tree26e76bafc0bee6c83e3dd7052976f5ed2c302300 /BUILD/check-cpu
parent0b3a1807a1452e3936f9bc84425650bf924799d7 (diff)
parent0876ef05131461c4fcaad9e656dfcb4a3626e33b (diff)
downloadmariadb-git-5f2bfccec41d0b5d693355628a1c51c66b47b75b.tar.gz
merge updates of build_mccge.sh and check-cpu
Diffstat (limited to 'BUILD/check-cpu')
-rwxr-xr-xBUILD/check-cpu46
1 files changed, 43 insertions, 3 deletions
diff --git a/BUILD/check-cpu b/BUILD/check-cpu
index 585043de67c..070e7de0125 100755
--- a/BUILD/check-cpu
+++ b/BUILD/check-cpu
@@ -4,6 +4,7 @@
# best compiler optimization flags for gcc
# Will return result in:
# cpu_arg : Type of CPU
+# low_cpu_arg : Type of CPU used up until GCC v3.3
# check_cpu_args : Arguments for GCC compiler settings
#
@@ -33,7 +34,7 @@ check_compiler_cpu_flags () {
case `gcc -dumpmachine` in
i?86-* | x86_64-*)
if test "$cc_comp" -lt 304 ; then
- check_cpu_cflags="-mcpu=${cpu_arg}"
+ check_cpu_cflags="-mcpu=${low_cpu_arg}"
elif test "$cc_comp" -ge 402 ; then
check_cpu_cflags="-mtune=native"
else
@@ -141,9 +142,10 @@ check_cpu () {
# detect CPU shortname as used by gcc options
# this list is not complete, feel free to add further entries
cpu_arg=""
- case "$cpu_family--$model_name--$spu_arch" in
+ low_cpu_arg=""
+ case "$cpu_vendor--$cpu_family--$model_name--$spu_arch" in
# DEC Alpha
- Alpha*EV6*)
+ *Alpha*EV6*)
cpu_arg="ev6";
;;
#Core 2 Duo
@@ -172,6 +174,13 @@ check_cpu () {
*Pentium*4*Mobile*)
cpu_arg="pentium4m"
;;
+ *Pentium\(R\)*\ M*)
+ cpu_arg="pentium-m"
+ low_cpu_arg="pentium3"
+ ;;
+ *Pentium\(R\)*\ D*)
+ cpu_arg="prescott"
+ ;;
*Pentium*4*)
cpu_arg="pentium4"
;;
@@ -196,6 +205,12 @@ check_cpu () {
*Celeron*)
cpu_arg="pentium2"
;;
+ *Atom*)
+ cpu_arg="prescott"
+ ;;
+ *GenuineIntel*)
+ cpu_arg="pentium"
+ ;;
*Turion*)
cpu_arg="athlon64"
;;
@@ -205,9 +220,30 @@ check_cpu () {
*Athlon*)
cpu_arg="athlon"
;;
+ *AMD-K7*)
+ cpu_arg="athlon"
+ ;;
+ *Athlon*XP\ *)
+ cpu_arg="athlon-xp"
+ ;;
+ *AMD*Sempron\(tm\)*)
+ cpu_arg="athlon-mp"
+ ;;
+ *AMD*Athlon\(tm\)\ 64*)
+ cpu_arg="k8"
+ ;;
*Opteron*)
cpu_arg="opteron"
;;
+ *Phenom*)
+ cpu_arg="k8"
+ ;;
+ *AuthenticAMD*)
+ cpu_arg="k6"
+ ;;
+ *VIA\ *)
+ cpu_arg="i686"
+ ;;
# MacOSX / Intel
*i386*i486*)
cpu_arg="pentium-m"
@@ -239,6 +275,10 @@ check_cpu () {
;;
esac
+ if test "x$low_cpu_arg" = "x" ; then
+ low_cpu_arg="$cpu_arg"
+ fi
+
if test -z "$cpu_arg" ; then
if test "$CPUINFO" != " " ; then
# fallback to uname if necessary