source: git/m4/cpu-check.m4 @ 84b294

spielwiese
Last change on this file since 84b294 was 41dde6, checked in by Mohamed Barakat <mohamed.barakat@…>, 13 years ago
- moved the definitions of HAVE_MULT_MOD, HAVE_DIV_MOD, and HAVE_GENERIC_ADD to cpu-check.m4 - generate misc/auxiliary.h in configure script
  • Property mode set to 100644
File size: 3.0 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_singuname" = ix86-Win; then
17  EXEC_EXT=".exe"
18  AC_DEFINE(SI_CPU_I386,1,"ix86 under Windows")
19  AC_SUBST(SI_CPU_I386)
20fi
21AC_SUBST(EXEC_EXT)
22if test "$ac_cv_singuname" = x86_64-Linux; then
23  AC_DEFINE(SI_CPU_X86_64,1,"ix86-64 under GNU/Linux")
24  AC_SUBST(SI_CPU_X86_64)
25fi
26if test "$ac_cv_singuname" = ix86-Linux; then
27  AC_DEFINE(SI_CPU_I386,1,"ix86 under GNU/Linux")
28  AC_SUBST(SI_CPU_I386)
29fi
30if test "$ac_cv_singuname" = IA64-Linux; then
31  AC_DEFINE(SI_CPU_IA64,1,"ia64 under GNU/Linux")
32  AC_SUBST(SI_CPU_IA64)
33fi
34if test "$ac_cv_singuname" = ppc-Linux; then
35  AC_DEFINE(SI_CPU_PPC,1,"PPC under GNU/Linux")
36  AC_SUBST(SI_CPU_PPC)
37fi
38if test "$ac_cv_singuname" = ppcMac-darwin; then
39  AC_DEFINE(SI_CPU_PPC,1,"PPC under MacOS")
40  AC_SUBST(SI_CPU_PPC)
41fi
42# test again with CPU names
43if test "$ac_cv_singcpuname" = i386; then
44  AC_DEFINE(SI_CPU_I386,1,"i386")
45  AC_SUBST(SI_CPU_I386)
46fi
47if test "$ac_cv_singcpuname" = i686; then
48  AC_DEFINE(SI_CPU_I386,1,"i686")
49  AC_SUBST(SI_CPU_I386)
50fi
51if test "$ac_cv_singcpuname" = x86_64; then
52  AC_DEFINE(SI_CPU_X86_64,1,"x86-64")
53  AC_SUBST(SI_CPU_X86_64)
54fi
55if test "$ac_cv_singcpuname" = ia64; then
56  AC_DEFINE(SI_CPU_IA64,1,"ia64")
57  AC_SUBST(SI_CPU_IA64)
58fi
59if test "$ac_cv_singcpuname" = sparc; then
60  AC_DEFINE(SI_CPU_SPARC,1,"SPARC")
61  AC_SUBST(SI_CPU_SPARC)
62fi
63if test "$ac_cv_singcpuname" = ppc; then
64  AC_DEFINE(SI_CPU_PPC,1,"PPC")
65  AC_SUBST(SI_CPU_PPC)
66fi
67
68# UNAME and PATH
69AC_MSG_CHECKING(uname for Singular)
70
71#ac_cv_singuname=`singuname.sh`
72AC_MSG_RESULT($ac_cv_singuname)
73if test "$ac_cv_singuname" = unknown; then
74  AC_MSG_WARN(Unknown architecture: Check singuname.sh)
75  ac_cv_singuname="unknown"
76fi
77AC_DEFINE_UNQUOTED(S_UNAME, "$ac_cv_singuname", Singular\'s own uname\, believe it or not)
78
79
80AS_CASE([$host_cpu],
81dnl the following settings seems to be better on i386 and x86_64 processors
82  [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)],
83dnl the following settings seems to be better on itanium processors
84dnl AC_DEFINE(HAVE_MULT_MOD,1,)
85  [ia64*], [AC_DEFINE(HAVE_GENERIC_ADD,1,use branch for addition in Z/p otherwise it uses a generic add)],
86dnl the following settings seems to be better on sparc processors
87  [sparc*], [
88            AC_DEFINE(HAVE_MULT_MOD,1,multiplication is fast on the cpu: a*b is with mod otherwise using tables of logartihms)
89            AC_DEFINE(HAVE_DIV_MOD,1,division using extend euclidian algorithm otherwise using tables of logartihms)
90            ],
91dnl the following settings seems to be better on ppc processors
92dnl testet on: ppc_Linux, 740/750 PowerMac G3, 512k L2 cache
93  [powerpc*|ppc*], [AC_DEFINE(HAVE_MULT_MOD,1,multiplication is fast on the cpu: a*b is with mod otherwise using tables of logartihms)],
94  []
95)
96
97])
Note: See TracBrowser for help on using the repository browser.