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