~mdcallag/+junk/5.1-map

« back to all changes in this revision

Viewing changes to BUILD/check-cpu

  • Committer: msvensson at pilot
  • Date: 2007-04-24 09:11:45 UTC
  • mfrom: (2469.1.106)
  • Revision ID: sp1r-msvensson@pilot.blaudden-20070424091145-10463
Merge pilot.blaudden:/home/msvensson/mysql/my51-m-mysql_upgrade
into  pilot.blaudden:/home/msvensson/mysql/mysql-5.1-maint

Show diffs side-by-side

added added

removed removed

Lines of Context:
64
64
      ;;
65
65
 
66
66
    # Intel ia32
67
 
    *X[eE][oO][nN]*)
 
67
    *Intel*Core*|*X[eE][oO][nN]*)
68
68
      # a Xeon is just another pentium4 ...
69
69
      # ... unless it has the "lm" (long-mode) flag set, 
70
 
      # in that case it's a Xeon with EM64T support 
 
70
      # in that case it's a Xeon with EM64T support
 
71
      # So is Intel Core.
71
72
          if [ -z "$cpu_flag_lm" ]; then
72
73
        cpu_arg="pentium4";
73
74
          else
114
115
    *i386*i486*)
115
116
      cpu_arg="pentium-m";
116
117
      ;;
 
118
    #Core 2 Duo  
 
119
    *Intel*Core\(TM\)2*)
 
120
      cpu_arg="nocona";
 
121
      ;;
117
122
 
118
123
    # Intel ia64
119
124
    *Itanium*)
160
165
 
161
166
  cc_ver=`$cc --version | sed 1q`
162
167
  cc_verno=`echo $cc_ver | sed -e 's/^.*gcc/gcc/g; s/[^0-9. ]//g;        s/^ *//g; s/ .*//g'`
 
168
  set -- `echo $cc_verno | tr '.' ' '`
 
169
  cc_major=$1
 
170
  cc_minor=$2
 
171
  cc_patch=$3
 
172
  cc_comp=`expr $cc_major '*' 100 '+' $cc_minor`
163
173
 
164
174
  case "$cc_ver--$cc_verno" in
165
175
    *GCC*)
166
176
        # different gcc backends (and versions) have different CPU flags
167
177
        case `gcc -dumpmachine` in
168
178
          i?86-*)
169
 
                case "$cc_verno" in
170
 
                      3.4*|3.5*|4.*)
171
 
                            check_cpu_args='-mtune=$cpu_arg -march=$cpu_arg'
172
 
                            ;;
173
 
                      *)
174
 
                            check_cpu_args='-mcpu=$cpu_arg -march=$cpu_arg'
175
 
                            ;;
176
 
            esac
 
179
            if test "$cc_comp" -lt 304
 
180
            then
 
181
                            check_cpu_args='-mcpu=$cpu_arg'
 
182
            else
 
183
                            check_cpu_args='-mtune=$cpu_arg'
 
184
            fi
177
185
            ;;
178
186
          ppc-*)
179
187
                    check_cpu_args='-mcpu=$cpu_arg -mtune=$cpu_arg'
180
188
            ;;
181
189
          x86_64-*)
182
 
                    check_cpu_args='-mtune=$cpu_arg'
 
190
            if test "$cc_comp" -lt 304
 
191
            then
 
192
                            check_cpu_args='-mcpu=$cpu_arg'
 
193
            else
 
194
                            check_cpu_args='-mtune=$cpu_arg'
 
195
            fi
183
196
            ;;
184
197
          *)
185
198
            check_cpu_cflags=""