27c725fc6eda0d24c449ac3f7896579cff6559fe
[openssl.git] / crypto / opensslconf.h.in
1 /* crypto/opensslconf.h.in */
2
3 /*
4  * Applications should use -DOPENSSL_API_COMPAT=<version> to suppress the
5  * declarations of functions deprecated in or before <version>. Otherwise, they
6  * still won't see them if the library has been built to disable deprecated
7  * functions.
8  */
9 #if defined(OPENSSL_NO_DEPRECATED)
10 # define DECLARE_DEPRECATED(f)
11 #elif __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 0)
12 # define DECLARE_DEPRECATED(f)    f __attribute__ ((deprecated));
13 #else
14 # define DECLARE_DEPRECATED(f)   f;
15 #endif
16
17 #ifndef OPENSSL_MIN_API
18 #define OPENSSL_MIN_API 0
19 #endif
20
21 #if !defined(OPENSSL_API_COMPAT) || OPENSSL_API_COMPAT < OPENSSL_MIN_API
22 #undef OPENSSL_API_COMPAT
23 #define OPENSSL_API_COMPAT OPENSSL_MIN_API
24 #endif
25
26 #if OPENSSL_API_COMPAT < 0x10100000L
27 # define DEPRECATEDIN_1_1_0(f)   DECLARE_DEPRECATED(f)
28 #else
29 # define DEPRECATEDIN_1_1_0(f)
30 #endif
31
32 #if OPENSSL_API_COMPAT < 0x10000000L
33 # define DEPRECATEDIN_1_0_0(f)   DECLARE_DEPRECATED(f)
34 #else
35 # define DEPRECATEDIN_1_0_0(f)
36 #endif
37
38 #if OPENSSL_API_COMPAT < 0x00908000L
39 # define DEPRECATEDIN_0_9_8(f)   DECLARE_DEPRECATED(f)
40 #else
41 # define DEPRECATEDIN_0_9_8(f)
42 #endif
43
44 /* Generate 80386 code? */
45 #undef I386_ONLY
46
47 #if !(defined(VMS) || defined(__VMS)) /* VMS uses logical names instead */
48 #if defined(HEADER_CRYPTLIB_H) && !defined(OPENSSLDIR)
49 #define ENGINESDIR "/usr/local/lib/engines"
50 #define OPENSSLDIR "/usr/local/ssl"
51 #endif
52 #endif
53
54 #undef OPENSSL_UNISTD
55 #define OPENSSL_UNISTD <unistd.h>
56
57 #undef OPENSSL_EXPORT_VAR_AS_FUNCTION
58
59 #if defined(HEADER_IDEA_H) && !defined(IDEA_INT)
60 #define IDEA_INT unsigned int
61 #endif
62
63 #if defined(HEADER_MD2_H) && !defined(MD2_INT)
64 #define MD2_INT unsigned int
65 #endif
66
67 #if defined(HEADER_RC2_H) && !defined(RC2_INT)
68 /* I need to put in a mod for the alpha - eay */
69 #define RC2_INT unsigned int
70 #endif
71
72 #if defined(HEADER_RC4_H)
73 #if !defined(RC4_INT)
74 /* using int types make the structure larger but make the code faster
75  * on most boxes I have tested - up to %20 faster. */
76 /*
77  * I don't know what does "most" mean, but declaring "int" is a must on:
78  * - Intel P6 because partial register stalls are very expensive;
79  * - elder Alpha because it lacks byte load/store instructions;
80  */
81 #define RC4_INT unsigned int
82 #endif
83 #if !defined(RC4_CHUNK)
84 /*
85  * This enables code handling data aligned at natural CPU word
86  * boundary. See crypto/rc4/rc4_enc.c for further details.
87  */
88 #undef RC4_CHUNK
89 #endif
90 #endif
91
92 #ifndef OSSL_DES_LONG
93 /* If this is set to 'unsigned int' on a DEC Alpha, this gives about a
94  * %20 speed up (longs are 8 bytes, int's are 4). */
95 #ifndef OSSL_DES_LONG
96 #define OSSL_DES_LONG unsigned long
97 #endif
98 #endif
99
100 #if defined(HEADER_BN_H) && !defined(CONFIG_HEADER_BN_H) && !defined(OPENSSL_SYS_UEFI)
101 #define CONFIG_HEADER_BN_H
102 #undef BN_LLONG
103
104 /* Should we define BN_DIV2W here? */
105
106 /* Only one for the following should be defined */
107 #undef SIXTY_FOUR_BIT_LONG
108 #undef SIXTY_FOUR_BIT
109 #define THIRTY_TWO_BIT
110 #endif
111
112 #if defined(HEADER_RC4_LOCL_H) && !defined(CONFIG_HEADER_RC4_LOCL_H)
113 #define CONFIG_HEADER_RC4_LOCL_H
114 /* if this is defined data[i] is used instead of *data, this is a %20
115  * speedup on x86 */
116 #undef RC4_INDEX
117 #endif
118
119 #if defined(HEADER_BF_LOCL_H) && !defined(CONFIG_HEADER_BF_LOCL_H)
120 #define CONFIG_HEADER_BF_LOCL_H
121 #undef BF_PTR
122 #endif /* HEADER_BF_LOCL_H */
123
124 #if defined(HEADER_DES_LOCL_H) && !defined(CONFIG_HEADER_DES_LOCL_H)
125 #define CONFIG_HEADER_DES_LOCL_H
126 #ifndef DES_DEFAULT_OPTIONS
127 /* the following is tweaked from a config script, that is why it is a
128  * protected undef/define */
129 #ifndef DES_PTR
130 #undef DES_PTR
131 #endif
132
133 /* This helps C compiler generate the correct code for multiple functional
134  * units.  It reduces register dependancies at the expense of 2 more
135  * registers */
136 #ifndef DES_RISC1
137 #undef DES_RISC1
138 #endif
139
140 #ifndef DES_RISC2
141 #undef DES_RISC2
142 #endif
143
144 #if defined(DES_RISC1) && defined(DES_RISC2)
145 #error YOU SHOULD NOT HAVE BOTH DES_RISC1 AND DES_RISC2 DEFINED!!!!!
146 #endif
147
148 /* Unroll the inner loop, this sometimes helps, sometimes hinders.
149  * Very mucy CPU dependant */
150 #ifndef DES_UNROLL
151 #undef DES_UNROLL
152 #endif
153
154 /* These default values were supplied by
155  * Peter Gutman <pgut001@cs.auckland.ac.nz>
156  * They are only used if nothing else has been defined */
157 #if !defined(DES_PTR) && !defined(DES_RISC1) && !defined(DES_RISC2) && !defined(DES_UNROLL)
158 /* Special defines which change the way the code is built depending on the
159    CPU and OS.  For SGI machines you can use _MIPS_SZLONG (32 or 64) to find
160    even newer MIPS CPU's, but at the moment one size fits all for
161    optimization options.  Older Sparc's work better with only UNROLL, but
162    there's no way to tell at compile time what it is you're running on */
163  
164 #if defined(sparc) || defined(__sparc__)        /* Newer Sparc's */
165 #  define DES_PTR
166 #  define DES_RISC1
167 #  define DES_UNROLL
168 #elif defined( __ultrix )       /* Older MIPS */
169 #  define DES_PTR
170 #  define DES_RISC2
171 #  define DES_UNROLL
172 #elif defined( __osf1__ )       /* Alpha */
173 #  define DES_PTR
174 #  define DES_RISC2
175 #elif defined ( _AIX )          /* RS6000 */
176   /* Unknown */
177 #elif defined( __hpux )         /* HP-PA */
178   /* Unknown */
179 #elif defined( __aux )          /* 68K */
180   /* Unknown */
181 #elif defined( __sgi )          /* Newer MIPS */
182 #  define DES_PTR
183 #  define DES_RISC2
184 #  define DES_UNROLL
185 #elif defined(i386) || defined(__i386__)        /* x86 boxes, should be gcc */
186 #  define DES_PTR
187 #  define DES_RISC1
188 #  define DES_UNROLL
189 #endif /* Systems-specific speed defines */
190 #endif
191
192 #endif /* DES_DEFAULT_OPTIONS */
193 #endif /* HEADER_DES_LOCL_H */