]>
Commit | Line | Data |
---|---|---|
f4d8f037 | 1 | ## -*- mode: perl; -*- |
f09e7ca9 | 2 | ## Standard openssl configuration targets. |
f09e7ca9 | 3 | |
2fe73036 RL |
4 | # Helper functions for the Windows configs |
5 | my $vc_win64a_info = {}; | |
6 | sub vc_win64a_info { | |
7 | unless (%$vc_win64a_info) { | |
8 | if (`nasm -v 2>NUL` =~ /NASM version ([0-9]+\.[0-9]+)/ && $1 >= 2.0) { | |
abe256e7 RL |
9 | $vc_win64a_info = { AS => "nasm", |
10 | ASFLAGS => "-g", | |
11 | asflags => "-Ox -f win64 -DNEAR", | |
b6954f3b | 12 | asoutflag => "-o " }; |
43800958 | 13 | } elsif ($disabled{asm}) { |
c059564a | 14 | # assembler is still used to compile uplink shim |
abe256e7 | 15 | $vc_win64a_info = { AS => "ml64", |
78a50c75 | 16 | ASFLAGS => "/nologo /Zi", |
abe256e7 | 17 | asflags => "/c /Cp /Cx", |
2fe73036 | 18 | asoutflag => "/Fo" }; |
43800958 | 19 | } else { |
d63c12c6 | 20 | $die->("NASM not found - please read INSTALL and NOTES.WIN for further details\n"); |
abe256e7 RL |
21 | $vc_win64a_info = { AS => "{unknown}", |
22 | ASFLAGS => "", | |
d63c12c6 RL |
23 | asflags => "", |
24 | asoutflag => "" }; | |
2fe73036 RL |
25 | } |
26 | } | |
27 | return $vc_win64a_info; | |
28 | } | |
29 | ||
43800958 RL |
30 | my $vc_win32_info = {}; |
31 | sub vc_win32_info { | |
32 | unless (%$vc_win32_info) { | |
33 | my $ver=`nasm -v 2>NUL`; | |
34 | my $vew=`nasmw -v 2>NUL`; | |
35 | if ($ver ne "" || $vew ne "") { | |
abe256e7 RL |
36 | $vc_win32_info = { AS => $ver ge $vew ? "nasm" : "nasmw", |
37 | ASFLAGS => "", | |
43800958 | 38 | asflags => "-f win32", |
b6954f3b | 39 | asoutflag => "-o ", |
43800958 RL |
40 | perlasm_scheme => "win32n" }; |
41 | } elsif ($disabled{asm}) { | |
c059564a | 42 | # not actually used, uplink shim is inlined into C code |
abe256e7 RL |
43 | $vc_win32_info = { AS => "ml", |
44 | ASFLAGS => "/nologo /Zi", | |
45 | asflags => "/Cp /coff /c /Cx", | |
43800958 RL |
46 | asoutflag => "/Fo", |
47 | perlasm_scheme => "win32" }; | |
48 | } else { | |
d63c12c6 | 49 | $die->("NASM not found - please read INSTALL and NOTES.WIN for further details\n"); |
abe256e7 RL |
50 | $vc_win32_info = { AS => "{unknown}", |
51 | ASFLAGS => "", | |
d63c12c6 RL |
52 | asflags => "", |
53 | asoutflag => "", | |
54 | perlasm_scheme => "win32" }; | |
43800958 RL |
55 | } |
56 | } | |
57 | return $vc_win32_info; | |
58 | } | |
59 | ||
2fe73036 RL |
60 | my $vc_wince_info = {}; |
61 | sub vc_wince_info { | |
62 | unless (%$vc_wince_info) { | |
63 | # sanity check | |
17f16617 RL |
64 | $die->('%OSVERSION% is not defined') if (!defined(env('OSVERSION'))); |
65 | $die->('%PLATFORM% is not defined') if (!defined(env('PLATFORM'))); | |
66 | $die->('%TARGETCPU% is not defined') if (!defined(env('TARGETCPU'))); | |
2fe73036 RL |
67 | |
68 | # | |
69 | # Idea behind this is to mimic flags set by eVC++ IDE... | |
70 | # | |
17f16617 | 71 | my $wcevers = env('OSVERSION'); # WCENNN |
d63c12c6 RL |
72 | my $wcevernum; |
73 | my $wceverdotnum; | |
74 | if ($wcevers =~ /^WCE([1-9])([0-9]{2})$/) { | |
75 | $wcevernum = "$1$2"; | |
76 | $wceverdotnum = "$1.$2"; | |
77 | } else { | |
78 | $die->('%OSVERSION% value is insane'); | |
79 | $wcevernum = "{unknown}"; | |
80 | $wceverdotnum = "{unknown}"; | |
81 | } | |
82 | my $wcecdefs = "-D_WIN32_WCE=$wcevernum -DUNDER_CE=$wcevernum"; # -D_WIN32_WCE=NNN | |
83 | my $wcelflag = "/subsystem:windowsce,$wceverdotnum"; # ...,N.NN | |
2fe73036 | 84 | |
17f16617 | 85 | my $wceplatf = env('PLATFORM'); |
01d99976 RL |
86 | |
87 | $wceplatf =~ tr/a-z0-9 /A-Z0-9_/; | |
88 | $wcecdefs .= " -DWCE_PLATFORM_$wceplatf"; | |
2fe73036 | 89 | |
17f16617 | 90 | my $wcetgt = env('TARGETCPU'); # just shorter name... |
2fe73036 RL |
91 | SWITCH: for($wcetgt) { |
92 | /^X86/ && do { $wcecdefs.=" -Dx86 -D_X86_ -D_i386_ -Di_386_"; | |
93 | $wcelflag.=" /machine:X86"; last; }; | |
94 | /^ARMV4[IT]/ && do { $wcecdefs.=" -DARM -D_ARM_ -D$wcetgt"; | |
95 | $wcecdefs.=" -DTHUMB -D_THUMB_" if($wcetgt=~/T$/); | |
96 | $wcecdefs.=" -QRarch4T -QRinterwork-return"; | |
97 | $wcelflag.=" /machine:THUMB"; last; }; | |
98 | /^ARM/ && do { $wcecdefs.=" -DARM -D_ARM_ -D$wcetgt"; | |
99 | $wcelflag.=" /machine:ARM"; last; }; | |
100 | /^MIPSIV/ && do { $wcecdefs.=" -DMIPS -D_MIPS_ -DR4000 -D$wcetgt"; | |
101 | $wcecdefs.=" -D_MIPS64 -QMmips4 -QMn32"; | |
102 | $wcelflag.=" /machine:MIPSFPU"; last; }; | |
103 | /^MIPS16/ && do { $wcecdefs.=" -DMIPS -D_MIPS_ -DR4000 -D$wcetgt"; | |
104 | $wcecdefs.=" -DMIPSII -QMmips16"; | |
105 | $wcelflag.=" /machine:MIPS16"; last; }; | |
106 | /^MIPSII/ && do { $wcecdefs.=" -DMIPS -D_MIPS_ -DR4000 -D$wcetgt"; | |
107 | $wcecdefs.=" -QMmips2"; | |
108 | $wcelflag.=" /machine:MIPS"; last; }; | |
109 | /^R4[0-9]{3}/ && do { $wcecdefs.=" -DMIPS -D_MIPS_ -DR4000"; | |
110 | $wcelflag.=" /machine:MIPS"; last; }; | |
111 | /^SH[0-9]/ && do { $wcecdefs.=" -D$wcetgt -D_${wcetgt}_ -DSHx"; | |
112 | $wcecdefs.=" -Qsh4" if ($wcetgt =~ /^SH4/); | |
113 | $wcelflag.=" /machine:$wcetgt"; last; }; | |
114 | { $wcecdefs.=" -D$wcetgt -D_${wcetgt}_"; | |
115 | $wcelflag.=" /machine:$wcetgt"; last; }; | |
116 | } | |
117 | ||
8c3bc594 | 118 | $vc_wince_info = { cppflags => $wcecdefs, |
2fe73036 RL |
119 | lflags => $wcelflag }; |
120 | } | |
121 | return $vc_wince_info; | |
122 | } | |
123 | ||
5fe5bc30 RL |
124 | # Helper functions for the VMS configs |
125 | my $vms_info = {}; | |
126 | sub vms_info { | |
ab907189 RL |
127 | my $pointer_size_str = $config{target} =~ m|-p(\d+)$| ? $1 : ""; |
128 | ||
129 | # For the case where Configure iterate through all config targets, such | |
130 | # as when listing them and their details, we reset info if the pointer | |
131 | # size changes. | |
132 | if (%$vms_info && $vms_info->{pointer_size} ne $pointer_size_str) { | |
133 | $vms_info = {}; | |
134 | } | |
0c9b1534 | 135 | |
ab907189 | 136 | unless (%$vms_info) { |
0c9b1534 | 137 | $vms_info->{disable_warns} = [ ]; |
7878e536 | 138 | $vms_info->{pointer_size} = $pointer_size_str; |
ab907189 | 139 | if ($pointer_size_str eq "64") { |
0c9b1534 RL |
140 | `PIPE CC /NOCROSS_REFERENCE /NOLIST /NOOBJECT /WARNINGS = DISABLE = ( MAYLOSEDATA3, EMPTYFILE ) NL: 2> NL:`; |
141 | if ($? == 0) { | |
142 | push @{$vms_info->{disable_warns}}, "MAYLOSEDATA3"; | |
143 | } | |
144 | } | |
62890f47 RL |
145 | |
146 | unless ($disabled{zlib}) { | |
0c9b1534 | 147 | my $default_zlib = 'GNV$LIBZSHR' . $pointer_size_str; |
62890f47 | 148 | if (defined($disabled{"zlib-dynamic"})) { |
0c9b1534 | 149 | $vms_info->{zlib} = $withargs{zlib_lib} || "$default_zlib/SHARE"; |
62890f47 | 150 | } else { |
0c9b1534 RL |
151 | $vms_info->{def_zlib} = $withargs{zlib_lib} || $default_zlib; |
152 | # In case the --with-zlib-lib value contains something like | |
153 | # /SHARE or /LIB or so at the end, remove it. | |
154 | $vms_info->{def_zlib} =~ s|/.*$||g; | |
62890f47 RL |
155 | } |
156 | } | |
ab7134ef RL |
157 | |
158 | if ($config{target} =~ /-ia64/) { | |
159 | `PIPE ias -H 2> NL:`; | |
160 | if ($? == 0) { | |
abe256e7 RL |
161 | $vms_info->{AS} = "ias"; |
162 | $vms_info->{ASFLAGS} = '-d debug'; | |
163 | $vms_info->{asflags} = '"-N" vms_upcase'; | |
b6954f3b | 164 | $vms_info->{asoutflag} = "-o "; |
ab7134ef RL |
165 | $vms_info->{perlasm_scheme} = "ias"; |
166 | } | |
167 | } | |
5fe5bc30 RL |
168 | } |
169 | return $vms_info; | |
170 | } | |
2fe73036 | 171 | |
3b6c4b07 | 172 | my %targets = ( |
f09e7ca9 | 173 | |
7ead0c89 | 174 | #### Basic configs that should work on any 32-bit box |
5e1b2353 | 175 | "gcc" => { |
d76117b9 | 176 | inherit_from => [ "BASE_unix" ], |
abe256e7 RL |
177 | CC => "gcc", |
178 | CFLAGS => picker(debug => "-O0 -g", | |
8864f0de | 179 | release => "-O3"), |
9c62a279 | 180 | thread_scheme => "(unknown)", |
5e1b2353 RL |
181 | bn_ops => "BN_LLONG", |
182 | }, | |
183 | "cc" => { | |
d76117b9 | 184 | inherit_from => [ "BASE_unix" ], |
abe256e7 RL |
185 | CC => "cc", |
186 | CFLAGS => "-O", | |
9c62a279 | 187 | thread_scheme => "(unknown)", |
5e1b2353 | 188 | }, |
f09e7ca9 | 189 | |
7ead0c89 | 190 | #### VOS Configurations |
5e1b2353 | 191 | "vos-gcc" => { |
d2b2221a | 192 | inherit_from => [ "BASE_unix" ], |
abe256e7 RL |
193 | CC => "gcc", |
194 | CFLAGS => picker(default => "-Wall", | |
463a7b8c | 195 | debug => "-O0 -g", |
8864f0de | 196 | release => "-O3"), |
68b8bcf4 RL |
197 | cppflags => "-D_POSIX_C_SOURCE=200112L -D_BSD -D_VOS_EXTENDED_NAMES", |
198 | lib_cppflags => "-DB_ENDIAN", | |
9c62a279 | 199 | thread_scheme => "(unknown)", |
5e1b2353 | 200 | sys_id => "VOS", |
47eeaf45 | 201 | lflags => add("-Wl,-map"), |
5e1b2353 RL |
202 | bn_ops => "BN_LLONG", |
203 | shared_extension => ".so", | |
204 | }, | |
f09e7ca9 | 205 | |
29d09327 | 206 | #### Solaris configurations |
f6739c3d | 207 | "solaris-common" => { |
d2b2221a | 208 | inherit_from => [ "BASE_unix" ], |
f6739c3d | 209 | template => 1, |
68b8bcf4 | 210 | lib_cppflags => "-DFILIO_H", |
8cfc21f5 | 211 | ex_libs => add("-lsocket -lnsl -ldl"), |
f6739c3d | 212 | dso_scheme => "dlfcn", |
9c62a279 | 213 | thread_scheme => "pthreads", |
dbb85890 | 214 | shared_target => "self", |
d4453024 | 215 | shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)", |
dbb85890 AP |
216 | shared_ldflag => "-Wl,-Bsymbolic", |
217 | shared_defflag => "-Wl,-M,", | |
218 | shared_sonameflag=> "-Wl,-h,", | |
f6739c3d | 219 | }, |
f09e7ca9 | 220 | #### Solaris x86 with GNU C setups |
5e1b2353 | 221 | "solaris-x86-gcc" => { |
fe9e5b9c AP |
222 | # NB. GNU C has to be configured to use GNU assembler, and not |
223 | # /usr/ccs/bin/as. Failure to comply will result in compile | |
224 | # failures [at least] in 32-bit build. | |
f6739c3d | 225 | inherit_from => [ "solaris-common", asm("x86_elf_asm") ], |
abe256e7 RL |
226 | CC => "gcc", |
227 | CFLAGS => add_before(picker(default => "-Wall", | |
8864f0de | 228 | debug => "-O0 -g", |
abe256e7 RL |
229 | release => "-O3 -fomit-frame-pointer")), |
230 | cflags => add(threads("-pthread")), | |
68b8bcf4 | 231 | lib_cppflags => add("-DL_ENDIAN"), |
fcd2ac80 | 232 | ex_libs => add(threads("-pthread")), |
a01dab94 | 233 | bn_ops => "BN_LLONG", |
5e1b2353 | 234 | shared_cflag => "-fPIC", |
dbb85890 | 235 | shared_ldflag => add("-shared -static-libgcc"), |
5e1b2353 | 236 | }, |
5e1b2353 | 237 | "solaris64-x86_64-gcc" => { |
7ead0c89 AP |
238 | # -shared -static-libgcc might appear controversial, but modules |
239 | # taken from static libgcc do not have relocations and linking | |
240 | # them into our shared objects doesn't have any negative side | |
241 | # effects. On the contrary, doing so makes it possible to use | |
242 | # gcc shared build with Sun C. Given that gcc generates faster | |
243 | # code [thanks to inline assembler], I would actually recommend | |
244 | # to consider using gcc shared build even with vendor compiler:-) | |
e3713c36 | 245 | # -- <appro@openssl.org> |
f6739c3d | 246 | inherit_from => [ "solaris-common", asm("x86_64_asm") ], |
abe256e7 RL |
247 | CC => "gcc", |
248 | CFLAGS => add_before(picker(default => "-Wall", | |
8864f0de | 249 | debug => "-O0 -g", |
abe256e7 RL |
250 | release => "-O3")), |
251 | cflags => add_before("-m64", threads("-pthread")), | |
68b8bcf4 | 252 | lib_cppflags => add("-DL_ENDIAN"), |
fcd2ac80 | 253 | ex_libs => add(threads("-pthread")), |
3e9e810f | 254 | bn_ops => "SIXTY_FOUR_BIT_LONG", |
5e1b2353 | 255 | perlasm_scheme => "elf", |
5e1b2353 | 256 | shared_cflag => "-fPIC", |
dbb85890 | 257 | shared_ldflag => add("-shared -static-libgcc"), |
5e1b2353 RL |
258 | multilib => "/64", |
259 | }, | |
f09e7ca9 RS |
260 | |
261 | #### Solaris x86 with Sun C setups | |
216a0cc4 AP |
262 | # There used to be solaris-x86-cc target, but it was removed, |
263 | # primarily because vendor assembler can't assemble our modules | |
264 | # with -KPIC flag. As result it, assembly support, was not even | |
265 | # available as option. But its lack means lack of side-channel | |
266 | # resistant code, which is incompatible with security by todays | |
267 | # standards. Fortunately gcc is readily available prepackaged | |
268 | # option, which we can firmly point at... | |
269 | # | |
270 | # On related note, solaris64-x86_64-cc target won't compile code | |
271 | # paths utilizing AVX and post-Haswell instruction extensions. | |
272 | # Consider switching to solaris64-x86_64-gcc even here... | |
273 | # | |
5e1b2353 | 274 | "solaris64-x86_64-cc" => { |
f6739c3d | 275 | inherit_from => [ "solaris-common", asm("x86_64_asm") ], |
abe256e7 RL |
276 | CC => "cc", |
277 | CFLAGS => add_before(picker(debug => "-g", | |
8c3bc594 | 278 | release => "-xO5 -xdepend -xbuiltin")), |
abe256e7 | 279 | cflags => add_before("-xarch=generic64 -xstrconst -Xa"), |
68b8bcf4 RL |
280 | cppflags => add(threads("-D_REENTRANT")), |
281 | lib_cppflags => add("-DL_ENDIAN"), | |
9c62a279 | 282 | thread_scheme => "pthreads", |
8dd0ff1c | 283 | lflags => add(threads("-mt")), |
9c62a279 | 284 | ex_libs => add(threads("-lpthread")), |
3e9e810f | 285 | bn_ops => "SIXTY_FOUR_BIT_LONG", |
5e1b2353 | 286 | perlasm_scheme => "elf", |
5e1b2353 | 287 | shared_cflag => "-KPIC", |
dbb85890 | 288 | shared_ldflag => add("-G -dy -z text"), |
5e1b2353 RL |
289 | multilib => "/64", |
290 | }, | |
f09e7ca9 RS |
291 | |
292 | #### SPARC Solaris with GNU C setups | |
5e1b2353 | 293 | "solaris-sparcv7-gcc" => { |
f6739c3d | 294 | inherit_from => [ "solaris-common" ], |
abe256e7 RL |
295 | CC => "gcc", |
296 | CFLAGS => add_before(picker(default => "-Wall", | |
8864f0de | 297 | debug => "-O0 -g", |
abe256e7 RL |
298 | release => "-O3")), |
299 | cflags => add(threads("-pthread")), | |
68b8bcf4 | 300 | lib_cppflags => add("-DB_ENDIAN -DBN_DIV2W"), |
fcd2ac80 | 301 | ex_libs => add(threads("-pthread")), |
3e9e810f | 302 | bn_ops => "BN_LLONG RC4_CHAR", |
5e1b2353 | 303 | shared_cflag => "-fPIC", |
dbb85890 | 304 | shared_ldflag => add("-shared"), |
5e1b2353 | 305 | }, |
5e1b2353 | 306 | "solaris-sparcv8-gcc" => { |
7ead0c89 | 307 | inherit_from => [ "solaris-sparcv7-gcc", asm("sparcv8_asm") ], |
bdcd83e1 | 308 | cflags => add_before("-mcpu=v8"), |
5e1b2353 | 309 | }, |
5e1b2353 | 310 | "solaris-sparcv9-gcc" => { |
7ead0c89 | 311 | # -m32 should be safe to add as long as driver recognizes |
f6739c3d | 312 | # -mcpu=ultrasparc |
7ead0c89 | 313 | inherit_from => [ "solaris-sparcv7-gcc", asm("sparcv9_asm") ], |
463a7b8c | 314 | cflags => add_before("-m32 -mcpu=ultrasparc"), |
5e1b2353 RL |
315 | }, |
316 | "solaris64-sparcv9-gcc" => { | |
7ead0c89 | 317 | inherit_from => [ "solaris-sparcv9-gcc" ], |
f6739c3d | 318 | cflags => sub { my $f=join(" ",@_); $f =~ s/\-m32/-m64/; $f; }, |
3e9e810f | 319 | bn_ops => "BN_LLONG RC4_CHAR", |
5e1b2353 RL |
320 | multilib => "/64", |
321 | }, | |
f09e7ca9 RS |
322 | |
323 | #### SPARC Solaris with Sun C setups | |
324 | # SC4.0 doesn't pass 'make test', upgrade to SC5.0 or SC4.2. | |
325 | # SC4.2 is ok, better than gcc even on bn as long as you tell it -xarch=v8 | |
326 | # SC5.0 note: Compiler common patch 107357-01 or later is required! | |
5e1b2353 | 327 | "solaris-sparcv7-cc" => { |
f6739c3d | 328 | inherit_from => [ "solaris-common" ], |
abe256e7 RL |
329 | CC => "cc", |
330 | CFLAGS => add_before(picker(debug => "-g", | |
8c3bc594 | 331 | release => "-xO5 -xdepend")), |
abe256e7 | 332 | cflags => add_before("-xstrconst -Xa"), |
68b8bcf4 RL |
333 | cppflags => add(threads("-D_REENTRANT")), |
334 | lib_cppflags => add("-DB_ENDIAN -DBN_DIV2W"), | |
9c62a279 RL |
335 | lflags => add(threads("-mt")), |
336 | ex_libs => add(threads("-lpthread")), | |
3e9e810f | 337 | bn_ops => "BN_LLONG RC4_CHAR", |
5e1b2353 | 338 | shared_cflag => "-KPIC", |
dbb85890 | 339 | shared_ldflag => add("-G -dy -z text"), |
5e1b2353 | 340 | }, |
f09e7ca9 | 341 | #### |
5e1b2353 | 342 | "solaris-sparcv8-cc" => { |
7ead0c89 | 343 | inherit_from => [ "solaris-sparcv7-cc", asm("sparcv8_asm") ], |
bdcd83e1 | 344 | cflags => add_before("-xarch=v8"), |
5e1b2353 RL |
345 | }, |
346 | "solaris-sparcv9-cc" => { | |
7ead0c89 | 347 | inherit_from => [ "solaris-sparcv7-cc", asm("sparcv9_asm") ], |
fa4618a2 | 348 | cflags => add_before("-xarch=v8plus"), |
5e1b2353 RL |
349 | }, |
350 | "solaris64-sparcv9-cc" => { | |
7ead0c89 | 351 | inherit_from => [ "solaris-sparcv7-cc", asm("sparcv9_asm") ], |
fa4618a2 | 352 | cflags => add_before("-xarch=v9"), |
3e9e810f | 353 | bn_ops => "BN_LLONG RC4_CHAR", |
5e1b2353 RL |
354 | multilib => "/64", |
355 | }, | |
f09e7ca9 | 356 | |
f09e7ca9 | 357 | #### IRIX 6.x configs |
c21c7830 | 358 | # Only N32 and N64 ABIs are supported. |
5e1b2353 | 359 | "irix-mips3-gcc" => { |
d2b2221a | 360 | inherit_from => [ "BASE_unix", asm("mips64_asm") ], |
abe256e7 RL |
361 | CC => "gcc", |
362 | CFLAGS => picker(debug => "-g -O0", | |
363 | release => "-O3"), | |
364 | cflags => "-mabi=n32", | |
34c74bfc | 365 | cppflags => combine("-DB_ENDIAN -DBN_DIV3W", |
c21c7830 | 366 | threads("-D_SGI_MP_SOURCE")), |
68b8bcf4 RL |
367 | cppflags => threads("-D_SGI_MP_SOURCE"), |
368 | lib_cppflags => "-DB_ENDIAN -DBN_DIV3W", | |
c21c7830 | 369 | ex_libs => add(threads("-lpthread")), |
3e9e810f | 370 | bn_ops => "RC4_CHAR SIXTY_FOUR_BIT", |
9c62a279 | 371 | thread_scheme => "pthreads", |
5e1b2353 RL |
372 | perlasm_scheme => "n32", |
373 | dso_scheme => "dlfcn", | |
374 | shared_target => "irix-shared", | |
d4453024 | 375 | shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)", |
5e1b2353 RL |
376 | multilib => "32", |
377 | }, | |
378 | "irix-mips3-cc" => { | |
d2b2221a | 379 | inherit_from => [ "BASE_unix", asm("mips64_asm") ], |
abe256e7 RL |
380 | CC => "cc", |
381 | CFLAGS => picker(debug => "-g -O0", | |
382 | release => "-O2"), | |
383 | cflags => "-n32 -mips3 -use_readonly_const -G0 -rdata_shared", | |
68b8bcf4 RL |
384 | cppflags => threads("-D_SGI_MP_SOURCE"), |
385 | lib_cppflags => "-DB_ENDIAN -DBN_DIV3W", | |
9c62a279 | 386 | ex_libs => add(threads("-lpthread")), |
3e9e810f | 387 | bn_ops => "RC4_CHAR SIXTY_FOUR_BIT", |
9c62a279 | 388 | thread_scheme => "pthreads", |
5e1b2353 RL |
389 | perlasm_scheme => "n32", |
390 | dso_scheme => "dlfcn", | |
391 | shared_target => "irix-shared", | |
d4453024 | 392 | shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)", |
5e1b2353 RL |
393 | multilib => "32", |
394 | }, | |
7ead0c89 | 395 | # N64 ABI builds. |
5e1b2353 | 396 | "irix64-mips4-gcc" => { |
d2b2221a | 397 | inherit_from => [ "BASE_unix", asm("mips64_asm") ], |
abe256e7 RL |
398 | CC => "gcc", |
399 | CFLAGS => picker(debug => "-g -O0", | |
400 | release => "-O3"), | |
401 | cflags => "-mabi=64 -mips4", | |
68b8bcf4 RL |
402 | cppflags => threads("-D_SGI_MP_SOURCE"), |
403 | lib_cppflags => "-DB_ENDIAN -DBN_DIV3W", | |
c21c7830 | 404 | ex_libs => add(threads("-lpthread")), |
3e9e810f | 405 | bn_ops => "RC4_CHAR SIXTY_FOUR_BIT_LONG", |
9c62a279 | 406 | thread_scheme => "pthreads", |
5e1b2353 RL |
407 | perlasm_scheme => "64", |
408 | dso_scheme => "dlfcn", | |
409 | shared_target => "irix-shared", | |
d4453024 | 410 | shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)", |
5e1b2353 RL |
411 | multilib => "64", |
412 | }, | |
413 | "irix64-mips4-cc" => { | |
d2b2221a | 414 | inherit_from => [ "BASE_unix", asm("mips64_asm") ], |
abe256e7 RL |
415 | CC => "cc", |
416 | CFLAGS => picker(debug => "-g -O0", | |
417 | release => "-O2"), | |
abe256e7 | 418 | cflags => "-64 -mips4 -use_readonly_const -G0 -rdata_shared", |
68b8bcf4 RL |
419 | cppflags => threads("-D_SGI_MP_SOURCE"), |
420 | lib_cppflags => "-DB_ENDIAN -DBN_DIV3W", | |
abe256e7 | 421 | ex_libs => threads("-lpthread"), |
3e9e810f | 422 | bn_ops => "RC4_CHAR SIXTY_FOUR_BIT_LONG", |
9c62a279 | 423 | thread_scheme => "pthreads", |
5e1b2353 RL |
424 | perlasm_scheme => "64", |
425 | dso_scheme => "dlfcn", | |
426 | shared_target => "irix-shared", | |
d4453024 | 427 | shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)", |
5e1b2353 RL |
428 | multilib => "64", |
429 | }, | |
f09e7ca9 RS |
430 | |
431 | #### Unified HP-UX ANSI C configs. | |
432 | # Special notes: | |
433 | # - Originally we were optimizing at +O4 level. It should be noted | |
434 | # that the only difference between +O3 and +O4 is global inter- | |
435 | # procedural analysis. As it has to be performed during the link | |
436 | # stage the compiler leaves behind certain pseudo-code in lib*.a | |
437 | # which might be release or even patch level specific. Generating | |
438 | # the machine code for and analyzing the *whole* program appears | |
439 | # to be *extremely* memory demanding while the performance gain is | |
440 | # actually questionable. The situation is intensified by the default | |
441 | # HP-UX data set size limit (infamous 'maxdsiz' tunable) of 64MB | |
442 | # which is way too low for +O4. In other words, doesn't +O3 make | |
443 | # more sense? | |
444 | # - Keep in mind that the HP compiler by default generates code | |
445 | # suitable for execution on the host you're currently compiling at. | |
b6453a68 | 446 | # If the toolkit is meant to be used on various PA-RISC processors |
7ead0c89 | 447 | # consider './Configure hpux-parisc-[g]cc +DAportable'. |
f09e7ca9 RS |
448 | # - -DMD32_XARRAY triggers workaround for compiler bug we ran into in |
449 | # 32-bit message digests. (For the moment of this writing) HP C | |
450 | # doesn't seem to "digest" too many local variables (they make "him" | |
451 | # chew forever:-). For more details look-up MD32_XARRAY comment in | |
452 | # crypto/sha/sha_lcl.h. | |
7ead0c89 | 453 | # - originally there were 32-bit hpux-parisc2-* targets. They were |
b6453a68 | 454 | # scrapped, because a) they were not interchangeable with other 32-bit |
0b919cc5 AP |
455 | # targets; b) performance-critical 32-bit assembly modules implement |
456 | # even PA-RISC 2.0-specific code paths, which are chosen at run-time, | |
457 | # thus adequate performance is provided even with PA-RISC 1.1 build. | |
3c3badcf AP |
458 | "hpux-common" => { |
459 | inherit_from => [ "BASE_unix" ], | |
6e301900 AP |
460 | template => 1, |
461 | defines => add("_XOPEN_SOURCE", "_XOPEN_SOURCE_EXTENDED", | |
462 | "_HPUX_ALT_XOPEN_SOCKET_API"), | |
3c3badcf AP |
463 | lib_cppflags => "-DB_ENDIAN", |
464 | thread_scheme => "pthreads", | |
465 | dso_scheme => "dlfcn", # overridden in 32-bit PA-RISC builds | |
466 | shared_target => "hpux-shared", | |
6e301900 | 467 | }, |
5e1b2353 | 468 | "hpux-parisc-gcc" => { |
3c3badcf | 469 | inherit_from => [ "hpux-common" ], |
abe256e7 RL |
470 | CC => "gcc", |
471 | CFLAGS => picker(debug => "-O0 -g", | |
472 | release => "-O3"), | |
473 | cflags => add(threads("-pthread")), | |
3c3badcf | 474 | lib_cppflags => add("-DBN_DIV2W"), |
6e301900 | 475 | ex_libs => add("-ldld", threads("-pthread")), |
3c3badcf | 476 | bn_ops => "BN_LLONG RC4_CHAR", |
5e1b2353 | 477 | dso_scheme => "dl", |
5e1b2353 RL |
478 | shared_cflag => "-fPIC", |
479 | shared_ldflag => "-shared", | |
d4453024 | 480 | shared_extension => ".sl.\$(SHLIB_VERSION_NUMBER)", |
5e1b2353 RL |
481 | }, |
482 | "hpux-parisc1_1-gcc" => { | |
7ead0c89 | 483 | inherit_from => [ "hpux-parisc-gcc", asm("parisc11_asm") ], |
5e1b2353 RL |
484 | multilib => "/pa1.1", |
485 | }, | |
5e1b2353 | 486 | "hpux64-parisc2-gcc" => { |
3c3badcf | 487 | inherit_from => [ "hpux-common", asm("parisc20_64_asm") ], |
abe256e7 RL |
488 | CC => "gcc", |
489 | CFLAGS => combine(picker(debug => "-O0 -g", | |
8c3bc594 | 490 | release => "-O3")), |
6e301900 | 491 | cflags => add(threads("-pthread")), |
6e301900 | 492 | ex_libs => add("-ldl", threads("-pthread")), |
3e9e810f | 493 | bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR", |
5e1b2353 RL |
494 | shared_cflag => "-fpic", |
495 | shared_ldflag => "-shared", | |
d4453024 | 496 | shared_extension => ".sl.\$(SHLIB_VERSION_NUMBER)", |
5e1b2353 RL |
497 | multilib => "/pa20_64", |
498 | }, | |
f09e7ca9 | 499 | |
7ead0c89 | 500 | # More attempts at unified 10.X and 11.X targets for HP C compiler. |
5e1b2353 | 501 | "hpux-parisc-cc" => { |
3c3badcf | 502 | inherit_from => [ "hpux-common" ], |
abe256e7 RL |
503 | CC => "cc", |
504 | CFLAGS => picker(debug => "+O0 +d -g", | |
505 | release => "+O3"), | |
506 | cflags => "+Optrs_strongly_typed -Ae +ESlit", | |
68b8bcf4 | 507 | cppflags => threads("-D_REENTRANT"), |
3c3badcf | 508 | lib_cppflags => add("-DBN_DIV2W -DMD32_XARRAY"), |
6e301900 | 509 | ex_libs => add("-ldld", threads("-lpthread")), |
3e9e810f | 510 | bn_ops => "RC4_CHAR", |
5e1b2353 | 511 | dso_scheme => "dl", |
5e1b2353 RL |
512 | shared_cflag => "+Z", |
513 | shared_ldflag => "-b", | |
d4453024 | 514 | shared_extension => ".sl.\$(SHLIB_VERSION_NUMBER)", |
5e1b2353 RL |
515 | }, |
516 | "hpux-parisc1_1-cc" => { | |
7ead0c89 | 517 | inherit_from => [ "hpux-parisc-cc", asm("parisc11_asm") ], |
bdcd83e1 | 518 | cflags => add_before("+DA1.1"), |
5e1b2353 RL |
519 | multilib => "/pa1.1", |
520 | }, | |
5e1b2353 | 521 | "hpux64-parisc2-cc" => { |
3c3badcf | 522 | inherit_from => [ "hpux-common", asm("parisc20_64_asm") ], |
abe256e7 RL |
523 | CC => "cc", |
524 | CFLAGS => picker(debug => "+O0 +d -g", | |
525 | release => "+O3") , | |
526 | cflags => "+DD64 +Optrs_strongly_typed -Ae +ESlit", | |
68b8bcf4 | 527 | cppflags => threads("-D_REENTRANT") , |
3c3badcf | 528 | lib_cppflags => add("-DMD32_XARRAY"), |
6e301900 | 529 | ex_libs => add("-ldl", threads("-lpthread")), |
3e9e810f | 530 | bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR", |
5e1b2353 | 531 | shared_cflag => "+Z", |
8dd0ff1c | 532 | shared_ldflag => "-b", |
d4453024 | 533 | shared_extension => ".sl.\$(SHLIB_VERSION_NUMBER)", |
5e1b2353 RL |
534 | multilib => "/pa20_64", |
535 | }, | |
f09e7ca9 | 536 | |
7ead0c89 | 537 | # HP/UX IA-64 targets |
5e1b2353 | 538 | "hpux-ia64-cc" => { |
3c3badcf | 539 | inherit_from => [ "hpux-common", asm("ia64_asm") ], |
abe256e7 RL |
540 | CC => "cc", |
541 | CFLAGS => picker(debug => "+O0 +d -g", | |
542 | release => "+O2"), | |
543 | cflags => "-Ae +DD32 +Olit=all -z", | |
68b8bcf4 | 544 | cppflags => add(threads("-D_REENTRANT")), |
6e301900 | 545 | ex_libs => add("-ldl", threads("-lpthread")), |
3e9e810f | 546 | bn_ops => "SIXTY_FOUR_BIT", |
5e1b2353 | 547 | shared_cflag => "+Z", |
8dd0ff1c | 548 | shared_ldflag => "-b", |
d4453024 | 549 | shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)", |
5e1b2353 RL |
550 | multilib => "/hpux32", |
551 | }, | |
5e1b2353 | 552 | "hpux64-ia64-cc" => { |
3c3badcf | 553 | inherit_from => [ "hpux-common", asm("ia64_asm") ], |
abe256e7 RL |
554 | CC => "cc", |
555 | CFLAGS => picker(debug => "+O0 +d -g", | |
556 | release => "+O3"), | |
557 | cflags => "-Ae +DD64 +Olit=all -z", | |
68b8bcf4 | 558 | cppflags => threads("-D_REENTRANT"), |
9c62a279 | 559 | ex_libs => add("-ldl", threads("-lpthread")), |
3e9e810f | 560 | bn_ops => "SIXTY_FOUR_BIT_LONG", |
5e1b2353 | 561 | shared_cflag => "+Z", |
8dd0ff1c | 562 | shared_ldflag => "-b", |
d4453024 | 563 | shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)", |
5e1b2353 RL |
564 | multilib => "/hpux64", |
565 | }, | |
7ead0c89 | 566 | # GCC builds... |
5e1b2353 | 567 | "hpux-ia64-gcc" => { |
3c3badcf | 568 | inherit_from => [ "hpux-common", asm("ia64_asm") ], |
abe256e7 RL |
569 | CC => "gcc", |
570 | CFLAGS => picker(debug => "-O0 -g", | |
571 | release => "-O3"), | |
572 | cflags => add(threads("-pthread")), | |
fcd2ac80 | 573 | ex_libs => add("-ldl", threads("-pthread")), |
3e9e810f | 574 | bn_ops => "SIXTY_FOUR_BIT", |
5e1b2353 RL |
575 | shared_cflag => "-fpic", |
576 | shared_ldflag => "-shared", | |
d4453024 | 577 | shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)", |
5e1b2353 RL |
578 | multilib => "/hpux32", |
579 | }, | |
580 | "hpux64-ia64-gcc" => { | |
3c3badcf | 581 | inherit_from => [ "hpux-common", asm("ia64_asm") ], |
abe256e7 RL |
582 | CC => "gcc", |
583 | CFLAGS => picker(debug => "-O0 -g", | |
584 | release => "-O3"), | |
585 | cflags => combine("-mlp64", threads("-pthread")), | |
fcd2ac80 | 586 | ex_libs => add("-ldl", threads("-pthread")), |
3e9e810f | 587 | bn_ops => "SIXTY_FOUR_BIT_LONG", |
5e1b2353 | 588 | shared_cflag => "-fpic", |
8dd0ff1c | 589 | shared_ldflag => "-shared", |
d4453024 | 590 | shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)", |
5e1b2353 RL |
591 | multilib => "/hpux64", |
592 | }, | |
f09e7ca9 | 593 | |
f09e7ca9 | 594 | #### HP MPE/iX http://jazz.external.hp.com/src/openssl/ |
5e1b2353 | 595 | "MPE/iX-gcc" => { |
d2b2221a | 596 | inherit_from => [ "BASE_unix" ], |
abe256e7 RL |
597 | CC => "gcc", |
598 | CFLAGS => "-O3", | |
68b8bcf4 RL |
599 | cppflags => "-D_POSIX_SOURCE -D_SOCKET_SOURCE", |
600 | includes => [ "/SYSLOG/PUB" ], | |
601 | lib_cppflags => "-DBN_DIV2W", | |
5e1b2353 | 602 | sys_id => "MPE", |
47eeaf45 RL |
603 | lflags => add("-L/SYSLOG/PUB"), |
604 | ex_libs => add("-lsyslog -lsocket -lcurses"), | |
9c62a279 | 605 | thread_scheme => "(unknown)", |
3e9e810f | 606 | bn_ops => "BN_LLONG", |
5e1b2353 | 607 | }, |
f09e7ca9 | 608 | |
b4de72bf AP |
609 | #### DEC Alpha Tru64 targets. Tru64 is marketing name for OSF/1 version 4 |
610 | #### and forward. In reality 'uname -s' still returns "OSF1". Originally | |
611 | #### there were even osf1-* configs targeting prior versions provided, | |
612 | #### but not anymore... | |
613 | "tru64-alpha-gcc" => { | |
d2b2221a | 614 | inherit_from => [ "BASE_unix", asm("alpha_asm") ], |
abe256e7 RL |
615 | CC => "gcc", |
616 | CFLAGS => "-O3", | |
617 | cflags => add("-std=c9x", threads("-pthread")), | |
8c3bc594 | 618 | cppflags => "-D_XOPEN_SOURCE=500 -D_OSF_SOURCE", |
fcd2ac80 | 619 | ex_libs => add("-lrt", threads("-pthread")), # for mlock(2) |
3e9e810f | 620 | bn_ops => "SIXTY_FOUR_BIT_LONG", |
b4de72bf | 621 | thread_scheme => "pthreads", |
5e1b2353 RL |
622 | dso_scheme => "dlfcn", |
623 | shared_target => "alpha-osf1-shared", | |
624 | shared_extension => ".so", | |
625 | }, | |
626 | "tru64-alpha-cc" => { | |
d2b2221a | 627 | inherit_from => [ "BASE_unix", asm("alpha_asm") ], |
abe256e7 RL |
628 | CC => "cc", |
629 | CFLAGS => "-tune host -fast", | |
630 | cflags => add("-std1 -readonly_strings", | |
631 | threads("-pthread")), | |
8c3bc594 | 632 | cppflags => "-D_XOPEN_SOURCE=500 -D_OSF_SOURCE", |
fcd2ac80 | 633 | ex_libs => add("-lrt", threads("-pthread")), # for mlock(2) |
3e9e810f | 634 | bn_ops => "SIXTY_FOUR_BIT_LONG", |
9c62a279 | 635 | thread_scheme => "pthreads", |
5e1b2353 RL |
636 | dso_scheme => "dlfcn", |
637 | shared_target => "alpha-osf1-shared", | |
638 | shared_ldflag => "-msym", | |
639 | shared_extension => ".so", | |
640 | }, | |
f09e7ca9 RS |
641 | |
642 | #### | |
643 | #### Variety of LINUX:-) | |
644 | #### | |
645 | # *-generic* is endian-neutral target, but ./config is free to | |
646 | # throw in -D[BL]_ENDIAN, whichever appropriate... | |
5e1b2353 | 647 | "linux-generic32" => { |
d2b2221a | 648 | inherit_from => [ "BASE_unix" ], |
abe256e7 RL |
649 | CC => "gcc", |
650 | CXX => "g++", | |
651 | CFLAGS => picker(default => "-Wall", | |
652 | debug => "-O0 -g", | |
653 | release => "-O3"), | |
654 | CXXFLAGS => picker(default => "-Wall", | |
655 | debug => "-O0 -g", | |
656 | release => "-O3"), | |
657 | cflags => threads("-pthread"), | |
658 | cxxflags => combine("-std=c++11", threads("-pthread")), | |
68b8bcf4 | 659 | lib_cppflags => "-DOPENSSL_USE_NODELETE", |
fcd2ac80 | 660 | ex_libs => add("-ldl", threads("-pthread")), |
3e9e810f | 661 | bn_ops => "BN_LLONG RC4_CHAR", |
9c62a279 | 662 | thread_scheme => "pthreads", |
5e1b2353 RL |
663 | dso_scheme => "dlfcn", |
664 | shared_target => "linux-shared", | |
8c3bc594 | 665 | shared_cflag => "-fPIC", |
075e9da0 | 666 | shared_ldflag => "-Wl,-znodelete", |
d4453024 | 667 | shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)", |
9e381e8a | 668 | enable => [ "afalgeng" ], |
5e1b2353 | 669 | }, |
7ead0c89 AP |
670 | "linux-generic64" => { |
671 | inherit_from => [ "linux-generic32" ], | |
3e9e810f | 672 | bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR", |
7ead0c89 AP |
673 | }, |
674 | ||
5e1b2353 | 675 | "linux-ppc" => { |
7ead0c89 | 676 | inherit_from => [ "linux-generic32", asm("ppc32_asm") ], |
5e1b2353 | 677 | perlasm_scheme => "linux32", |
7ead0c89 AP |
678 | }, |
679 | "linux-ppc64" => { | |
680 | inherit_from => [ "linux-generic64", asm("ppc64_asm") ], | |
8c3bc594 | 681 | cflags => add("-m64"), |
72d7f221 | 682 | cxxflags => add("-m64"), |
68b8bcf4 | 683 | lib_cppflags => add("-DB_ENDIAN"), |
7ead0c89 | 684 | perlasm_scheme => "linux64", |
7ead0c89 AP |
685 | multilib => "64", |
686 | }, | |
687 | "linux-ppc64le" => { | |
688 | inherit_from => [ "linux-generic64", asm("ppc64_asm") ], | |
8c3bc594 | 689 | cflags => add("-m64"), |
72d7f221 | 690 | cxxflags => add("-m64"), |
68b8bcf4 | 691 | lib_cppflags => add("-DL_ENDIAN"), |
7ead0c89 | 692 | perlasm_scheme => "linux64le", |
5e1b2353 | 693 | }, |
f09e7ca9 | 694 | |
5e1b2353 | 695 | "linux-armv4" => { |
7ead0c89 AP |
696 | ################################################################ |
697 | # Note that -march is not among compiler options in linux-armv4 | |
698 | # target description. Not specifying one is intentional to give | |
699 | # you choice to: | |
700 | # | |
701 | # a) rely on your compiler default by not specifying one; | |
702 | # b) specify your target platform explicitly for optimal | |
703 | # performance, e.g. -march=armv6 or -march=armv7-a; | |
704 | # c) build "universal" binary that targets *range* of platforms | |
705 | # by specifying minimum and maximum supported architecture; | |
706 | # | |
707 | # As for c) option. It actually makes no sense to specify | |
708 | # maximum to be less than ARMv7, because it's the least | |
709 | # requirement for run-time switch between platform-specific | |
710 | # code paths. And without run-time switch performance would be | |
711 | # equivalent to one for minimum. Secondly, there are some | |
712 | # natural limitations that you'd have to accept and respect. | |
713 | # Most notably you can *not* build "universal" binary for | |
714 | # big-endian platform. This is because ARMv7 processor always | |
715 | # picks instructions in little-endian order. Another similar | |
716 | # limitation is that -mthumb can't "cross" -march=armv6t2 | |
717 | # boundary, because that's where it became Thumb-2. Well, this | |
718 | # limitation is a bit artificial, because it's not really | |
719 | # impossible, but it's deemed too tricky to support. And of | |
720 | # course you have to be sure that your binutils are actually | |
721 | # up to the task of handling maximum target platform. With all | |
722 | # this in mind here is an example of how to configure | |
723 | # "universal" build: | |
724 | # | |
725 | # ./Configure linux-armv4 -march=armv6 -D__ARM_MAX_ARCH__=8 | |
726 | # | |
727 | inherit_from => [ "linux-generic32", asm("armv4_asm") ], | |
728 | perlasm_scheme => "linux32", | |
5e1b2353 RL |
729 | }, |
730 | "linux-aarch64" => { | |
7ead0c89 | 731 | inherit_from => [ "linux-generic64", asm("aarch64_asm") ], |
5e1b2353 | 732 | perlasm_scheme => "linux64", |
5e1b2353 | 733 | }, |
a93d3e06 AP |
734 | "linux-arm64ilp32" => { # https://wiki.linaro.org/Platform/arm64-ilp32 |
735 | inherit_from => [ "linux-generic32", asm("aarch64_asm") ], | |
8864f0de | 736 | cflags => add("-mabi=ilp32"), |
72d7f221 | 737 | cxxflags => add("-mabi=ilp32"), |
3e9e810f | 738 | bn_ops => "SIXTY_FOUR_BIT RC4_CHAR", |
a93d3e06 | 739 | perlasm_scheme => "linux64", |
a93d3e06 | 740 | }, |
7ead0c89 | 741 | |
5e1b2353 | 742 | "linux-mips32" => { |
7ead0c89 AP |
743 | # Configure script adds minimally required -march for assembly |
744 | # support, if no -march was specified at command line. | |
745 | inherit_from => [ "linux-generic32", asm("mips32_asm") ], | |
8c3bc594 | 746 | cflags => add("-mabi=32"), |
72d7f221 | 747 | cxxflags => add("-mabi=32"), |
68b8bcf4 | 748 | lib_cppflags => add("-DBN_DIV3W"), |
5e1b2353 | 749 | perlasm_scheme => "o32", |
5e1b2353 | 750 | }, |
7ead0c89 AP |
751 | # mips32 and mips64 below refer to contemporary MIPS Architecture |
752 | # specifications, MIPS32 and MIPS64, rather than to kernel bitness. | |
5e1b2353 | 753 | "linux-mips64" => { |
7ead0c89 | 754 | inherit_from => [ "linux-generic32", asm("mips64_asm") ], |
8c3bc594 | 755 | cflags => add("-mabi=n32"), |
72d7f221 | 756 | cxxflags => add("-mabi=n32"), |
68b8bcf4 | 757 | lib_cppflags => add("-DBN_DIV3W"), |
3e9e810f | 758 | bn_ops => "SIXTY_FOUR_BIT RC4_CHAR", |
5e1b2353 | 759 | perlasm_scheme => "n32", |
5e1b2353 RL |
760 | multilib => "32", |
761 | }, | |
762 | "linux64-mips64" => { | |
7ead0c89 | 763 | inherit_from => [ "linux-generic64", asm("mips64_asm") ], |
8c3bc594 | 764 | cflags => add("-mabi=64"), |
72d7f221 | 765 | cxxflags => add("-mabi=64"), |
68b8bcf4 | 766 | lib_cppflags => add("-DBN_DIV3W"), |
5e1b2353 | 767 | perlasm_scheme => "64", |
5e1b2353 RL |
768 | multilib => "64", |
769 | }, | |
7ead0c89 AP |
770 | |
771 | #### IA-32 targets... | |
7fbc0bfd RL |
772 | #### These two targets are a bit aged and are to be used on older Linux |
773 | #### machines where gcc doesn't understand -m32 and -m64 | |
5e1b2353 | 774 | "linux-elf" => { |
7ead0c89 | 775 | inherit_from => [ "linux-generic32", asm("x86_elf_asm") ], |
abe256e7 | 776 | CFLAGS => add(picker(release => "-fomit-frame-pointer")), |
68b8bcf4 | 777 | lib_cppflags => add("-DL_ENDIAN"), |
a01dab94 | 778 | bn_ops => "BN_LLONG", |
5e1b2353 RL |
779 | }, |
780 | "linux-aout" => { | |
d2b2221a | 781 | inherit_from => [ "BASE_unix", asm("x86_asm") ], |
abe256e7 RL |
782 | CC => "gcc", |
783 | CFLAGS => add(picker(default => "-Wall", | |
8864f0de RL |
784 | debug => "-O0 -g", |
785 | release => "-O3 -fomit-frame-pointer")), | |
68b8bcf4 | 786 | lib_cppflags => add("-DL_ENDIAN"), |
a01dab94 | 787 | bn_ops => "BN_LLONG", |
9c62a279 | 788 | thread_scheme => "(unknown)", |
5e1b2353 RL |
789 | perlasm_scheme => "a.out", |
790 | }, | |
7ead0c89 | 791 | |
7fbc0bfd RL |
792 | #### X86 / X86_64 targets |
793 | "linux-x86" => { | |
794 | inherit_from => [ "linux-generic32", asm("x86_asm") ], | |
abe256e7 RL |
795 | CFLAGS => add(picker(release => "-fomit-frame-pointer")), |
796 | cflags => add("-m32"), | |
72d7f221 | 797 | cxxflags => add("-m32"), |
68b8bcf4 | 798 | lib_cppflags => add("-DL_ENDIAN"), |
7fbc0bfd RL |
799 | bn_ops => "BN_LLONG", |
800 | perlasm_scheme => "elf", | |
7fbc0bfd RL |
801 | }, |
802 | "linux-x86-clang" => { | |
803 | inherit_from => [ "linux-x86" ], | |
abe256e7 RL |
804 | CC => "clang", |
805 | CXX => "clang++", | |
7fbc0bfd | 806 | }, |
5e1b2353 | 807 | "linux-x86_64" => { |
7ead0c89 | 808 | inherit_from => [ "linux-generic64", asm("x86_64_asm") ], |
8c3bc594 | 809 | cflags => add("-m64"), |
72d7f221 | 810 | cxxflags => add("-m64"), |
68b8bcf4 | 811 | lib_cppflags => add("-DL_ENDIAN"), |
3e9e810f | 812 | bn_ops => "SIXTY_FOUR_BIT_LONG", |
5e1b2353 | 813 | perlasm_scheme => "elf", |
5e1b2353 RL |
814 | multilib => "64", |
815 | }, | |
7ead0c89 AP |
816 | "linux-x86_64-clang" => { |
817 | inherit_from => [ "linux-x86_64" ], | |
abe256e7 RL |
818 | CC => "clang", |
819 | CXX => "clang++", | |
7ead0c89 | 820 | }, |
5e1b2353 | 821 | "linux-x32" => { |
7ead0c89 | 822 | inherit_from => [ "linux-generic32", asm("x86_64_asm") ], |
8c3bc594 | 823 | cflags => add("-mx32"), |
72d7f221 | 824 | cxxflags => add("-mx32"), |
68b8bcf4 | 825 | lib_cppflags => add("-DL_ENDIAN"), |
3e9e810f | 826 | bn_ops => "SIXTY_FOUR_BIT", |
2460c7f1 | 827 | perlasm_scheme => "elf32", |
5e1b2353 RL |
828 | multilib => "x32", |
829 | }, | |
7ead0c89 AP |
830 | |
831 | "linux-ia64" => { | |
832 | inherit_from => [ "linux-generic64", asm("ia64_asm") ], | |
3e9e810f | 833 | bn_ops => "SIXTY_FOUR_BIT_LONG", |
7ead0c89 AP |
834 | }, |
835 | ||
5e1b2353 | 836 | "linux64-s390x" => { |
7ead0c89 | 837 | inherit_from => [ "linux-generic64", asm("s390x_asm") ], |
8c3bc594 | 838 | cflags => add("-m64"), |
72d7f221 | 839 | cxxflags => add("-m64"), |
68b8bcf4 | 840 | lib_cppflags => add("-DB_ENDIAN"), |
5e1b2353 | 841 | perlasm_scheme => "64", |
5e1b2353 RL |
842 | multilib => "64", |
843 | }, | |
5e1b2353 | 844 | "linux32-s390x" => { |
7ead0c89 AP |
845 | #### So called "highgprs" target for z/Architecture CPUs |
846 | # "Highgprs" is kernel feature first implemented in Linux | |
847 | # 2.6.32, see /proc/cpuinfo. The idea is to preserve most | |
848 | # significant bits of general purpose registers not only | |
849 | # upon 32-bit process context switch, but even on | |
850 | # asynchronous signal delivery to such process. This makes | |
851 | # it possible to deploy 64-bit instructions even in legacy | |
852 | # application context and achieve better [or should we say | |
853 | # adequate] performance. The build is binary compatible with | |
854 | # linux-generic32, and the idea is to be able to install the | |
855 | # resulting libcrypto.so alongside generic one, e.g. as | |
856 | # /lib/highgprs/libcrypto.so.x.y, for ldconfig and run-time | |
857 | # linker to autodiscover. Unfortunately it doesn't work just | |
858 | # yet, because of couple of bugs in glibc | |
859 | # sysdeps/s390/dl-procinfo.c affecting ldconfig and ld.so.1... | |
860 | # | |
861 | inherit_from => [ "linux-generic32", asm("s390x_asm") ], | |
8c3bc594 | 862 | cflags => add("-m31 -Wa,-mzarch"), |
72d7f221 | 863 | cxxflags => add("-m31 -Wa,-mzarch"), |
68b8bcf4 | 864 | lib_cppflags => add("-DB_ENDIAN"), |
8d51db86 | 865 | bn_asm_src => sub { my $r=join(" ",@_); $r=~s|asm/s390x\.S|bn_asm.c|; $r; }, |
5e1b2353 | 866 | perlasm_scheme => "31", |
5e1b2353 RL |
867 | multilib => "/highgprs", |
868 | }, | |
7ead0c89 AP |
869 | |
870 | #### SPARC Linux setups | |
5e1b2353 | 871 | "linux-sparcv8" => { |
7ead0c89 | 872 | inherit_from => [ "linux-generic32", asm("sparcv8_asm") ], |
8c3bc594 | 873 | cflags => add("-mcpu=v8"), |
72d7f221 | 874 | cxxflags => add("-mcpu=v8"), |
abe256e7 | 875 | lib_cppflags => add("-DB_ENDIAN -DBN_DIV2W"), |
5e1b2353 | 876 | }, |
5e1b2353 | 877 | "linux-sparcv9" => { |
7ead0c89 AP |
878 | # it's a real mess with -mcpu=ultrasparc option under Linux, |
879 | # but -Wa,-Av8plus should do the trick no matter what. | |
880 | inherit_from => [ "linux-generic32", asm("sparcv9_asm") ], | |
8c3bc594 | 881 | cflags => add("-m32 -mcpu=ultrasparc -Wa,-Av8plus"), |
72d7f221 | 882 | cxxflags => add("-m32 -mcpu=ultrasparc -Wa,-Av8plus"), |
abe256e7 | 883 | lib_cppflags => add("-DB_ENDIAN -DBN_DIV2W"), |
5e1b2353 | 884 | }, |
5e1b2353 | 885 | "linux64-sparcv9" => { |
7ead0c89 AP |
886 | # GCC 3.1 is a requirement |
887 | inherit_from => [ "linux-generic64", asm("sparcv9_asm") ], | |
8c3bc594 | 888 | cflags => add("-m64 -mcpu=ultrasparc"), |
72d7f221 | 889 | cxxflags => add("-m64 -mcpu=ultrasparc"), |
abe256e7 | 890 | lib_cppflags => add("-DB_ENDIAN"), |
3e9e810f | 891 | bn_ops => "BN_LLONG RC4_CHAR", |
5e1b2353 RL |
892 | multilib => "64", |
893 | }, | |
7ead0c89 | 894 | |
5e1b2353 | 895 | "linux-alpha-gcc" => { |
7ead0c89 | 896 | inherit_from => [ "linux-generic64", asm("alpha_asm") ], |
abe256e7 | 897 | lib_cppflags => add("-DL_ENDIAN"), |
3e9e810f | 898 | bn_ops => "SIXTY_FOUR_BIT_LONG", |
5e1b2353 | 899 | }, |
5e1b2353 | 900 | "linux-c64xplus" => { |
d2b2221a | 901 | inherit_from => [ "BASE_unix" ], |
7ead0c89 | 902 | # TI_CGT_C6000_7.3.x is a requirement |
abe256e7 RL |
903 | CC => "cl6x", |
904 | CFLAGS => "-o2 -ox -ms", | |
905 | cflags => "--linux -ea=.s -eo=.o -mv6400+ -pden", | |
72d7f221 | 906 | cxxflags => "--linux -ea=.s -eo=.o -mv6400+ -pden", |
8c3bc594 | 907 | cppflags => combine("-DOPENSSL_SMALL_FOOTPRINT", |
9c62a279 | 908 | threads("-D_REENTRANT")), |
5e1b2353 | 909 | bn_ops => "BN_LLONG", |
f4e175e4 AP |
910 | cpuid_asm_src => "c64xpluscpuid.s", |
911 | bn_asm_src => "asm/bn-c64xplus.asm c64xplus-gf2m.s", | |
912 | aes_asm_src => "aes-c64xplus.s aes_cbc.c aes-ctr.fake", | |
913 | sha1_asm_src => "sha1-c64xplus.s sha256-c64xplus.s sha512-c64xplus.s", | |
914 | rc4_asm_src => "rc4-c64xplus.s", | |
915 | modes_asm_src => "ghash-c64xplus.s", | |
916 | chacha_asm_src => "chacha-c64xplus.s", | |
917 | poly1305_asm_src => "poly1305-c64xplus.s", | |
9c62a279 | 918 | thread_scheme => "pthreads", |
5e1b2353 RL |
919 | perlasm_scheme => "void", |
920 | dso_scheme => "dlfcn", | |
921 | shared_target => "linux-shared", | |
922 | shared_cflag => "--pic", | |
b6d5ba1a | 923 | shared_ldflag => add("-z --sysv --shared"), |
d4453024 | 924 | shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)", |
5e1b2353 RL |
925 | ranlib => "true", |
926 | }, | |
f09e7ca9 | 927 | |
1818572d | 928 | #### *BSD |
5e1b2353 | 929 | "BSD-generic32" => { |
9c62a279 | 930 | # As for thread cflag. Idea is to maintain "collective" set of |
1818572d AP |
931 | # flags, which would cover all BSD flavors. -pthread applies |
932 | # to them all, but is treated differently. OpenBSD expands is | |
933 | # as -D_POSIX_THREAD -lc_r, which is sufficient. FreeBSD 4.x | |
934 | # expands it as -lc_r, which has to be accompanied by explicit | |
935 | # -D_THREAD_SAFE and sometimes -D_REENTRANT. FreeBSD 5.x | |
936 | # expands it as -lc_r, which seems to be sufficient? | |
d2b2221a | 937 | inherit_from => [ "BASE_unix" ], |
abe256e7 RL |
938 | CC => "cc", |
939 | CFLAGS => picker(default => "-Wall", | |
940 | debug => "-O0 -g", | |
941 | release => "-O3"), | |
942 | cflags => threads("-pthread"), | |
8c3bc594 | 943 | cppflags => threads("-D_THREAD_SAFE -D_REENTRANT"), |
fcd2ac80 | 944 | ex_libs => add(threads("-pthread")), |
619eb33a | 945 | enable => add("devcryptoeng"), |
3e9e810f | 946 | bn_ops => "BN_LLONG", |
9c62a279 | 947 | thread_scheme => "pthreads", |
5e1b2353 RL |
948 | dso_scheme => "dlfcn", |
949 | shared_target => "bsd-gcc-shared", | |
950 | shared_cflag => "-fPIC", | |
d4453024 | 951 | shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)", |
5e1b2353 | 952 | }, |
7ead0c89 AP |
953 | "BSD-generic64" => { |
954 | inherit_from => [ "BSD-generic32" ], | |
3e9e810f | 955 | bn_ops => "SIXTY_FOUR_BIT_LONG", |
5e1b2353 | 956 | }, |
7ead0c89 AP |
957 | |
958 | "BSD-x86" => { | |
959 | inherit_from => [ "BSD-generic32", asm("x86_asm") ], | |
abe256e7 | 960 | CFLAGS => add(picker(release => "-fomit-frame-pointer")), |
68b8bcf4 | 961 | lib_cppflags => add("-DL_ENDIAN"), |
a01dab94 | 962 | bn_ops => "BN_LLONG", |
5e1b2353 | 963 | shared_target => "bsd-shared", |
7ead0c89 | 964 | perlasm_scheme => "a.out", |
5e1b2353 | 965 | }, |
7ead0c89 AP |
966 | "BSD-x86-elf" => { |
967 | inherit_from => [ "BSD-x86" ], | |
968 | perlasm_scheme => "elf", | |
5e1b2353 | 969 | }, |
f09e7ca9 | 970 | |
7ead0c89 AP |
971 | "BSD-sparcv8" => { |
972 | inherit_from => [ "BSD-generic32", asm("sparcv8_asm") ], | |
8c3bc594 | 973 | cflags => add("-mcpu=v8"), |
68b8bcf4 | 974 | lib_cppflags => add("-DB_ENDIAN"), |
5e1b2353 | 975 | }, |
5e1b2353 | 976 | "BSD-sparc64" => { |
7ead0c89 AP |
977 | # -DMD32_REG_T=int doesn't actually belong in sparc64 target, it |
978 | # simply *happens* to work around a compiler bug in gcc 3.3.3, | |
979 | # triggered by RIPEMD160 code. | |
980 | inherit_from => [ "BSD-generic64", asm("sparcv9_asm") ], | |
68b8bcf4 | 981 | lib_cppflags => add("-DB_ENDIAN -DMD32_REG_T=int"), |
3e9e810f | 982 | bn_ops => "BN_LLONG", |
5e1b2353 | 983 | }, |
7ead0c89 | 984 | |
5e1b2353 | 985 | "BSD-ia64" => { |
7ead0c89 | 986 | inherit_from => [ "BSD-generic64", asm("ia64_asm") ], |
68b8bcf4 | 987 | lib_cppflags => add("-DL_ENDIAN"), |
3e9e810f | 988 | bn_ops => "SIXTY_FOUR_BIT_LONG", |
5e1b2353 | 989 | }, |
7ead0c89 | 990 | |
5e1b2353 | 991 | "BSD-x86_64" => { |
7ead0c89 | 992 | inherit_from => [ "BSD-generic64", asm("x86_64_asm") ], |
68b8bcf4 | 993 | lib_cppflags => add("-DL_ENDIAN"), |
3e9e810f | 994 | bn_ops => "SIXTY_FOUR_BIT_LONG", |
5e1b2353 | 995 | perlasm_scheme => "elf", |
5e1b2353 | 996 | }, |
f09e7ca9 | 997 | |
5e1b2353 | 998 | "bsdi-elf-gcc" => { |
d2b2221a | 999 | inherit_from => [ "BASE_unix", asm("x86_elf_asm") ], |
abe256e7 RL |
1000 | CC => "gcc", |
1001 | CFLAGS => "-fomit-frame-pointer -O3 -Wall", | |
68b8bcf4 | 1002 | lib_cppflags => "-DPERL5 -DL_ENDIAN", |
98fdbce0 | 1003 | ex_libs => add("-ldl"), |
a01dab94 | 1004 | bn_ops => "BN_LLONG", |
9c62a279 | 1005 | thread_scheme => "(unknown)", |
5e1b2353 RL |
1006 | dso_scheme => "dlfcn", |
1007 | shared_target => "bsd-gcc-shared", | |
1008 | shared_cflag => "-fPIC", | |
d4453024 | 1009 | shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)", |
5e1b2353 | 1010 | }, |
f09e7ca9 | 1011 | |
5e1b2353 | 1012 | "nextstep" => { |
d2b2221a | 1013 | inherit_from => [ "BASE_unix" ], |
abe256e7 RL |
1014 | CC => "cc", |
1015 | CFLAGS => "-O -Wall", | |
5e1b2353 | 1016 | unistd => "<libc.h>", |
a01dab94 | 1017 | bn_ops => "BN_LLONG", |
9c62a279 | 1018 | thread_scheme => "(unknown)", |
5e1b2353 RL |
1019 | }, |
1020 | "nextstep3.3" => { | |
d2b2221a | 1021 | inherit_from => [ "BASE_unix" ], |
abe256e7 RL |
1022 | CC => "cc", |
1023 | CFLAGS => "-O3 -Wall", | |
5e1b2353 | 1024 | unistd => "<libc.h>", |
a01dab94 | 1025 | bn_ops => "BN_LLONG", |
9c62a279 | 1026 | thread_scheme => "(unknown)", |
5e1b2353 | 1027 | }, |
f09e7ca9 | 1028 | |
f09e7ca9 RS |
1029 | #### SCO/Caldera targets. |
1030 | # | |
1031 | # Originally we had like unixware-*, unixware-*-pentium, unixware-*-p6, etc. | |
1032 | # Now we only have blended unixware-* as it's the only one used by ./config. | |
1033 | # If you want to optimize for particular microarchitecture, bypass ./config | |
1034 | # and './Configure unixware-7 -Kpentium_pro' or whatever appropriate. | |
1035 | # Note that not all targets include assembler support. Mostly because of | |
1036 | # lack of motivation to support out-of-date platforms with out-of-date | |
e3713c36 | 1037 | # compiler drivers and assemblers. |
f09e7ca9 RS |
1038 | # |
1039 | # UnixWare 2.0x fails destest with -O. | |
5e1b2353 | 1040 | "unixware-2.0" => { |
d2b2221a | 1041 | inherit_from => [ "BASE_unix" ], |
abe256e7 RL |
1042 | CC => "cc", |
1043 | cflags => threads("-Kthread"), | |
68b8bcf4 | 1044 | lib_cppflags => "-DFILIO_H -DNO_STRINGS_H", |
98fdbce0 | 1045 | ex_libs => add("-lsocket -lnsl -lresolv -lx"), |
9c62a279 | 1046 | thread_scheme => "uithreads", |
5e1b2353 RL |
1047 | }, |
1048 | "unixware-2.1" => { | |
d2b2221a | 1049 | inherit_from => [ "BASE_unix" ], |
abe256e7 RL |
1050 | CC => "cc", |
1051 | CFLAGS => "-O", | |
1052 | cflags => threads("-Kthread"), | |
68b8bcf4 | 1053 | lib_cppflags => "-DFILIO_H", |
98fdbce0 | 1054 | ex_libs => add("-lsocket -lnsl -lresolv -lx"), |
9c62a279 | 1055 | thread_scheme => "uithreads", |
5e1b2353 RL |
1056 | }, |
1057 | "unixware-7" => { | |
d2b2221a | 1058 | inherit_from => [ "BASE_unix", asm("x86_elf_asm") ], |
abe256e7 RL |
1059 | CC => "cc", |
1060 | CFLAGS => "-O", | |
1061 | cflags => combine("-Kalloca", threads("-Kthread")), | |
68b8bcf4 | 1062 | lib_cppflags => "-DFILIO_H", |
98fdbce0 | 1063 | ex_libs => add("-lsocket -lnsl"), |
9c62a279 | 1064 | thread_scheme => "uithreads", |
a01dab94 | 1065 | bn_ops => "BN_LLONG", |
5e1b2353 RL |
1066 | perlasm_scheme => "elf-1", |
1067 | dso_scheme => "dlfcn", | |
1068 | shared_target => "svr5-shared", | |
1069 | shared_cflag => "-Kpic", | |
d4453024 | 1070 | shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)", |
5e1b2353 RL |
1071 | }, |
1072 | "unixware-7-gcc" => { | |
d2b2221a | 1073 | inherit_from => [ "BASE_unix", asm("x86_elf_asm") ], |
abe256e7 RL |
1074 | CC => "gcc", |
1075 | CFLAGS => "-O3 -fomit-frame-pointer -Wall", | |
68b8bcf4 RL |
1076 | cppflags => add(threads("-D_REENTRANT")), |
1077 | lib_cppflags => add("-DL_ENDIAN -DFILIO_H"), | |
98fdbce0 | 1078 | ex_libs => add("-lsocket -lnsl"), |
a01dab94 | 1079 | bn_ops => "BN_LLONG", |
9c62a279 | 1080 | thread_scheme => "pthreads", |
5e1b2353 RL |
1081 | perlasm_scheme => "elf-1", |
1082 | dso_scheme => "dlfcn", | |
1083 | shared_target => "gnu-shared", | |
1084 | shared_cflag => "-fPIC", | |
d4453024 | 1085 | shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)", |
5e1b2353 | 1086 | }, |
e3713c36 | 1087 | # SCO 5 - Ben Laurie says the -O breaks the SCO cc. |
5e1b2353 | 1088 | "sco5-cc" => { |
d2b2221a | 1089 | inherit_from => [ "BASE_unix", asm("x86_elf_asm") ], |
5e1b2353 RL |
1090 | cc => "cc", |
1091 | cflags => "-belf", | |
98fdbce0 | 1092 | ex_libs => add("-lsocket -lnsl"), |
9c62a279 | 1093 | thread_scheme => "(unknown)", |
5e1b2353 RL |
1094 | perlasm_scheme => "elf-1", |
1095 | dso_scheme => "dlfcn", | |
1096 | shared_target => "svr3-shared", | |
1097 | shared_cflag => "-Kpic", | |
d4453024 | 1098 | shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)", |
5e1b2353 RL |
1099 | }, |
1100 | "sco5-gcc" => { | |
d2b2221a | 1101 | inherit_from => [ "BASE_unix", asm("x86_elf_asm") ], |
5e1b2353 RL |
1102 | cc => "gcc", |
1103 | cflags => "-O3 -fomit-frame-pointer", | |
98fdbce0 | 1104 | ex_libs => add("-lsocket -lnsl"), |
a01dab94 | 1105 | bn_ops => "BN_LLONG", |
9c62a279 | 1106 | thread_scheme => "(unknown)", |
5e1b2353 RL |
1107 | perlasm_scheme => "elf-1", |
1108 | dso_scheme => "dlfcn", | |
1109 | shared_target => "svr3-shared", | |
1110 | shared_cflag => "-fPIC", | |
d4453024 | 1111 | shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)", |
5e1b2353 | 1112 | }, |
f09e7ca9 RS |
1113 | |
1114 | #### IBM's AIX. | |
f780eaad AP |
1115 | # Below targets assume AIX >=5. Caveat lector. If you are accustomed |
1116 | # to control compilation "bitness" by setting $OBJECT_MODE environment | |
1117 | # variable, then you should know that in OpenSSL case it's considered | |
1118 | # only in ./config. Once configured, build procedure remains "deaf" to | |
1119 | # current value of $OBJECT_MODE. | |
5e1b2353 | 1120 | "aix-gcc" => { |
d2b2221a | 1121 | inherit_from => [ "BASE_unix", asm("ppc32_asm") ], |
abe256e7 RL |
1122 | CC => "gcc", |
1123 | CFLAGS => picker(debug => "-O0 -g", | |
1124 | release => "-O"), | |
1125 | cflags => add(threads("-pthread")), | |
68b8bcf4 | 1126 | lib_cppflags => "-DB_ENDIAN", |
fcd2ac80 | 1127 | ex_libs => add(threads("-pthread")), |
5e1b2353 RL |
1128 | sys_id => "AIX", |
1129 | bn_ops => "BN_LLONG RC4_CHAR", | |
9c62a279 | 1130 | thread_scheme => "pthreads", |
5e1b2353 RL |
1131 | perlasm_scheme => "aix32", |
1132 | dso_scheme => "dlfcn", | |
1133 | shared_target => "aix-shared", | |
f780eaad | 1134 | shared_ldflag => "-shared -static-libgcc -Wl,-G", |
d4453024 | 1135 | shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)", |
2a23cd7f AP |
1136 | AR => add("-X32"), |
1137 | RANLIB => add("-X32"), | |
5e1b2353 RL |
1138 | }, |
1139 | "aix64-gcc" => { | |
d2b2221a | 1140 | inherit_from => [ "BASE_unix", asm("ppc64_asm") ], |
abe256e7 RL |
1141 | CC => "gcc", |
1142 | CFLAGS => picker(debug => "-O0 -g", | |
1143 | release => "-O"), | |
1144 | cflags => combine("-maix64", threads("-pthread")), | |
68b8bcf4 | 1145 | lib_cppflags => "-DB_ENDIAN", |
fcd2ac80 | 1146 | ex_libs => add(threads("-pthread")), |
5e1b2353 RL |
1147 | sys_id => "AIX", |
1148 | bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR", | |
9c62a279 | 1149 | thread_scheme => "pthreads", |
5e1b2353 RL |
1150 | perlasm_scheme => "aix64", |
1151 | dso_scheme => "dlfcn", | |
1152 | shared_target => "aix-shared", | |
8dd0ff1c | 1153 | shared_ldflag => "-shared -static-libgcc -Wl,-G", |
d4453024 | 1154 | shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)", |
2a23cd7f AP |
1155 | AR => add("-X64"), |
1156 | RANLIB => add("-X64"), | |
5e1b2353 | 1157 | }, |
5e1b2353 | 1158 | "aix-cc" => { |
d2b2221a | 1159 | inherit_from => [ "BASE_unix", asm("ppc32_asm") ], |
abe256e7 RL |
1160 | CC => "cc", |
1161 | CFLAGS => picker(debug => "-O0 -g", | |
1162 | release => "-O"), | |
1163 | cflags => combine("-q32 -qmaxmem=16384 -qro -qroconst", | |
8c3bc594 | 1164 | threads("-qthreaded")), |
68b8bcf4 RL |
1165 | cppflags => threads("-D_THREAD_SAFE"), |
1166 | lib_cppflags => "-DB_ENDIAN", | |
5e1b2353 RL |
1167 | sys_id => "AIX", |
1168 | bn_ops => "BN_LLONG RC4_CHAR", | |
9c62a279 | 1169 | thread_scheme => "pthreads", |
f780eaad | 1170 | ex_libs => threads("-lpthreads"), |
5e1b2353 RL |
1171 | perlasm_scheme => "aix32", |
1172 | dso_scheme => "dlfcn", | |
1173 | shared_target => "aix-shared", | |
4af14b7b | 1174 | shared_cflag => "-qpic", |
8dd0ff1c | 1175 | shared_ldflag => "-G", |
d4453024 | 1176 | shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)", |
2a23cd7f AP |
1177 | AR => add("-X32"), |
1178 | RANLIB => add("-X32"), | |
5e1b2353 RL |
1179 | }, |
1180 | "aix64-cc" => { | |
d2b2221a | 1181 | inherit_from => [ "BASE_unix", asm("ppc64_asm") ], |
abe256e7 RL |
1182 | CC => "cc", |
1183 | CFLAGS => picker(debug => "-O0 -g", | |
1184 | release => "-O"), | |
1185 | cflags => combine("-q64 -qmaxmem=16384 -qro -qroconst", | |
8c3bc594 | 1186 | threads("-qthreaded")), |
68b8bcf4 RL |
1187 | cppflags => threads("-D_THREAD_SAFE"), |
1188 | lib_cppflags => "-DB_ENDIAN", | |
5e1b2353 RL |
1189 | sys_id => "AIX", |
1190 | bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR", | |
9c62a279 | 1191 | thread_scheme => "pthreads", |
f780eaad | 1192 | ex_libs => threads("-lpthreads"), |
5e1b2353 RL |
1193 | perlasm_scheme => "aix64", |
1194 | dso_scheme => "dlfcn", | |
1195 | shared_target => "aix-shared", | |
4af14b7b | 1196 | shared_cflag => "-qpic", |
8dd0ff1c | 1197 | shared_ldflag => "-G", |
d4453024 | 1198 | shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)", |
2a23cd7f AP |
1199 | AR => add("-X64"), |
1200 | RANLIB => add("-X64"), | |
5e1b2353 | 1201 | }, |
f09e7ca9 RS |
1202 | |
1203 | # SIEMENS BS2000/OSD: an EBCDIC-based mainframe | |
5e1b2353 | 1204 | "BS2000-OSD" => { |
d2b2221a | 1205 | inherit_from => [ "BASE_unix" ], |
abe256e7 RL |
1206 | CC => "c89", |
1207 | CFLAGS => "-O", | |
1208 | cflags => "-XLLML -XLLMK -XL", | |
68b8bcf4 RL |
1209 | cppflags => "-DCHARSET_EBCDIC", |
1210 | lib_cppflags => "-DB_ENDIAN", | |
98fdbce0 | 1211 | ex_libs => add("-lsocket -lnsl"), |
3e9e810f | 1212 | bn_ops => "THIRTY_TWO_BIT RC4_CHAR", |
9c62a279 | 1213 | thread_scheme => "(unknown)", |
5e1b2353 | 1214 | }, |
f09e7ca9 | 1215 | |
7ead0c89 | 1216 | #### Visual C targets |
f09e7ca9 | 1217 | # |
78a50c75 | 1218 | # Win64 targets, WIN64I denotes IA-64/Itanium and WIN64A - AMD64 |
f09e7ca9 | 1219 | # |
78a50c75 | 1220 | # Note about /wd4090, disable warning C4090. This warning returns false |
f09e7ca9 RS |
1221 | # positives in some situations. Disabling it altogether masks both |
1222 | # legitimate and false cases, but as we compile on multiple platforms, | |
1223 | # we rely on other compilers to catch legitimate cases. | |
2fe73036 RL |
1224 | # |
1225 | # Also note that we force threads no matter what. Configuring "no-threads" | |
1226 | # is ignored. | |
78a50c75 AP |
1227 | # |
1228 | # UNICODE is defined in VC-common and applies to all targets. It used to | |
1229 | # be an opt-in option for VC-WIN32, but not anymore. The original reason | |
1230 | # was because ANSI API was *native* system interface for no longer | |
1231 | # supported Windows 9x. Keep in mind that UNICODE only affects how | |
1232 | # OpenSSL libraries interact with underlying OS, it doesn't affect API | |
1233 | # that OpenSSL presents to application. | |
1234 | ||
7ead0c89 | 1235 | "VC-common" => { |
d2b2221a | 1236 | inherit_from => [ "BASE_Windows" ], |
7ead0c89 | 1237 | template => 1, |
abe256e7 RL |
1238 | CC => "cl", |
1239 | CPP => '$(CC) /EP /C', | |
78a50c75 | 1240 | CFLAGS => "/W3 /wd4090 /nologo", |
abe256e7 RL |
1241 | LDFLAGS => add("/debug"), |
1242 | coutflag => "/Fo", | |
8c3bc594 | 1243 | defines => add("OPENSSL_SYS_WIN32", "WIN32_LEAN_AND_MEAN", |
78a50c75 | 1244 | "UNICODE", "_UNICODE", |
68b8bcf4 RL |
1245 | "_CRT_SECURE_NO_DEPRECATE", |
1246 | "_WINSOCK_DEPRECATED_NO_WARNINGS"), | |
78a50c75 AP |
1247 | lib_cflags => add("/Zi /Fdossl_static.pdb"), |
1248 | lib_defines => add("L_ENDIAN"), | |
1249 | dso_cflags => "/Zi /Fddso.pdb", | |
1250 | bin_cflags => "/Zi /Fdapp.pdb", | |
2fe73036 | 1251 | shared_ldflag => "/dll", |
e9abfc3a | 1252 | shared_target => "win-shared", # meaningless except it gives Configure a hint |
2fe73036 | 1253 | thread_scheme => "winthreads", |
5e1b2353 | 1254 | dso_scheme => "win32", |
4e155ec4 | 1255 | apps_aux_src => add("win32_init.c"), |
78a50c75 | 1256 | bn_ops => "EXPORT_VAR_AS_FN", |
6a145a32 AP |
1257 | # additional parameter to build_scheme denotes install-path "flavour" |
1258 | build_scheme => add("VC-common", { separator => undef }), | |
5e1b2353 | 1259 | }, |
2fe73036 | 1260 | "VC-noCE-common" => { |
acf15259 | 1261 | inherit_from => [ "VC-common" ], |
be1f4812 | 1262 | template => 1, |
abe256e7 RL |
1263 | CFLAGS => add(picker(debug => '/Od', |
1264 | release => '/O2')), | |
78a50c75 AP |
1265 | cflags => add(picker(default => '/Gs0 /GF /Gy', |
1266 | debug => | |
2fe73036 | 1267 | sub { |
abe256e7 | 1268 | ($disabled{shared} ? "" : "/MDd"); |
2fe73036 RL |
1269 | }, |
1270 | release => | |
1271 | sub { | |
abe256e7 | 1272 | ($disabled{shared} ? "" : "/MD"); |
2fe73036 | 1273 | })), |
fffb1c54 AP |
1274 | defines => add(picker(default => [], # works as type cast |
1275 | debug => [ "DEBUG", "_DEBUG" ])), | |
c32cbe97 AP |
1276 | lib_cflags => add(sub { $disabled{shared} ? "/MT /Zl" : () }), |
1277 | # Following might/should appears controversial, i.e. defining | |
1278 | # /MDd without evaluating $disabled{shared}. It works in | |
1279 | # non-shared build because static library is compiled with /Zl | |
1280 | # and bares no reference to specific RTL. And it works in | |
1281 | # shared build because multiple /MDd options are not prohibited. | |
1282 | # But why /MDd in static build? Well, basically this is just a | |
1283 | # reference point, which allows to catch eventual errors that | |
1284 | # would prevent those who want to wrap OpenSSL into own .DLL. | |
1285 | # Why not /MD in release build then? Well, some are likely to | |
1286 | # prefer [non-debug] openssl.exe to be free from Micorosoft RTL | |
1287 | # redistributable. | |
1288 | bin_cflags => add(picker(debug => "/MDd", | |
1289 | release => sub { $disabled{shared} ? "/MT" : () }, | |
1290 | )), | |
2fe73036 | 1291 | bin_lflags => add("/subsystem:console /opt:ref"), |
ef5b8296 | 1292 | ex_libs => add(sub { |
2fe73036 RL |
1293 | my @ex_libs = (); |
1294 | push @ex_libs, 'ws2_32.lib' unless $disabled{sock}; | |
1295 | push @ex_libs, 'gdi32.lib advapi32.lib crypt32.lib user32.lib'; | |
1296 | return join(" ", @ex_libs); | |
ef5b8296 | 1297 | }), |
2fe73036 RL |
1298 | }, |
1299 | "VC-WIN64-common" => { | |
1300 | inherit_from => [ "VC-noCE-common" ], | |
be1f4812 | 1301 | template => 1, |
ef5b8296 | 1302 | ex_libs => add(sub { |
2fe73036 RL |
1303 | my @ex_libs = (); |
1304 | push @ex_libs, 'bufferoverflowu.lib' if (`cl 2>&1` =~ /14\.00\.4[0-9]{4}\./); | |
1305 | return join(" ", @_, @ex_libs); | |
ef5b8296 | 1306 | }), |
78a50c75 | 1307 | bn_ops => add("SIXTY_FOUR_BIT"), |
2fe73036 | 1308 | }, |
7ead0c89 | 1309 | "VC-WIN64I" => { |
acf15259 AP |
1310 | inherit_from => [ "VC-WIN64-common", asm("ia64_asm"), |
1311 | sub { $disabled{shared} ? () : "ia64_uplink" } ], | |
abe256e7 RL |
1312 | AS => "ias", |
1313 | ASFLAGS => "-d debug", | |
78a50c75 | 1314 | asoutflag => "-o ", |
5e1b2353 | 1315 | sys_id => "WIN64I", |
6ddb62a5 AP |
1316 | bn_asm_src => sub { return undef unless @_; |
1317 | my $r=join(" ",@_); $r=~s|bn-ia64.s|bn_asm.c|; $r; }, | |
5e1b2353 | 1318 | perlasm_scheme => "ias", |
6ddb62a5 | 1319 | multilib => "-ia64", |
5e1b2353 RL |
1320 | }, |
1321 | "VC-WIN64A" => { | |
acf15259 AP |
1322 | inherit_from => [ "VC-WIN64-common", asm("x86_64_asm"), |
1323 | sub { $disabled{shared} ? () : "x86_64_uplink" } ], | |
abe256e7 RL |
1324 | AS => sub { vc_win64a_info()->{AS} }, |
1325 | ASFLAGS => sub { vc_win64a_info()->{ASFLAGS} }, | |
2fe73036 | 1326 | asoutflag => sub { vc_win64a_info()->{asoutflag} }, |
abe256e7 | 1327 | asflags => sub { vc_win64a_info()->{asflags} }, |
5e1b2353 | 1328 | sys_id => "WIN64A", |
2fe73036 RL |
1329 | bn_asm_src => sub { return undef unless @_; |
1330 | my $r=join(" ",@_); $r=~s|asm/x86_64-gcc|bn_asm|; $r; }, | |
5e1b2353 | 1331 | perlasm_scheme => "auto", |
6ddb62a5 | 1332 | multilib => "-x64", |
5e1b2353 | 1333 | }, |
5e1b2353 | 1334 | "VC-WIN32" => { |
acf15259 | 1335 | inherit_from => [ "VC-noCE-common", asm("x86_asm"), |
fdf6f73e | 1336 | sub { $disabled{shared} ? () : "uplink_common" } ], |
78a50c75 | 1337 | CFLAGS => add("/WX"), |
abe256e7 RL |
1338 | AS => sub { vc_win32_info()->{AS} }, |
1339 | ASFLAGS => sub { vc_win32_info()->{ASFLAGS} }, | |
43800958 | 1340 | asoutflag => sub { vc_win32_info()->{asoutflag} }, |
abe256e7 | 1341 | asflags => sub { vc_win32_info()->{asflags} }, |
5e1b2353 | 1342 | sys_id => "WIN32", |
78a50c75 | 1343 | bn_ops => add("BN_LLONG"), |
f0d484fc | 1344 | perlasm_scheme => sub { vc_win32_info()->{perlasm_scheme} }, |
6a145a32 AP |
1345 | # "WOW" stands for "Windows on Windows", and "VC-WOW" engages |
1346 | # some installation path heuristics in windows-makefile.tmpl... | |
1347 | build_scheme => add("VC-WOW", { separator => undef }), | |
5e1b2353 | 1348 | }, |
5e1b2353 | 1349 | "VC-CE" => { |
2fe73036 | 1350 | inherit_from => [ "VC-common" ], |
78a50c75 AP |
1351 | CFLAGS => add(picker(debug => "/Od", |
1352 | release => "/O1i")), | |
abe256e7 RL |
1353 | CPPDEFINES => picker(debug => [ "DEBUG", "_DEBUG" ]), |
1354 | LDFLAGS => add("/nologo /opt:ref"), | |
2fe73036 | 1355 | cflags => |
abe256e7 RL |
1356 | combine('/GF /Gy', |
1357 | sub { vc_wince_info()->{cflags}; }, | |
1358 | sub { `cl 2>&1` =~ /Version ([0-9]+)\./ && $1>=14 | |
1359 | ? ($disabled{shared} ? " /MT" : " /MD") | |
1360 | : " /MC"; }), | |
e548c1fe | 1361 | cppflags => sub { vc_wince_info()->{cppflags}; }, |
78a50c75 | 1362 | lib_defines => add("NO_CHMOD", "OPENSSL_SMALL_FOOTPRINT"), |
68b8bcf4 | 1363 | lib_cppflags => sub { vc_wince_info()->{cppflags}; }, |
8c3bc594 | 1364 | includes => |
368297d1 RL |
1365 | add(combine(sub { defined(env('WCECOMPAT')) |
1366 | ? '$(WCECOMPAT)/include' : (); }, | |
1367 | sub { defined(env('PORTSDK_LIBPATH')) | |
1368 | ? '$(PORTSDK_LIBPATH)/../../include' | |
1369 | : (); })), | |
abe256e7 | 1370 | lflags => add(combine(sub { vc_wince_info()->{lflags}; }, |
47eeaf45 RL |
1371 | sub { defined(env('PORTSDK_LIBPATH')) |
1372 | ? "/entry:mainCRTstartup" : (); })), | |
5e1b2353 | 1373 | sys_id => "WINCE", |
78a50c75 | 1374 | bn_ops => add("BN_LLONG"), |
ef5b8296 | 1375 | ex_libs => add(sub { |
2fe73036 RL |
1376 | my @ex_libs = (); |
1377 | push @ex_libs, 'ws2.lib' unless $disabled{sock}; | |
1378 | push @ex_libs, 'crypt32.lib'; | |
17f16617 | 1379 | if (defined(env('WCECOMPAT'))) { |
2fe73036 | 1380 | my $x = '$(WCECOMPAT)/lib'; |
17f16617 | 1381 | if (-f "$x/env('TARGETCPU')/wcecompatex.lib") { |
2fe73036 RL |
1382 | $x .= '/$(TARGETCPU)/wcecompatex.lib'; |
1383 | } else { | |
1384 | $x .= '/wcecompatex.lib'; | |
1385 | } | |
1386 | push @ex_libs, $x; | |
1387 | } | |
1388 | push @ex_libs, '$(PORTSDK_LIBPATH)/portlib.lib' | |
17f16617 | 1389 | if (defined(env('PORTSDK_LIBPATH'))); |
2fe73036 | 1390 | push @ex_libs, ' /nodefaultlib coredll.lib corelibc.lib' |
17f16617 | 1391 | if (env('TARGETCPU') eq "X86"); |
2fe73036 | 1392 | return @ex_libs; |
ef5b8296 | 1393 | }), |
5e1b2353 | 1394 | }, |
f09e7ca9 | 1395 | |
7ead0c89 | 1396 | #### MinGW |
5e1b2353 | 1397 | "mingw" => { |
d2b2221a | 1398 | inherit_from => [ "BASE_unix", asm("x86_asm"), |
84af1bae | 1399 | sub { $disabled{shared} ? () : "x86_uplink" } ], |
abe256e7 RL |
1400 | CC => "gcc", |
1401 | CFLAGS => picker(default => "-Wall", | |
8c3bc594 RL |
1402 | debug => "-g -O0", |
1403 | release => "-O3 -fomit-frame-pointer"), | |
abe256e7 | 1404 | cflags => "-m32", |
68b8bcf4 | 1405 | cppflags => combine("-DUNICODE -D_UNICODE -DWIN32_LEAN_AND_MEAN", |
abe256e7 | 1406 | threads("-D_MT")), |
68b8bcf4 | 1407 | lib_cppflags => "-DL_ENDIAN", |
5e1b2353 | 1408 | sys_id => "MINGW32", |
98fdbce0 | 1409 | ex_libs => add("-lws2_32 -lgdi32 -lcrypt32"), |
a01dab94 | 1410 | bn_ops => "BN_LLONG EXPORT_VAR_AS_FN", |
9c62a279 | 1411 | thread_scheme => "winthreads", |
5e1b2353 RL |
1412 | perlasm_scheme => "coff", |
1413 | dso_scheme => "win32", | |
520f434b | 1414 | shared_target => "mingw-shared", |
8c3bc594 | 1415 | shared_cppflags => add("_WINDLL"), |
68ab559a | 1416 | shared_ldflag => "-static-libgcc", |
64c443e3 | 1417 | shared_rcflag => "--target=pe-i386", |
fcf80c46 | 1418 | shared_extension => ".dll", |
520f434b | 1419 | multilib => "", |
4e155ec4 | 1420 | apps_aux_src => add("win32_init.c"), |
5e1b2353 | 1421 | }, |
5e1b2353 | 1422 | "mingw64" => { |
7ead0c89 AP |
1423 | # As for OPENSSL_USE_APPLINK. Applink makes it possible to use |
1424 | # .dll compiled with one compiler with application compiled with | |
1425 | # another compiler. It's possible to engage Applink support in | |
1426 | # mingw64 build, but it's not done, because till mingw64 | |
1427 | # supports structured exception handling, one can't seriously | |
1428 | # consider its binaries for using with non-mingw64 run-time | |
1429 | # environment. And as mingw64 is always consistent with itself, | |
1430 | # Applink is never engaged and can as well be omitted. | |
d2b2221a | 1431 | inherit_from => [ "BASE_unix", asm("x86_64_asm") ], |
abe256e7 RL |
1432 | CC => "gcc", |
1433 | CFLAGS => picker(default => "-Wall", | |
8c3bc594 RL |
1434 | debug => "-g -O0", |
1435 | release => "-O3"), | |
abe256e7 | 1436 | cflags => "-m64", |
68b8bcf4 | 1437 | cppflags => combine("-DUNICODE -D_UNICODE -DWIN32_LEAN_AND_MEAN", |
abe256e7 | 1438 | threads("-D_MT")), |
68b8bcf4 | 1439 | lib_cppflags => "-DL_ENDIAN", |
5e1b2353 | 1440 | sys_id => "MINGW64", |
98fdbce0 | 1441 | ex_libs => add("-lws2_32 -lgdi32 -lcrypt32"), |
3e9e810f | 1442 | bn_ops => "SIXTY_FOUR_BIT EXPORT_VAR_AS_FN", |
9c62a279 | 1443 | thread_scheme => "winthreads", |
5e1b2353 RL |
1444 | perlasm_scheme => "mingw64", |
1445 | dso_scheme => "win32", | |
520f434b | 1446 | shared_target => "mingw-shared", |
8c3bc594 | 1447 | shared_cppflags => add("_WINDLL"), |
68ab559a | 1448 | shared_ldflag => "-static-libgcc", |
64c443e3 | 1449 | shared_rcflag => "--target=pe-x86-64", |
fcf80c46 | 1450 | shared_extension => ".dll", |
520f434b | 1451 | multilib => "64", |
4e155ec4 | 1452 | apps_aux_src => add("win32_init.c"), |
5e1b2353 | 1453 | }, |
f09e7ca9 | 1454 | |
4d60c7e1 DW |
1455 | #### UEFI |
1456 | "UEFI" => { | |
d2b2221a | 1457 | inherit_from => [ "BASE_unix" ], |
abe256e7 RL |
1458 | CC => "cc", |
1459 | CFLAGS => "-O", | |
68b8bcf4 | 1460 | lib_cppflags => "-DL_ENDIAN", |
4d60c7e1 DW |
1461 | sys_id => "UEFI", |
1462 | }, | |
1463 | ||
7ead0c89 | 1464 | #### UWIN |
5e1b2353 | 1465 | "UWIN" => { |
d2b2221a | 1466 | inherit_from => [ "BASE_unix" ], |
abe256e7 RL |
1467 | CC => "cc", |
1468 | CFLAGS => "-O -Wall", | |
1469 | lib_cppflags => "-DTERMIOS -DL_ENDIAN", | |
5e1b2353 | 1470 | sys_id => "UWIN", |
a01dab94 | 1471 | bn_ops => "BN_LLONG", |
5e1b2353 RL |
1472 | dso_scheme => "win32", |
1473 | }, | |
f09e7ca9 | 1474 | |
7ead0c89 | 1475 | #### Cygwin |
3f542969 | 1476 | "Cygwin-x86" => { |
d2b2221a | 1477 | inherit_from => [ "BASE_unix", asm("x86_asm") ], |
abe256e7 RL |
1478 | CC => "gcc", |
1479 | CFLAGS => picker(default => "-Wall", | |
8864f0de RL |
1480 | debug => "-g -O0", |
1481 | release => "-O3 -fomit-frame-pointer"), | |
68b8bcf4 | 1482 | lib_cppflags => "-DTERMIOS -DL_ENDIAN", |
5e1b2353 | 1483 | sys_id => "CYGWIN", |
a01dab94 | 1484 | bn_ops => "BN_LLONG", |
e58d9102 | 1485 | thread_scheme => "pthread", |
5e1b2353 RL |
1486 | perlasm_scheme => "coff", |
1487 | dso_scheme => "dlfcn", | |
1488 | shared_target => "cygwin-shared", | |
8c3bc594 | 1489 | shared_cppflags => "-D_WINDLL", |
fcf80c46 | 1490 | shared_extension => ".dll", |
5e1b2353 RL |
1491 | }, |
1492 | "Cygwin-x86_64" => { | |
d2b2221a | 1493 | inherit_from => [ "BASE_unix", asm("x86_64_asm") ], |
abe256e7 RL |
1494 | CC => "gcc", |
1495 | CFLAGS => picker(default => "-Wall", | |
8864f0de RL |
1496 | debug => "-g -O0", |
1497 | release => "-O3"), | |
68b8bcf4 | 1498 | lib_cppflags => "-DTERMIOS -DL_ENDIAN", |
5e1b2353 | 1499 | sys_id => "CYGWIN", |
3e9e810f | 1500 | bn_ops => "SIXTY_FOUR_BIT_LONG", |
e58d9102 | 1501 | thread_scheme => "pthread", |
5e1b2353 RL |
1502 | perlasm_scheme => "mingw64", |
1503 | dso_scheme => "dlfcn", | |
1504 | shared_target => "cygwin-shared", | |
8c3bc594 | 1505 | shared_cppflags => "-D_WINDLL", |
fcf80c46 | 1506 | shared_extension => ".dll", |
5e1b2353 | 1507 | }, |
b9ee2dac RL |
1508 | # Backward compatibility for those using this target |
1509 | "Cygwin" => { | |
1510 | inherit_from => [ "Cygwin-x86" ] | |
1511 | }, | |
1512 | # In case someone constructs the Cygwin target name themself | |
1513 | "Cygwin-i386" => { | |
1514 | inherit_from => [ "Cygwin-x86" ] | |
1515 | }, | |
1516 | "Cygwin-i486" => { | |
1517 | inherit_from => [ "Cygwin-x86" ] | |
1518 | }, | |
1519 | "Cygwin-i586" => { | |
1520 | inherit_from => [ "Cygwin-x86" ] | |
1521 | }, | |
1522 | "Cygwin-i686" => { | |
1523 | inherit_from => [ "Cygwin-x86" ] | |
1524 | }, | |
f09e7ca9 | 1525 | |
f09e7ca9 | 1526 | ##### MacOS X (a.k.a. Darwin) setup |
7ead0c89 | 1527 | "darwin-common" => { |
d2b2221a | 1528 | inherit_from => [ "BASE_unix" ], |
7ead0c89 | 1529 | template => 1, |
abe256e7 RL |
1530 | CC => "cc", |
1531 | CFLAGS => picker(debug => "-g -O0", | |
8c3bc594 RL |
1532 | release => "-O3"), |
1533 | cppflags => threads("-D_REENTRANT"), | |
abe256e7 | 1534 | lflags => "-Wl,-search_paths_first", |
5e1b2353 | 1535 | sys_id => "MACOSX", |
3e9e810f | 1536 | bn_ops => "BN_LLONG RC4_CHAR", |
9c62a279 | 1537 | thread_scheme => "pthreads", |
5e1b2353 RL |
1538 | perlasm_scheme => "osx32", |
1539 | dso_scheme => "dlfcn", | |
0c873419 | 1540 | ranlib => "ranlib -c", |
5e1b2353 | 1541 | shared_target => "darwin-shared", |
0c873419 | 1542 | shared_cflag => "-fPIC", |
d4453024 | 1543 | shared_extension => ".\$(SHLIB_VERSION_NUMBER).dylib", |
5e1b2353 | 1544 | }, |
c75065e1 AP |
1545 | # Option "freeze" such as -std=gnu9x can't negatively interfere |
1546 | # with future defaults for below two targets, because MacOS X | |
1547 | # for PPC has no future, it was discontinued by vendor in 2009. | |
7ead0c89 AP |
1548 | "darwin-ppc-cc" => { |
1549 | inherit_from => [ "darwin-common", asm("ppc32_asm") ], | |
8c3bc594 | 1550 | cflags => add("-arch ppc -std=gnu9x -Wa,-force_cpusubtype_ALL"), |
68b8bcf4 | 1551 | lib_cppflags => add("-DB_ENDIAN"), |
107783d9 | 1552 | shared_cflag => add("-fno-common"), |
7ead0c89 | 1553 | perlasm_scheme => "osx32", |
7ead0c89 | 1554 | }, |
5e1b2353 | 1555 | "darwin64-ppc-cc" => { |
7ead0c89 | 1556 | inherit_from => [ "darwin-common", asm("ppc64_asm") ], |
8c3bc594 | 1557 | cflags => add("-arch ppc64 -std=gnu9x"), |
68b8bcf4 | 1558 | lib_cppflags => add("-DB_ENDIAN"), |
3e9e810f | 1559 | bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR", |
5e1b2353 | 1560 | perlasm_scheme => "osx64", |
5e1b2353 RL |
1561 | }, |
1562 | "darwin-i386-cc" => { | |
7ead0c89 | 1563 | inherit_from => [ "darwin-common", asm("x86_asm") ], |
abe256e7 RL |
1564 | CFLAGS => add(picker(release => "-fomit-frame-pointer")), |
1565 | cflags => add("-arch i386"), | |
68b8bcf4 | 1566 | lib_cppflags => add("-DL_ENDIAN"), |
3e9e810f | 1567 | bn_ops => "BN_LLONG RC4_INT", |
5e1b2353 | 1568 | perlasm_scheme => "macosx", |
5e1b2353 RL |
1569 | }, |
1570 | "darwin64-x86_64-cc" => { | |
7ead0c89 | 1571 | inherit_from => [ "darwin-common", asm("x86_64_asm") ], |
abe256e7 RL |
1572 | CFLAGS => add("-Wall"), |
1573 | cflags => add("-arch x86_64"), | |
68b8bcf4 | 1574 | lib_cppflags => add("-DL_ENDIAN"), |
3e9e810f | 1575 | bn_ops => "SIXTY_FOUR_BIT_LONG", |
5e1b2353 | 1576 | perlasm_scheme => "macosx", |
5e1b2353 | 1577 | }, |
7ead0c89 | 1578 | |
f09e7ca9 | 1579 | ##### GNU Hurd |
5e1b2353 | 1580 | "hurd-x86" => { |
d2b2221a | 1581 | inherit_from => [ "BASE_unix" ], |
7ead0c89 | 1582 | inherit_from => [ asm("x86_elf_asm") ], |
abe256e7 RL |
1583 | CC => "gcc", |
1584 | CFLAGS => "-O3 -fomit-frame-pointer -Wall", | |
1585 | cflags => threads("-pthread"), | |
68b8bcf4 | 1586 | lib_cppflags => "-DL_ENDIAN", |
fcd2ac80 | 1587 | ex_libs => add("-ldl", threads("-pthread")), |
a01dab94 | 1588 | bn_ops => "BN_LLONG", |
9c62a279 | 1589 | thread_scheme => "pthreads", |
5e1b2353 RL |
1590 | dso_scheme => "dlfcn", |
1591 | shared_target => "linux-shared", | |
1592 | shared_cflag => "-fPIC", | |
d4453024 | 1593 | shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)", |
5e1b2353 | 1594 | }, |
f09e7ca9 | 1595 | |
f09e7ca9 | 1596 | ##### VxWorks for various targets |
5e1b2353 | 1597 | "vxworks-ppc60x" => { |
d2b2221a | 1598 | inherit_from => [ "BASE_unix" ], |
abe256e7 RL |
1599 | CC => "ccppc", |
1600 | CFLAGS => "-O2 -Wall -fstrength-reduce", | |
1601 | cflags => "-mrtp -mhard-float -mstrict-align -fno-implicit-fp -fno-builtin -fno-strict-aliasing", | |
8c3bc594 RL |
1602 | cppflags => combine("-D_REENTRANT -DPPC32_fp60x -DCPU=PPC32", |
1603 | "_DTOOL_FAMILY=gnu -DTOOL=gnu", | |
1604 | "-I\$(WIND_BASE)/target/usr/h", | |
1605 | "-I\$(WIND_BASE)/target/usr/h/wrn/coreip"), | |
5e1b2353 | 1606 | sys_id => "VXWORKS", |
47eeaf45 RL |
1607 | lflags => add("-L \$(WIND_BASE)/target/usr/lib/ppc/PPC32/common"), |
1608 | ex_libs => add("-Wl,--defsym,__wrs_rtp_base=0xe0000000"), | |
5e1b2353 RL |
1609 | }, |
1610 | "vxworks-ppcgen" => { | |
d2b2221a | 1611 | inherit_from => [ "BASE_unix" ], |
abe256e7 RL |
1612 | CC => "ccppc", |
1613 | CFLAGS => "-O1 -Wall", | |
1614 | cflags => "-mrtp -msoft-float -mstrict-align -fno-builtin -fno-strict-aliasing", | |
8c3bc594 RL |
1615 | cppflags => combine("-D_REENTRANT -DPPC32 -DCPU=PPC32", |
1616 | "-DTOOL_FAMILY=gnu -DTOOL=gnu", | |
1617 | "-I\$(WIND_BASE)/target/usr/h", | |
1618 | "-I\$(WIND_BASE)/target/usr/h/wrn/coreip"), | |
5e1b2353 | 1619 | sys_id => "VXWORKS", |
47eeaf45 RL |
1620 | lflags => add("-L \$(WIND_BASE)/target/usr/lib/ppc/PPC32/sfcommon"), |
1621 | ex_libs => add("-Wl,--defsym,__wrs_rtp_base=0xe0000000"), | |
5e1b2353 RL |
1622 | }, |
1623 | "vxworks-ppc405" => { | |
d2b2221a | 1624 | inherit_from => [ "BASE_unix" ], |
abe256e7 RL |
1625 | CC => "ccppc", |
1626 | CFLAGS => "-g", | |
1627 | cflags => "-msoft-float -mlongcall", | |
8c3bc594 RL |
1628 | cppflags => combine("-D_REENTRANT -DPPC32 -DCPU=PPC405", |
1629 | "-DTOOL_FAMILY=gnu -DTOOL=gnu", | |
1630 | "-I\$(WIND_BASE)/target/h"), | |
5e1b2353 | 1631 | sys_id => "VXWORKS", |
47eeaf45 | 1632 | lflags => add("-r"), |
5e1b2353 RL |
1633 | }, |
1634 | "vxworks-ppc750" => { | |
d2b2221a | 1635 | inherit_from => [ "BASE_unix" ], |
abe256e7 RL |
1636 | CC => "ccppc", |
1637 | CFLAGS => "-ansi -fvolatile -Wall \$(DEBUG_FLAG)", | |
1638 | cflags => "-nostdinc -fno-builtin -fno-for-scope -fsigned-char -msoft-float -mlongcall", | |
8c3bc594 RL |
1639 | cppflags => combine("-DPPC750 -D_REENTRANT -DCPU=PPC604", |
1640 | "-I\$(WIND_BASE)/target/h"), | |
5e1b2353 | 1641 | sys_id => "VXWORKS", |
47eeaf45 | 1642 | lflags => add("-r"), |
5e1b2353 RL |
1643 | }, |
1644 | "vxworks-ppc750-debug" => { | |
d2b2221a | 1645 | inherit_from => [ "BASE_unix" ], |
abe256e7 RL |
1646 | CC => "ccppc", |
1647 | CFLAGS => "-ansi -fvolatile -Wall -g", | |
1648 | cflags => "-nostdinc -fno-builtin -fno-for-scope -fsigned-char -msoft-float -mlongcall", | |
8c3bc594 RL |
1649 | cppflags => combine("-DPPC750 -D_REENTRANT -DCPU=PPC604", |
1650 | "-DPEDANTIC -DDEBUG", | |
1651 | "-I\$(WIND_BASE)/target/h"), | |
5e1b2353 | 1652 | sys_id => "VXWORKS", |
47eeaf45 | 1653 | lflags => add("-r"), |
5e1b2353 RL |
1654 | }, |
1655 | "vxworks-ppc860" => { | |
d2b2221a | 1656 | inherit_from => [ "BASE_unix" ], |
abe256e7 | 1657 | CC => "ccppc", |
8c3bc594 RL |
1658 | cflags => "-nostdinc -msoft-float", |
1659 | cppflags => combine("-DCPU=PPC860 -DNO_STRINGS_H", | |
1660 | "-I\$(WIND_BASE)/target/h"), | |
5e1b2353 | 1661 | sys_id => "VXWORKS", |
47eeaf45 | 1662 | lflags => add("-r"), |
5e1b2353 RL |
1663 | }, |
1664 | "vxworks-simlinux" => { | |
d2b2221a | 1665 | inherit_from => [ "BASE_unix" ], |
abe256e7 | 1666 | CC => "ccpentium", |
8c3bc594 RL |
1667 | cflags => "-B\$(WIND_BASE)/host/\$(WIND_HOST_TYPE)/lib/gcc-lib/ -fno-builtin -fno-defer-pop", |
1668 | cppflags => combine("-D_VSB_CONFIG_FILE=\"\$(WIND_BASE)/target/lib/h/config/vsbConfig.h\"", | |
1669 | "-DL_ENDIAN -DCPU=SIMLINUX -DNO_STRINGS_H", | |
1670 | "-DTOOL_FAMILY=gnu -DTOOL=gnu", | |
1671 | "-DOPENSSL_NO_HW_PADLOCK", | |
1672 | "-I\$(WIND_BASE)/target/h", | |
1673 | "-I\$(WIND_BASE)/target/h/wrn/coreip"), | |
5e1b2353 | 1674 | sys_id => "VXWORKS", |
47eeaf45 | 1675 | lflags => add("-r"), |
5e1b2353 RL |
1676 | ranlib => "ranlibpentium", |
1677 | }, | |
1678 | "vxworks-mips" => { | |
d2b2221a | 1679 | inherit_from => [ "BASE_unix", asm("mips32_asm") ], |
abe256e7 RL |
1680 | CC => "ccmips", |
1681 | CFLAGS => "-O -G 0", | |
1682 | cflags => "-mrtp -mips2 -B\$(WIND_BASE)/host/\$(WIND_HOST_TYPE)/lib/gcc-lib/ -msoft-float -mno-branch-likely -fno-builtin -fno-defer-pop", | |
8c3bc594 RL |
1683 | cppflags => combine("-D_VSB_CONFIG_FILE=\"\$(WIND_BASE)/target/lib/h/config/vsbConfig.h\"", |
1684 | "-DCPU=MIPS32 -DNO_STRINGS_H", | |
1685 | "-DTOOL_FAMILY=gnu -DTOOL=gnu", | |
1686 | "-DOPENSSL_NO_HW_PADLOCK", | |
1687 | threads("-D_REENTRANT"), | |
1688 | "-I\$(WIND_BASE)/target/h", | |
1689 | "-I\$(WIND_BASE)/target/h/wrn/coreip"), | |
5e1b2353 | 1690 | sys_id => "VXWORKS", |
47eeaf45 RL |
1691 | lflags => add("-L \$(WIND_BASE)/target/usr/lib/mips/MIPSI32/sfcommon"), |
1692 | ex_libs => add("-Wl,--defsym,__wrs_rtp_base=0xe0000000"), | |
9c62a279 | 1693 | thread_scheme => "pthreads", |
5e1b2353 RL |
1694 | perlasm_scheme => "o32", |
1695 | ranlib => "ranlibmips", | |
1696 | }, | |
f09e7ca9 | 1697 | |
7ead0c89 | 1698 | #### uClinux |
5e1b2353 | 1699 | "uClinux-dist" => { |
d2b2221a | 1700 | inherit_from => [ "BASE_unix" ], |
abe256e7 | 1701 | CC => sub { env('CC') }, |
8c3bc594 | 1702 | cppflags => threads("-D_REENTRANT"), |
98fdbce0 | 1703 | ex_libs => add("\$(LDLIBS)"), |
5e1b2353 | 1704 | bn_ops => "BN_LLONG", |
9c62a279 | 1705 | thread_scheme => "pthreads", |
17f16617 | 1706 | dso_scheme => sub { env('LIBSSL_dlfcn') }, |
5e1b2353 RL |
1707 | shared_target => "linux-shared", |
1708 | shared_cflag => "-fPIC", | |
d4453024 | 1709 | shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)", |
17f16617 | 1710 | ranlib => sub { env('RANLIB') }, |
5e1b2353 RL |
1711 | }, |
1712 | "uClinux-dist64" => { | |
d2b2221a | 1713 | inherit_from => [ "BASE_unix" ], |
abe256e7 | 1714 | CC => sub { env('CC') }, |
8c3bc594 | 1715 | cppflags => threads("-D_REENTRANT"), |
98fdbce0 | 1716 | ex_libs => add("\$(LDLIBS)"), |
5e1b2353 | 1717 | bn_ops => "SIXTY_FOUR_BIT_LONG", |
9c62a279 | 1718 | thread_scheme => "pthreads", |
17f16617 | 1719 | dso_scheme => sub { env('LIBSSL_dlfcn') }, |
5e1b2353 RL |
1720 | shared_target => "linux-shared", |
1721 | shared_cflag => "-fPIC", | |
d4453024 | 1722 | shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)", |
17f16617 | 1723 | ranlib => sub { env('RANLIB') }, |
5e1b2353 | 1724 | }, |
f09e7ca9 | 1725 | |
e84193e4 | 1726 | ##### VMS |
ab907189 RL |
1727 | # Most things happen in vms-generic. |
1728 | # Note that vms_info extracts the pointer size from the end of | |
1729 | # the target name, and will assume that anything matching /-p\d+$/ | |
1730 | # indicates the pointer size setting for the desired target. | |
e84193e4 | 1731 | "vms-generic" => { |
d2b2221a | 1732 | inherit_from => [ "BASE_VMS" ], |
e84193e4 | 1733 | template => 1, |
abe256e7 RL |
1734 | CC => "CC/DECC", |
1735 | CPP => '$(CC)/PREPROCESS_ONLY=SYS$OUTPUT:', | |
1736 | CFLAGS => | |
ab907189 RL |
1737 | combine(picker(default => "/STANDARD=(ISOC94,RELAXED)/NOLIST/PREFIX=ALL", |
1738 | debug => "/NOOPTIMIZE/DEBUG", | |
1739 | release => "/OPTIMIZE/NODEBUG"), | |
1740 | sub { my @warnings = | |
1741 | @{vms_info()->{disable_warns}}; | |
1742 | @warnings | |
1743 | ? "/WARNINGS=DISABLE=(".join(",",@warnings).")" : (); }), | |
68b8bcf4 | 1744 | lib_defines => |
ab907189 RL |
1745 | add("OPENSSL_USE_NODELETE", |
1746 | sub { | |
1747 | return vms_info()->{def_zlib} | |
1748 | ? "LIBZ=\"\"\"".vms_info()->{def_zlib}."\"\"\"" : (); | |
1749 | }), | |
2de2df7f | 1750 | lflags => picker(default => "/MAP='F\$PARSE(\".MAP\",\"\$\@\")'", |
1ae4c07e | 1751 | debug => "/DEBUG/TRACEBACK", |
8864f0de | 1752 | release => "/NODEBUG/NOTRACEBACK"), |
68a39960 | 1753 | lib_cflags => add("/NAMES=(AS_IS,SHORTENED)/EXTERN_MODEL=STRICT_REFDEF"), |
19eaee74 RL |
1754 | # no_inst_lib_cflags is used instead of lib_cflags by descrip.mms.tmpl |
1755 | # for object files belonging to selected internal libraries | |
1756 | no_inst_lib_cflags => "", | |
ab907189 | 1757 | ex_libs => add(sub { return vms_info()->{zlib} || (); }), |
e84193e4 | 1758 | shared_target => "vms-shared", |
ac722c9a | 1759 | dso_scheme => "vms", |
9c62a279 | 1760 | thread_scheme => "pthreads", |
e84193e4 | 1761 | |
abe256e7 RL |
1762 | AS => sub { vms_info()->{AS} }, |
1763 | ASFLAGS => sub { vms_info()->{ASFLAGS} }, | |
ab7134ef | 1764 | asoutflag => sub { vms_info()->{asoutflag} }, |
abe256e7 | 1765 | asflags => sub { vms_info()->{asflags} }, |
ab7134ef RL |
1766 | perlasm_scheme => sub { vms_info()->{perlasm_scheme} }, |
1767 | ||
d6baf09f RL |
1768 | apps_aux_src => "vms_term_sock.c", |
1769 | apps_init_src => "vms_decc_init.c", | |
e84193e4 RL |
1770 | }, |
1771 | ||
ab907189 RL |
1772 | # From HELP CC/POINTER_SIZE: |
1773 | # | |
1774 | # ---------- | |
1775 | # LONG[=ARGV] The compiler assumes 64-bit pointers. If the ARGV option to | |
1776 | # LONG or 64 is present, the main argument argv will be an | |
1777 | # array of long pointers instead of an array of short pointers. | |
1778 | # | |
1779 | # 64[=ARGV] Same as LONG. | |
1780 | # ---------- | |
1781 | # | |
1782 | # We don't want the hassle of dealing with 32-bit pointers with argv, so | |
1783 | # we force it to have 64-bit pointers, see the added cflags in the -p64 | |
1784 | # config targets below. | |
1785 | ||
e84193e4 RL |
1786 | "vms-alpha" => { |
1787 | inherit_from => [ "vms-generic" ], | |
ab907189 RL |
1788 | bn_ops => "SIXTY_FOUR_BIT RC4_INT", |
1789 | pointer_size => "", | |
e84193e4 | 1790 | }, |
52d86d9b | 1791 | "vms-alpha-p32" => { |
ab907189 RL |
1792 | inherit_from => [ "vms-alpha" ], |
1793 | cflags => add("/POINTER_SIZE=32"), | |
1794 | pointer_size => "32", | |
e84193e4 | 1795 | }, |
52d86d9b | 1796 | "vms-alpha-p64" => { |
ab907189 RL |
1797 | inherit_from => [ "vms-alpha" ], |
1798 | cflags => add("/POINTER_SIZE=64=ARGV"), | |
1799 | pointer_size => "64", | |
e84193e4 RL |
1800 | }, |
1801 | "vms-ia64" => { | |
0f4844a9 RL |
1802 | inherit_from => [ "vms-generic", |
1803 | sub { vms_info()->{as} | |
1804 | ? asm("ia64_asm")->() : () } ], | |
ab907189 RL |
1805 | bn_ops => "SIXTY_FOUR_BIT RC4_INT", |
1806 | pointer_size => "", | |
0f4844a9 RL |
1807 | |
1808 | modes_asm_src => "", # Because ghash-ia64.s doesn't work on VMS | |
e84193e4 | 1809 | }, |
52d86d9b | 1810 | "vms-ia64-p32" => { |
ab907189 RL |
1811 | inherit_from => [ "vms-ia64" ], |
1812 | cflags => add("/POINTER_SIZE=32"), | |
1813 | pointer_size => "32", | |
e84193e4 | 1814 | }, |
52d86d9b | 1815 | "vms-ia64-p64" => { |
ab907189 RL |
1816 | inherit_from => [ "vms-ia64" ], |
1817 | cflags => add("/POINTER_SIZE=64=ARGV"), | |
1818 | pointer_size => "64", | |
e84193e4 RL |
1819 | }, |
1820 | ||
f09e7ca9 | 1821 | ); |