summaryrefslogtreecommitdiff
path: root/BUILD/check-cpu
diff options
context:
space:
mode:
authorjoerg@trift2. <>2007-03-23 10:57:17 +0100
committerjoerg@trift2. <>2007-03-23 10:57:17 +0100
commit2e5e79cf37c7097918bffad63b77f239694ff6fa (patch)
tree36b7180c86dfeccae6ebcb449634f7aa1885cd80 /BUILD/check-cpu
parentb9a317de708a30f977e94e23e60c286e638d8785 (diff)
parentcbdd03c5d5866e109146029ee20f10d9b4f2c32e (diff)
downloadmariadb-git-2e5e79cf37c7097918bffad63b77f239694ff6fa.tar.gz
Merge trift2.:/MySQL/M51/mysql-5.1
into trift2.:/MySQL/M51/push-5.1
Diffstat (limited to 'BUILD/check-cpu')
-rwxr-xr-xBUILD/check-cpu26
1 files changed, 17 insertions, 9 deletions
diff --git a/BUILD/check-cpu b/BUILD/check-cpu
index 7bcb6815323..2852aa98ef3 100755
--- a/BUILD/check-cpu
+++ b/BUILD/check-cpu
@@ -165,26 +165,34 @@ check_cpu () {
cc_ver=`$cc --version | sed 1q`
cc_verno=`echo $cc_ver | sed -e 's/^.*gcc/gcc/g; s/[^0-9. ]//g; s/^ *//g; s/ .*//g'`
+ set -- `echo $cc_verno | tr '.' ' '`
+ cc_major=$1
+ cc_minor=$2
+ cc_patch=$3
+ cc_comp=`expr $cc_major '*' 100 '+' $cc_minor`
case "$cc_ver--$cc_verno" in
*GCC*)
# different gcc backends (and versions) have different CPU flags
case `gcc -dumpmachine` in
i?86-*)
- case "$cc_verno" in
- 3.4*|3.5*|4.*)
- check_cpu_args='-mtune=$cpu_arg -march=$cpu_arg'
- ;;
- *)
- check_cpu_args='-mcpu=$cpu_arg -march=$cpu_arg'
- ;;
- esac
+ if test "$cc_comp" -lt 304
+ then
+ check_cpu_args='-mcpu=$cpu_arg'
+ else
+ check_cpu_args='-mtune=$cpu_arg'
+ fi
;;
ppc-*)
check_cpu_args='-mcpu=$cpu_arg -mtune=$cpu_arg'
;;
x86_64-*)
- check_cpu_args='-mtune=$cpu_arg'
+ if test "$cc_comp" -lt 304
+ then
+ check_cpu_args='-mcpu=$cpu_arg'
+ else
+ check_cpu_args='-mtune=$cpu_arg'
+ fi
;;
*)
check_cpu_cflags=""