/^([^\t]+)\t+:\s*(.*)$/ and $pc{$1}=$2;
}
close X;
- if ($pc{'vendor_id'} eq "AuthenticAMD" && $pc{'cpu family'} >= 6) {
- $arch = "i686";
+
+ # Try to understand CPU vendor, family and model [inspired by MPlayer's configure script]
+ my $vendor = $pc{'vendor_id'} || "";
+ my $family = $pc{'cpu family'} || 0;
+ my $model = $pc{'model'} || 0;
+ if ($vendor eq "AuthenticAMD") {
+ if ($family >= 6) {
+ if ($model >= 31) { $arch = "athlon64"; }
+ elsif ($model >= 6) { $arch = "athlon-xp"; }
+ else { $arch = "athlon"; }
+ }
+ } elsif ($vendor eq "GenuineIntel") {
+ # We don't recognize Prescott and Nocona cores yet
+ if ($family >= 15) { $arch = "pentium4"; }
+ elsif ($family >= 6) {
+ if ($model >= 7) { $arch = "pentium3"; }
+ elsif ($model >= 3) { $arch = "pentium2"; }
+ }
+ }
+
+ # No match on vendor, try the family
+ if ($arch eq "") {
+ if ($family >= 6) {
+ $arch = "i686";
+ } elsif ($family >= 3) {
+ $arch = "i${family}86";
+ }
}
if ($arch ne "") {
- Log "(according to /proc/cpuinfo) ";
+ Log "(using /proc/cpuinfo) ";
} else {
Log "(don't understand /proc/cpuinfo) ";
}