1 | # Check the cpu type |
---|
2 | |
---|
3 | dnl SING_CHECK_CPU |
---|
4 | dnl |
---|
5 | dnl check the cpu and define EXEC_EXT and SI_CPU* |
---|
6 | |
---|
7 | AC_DEFUN([SING_CHECK_CPU], |
---|
8 | [ |
---|
9 | AC_CANONICAL_HOST |
---|
10 | AC_MSG_CHECKING(CPU for singular) |
---|
11 | |
---|
12 | # CPUUNAME and PATH |
---|
13 | ac_cv_singcpuname=`uname -m` |
---|
14 | AC_MSG_RESULT($ac_cv_singcpuname) |
---|
15 | |
---|
16 | if test "$ac_cv_singcpuname" = i386; then |
---|
17 | AC_DEFINE(SI_CPU_I386,1,"i386") |
---|
18 | AC_SUBST(SI_CPU_I386) |
---|
19 | fi |
---|
20 | if test "$ac_cv_singcpuname" = i686; then |
---|
21 | AC_DEFINE(SI_CPU_I386,1,"i686") |
---|
22 | AC_SUBST(SI_CPU_I386) |
---|
23 | fi |
---|
24 | if test "$ac_cv_singcpuname" = x86_64; then |
---|
25 | AC_DEFINE(SI_CPU_X86_64,1,"x86-64") |
---|
26 | AC_SUBST(SI_CPU_X86_64) |
---|
27 | fi |
---|
28 | if test "$ac_cv_singcpuname" = ia64; then |
---|
29 | AC_DEFINE(SI_CPU_IA64,1,"ia64") |
---|
30 | AC_SUBST(SI_CPU_IA64) |
---|
31 | fi |
---|
32 | if test "$ac_cv_singcpuname" = sparc; then |
---|
33 | AC_DEFINE(SI_CPU_SPARC,1,"SPARC") |
---|
34 | AC_SUBST(SI_CPU_SPARC) |
---|
35 | fi |
---|
36 | if test "$ac_cv_singcpuname" = ppc; then |
---|
37 | AC_DEFINE(SI_CPU_PPC,1,"PPC") |
---|
38 | AC_SUBST(SI_CPU_PPC) |
---|
39 | fi |
---|
40 | |
---|
41 | # UNAME and PATH |
---|
42 | AC_MSG_CHECKING(uname for Singular) |
---|
43 | |
---|
44 | #ac_cv_singuname=`./config.guess` |
---|
45 | ac_cv_singuname=`uname -m`-`uname -s` |
---|
46 | AC_MSG_RESULT($ac_cv_singuname) |
---|
47 | AC_DEFINE_UNQUOTED(S_UNAME, "$ac_cv_singuname", Singular\'s own uname\, believe it or not) |
---|
48 | |
---|
49 | |
---|
50 | AS_CASE([$host_cpu], |
---|
51 | dnl the following settings seems to be better on itanium processors |
---|
52 | [ia64*], [ |
---|
53 | AC_DEFINE(HAVE_GENERIC_ADD,1,use branch for addition in Z/p otherwise it uses a generic add)], |
---|
54 | dnl the following settings seems to be better on i386 and x86_64 processors |
---|
55 | dnl AC_DEFINE(HAVE_GENERIC_MULT,1,) |
---|
56 | [i*86*|x86_64*], [ |
---|
57 | AC_DEFINE(HAVE_GENERIC_ADD,1,use branch for addition in Z/p otherwise it uses a generic add) |
---|
58 | AC_DEFINE(HAVE_GENERIC_MULT,1,multiplication is fast on the cpu: a*b is with mod otherwise using tables of logartihms) |
---|
59 | ], |
---|
60 | dnl the following settings seems to be better on sparc processors |
---|
61 | [sparc*], [ |
---|
62 | AC_DEFINE(HAVE_GENERIC_ADD,1,use branch for addition in Z/p otherwise it uses a generic add) |
---|
63 | ], |
---|
64 | dnl the following settings seems to be better on ppc processors |
---|
65 | dnl testet on: ppc_Linux, 740/750 PowerMac G3, 512k L2 cache |
---|
66 | [powerpc*|yyppc*], [AC_DEFINE(HAVE_GENERIC_MULT,1,multiplication is fast on the cpu: a*b is with mod otherwise using tables of logartihms)], |
---|
67 | [] |
---|
68 | ) |
---|
69 | |
---|
70 | ]) |
---|