source: Sophya/trunk/SophyaLib/BaseTools/machdefs_mkmf.h@ 2867

Last change on this file since 2867 was 2867, checked in by ansari, 20 years ago

Portage/compilation sur AIX-XlC (regatta) - Reza 3 Jan 2006

File size: 10.1 KB
RevLine 
[1261]1#ifndef MACHDEFS_SEEN
2#define MACHDEFS_SEEN
3
4/***********************************************************************/
5/* Find hardware, OS and compiler combination */
6/***********************************************************************/
7
8#if defined(OSF1)
9#define MACH_ALPHA
10#define OS_OSF1
11#endif
12
13#if defined(_AIX) || defined(AIX)
14#define MACH_IBMRS
15#define OS_AIX
16#endif
17
18#if defined(__hpux__) || defined(HPUX)
19#define MACH_HP
20#define OS_HPUX
21#endif
22
23#ifdef __MWERKS__
24#define MACH_POWERMAC
25#define OS_MACOS
26#endif
27
28#if defined(SunOS) || defined ( sun )
29#define MACH_SUN
30#define OS_SOLARIS
31#endif
32
33#ifdef IRIX64
34#define MACH_SGI
35#define OS_IRIX64
36#endif
37
[1783]38#ifdef __APPLE__
39#ifdef __MACH__
40#define MACH_POWERPC
41#define OS_MACOSX
42#endif
43#endif
44
[1261]45#if defined(Linux) || defined(linux)
46#if defined(__alpha__)
47#define MACH_ALPHA
48#elif defined(powerpc)
49#define MACH_POWERPC
50#elif defined(__i386__)
51#define MACH_INTEL
52#else
53#error Undefined Platform (machine) type with linux in machdefs.h
54#endif
55#define OS_LINUX
56#endif
57
58
59/***********************************************************************/
60/* Hardware/OS dependent stuff */
61/***********************************************************************/
62
63#if defined(OS_OSF1)
64
65 typedef signed char int_1;
66 typedef unsigned char uint_1;
67 typedef int int_4;
68 typedef unsigned int uint_4;
69 typedef short int_2;
70 typedef unsigned short uint_2;
71 typedef float r_4;
72 typedef double r_8;
73 typedef long long int_8;
74 typedef unsigned long long uint_8;
75
76#define SWAP 1
77#define SWAPDEFAUT 1
78
79#elif defined(OS_HPUX)
80
81 typedef signed char int_1;
82 typedef unsigned char uint_1;
83 typedef int int_4 ;
84 typedef unsigned int uint_4;
85 typedef short int_2;
86 typedef unsigned short uint_2;
87 typedef float r_4;
88 typedef double r_8;
89 typedef long long int_8;
90 typedef unsigned long long uint_8;
91
92#define SWAP 0
93#define SWAPDEFAUT 0
94
95
96#elif defined( OS_AIX )
97
98 typedef signed char int_1;
99 typedef unsigned char uint_1;
100 typedef int int_4;
101 typedef unsigned int uint_4;
102 typedef short int_2;
103 typedef unsigned short uint_2;
104 typedef float r_4;
105 typedef double r_8;
106 typedef long long int_8;
107 typedef unsigned long long uint_8;
108
109#define SWAP 0
110#define SWAPDEFAUT 0
111
112/* Check for solaris on intel... */
113#elif defined( OS_SOLARIS ) && defined( MACH_SUN )
114
115 typedef signed char int_1;
116 typedef unsigned char uint_1;
117 typedef int int_4;
118 typedef unsigned int uint_4;
119 typedef short int_2;
120 typedef unsigned short uint_2;
121 typedef float r_4;
122 typedef double r_8;
123 typedef long long int_8;
124 typedef unsigned long long uint_8;
125
126#define SWAP 0
127#define SWAPDEFAUT 0
128
129#elif defined( OS_IRIX64 )
130
131 typedef signed char int_1;
132 typedef unsigned char uint_1;
133 typedef int int_4;
134 typedef unsigned int uint_4;
135 typedef short int_2;
136 typedef unsigned short uint_2;
137 typedef float r_4;
138 typedef double r_8;
139 typedef long long int_8;
140 typedef unsigned long long uint_8;
141
142#define SWAP 0
143#define SWAPDEFAUT 0
144
145/* Check linux on other machines than Intel */
146#elif defined(OS_LINUX)
147/* Sizes OK for PowerPC, Alpha, Intel */
148/* On Alpha, long is 8 bytes */
149 typedef signed char int_1;
150 typedef unsigned char uint_1;
151 typedef int int_4;
152 typedef unsigned int uint_4;
153 typedef short int_2;
154 typedef unsigned short uint_2;
155 typedef float r_4;
156 typedef double r_8;
157 typedef long long int_8;
158 typedef unsigned long long uint_8;
159
160#if defined(powerpc) || (__alpha__)
161#define SWAP 0
162#define SWAPDEFAUT 0
163#else
164#define SWAP 1
165#define SWAPDEFAUT 1
166#endif
167
168#elif defined(OS_MACOS)
169
170 typedef signed char int_1;
171 typedef unsigned char uint_1;
172 typedef long int_4;
173 typedef unsigned long uint_4;
174 typedef short int_2;
175 typedef unsigned short uint_2;
176 typedef float r_4;
177 typedef double r_8;
178 typedef long long int_8;
179 typedef unsigned long long uint_8;
180
181#define SWAP 0
182#define SWAPDEFAUT 0
183
[1783]184#elif defined(OS_MACOSX)
185
186 typedef signed char int_1;
187 typedef unsigned char uint_1;
188 typedef int int_4;
189 typedef unsigned int uint_4;
190 typedef short int_2;
191 typedef unsigned short uint_2;
192 typedef float r_4;
193 typedef double r_8;
194 typedef long long int_8;
195 typedef unsigned long long uint_8;
196
197#define SWAP 0
198#define SWAPDEFAUT 0
199
200
[1261]201#else
202#error Undefined Machine/OS type in machdefs.h
203#endif
204
205
206
207#if SWAP==1
208#define IS_BIG_ENDIAN 0
209#else
210#define IS_BIG_ENDIAN 1
211#endif
212
213
214/***********************************************************************/
215/* Find Compiler */
216/***********************************************************************/
217
218/* __MWERKS__ : Metrowerks Codewarrior (>= PRO 4) */
219/* __DECCXX : DEC CXX, version >= 6 is required */
220/* __GNUG__ : GNU C++ 2.8.1, egcs ?? */
221/* __aCC__ : aCC on HP */
222/* __KCC__ : KCC, version >= 3.3 is required */
223/* __SGICC__ : SGI (IRIX64) CC compiler */
224
225/***********************************************************************/
226/* Compiler-specific stuff */
227/***********************************************************************/
228
229/* Some features will be *required* for Planck. Which ones ? */
230
231/* ANSI_TEMPLATES : use ANSI syntax for explicit templates */
232/* GNUG_TEMPLATES : use GNU syntax for explicit templates */
233/* PRAGMA_TEMPLATES : use pragma template, a la cxx */
234/* COMPILER_EXCEPTIONS : knows about exceptions --- required ? */
235/* STREAMPOS_IS_CLASS : streampos is a real class */
236/* ITER_TAG : use iter_tag for iterator qualifiers in STL */
237/* NO_STRSTREAM : does not have strstream */
[1889]238/* NO_EXPLICIT : does not know about explicit keyword */
[1261]239/* HAS_IOS_BIN */
240/* HAS_IOS_NOCREATE */
241/* HAS_VEC_NEW : operator new[] */
242/* CC_HAS_RTTI_SUPPORT has Run Time Type Identification support */
243/* ANSI_IO : rdbuf()->pubseekoff rather than seekg */
244/* HAS_STR_NPOS : has string::npos and not a global NPOS */
245/* NO_IOS_COMPLEX : does not have operator << defined for complex */
[2339]246/* DECL_TEMP_SPEC : Template specialization declaration */
[1261]247
248
[2322]249/* (STREAMPOS_IS_CLASS non-active: ca compile sans sur gcc3.2 et cxx)
250 rz+cmv 11/02/03 */
251
[1261]252/* The following is true for most compilers */
253
254#ifndef HAS_VEC_NEW
255#define HAS_VEC_NEW
256#endif
257
258#ifndef COMPILER_EXCEPTIONS
259#define COMPILER_EXCEPTIONS
260#endif
261
262#ifndef CC_HAS_RTTI_SUPPORT
263#define CC_HAS_RTTI_SUPPORT
264#endif
265
[2339]266
267#ifndef DECL_TEMP_SPEC
268#define DECL_TEMP_SPEC
269#endif
270
271
[1261]272/* now the specific things */
273
274#ifdef __MWERKS__
275#define ANSI_TEMPLATES
276#undef HAS_VEC_NEW
277#define NO_STRSTREAM
278//#define STREAMPOS_IS_CLASS
279#define ITER_TAG
280#define HAS_IOS_BIN
281#define HAS_IOS_NOCREATE
282#define HAS_STR_NPOS
283#endif
284
285#ifdef __GNUG__
286#define ANSI_TEMPLATES
[2322]287/*
288if (__GNUC__ >= 3)
289define STREAMPOS_IS_CLASS
290endif
291*/
292#define GNU_TEMPLATES
[1261]293#define HAS_STR_NPOS
294#define HAS_IOS_BIN
295#define HAS_IOS_NOCREATE
296#endif
297
298#ifdef __DECCXX
299#define HAS_STR_NPOS
300#define ITER_TAG
301#define __CXX_PRAGMA_TEMPLATES__
302#define PRAGMA_TEMPLATES
303#endif
304
305#if defined (__aCC__)
306#ifndef ANSI_TEMPLATES
307#define ANSI_TEMPLATES
308#endif
309#endif
310
311#if defined(__KCC__)
312/* KCC V 3.2 ne compile pas i/ostream s ; long p = s.tellg(); OK en V 3.3 */
313#define HAS_STR_NPOS
314#ifndef ANSI_TEMPLATES
315#define ANSI_TEMPLATES
316#endif
317#endif
318
319#if defined(__SGICC__)
320#define HAS_STR_NPOS
321#ifndef ANSI_TEMPLATES
322#define ANSI_TEMPLATES
[2867]323#endif
[2339]324#undef DECL_TEMP_SPEC
325#define DECL_TEMP_SPEC template <>
[1261]326#endif
[2867]327
328#if defined(__IBMCPP__)
329/* IBM xlC compiler support Added : dec 2005 */
330#ifndef ANSI_TEMPLATES
331#define ANSI_TEMPLATES
[1261]332#endif
[2867]333#undef DECL_TEMP_SPEC
334#define DECL_TEMP_SPEC template <>
335#endif
[1261]336
337/* Get things has homogeneous as possible between compilers */
338
339#ifdef HAS_STR_NPOS
340#define NPOS string::npos
341#else
342#define NPOS (size_t)-1
343#endif
344
345#ifndef __GNUG__
346#define __PRETTY_FUNCTION__ __FILE__ " __LINE__ "
347#ifndef __FUNCTION__
348#define __FUNCTION__ __FILE__ " __LINE__ "
349#endif
350#ifndef __KCC__
351#define __attribute__(_x_)
352#endif
353#endif
354
[1889]355#ifdef NO_EXPLICIT
[1261]356#define explicit
357#endif
358
359#ifdef HAS_IOS_BIN
360#define IOS_BIN ios::binary
361#else
362#define IOS_BIN 0
363#endif
364
[2322]365/* Commente par Reza+CMV - Fev 2003
366 ifdef ANSI_IO
367 define seekg(p_, m_) rdbuf()->pubseekoff(p_,m_)
368 define seekp(p_, m_) rdbuf()->pubseekoff(p_,m_)
369 endif
370*/
[1261]371
372#ifdef __MWERKS__
373//#define hypot(_x_,_y_) sqrt((_x_)*(_x_) + (_y_)*(_y_))
374#define random() (rand()*65538.0 + rand()*2. + rand())
375#define srandom srand
376#define initstate(seed, tab, n) srand(seed)
377#define nice(_x)
378
379#ifdef __cplusplus
380#include <string.h>
381#include <string>
382inline bool operator< (string const& s1, string const& s2)
383{ return (strcmp(s1.c_str(), s2.c_str()) < 0); }
384#endif
385#endif
386
[1783]387#ifdef OS_MACOSX
388#define NO_VALUES_H
389#include "osx_values.h"
390#endif
[1261]391
[1783]392
[1261]393/********************************************************/
394/* Outil d'impressions pour debug */
395#define PR(_data_) {cout<<" "<<#_data_<<" "<<_data_;}
396#define CR {cout<<"\n"<<flush;}
397/* ********************************************************/
398
399/* ---- Activation des flags de debug/bound checking ----- */
400#ifdef SOPHYA_DEBUG
401#define SO_BOUNDCHECKING
402#endif
403
404/* ---- La taille et les index des tableaux ---- */
405#ifdef SGI_ARCH64
406typedef int_8 sa_size_t ;
407#else
408typedef int_4 sa_size_t ;
409#endif
410
411/* Compatibilite, avant de migrer tout le code en "PLANCK" */
412
413#ifdef __cplusplus
[1870]414/* Standard C++ library classes are in the namespace std */
415namespace std { }
416using namespace std;
[2615]417/*******************************************/
418/* SOPHYA classes are in namespace SOPHYA */
419/* namespace SOPHYA {} */
420/* using namespace SOPHYA; */
421/* Please use instead: sopnamsp.h */
422/*******************************************/
[1261]423#define EXPLICIT explicit
424#endif
425
426#endif
Note: See TracBrowser for help on using the repository browser.