source: git/m4/cpu-check.m4 @ 8d1432e

spielwiese
Last change on this file since 8d1432e was 92644b, checked in by Hans Schoenemann <hannes@…>, 11 years ago
fix: version checks for header removed Singular/version.h (define now in config.h) new check for S_UNAME: uname -m uname -s remmoved feVersionId
  • Property mode set to 100644
File size: 2.1 KB
Line 
1# Check the cpu type
2
3dnl SING_CHECK_CPU
4dnl
5dnl check the cpu and define EXEC_EXT and SI_CPU*
6
7AC_DEFUN([SING_CHECK_CPU],
8[
9AC_CANONICAL_HOST
10AC_MSG_CHECKING(CPU for singular)
11
12# CPUUNAME and PATH
13ac_cv_singcpuname=`uname -m`
14AC_MSG_RESULT($ac_cv_singcpuname)
15
16if test "$ac_cv_singcpuname" = i386; then
17  AC_DEFINE(SI_CPU_I386,1,"i386")
18  AC_SUBST(SI_CPU_I386)
19fi
20if test "$ac_cv_singcpuname" = i686; then
21  AC_DEFINE(SI_CPU_I386,1,"i686")
22  AC_SUBST(SI_CPU_I386)
23fi
24if test "$ac_cv_singcpuname" = x86_64; then
25  AC_DEFINE(SI_CPU_X86_64,1,"x86-64")
26  AC_SUBST(SI_CPU_X86_64)
27fi
28if test "$ac_cv_singcpuname" = ia64; then
29  AC_DEFINE(SI_CPU_IA64,1,"ia64")
30  AC_SUBST(SI_CPU_IA64)
31fi
32if test "$ac_cv_singcpuname" = sparc; then
33  AC_DEFINE(SI_CPU_SPARC,1,"SPARC")
34  AC_SUBST(SI_CPU_SPARC)
35fi
36if test "$ac_cv_singcpuname" = ppc; then
37  AC_DEFINE(SI_CPU_PPC,1,"PPC")
38  AC_SUBST(SI_CPU_PPC)
39fi
40
41# UNAME and PATH
42AC_MSG_CHECKING(uname for Singular)
43
44#ac_cv_singuname=`./config.guess`
45ac_cv_singuname=`uname -m`-`uname -s`
46AC_MSG_RESULT($ac_cv_singuname)
47AC_DEFINE_UNQUOTED(S_UNAME, "$ac_cv_singuname", Singular\'s own uname\, believe it or not)
48
49
50AS_CASE([$host_cpu],
51dnl the following settings seems to be better on i386 and x86_64 processors
52  [i*86*|x86_64*], [AC_DEFINE(HAVE_MULT_MOD,1,multiplication is fast on the cpu: a*b is with mod otherwise using tables of logartihms)],
53dnl the following settings seems to be better on itanium processors
54dnl AC_DEFINE(HAVE_MULT_MOD,1,)
55  [ia64*], [AC_DEFINE(HAVE_GENERIC_ADD,1,use branch for addition in Z/p otherwise it uses a generic add)],
56dnl the following settings seems to be better on sparc processors
57  [sparc*], [
58            AC_DEFINE(HAVE_MULT_MOD,1,multiplication is fast on the cpu: a*b is with mod otherwise using tables of logartihms)
59            AC_DEFINE(HAVE_DIV_MOD,1,division using extend euclidian algorithm otherwise using tables of logartihms)
60            ],
61dnl the following settings seems to be better on ppc processors
62dnl testet on: ppc_Linux, 740/750 PowerMac G3, 512k L2 cache
63  [powerpc*|ppc*], [AC_DEFINE(HAVE_MULT_MOD,1,multiplication is fast on the cpu: a*b is with mod otherwise using tables of logartihms)],
64  []
65)
66
67])
Note: See TracBrowser for help on using the repository browser.