summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorunknown <df@pippilotta.erinye.com>2007-03-21 15:49:51 +0100
committerunknown <df@pippilotta.erinye.com>2007-03-21 15:49:51 +0100
commit983e1f5acb90ef3db021f393b7d294017f2da926 (patch)
treeeb92480fe1bef90b1fdc918cd13b4adbc02e49ad
parentf52dcd1a85c41540df3957c78f975e40e57cd731 (diff)
downloadmariadb-git-983e1f5acb90ef3db021f393b7d294017f2da926.tar.gz
fix shell script
BUILD/check-cpu: make comparison a little more compatible with less exotic shells
-rwxr-xr-xBUILD/check-cpu9
1 files changed, 7 insertions, 2 deletions
diff --git a/BUILD/check-cpu b/BUILD/check-cpu
index f1c9bc51dc5..d7125da192d 100755
--- a/BUILD/check-cpu
+++ b/BUILD/check-cpu
@@ -160,13 +160,18 @@ 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-*)
- if test "$cc_verno" -lt "3.4"
+ if test "$cc_comp" -lt 304
then
check_cpu_args='-mcpu=$cpu_arg'
else
@@ -177,7 +182,7 @@ check_cpu () {
check_cpu_args='-mcpu=$cpu_arg -mtune=$cpu_arg'
;;
x86_64-*)
- if test "$cc_verno" -lt "3.4"
+ if test "$cc_comp" -lt 304
then
check_cpu_args='-mcpu=$cpu_arg'
else