1 /**
2 * This is the build config file.
3 *
4 * With this you can setup what to inlcude/exclude automatically during any build.  Just comment
5 * out the line that enum's the word for the thing you want to remove.  phew!
6 */
7 module tomcrypt.cfg;
8 
9 import core.stdc.config;
10 
11 extern(C) nothrow:
12 
13 /* type of argument checking, 0=default, 1=fatal and 2=error+continue, 3=nothing */
14 enum ARGTYPE  = 0;
15 
16 
17 /* Controls endianess and size of registers.  Leave uncommented to get platform neutral [slower] code 
18  * 
19  * Note: in order to use the optimized macros your platform must support unaligned 32 and 64 bit read/writes.
20  * The x86 platforms allow this but some others [ARM for instance] do not.  On those platforms you **MUST**
21  * use the portable [slower] macros.
22  */
23 
24 /* No asm is a quick way to disable anything "not portable" */
25 version(LTC_NO_ASM)
26 {
27     version = LTC_NO_ROLC;
28     version = LTC_NO_BSWAP;  
29 }
30 else
31 {
32     version(LittleEndian)
33     {
34         version = ENDIAN_LITTLE;
35     }
36     version(BitEndian)
37     {
38         version = ENDIAN_BIG;
39     }
40     
41     /* detect x86-32 machines somewhat */
42     version(x86)
43     {
44         version = ENDIAN_32BITWORD;
45         version(LTC_NO_FAST) {}
46         else
47         {
48             version = LTC_FAST;
49             alias LTC_FAST_TYPE = c_ulong;
50         }
51     }
52     
53     /* detects MIPS R5900 processors (PS2) */
54     version(MIPS64)
55     {
56         version = ENDIAN_64BITWORD;
57     }
58     version(MIPS32)
59     {
60         version = ENDIAN_32BITWORD;
61     }
62     
63     /* detect amd64 */
64     version(X86_64)
65     {
66         version = ENDIAN_64BITWORD; 
67         version(LTC_NO_FAST) {}
68         else
69         {
70             version = LTC_FAST;
71             alias LTC_FAST_TYPE = c_ulong;
72         }
73     }
74     
75     /* detect PPC32 */
76     version(PPC)
77     {
78         version = ENDIAN_32BITWORD;
79         version(LTC_NO_FAST) {}
80         else
81         {
82             version = LTC_FAST;
83             alias LTC_FAST_TYPE = c_ulong;
84         }
85     }
86     
87     /* detect sparc and sparc64 */
88     version(SPARC)
89     {
90         version = ENDIAN_32BITWORD;
91     }
92     version(SPARC64)
93     {
94         version = ENDIAN_64BITWORD;
95     }
96 }
97 
98 /* version = ENDIAN_LITTLE; */
99 /* version = ENDIAN_BIG; */
100 
101 /* version = ENDIAN_32BITWORD; */
102 /* version = ENDIAN_64BITWORD; */
103 
104 version(ENDIAN_BIG)
105 {
106     version(ENDIAN_32BITWORD) {}
107     else version(ENDIAN_64BITWORD) {}
108     else
109     {
110         pragma(msg, "You must specify a word size as well as endianess in tomcrypt_cfg.h");
111     }
112 } 
113 else version(ENDIAN_LITTLE)
114 {
115     version(ENDIAN_32BITWORD) {}
116     else version(ENDIAN_64BITWORD) {}
117     else
118     {
119         pragma(msg, "You must specify a word size as well as endianess in tomcrypt_cfg.h");
120     }
121 } else
122 {
123     version = ENDIAN_NEUTRAL;
124 }
125 
126 /* $Source: /cvs/libtom/libtomcrypt/src/headers/tomcrypt_cfg.h,v $ */
127 /* $Revision: 1.19 $ */
128 /* $Date: 2006/12/04 02:19:48 $ */