Corrected cpu script for non-64bit semprons, updated check for pentium-m archs. Also dropped some cflags judged unsafe or counter-productive.

This commit is contained in:
grinvader
2005-10-27 12:25:35 +00:00
parent 5a67f4d561
commit 543ef5256d
2 changed files with 30 additions and 30 deletions

View File

@@ -306,18 +306,18 @@ if test x$enable_cpucheck != xno; then
} }
} }
int main(int argc, char *argv[]) int main()
{ {
char *cpu = 0, model_name[216], flags[216]; char model_name[216], flags[216], cpu_family[216];
char cpu_family[216], vendor_id[216], model[216]; char vendor_id[216], model[216], *cpu = 0;
FILE *fp; FILE *fp;
*model_name = 0; *model_name = 0;
*flags = 0;
*cpu_family = 0; *cpu_family = 0;
*vendor_id = 0; *vendor_id = 0;
*model = 0; *model = 0;
strcpy(flags, " ");
if ((fp = fopen("/proc/cpuinfo", "r"))) if ((fp = fopen("/proc/cpuinfo", "r")))
{ {
@@ -328,8 +328,11 @@ if test x$enable_cpucheck != xno; then
{ {
if (!strncmp(key, "model name", strlen("model name")) && !*model_name) if (!strncmp(key, "model name", strlen("model name")) && !*model_name)
{ strcpy(model_name, arg); } { strcpy(model_name, arg); }
else if (!strncmp(key, "flags", strlen("flags")) && !*flags) else if (!strncmp(key, "flags", strlen("flags")) && !flags[1])
{ strcpy(flags, arg); } {
strcat(flags, arg);
strcat(flags, " ");
}
else if (!strncmp(key, "cpu family", strlen("cpu family")) && !*cpu_family) else if (!strncmp(key, "cpu family", strlen("cpu family")) && !*cpu_family)
{ strcpy(cpu_family, arg); } { strcpy(cpu_family, arg); }
else if (!strncmp(key, "vendor_id", strlen("vendor_id")) && !*vendor_id) else if (!strncmp(key, "vendor_id", strlen("vendor_id")) && !*vendor_id)
@@ -389,9 +392,6 @@ if test x$enable_cpucheck != xno; then
strncat(model_name, (char *)&ecx, 4); strncat(model_name, (char *)&ecx, 4);
strncat(model_name, (char *)&edx, 4); strncat(model_name, (char *)&edx, 4);
} }
while (isspace(*model_name))
{ memmove(model_name, model_name+1, strlen(model_name)); }
} }
} }
@@ -417,7 +417,7 @@ if test x$enable_cpucheck != xno; then
if (!cpu) if (!cpu)
{ {
if (strstr(model_name, "Athlon(tm) 4")) { cpu = "athlon-4"; } if (strstr(model_name, "Athlon(tm) 4")) { cpu = "athlon-4"; }
else { cpu = (strstr(model_name, "Athlon(tm) MP")) ? "athlon-mp" : "athlon-xp"; } else { cpu = (strstr(model_name, "Athlon(tm) MP")) ? "athlon-mp" : cpu = "athlon-xp"; }
} }
} }
@@ -458,7 +458,7 @@ if test x$enable_cpucheck != xno; then
if (!cpu) if (!cpu)
{ {
if (strstr(model_name, "Pentium(R) M") || strstr(model_name, "Celeron(R) M")) if (!strcmp(cpu_family, "6"))
{ {
#if __GNUC__ > 3 || __GNUC_MINOR__ > 3 #if __GNUC__ > 3 || __GNUC_MINOR__ > 3
cpu = "pentium-m"; cpu = "pentium-m";

View File

@@ -124,7 +124,7 @@ else
if test x$release = xyes; then if test x$release = xyes; then
AC_MSG_RESULT(yes) AC_MSG_RESULT(yes)
CFLAGS="$CFLAGS -O3 -pipe -fomit-frame-pointer -ffast-math -fprefetch-loop-arrays -frename-registers -fforce-addr -s" CFLAGS="$CFLAGS -O3 -fomit-frame-pointer -ffast-math -fprefetch-loop-arrays -fforce-addr -s"
NFLAGS="$NFLAGS -O99999999" NFLAGS="$NFLAGS -O99999999"
else else
AC_MSG_RESULT(no) AC_MSG_RESULT(no)