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