2 ## Standard openssl configuration targets.
4 # Helper functions for the Windows configs
5 my $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",
11 asflags => "-Ox -f win64 -DNEAR",
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",
20 $die->("NASM not found - make sure it's installed and available on %PATH%\n");
21 $vc_win64a_info = { AS => "{unknown}",
27 return $vc_win64a_info;
30 my $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",
38 asflags => "-f win32",
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",
47 perlasm_scheme => "win32" };
49 $die->("NASM not found - make sure it's installed and available on %PATH%\n");
50 $vc_win32_info = { AS => "{unknown}",
54 perlasm_scheme => "win32" };
57 return $vc_win32_info;
60 my $vc_wince_info = {};
62 unless (%$vc_wince_info) {
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')));
69 # Idea behind this is to mimic flags set by eVC++ IDE...
71 my $wcevers = env('OSVERSION'); # WCENNN
74 if ($wcevers =~ /^WCE([1-9])([0-9]{2})$/) {
76 $wceverdotnum = "$1.$2";
78 $die->('%OSVERSION% value is insane');
79 $wcevernum = "{unknown}";
80 $wceverdotnum = "{unknown}";
82 my $wcecdefs = "-D_WIN32_WCE=$wcevernum -DUNDER_CE=$wcevernum"; # -D_WIN32_WCE=NNN
83 my $wcelflag = "/subsystem:windowsce,$wceverdotnum"; # ...,N.NN
85 my $wceplatf = env('PLATFORM');
87 $wceplatf =~ tr/a-z0-9 /A-Z0-9_/;
88 $wcecdefs .= " -DWCE_PLATFORM_$wceplatf";
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; };
118 $vc_wince_info = { cppflags => $wcecdefs,
119 lflags => $wcelflag };
121 return $vc_wince_info;
124 # Helper functions for the VMS configs
127 my $pointer_size_str = $config{target} =~ m|-p(\d+)$| ? $1 : "";
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
132 if (%$vms_info && $vms_info->{pointer_size} ne $pointer_size_str) {
136 unless (%$vms_info) {
137 $vms_info->{disable_warns} = [
138 "CXXPRAGMANA", # Shut up about unknown / unsupported pragmas
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:`;
144 push @{$vms_info->{disable_warns}}, "MAYLOSEDATA3";
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";
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;
160 if ($config{target} =~ /-ia64/) {
161 `PIPE ias -H 2> NL:`;
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";
176 #### Basic configs that should work on any 32-bit box
178 inherit_from => [ "BASE_unix" ],
180 CFLAGS => picker(debug => "-O0 -g",
182 thread_scheme => "(unknown)",
183 bn_ops => "BN_LLONG",
186 inherit_from => [ "BASE_unix" ],
189 thread_scheme => "(unknown)",
192 #### VOS Configurations
194 inherit_from => [ "BASE_unix" ],
196 CFLAGS => picker(default => "-Wall",
199 cppflags => "-D_POSIX_C_SOURCE=200112L -D_BSD -D_VOS_EXTENDED_NAMES",
200 lib_cppflags => "-DB_ENDIAN",
201 thread_scheme => "(unknown)",
203 lflags => add("-Wl,-map"),
204 bn_ops => "BN_LLONG",
205 shared_extension => ".so",
208 #### Solaris configurations
209 "solaris-common" => {
210 inherit_from => [ "BASE_unix" ],
212 lib_cppflags => "-DFILIO_H",
213 ex_libs => add("-lsocket -lnsl -ldl"),
214 dso_scheme => "dlfcn",
215 thread_scheme => "pthreads",
217 #### Solaris common with Sun C setups
218 "solaris-common-cc" => {
219 inherit_from => [ "solaris-common" ],
221 shared_target => "solaris",
222 shared_ldflag => "-Wl,-Bsymbolic",
223 shared_defflag => "-Wl,-M,",
224 shared_sonameflag=> "-Wl,-h,",
226 #### Solaris common with GNU C setups
227 "solaris-common-gcc" => {
228 inherit_from => [ "solaris-common" ],
230 shared_target => "solaris-gcc-shared", # The rest is on shared_info.pl
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" ],
239 CFLAGS => add_before(picker(default => "-Wall",
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"),
247 perlasm_scheme => 'elf',
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" ],
260 CFLAGS => add_before(picker(default => "-Wall",
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"),
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...
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...
286 "solaris64-x86_64-cc" => {
287 inherit_from => [ "solaris-common-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"),
304 #### SPARC Solaris with GNU C setups
305 "solaris-sparcv7-gcc" => {
306 inherit_from => [ "solaris-common-gcc" ],
308 CFLAGS => add_before(picker(default => "-Wall",
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"),
316 "solaris-sparcv8-gcc" => {
317 inherit_from => [ "solaris-sparcv7-gcc" ],
318 cflags => add_before("-mcpu=v8"),
319 asm_arch => 'sparcv8',
320 perlasm_scheme => 'void',
322 "solaris-sparcv9-gcc" => {
323 # -m32 should be safe to add as long as driver recognizes
325 inherit_from => [ "solaris-sparcv7-gcc" ],
326 cflags => add_before("-m32 -mcpu=ultrasparc"),
327 asm_arch => 'sparcv9',
328 perlasm_scheme => 'void',
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",
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" ],
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"),
355 "solaris-sparcv8-cc" => {
356 inherit_from => [ "solaris-sparcv7-cc" ],
357 cflags => add_before("-xarch=v8"),
358 asm_arch => 'sparcv8',
359 perlasm_scheme => 'void',
361 "solaris-sparcv9-cc" => {
362 inherit_from => [ "solaris-sparcv7-cc" ],
363 cflags => add_before("-xarch=v8plus"),
364 asm_arch => 'sparcv9',
365 perlasm_scheme => 'void',
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',
376 #### IRIX 6.x configs
377 # Only N32 and N64 ABIs are supported.
379 inherit_from => [ "BASE_unix" ],
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,",
390 "irix-mips3-gcc" => {
391 inherit_from => [ "irix-common" ],
393 CFLAGS => picker(debug => "-g -O0",
395 LDFLAGS => "-static-libgcc",
396 cflags => "-mabi=n32",
397 bn_ops => "RC4_CHAR SIXTY_FOUR_BIT",
398 asm_arch => 'mips64',
399 perlasm_scheme => "n32",
403 inherit_from => [ "irix-common" ],
405 CFLAGS => picker(debug => "-g -O0",
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",
414 "irix64-mips4-gcc" => {
415 inherit_from => [ "irix-common" ],
417 CFLAGS => picker(debug => "-g -O0",
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",
426 "irix64-mips4-cc" => {
427 inherit_from => [ "irix-common" ],
429 CFLAGS => picker(debug => "-g -O0",
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",
438 #### Unified HP-UX ANSI C configs.
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
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.
466 inherit_from => [ "BASE_unix" ],
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,",
478 "hpux-parisc-gcc" => {
479 inherit_from => [ "hpux-common" ],
481 CFLAGS => picker(debug => "-O0 -g",
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",
488 shared_cflag => "-fPIC",
489 shared_ldflag => add_before("-shared"),
490 shared_extension => ".sl.\$(SHLIB_VERSION_NUMBER)",
492 "hpux-parisc1_1-gcc" => {
493 inherit_from => [ "hpux-parisc-gcc" ],
494 asm_arch => 'parisc11',
495 perlasm_scheme => "32",
496 multilib => "/pa1.1",
498 "hpux64-parisc2-gcc" => {
499 inherit_from => [ "hpux-common" ],
501 CFLAGS => combine(picker(debug => "-O0 -g",
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",
514 # More attempts at unified 10.X and 11.X targets for HP C compiler.
515 "hpux-parisc-cc" => {
516 inherit_from => [ "hpux-common" ],
518 CFLAGS => picker(debug => "+O0 +d -g",
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",
526 shared_cflag => "+Z",
527 shared_ldflag => add_before("-b"),
528 shared_extension => ".sl.\$(SHLIB_VERSION_NUMBER)",
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",
537 "hpux64-parisc2-cc" => {
538 inherit_from => [ "hpux-common" ],
540 CFLAGS => picker(debug => "+O0 +d -g",
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",
555 # HP/UX IA-64 targets
557 inherit_from => [ "hpux-common" ],
559 CFLAGS => picker(debug => "+O0 +d -g",
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",
566 perlasm_scheme => 'void',
567 shared_cflag => "+Z",
568 shared_ldflag => add_before("-b"),
569 multilib => "/hpux32",
571 "hpux64-ia64-cc" => {
572 inherit_from => [ "hpux-common" ],
574 CFLAGS => picker(debug => "+O0 +d -g",
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",
581 perlasm_scheme => 'void',
582 shared_cflag => "+Z",
583 shared_ldflag => add_before("-b"),
584 multilib => "/hpux64",
588 inherit_from => [ "hpux-common" ],
590 CFLAGS => picker(debug => "-O0 -g",
592 cflags => add(threads("-pthread")),
593 ex_libs => add("-ldl", threads("-pthread")),
594 bn_ops => "SIXTY_FOUR_BIT",
596 perlasm_scheme => 'void',
597 shared_cflag => "-fpic",
598 shared_ldflag => add_before("-shared"),
599 multilib => "/hpux32",
601 "hpux64-ia64-gcc" => {
602 inherit_from => [ "hpux-common" ],
604 CFLAGS => picker(debug => "-O0 -g",
606 cflags => combine("-mlp64", threads("-pthread")),
607 ex_libs => add("-ldl", threads("-pthread")),
608 bn_ops => "SIXTY_FOUR_BIT_LONG",
610 perlasm_scheme => 'void',
611 shared_cflag => "-fpic",
612 shared_ldflag => add_before("-shared"),
613 multilib => "/hpux64",
616 #### HP MPE/iX http://jazz.external.hp.com/src/openssl/
618 inherit_from => [ "BASE_unix" ],
621 cppflags => "-D_POSIX_SOURCE -D_SOCKET_SOURCE",
622 includes => [ "/SYSLOG/PUB" ],
623 lib_cppflags => "-DBN_DIV2W",
625 lflags => add("-L/SYSLOG/PUB"),
626 ex_libs => add("-lsyslog -lsocket -lcurses"),
627 thread_scheme => "(unknown)",
628 bn_ops => "BN_LLONG",
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" ],
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",
644 perlasm_scheme => "void",
645 thread_scheme => "pthreads",
646 dso_scheme => "dlfcn",
647 shared_target => "alpha-osf1-shared",
648 shared_extension => ".so",
650 "tru64-alpha-cc" => {
651 inherit_from => [ "BASE_unix" ],
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",
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",
669 #### Variety of LINUX:-)
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" ],
677 CFLAGS => picker(default => "-Wall",
680 CXXFLAGS => picker(default => "-Wall",
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" ],
696 inherit_from => [ "linux-generic32" ],
697 ex_libs => add(threads("-latomic")),
699 "linux-generic64" => {
700 inherit_from => [ "linux-generic32" ],
701 bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
705 inherit_from => [ "linux-latomic" ],
707 perlasm_scheme => "linux32",
708 lib_cppflags => add("-DB_ENDIAN"),
711 inherit_from => [ "linux-generic64" ],
712 cflags => add("-m64"),
713 cxxflags => add("-m64"),
714 lib_cppflags => add("-DB_ENDIAN"),
716 perlasm_scheme => "linux64",
720 inherit_from => [ "linux-generic64" ],
721 cflags => add("-m64"),
722 cxxflags => add("-m64"),
723 lib_cppflags => add("-DL_ENDIAN"),
725 perlasm_scheme => "linux64le",
729 ################################################################
730 # Note that -march is not among compiler options in linux-armv4
731 # target description. Not specifying one is intentional to give
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;
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
758 # ./Configure linux-armv4 -march=armv6 -D__ARM_MAX_ARCH__=8
760 inherit_from => [ "linux-latomic" ],
762 perlasm_scheme => "linux32",
765 inherit_from => [ "linux-generic64" ],
766 asm_arch => 'aarch64',
767 perlasm_scheme => "linux64",
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",
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",
787 # mips32 and mips64 below refer to contemporary MIPS Architecture
788 # specifications, MIPS32 and MIPS64, rather than to kernel bitness.
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",
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",
807 # riscv below refers to contemporary RISCV Architecture
809 "linux64-riscv64" => {
810 inherit_from => [ "linux-generic64"],
811 perlasm_scheme => "linux64",
812 asm_arch => 'riscv64',
815 "linux32-riscv32" => {
816 inherit_from => [ "linux-generic32"],
817 perlasm_scheme => "linux32",
818 asm_arch => 'riscv32',
821 # loongarch64 below refers to contemporary LOONGARCH Architecture
823 "linux64-loongarch64" => {
824 inherit_from => [ "linux-generic64"],
825 perlasm_scheme => "linux64",
826 asm_arch => 'loongarch64',
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
833 inherit_from => [ "linux-generic32" ],
834 CFLAGS => add(picker(release => "-fomit-frame-pointer")),
835 lib_cppflags => add("-DL_ENDIAN"),
836 bn_ops => "BN_LLONG",
838 perlasm_scheme => "elf",
841 inherit_from => [ "BASE_unix" ],
843 CFLAGS => add(picker(default => "-Wall",
845 release => "-O3 -fomit-frame-pointer")),
846 lib_cppflags => add("-DL_ENDIAN"),
847 bn_ops => "BN_LLONG",
848 thread_scheme => "(unknown)",
850 perlasm_scheme => "a.out",
853 #### X86 / X86_64 targets
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",
862 perlasm_scheme => "elf",
864 "linux-x86-latomic" => {
865 inherit_from => [ "linux-x86" ],
866 ex_libs => add(threads("-latomic")),
868 "linux-x86-clang" => {
869 inherit_from => [ "linux-x86" ],
872 ex_libs => add(threads("-latomic")),
875 inherit_from => [ "linux-generic64" ],
876 cflags => add("-m64"),
877 cxxflags => add("-m64"),
878 lib_cppflags => add("-DL_ENDIAN"),
879 bn_ops => "SIXTY_FOUR_BIT_LONG",
880 asm_arch => 'x86_64',
881 perlasm_scheme => "elf",
884 "linux-x86_64-clang" => {
885 inherit_from => [ "linux-x86_64" ],
890 inherit_from => [ "linux-generic32" ],
891 cflags => add("-mx32"),
892 cxxflags => add("-mx32"),
893 lib_cppflags => add("-DL_ENDIAN"),
894 bn_ops => "SIXTY_FOUR_BIT",
895 asm_arch => 'x86_64',
896 perlasm_scheme => "elf32",
901 inherit_from => [ "linux-generic64" ],
902 bn_ops => "SIXTY_FOUR_BIT_LONG",
904 perlasm_scheme => 'void',
908 inherit_from => [ "linux-generic64" ],
909 cflags => add("-m64"),
910 cxxflags => add("-m64"),
911 lib_cppflags => add("-DB_ENDIAN"),
913 perlasm_scheme => "64",
917 #### So called "highgprs" target for z/Architecture CPUs
918 # "Highgprs" is kernel feature first implemented in Linux
919 # 2.6.32, see /proc/cpuinfo. The idea is to preserve most
920 # significant bits of general purpose registers not only
921 # upon 32-bit process context switch, but even on
922 # asynchronous signal delivery to such process. This makes
923 # it possible to deploy 64-bit instructions even in legacy
924 # application context and achieve better [or should we say
925 # adequate] performance. The build is binary compatible with
926 # linux-generic32, and the idea is to be able to install the
927 # resulting libcrypto.so alongside generic one, e.g. as
928 # /lib/highgprs/libcrypto.so.x.y, for ldconfig and run-time
929 # linker to autodiscover. Unfortunately it doesn't work just
930 # yet, because of couple of bugs in glibc
931 # sysdeps/s390/dl-procinfo.c affecting ldconfig and ld.so.1...
933 inherit_from => [ "linux-generic32" ],
934 cflags => add("-m31 -Wa,-mzarch"),
935 cxxflags => add("-m31 -Wa,-mzarch"),
936 lib_cppflags => add("-DB_ENDIAN"),
938 perlasm_scheme => "31",
939 multilib => "/highgprs",
942 #### SPARC Linux setups
944 inherit_from => [ "linux-latomic" ],
945 cflags => add("-mcpu=v8"),
946 cxxflags => add("-mcpu=v8"),
947 lib_cppflags => add("-DB_ENDIAN -DBN_DIV2W"),
948 asm_arch => 'sparcv8',
949 perlasm_scheme => 'void',
952 # it's a real mess with -mcpu=ultrasparc option under Linux,
953 # but -Wa,-Av8plus should do the trick no matter what.
954 inherit_from => [ "linux-latomic" ],
955 cflags => add("-m32 -mcpu=ultrasparc -Wa,-Av8plus"),
956 cxxflags => add("-m32 -mcpu=ultrasparc -Wa,-Av8plus"),
957 lib_cppflags => add("-DB_ENDIAN -DBN_DIV2W"),
958 asm_arch => 'sparcv9',
959 perlasm_scheme => 'void',
961 "linux64-sparcv9" => {
962 # GCC 3.1 is a requirement
963 inherit_from => [ "linux-generic64" ],
964 cflags => add("-m64 -mcpu=ultrasparc"),
965 cxxflags => add("-m64 -mcpu=ultrasparc"),
966 lib_cppflags => add("-DB_ENDIAN"),
967 ex_libs => add(threads("-latomic")),
968 bn_ops => "BN_LLONG RC4_CHAR",
969 asm_arch => 'sparcv9',
970 perlasm_scheme => 'void',
974 "linux-alpha-gcc" => {
975 inherit_from => [ "linux-generic64" ],
976 lib_cppflags => add("-DL_ENDIAN"),
977 bn_ops => "SIXTY_FOUR_BIT_LONG",
979 perlasm_scheme => "void",
981 "linux-c64xplus" => {
982 inherit_from => [ "BASE_unix" ],
983 # TI_CGT_C6000_7.3.x is a requirement
985 CFLAGS => "-o2 -ox -ms",
986 cflags => "--linux -ea=.s -eo=.o -mv6400+ -pden",
987 cxxflags => "--linux -ea=.s -eo=.o -mv6400+ -pden",
988 cppflags => combine("-DOPENSSL_SMALL_FOOTPRINT",
989 threads("-D_REENTRANT")),
990 bn_ops => "BN_LLONG",
991 thread_scheme => "pthreads",
992 asm_arch => 'c64xplus',
993 perlasm_scheme => "void",
994 dso_scheme => "dlfcn",
995 shared_target => "linux-shared",
996 shared_cflag => "--pic",
997 shared_ldflag => add("-z --sysv --shared"),
1002 "BSD-generic32" => {
1003 # As for thread cflag. Idea is to maintain "collective" set of
1004 # flags, which would cover all BSD flavors. -pthread applies
1005 # to them all, but is treated differently. OpenBSD expands is
1006 # as -D_POSIX_THREAD -lc_r, which is sufficient. FreeBSD 4.x
1007 # expands it as -lc_r, which has to be accompanied by explicit
1008 # -D_THREAD_SAFE and sometimes -D_REENTRANT. FreeBSD 5.x
1009 # expands it as -lc_r, which seems to be sufficient?
1010 inherit_from => [ "BASE_unix" ],
1012 CFLAGS => picker(default => "-Wall",
1015 cflags => threads("-pthread"),
1016 cppflags => threads("-D_THREAD_SAFE -D_REENTRANT"),
1017 ex_libs => add(threads("-pthread")),
1018 enable => add("devcryptoeng"),
1019 bn_ops => "BN_LLONG",
1020 thread_scheme => "pthreads",
1021 dso_scheme => "dlfcn",
1022 shared_target => "bsd-gcc-shared",
1023 shared_cflag => "-fPIC",
1025 "BSD-generic64" => {
1026 inherit_from => [ "BSD-generic32" ],
1027 bn_ops => "SIXTY_FOUR_BIT_LONG",
1031 inherit_from => [ "BSD-generic32" ],
1032 CFLAGS => add(picker(release => "-fomit-frame-pointer")),
1033 lib_cppflags => add("-DL_ENDIAN"),
1034 bn_ops => "BN_LLONG",
1036 perlasm_scheme => "a.out",
1039 inherit_from => [ "BSD-x86" ],
1040 perlasm_scheme => "elf",
1044 inherit_from => [ "BSD-generic32" ],
1045 cflags => add("-mcpu=v8"),
1046 lib_cppflags => add("-DB_ENDIAN"),
1047 asm_arch => 'sparcv8',
1048 perlasm_scheme => 'void',
1051 # -DMD32_REG_T=int doesn't actually belong in sparc64 target, it
1052 # simply *happens* to work around a compiler bug in gcc 3.3.3,
1053 # triggered by RIPEMD160 code.
1054 inherit_from => [ "BSD-generic64" ],
1055 lib_cppflags => add("-DB_ENDIAN -DMD32_REG_T=int"),
1056 bn_ops => "BN_LLONG",
1057 asm_arch => 'sparcv9',
1058 perlasm_scheme => 'void',
1062 inherit_from => [ "BSD-generic64" ],
1063 lib_cppflags => add("-DL_ENDIAN"),
1064 bn_ops => "SIXTY_FOUR_BIT_LONG",
1066 perlasm_scheme => 'void',
1070 inherit_from => [ "BSD-generic64" ],
1071 lib_cppflags => add("-DL_ENDIAN"),
1072 bn_ops => "SIXTY_FOUR_BIT_LONG",
1073 asm_arch => 'x86_64',
1074 perlasm_scheme => "elf",
1078 inherit_from => [ "BSD-generic64" ],
1079 lib_cppflags => add("-DL_ENDIAN"),
1080 bn_ops => "SIXTY_FOUR_BIT_LONG",
1081 asm_arch => 'aarch64',
1082 perlasm_scheme => "linux64",
1086 inherit_from => [ "BSD-generic32" ],
1087 asm_arch => 'ppc32',
1088 perlasm_scheme => "linux32",
1089 lib_cppflags => add("-DB_ENDIAN"),
1093 inherit_from => [ "BSD-generic64" ],
1094 cflags => add("-m64"),
1095 cxxflags => add("-m64"),
1096 lib_cppflags => add("-DB_ENDIAN"),
1097 asm_arch => 'ppc64',
1098 perlasm_scheme => "linux64",
1102 inherit_from => [ "BSD-generic64" ],
1103 cflags => add("-m64"),
1104 cxxflags => add("-m64"),
1105 lib_cppflags => add("-DL_ENDIAN"),
1106 asm_arch => 'ppc64',
1107 perlasm_scheme => "linux64le",
1110 # riscv below refers to contemporary RISCV Architecture
1113 inherit_from => [ "BSD-generic64"],
1114 perlasm_scheme => "linux64",
1115 asm_arch => 'riscv64',
1119 inherit_from => [ "BSD-generic32"],
1120 perlasm_scheme => "linux32",
1121 asm_arch => 'riscv32',
1125 ################################################################
1126 # Note that -march is not among compiler options in linux-armv4
1127 # target description. Not specifying one is intentional to give
1130 # a) rely on your compiler default by not specifying one;
1131 # b) specify your target platform explicitly for optimal
1132 # performance, e.g. -march=armv6 or -march=armv7-a;
1133 # c) build "universal" binary that targets *range* of platforms
1134 # by specifying minimum and maximum supported architecture;
1136 # As for c) option. It actually makes no sense to specify
1137 # maximum to be less than ARMv7, because it's the least
1138 # requirement for run-time switch between platform-specific
1139 # code paths. And without run-time switch performance would be
1140 # equivalent to one for minimum. Secondly, there are some
1141 # natural limitations that you'd have to accept and respect.
1142 # Most notably you can *not* build "universal" binary for
1143 # big-endian platform. This is because ARMv7 processor always
1144 # picks instructions in little-endian order. Another similar
1145 # limitation is that -mthumb can't "cross" -march=armv6t2
1146 # boundary, because that's where it became Thumb-2. Well, this
1147 # limitation is a bit artificial, because it's not really
1148 # impossible, but it's deemed too tricky to support. And of
1149 # course you have to be sure that your binutils are actually
1150 # up to the task of handling maximum target platform. With all
1151 # this in mind here is an example of how to configure
1152 # "universal" build:
1154 # ./Configure BSD-armv4 -march=armv6 -D__ARM_MAX_ARCH__=8
1156 inherit_from => [ "BSD-generic32" ],
1157 asm_arch => 'armv4',
1158 perlasm_scheme => "linux32",
1162 inherit_from => [ "BASE_unix" ],
1164 CFLAGS => "-fomit-frame-pointer -O3 -Wall",
1165 lib_cppflags => "-DPERL5 -DL_ENDIAN",
1166 ex_libs => add("-ldl"),
1167 bn_ops => "BN_LLONG",
1169 perlasm_scheme => "elf",
1170 thread_scheme => "(unknown)",
1171 dso_scheme => "dlfcn",
1172 shared_target => "bsd-gcc-shared",
1173 shared_cflag => "-fPIC",
1176 "BSD-nodef-generic32" => {
1177 # As for thread cflag. Idea is to maintain "collective" set of
1178 # flags, which would cover all BSD flavors. -pthread applies
1179 # to them all, but is treated differently. OpenBSD expands is
1180 # as -D_POSIX_THREAD -lc_r, which is sufficient. FreeBSD 4.x
1181 # expands it as -lc_r, which has to be accompanied by explicit
1182 # -D_THREAD_SAFE and sometimes -D_REENTRANT. FreeBSD 5.x
1183 # expands it as -lc_r, which seems to be sufficient?
1184 inherit_from => [ "BASE_unix" ],
1186 CFLAGS => picker(default => "-Wall",
1189 cflags => threads("-pthread"),
1190 cppflags => threads("-D_THREAD_SAFE -D_REENTRANT"),
1191 ex_libs => add(threads("-pthread")),
1192 enable => add("devcryptoeng"),
1193 bn_ops => "BN_LLONG",
1194 thread_scheme => "pthreads",
1195 dso_scheme => "dlfcn",
1196 shared_target => "bsd-gcc-nodef-shared",
1197 shared_cflag => "-fPIC",
1199 "BSD-nodef-generic64" => {
1200 inherit_from => [ "BSD-nodef-generic32" ],
1201 bn_ops => "SIXTY_FOUR_BIT_LONG",
1204 "BSD-nodef-x86" => {
1205 inherit_from => [ "BSD-nodef-generic32" ],
1206 CFLAGS => add(picker(release => "-fomit-frame-pointer")),
1207 lib_cppflags => add("-DL_ENDIAN"),
1208 bn_ops => "BN_LLONG",
1210 perlasm_scheme => "a.out",
1212 "BSD-nodef-x86-elf" => {
1213 inherit_from => [ "BSD-nodef-x86" ],
1214 perlasm_scheme => "elf",
1217 "BSD-nodef-sparcv8" => {
1218 inherit_from => [ "BSD-nodef-generic32" ],
1219 cflags => add("-mcpu=v8"),
1220 lib_cppflags => add("-DB_ENDIAN"),
1221 asm_arch => 'sparcv8',
1222 perlasm_scheme => 'void',
1224 "BSD-nodef-sparc64" => {
1225 # -DMD32_REG_T=int doesn't actually belong in sparc64 target, it
1226 # simply *happens* to work around a compiler bug in gcc 3.3.3,
1227 # triggered by RIPEMD160 code.
1228 inherit_from => [ "BSD-nodef-generic64" ],
1229 lib_cppflags => add("-DB_ENDIAN -DMD32_REG_T=int"),
1230 bn_ops => "BN_LLONG",
1231 asm_arch => 'sparcv9',
1232 perlasm_scheme => 'void',
1235 "BSD-nodef-ia64" => {
1236 inherit_from => [ "BSD-nodef-generic64" ],
1237 lib_cppflags => add("-DL_ENDIAN"),
1238 bn_ops => "SIXTY_FOUR_BIT_LONG",
1240 perlasm_scheme => 'void',
1243 "BSD-nodef-x86_64" => {
1244 inherit_from => [ "BSD-nodef-generic64" ],
1245 lib_cppflags => add("-DL_ENDIAN"),
1246 bn_ops => "SIXTY_FOUR_BIT_LONG",
1247 asm_arch => 'x86_64',
1248 perlasm_scheme => "elf",
1251 #### SCO/Caldera targets.
1253 # Originally we had like unixware-*, unixware-*-pentium, unixware-*-p6, etc.
1254 # Now we only have blended unixware-* as it's the only one used by ./config.
1255 # If you want to optimize for particular microarchitecture, bypass ./config
1256 # and './Configure unixware-7 -Kpentium_pro' or whatever appropriate.
1257 # Note that not all targets include assembler support. Mostly because of
1258 # lack of motivation to support out-of-date platforms with out-of-date
1259 # compiler drivers and assemblers.
1261 # UnixWare 2.0x fails destest with -O.
1263 inherit_from => [ "BASE_unix" ],
1265 cflags => threads("-Kthread"),
1266 lib_cppflags => "-DFILIO_H -DNO_STRINGS_H",
1267 ex_libs => add("-lsocket -lnsl -lresolv -lx"),
1268 thread_scheme => "uithreads",
1271 inherit_from => [ "BASE_unix" ],
1274 cflags => threads("-Kthread"),
1275 lib_cppflags => "-DFILIO_H",
1276 ex_libs => add("-lsocket -lnsl -lresolv -lx"),
1277 thread_scheme => "uithreads",
1280 inherit_from => [ "BASE_unix" ],
1283 cflags => combine("-Kalloca", threads("-Kthread")),
1284 lib_cppflags => "-DFILIO_H",
1285 ex_libs => add("-lsocket -lnsl"),
1286 thread_scheme => "uithreads",
1287 bn_ops => "BN_LLONG",
1289 perlasm_scheme => "elf-1",
1290 dso_scheme => "dlfcn",
1291 shared_target => "svr5-shared",
1292 shared_cflag => "-Kpic",
1294 "unixware-7-gcc" => {
1295 inherit_from => [ "BASE_unix" ],
1297 CFLAGS => "-O3 -fomit-frame-pointer -Wall",
1298 cppflags => add(threads("-D_REENTRANT")),
1299 lib_cppflags => add("-DL_ENDIAN -DFILIO_H"),
1300 ex_libs => add("-lsocket -lnsl"),
1301 bn_ops => "BN_LLONG",
1302 thread_scheme => "pthreads",
1304 perlasm_scheme => "elf-1",
1305 dso_scheme => "dlfcn",
1306 shared_target => "gnu-shared",
1307 shared_cflag => "-fPIC",
1309 # SCO 5 - Ben Laurie says the -O breaks the SCO cc.
1311 inherit_from => [ "BASE_unix" ],
1314 ex_libs => add("-lsocket -lnsl"),
1315 thread_scheme => "(unknown)",
1317 perlasm_scheme => "elf-1",
1318 dso_scheme => "dlfcn",
1319 shared_target => "svr3-shared",
1320 shared_cflag => "-Kpic",
1323 inherit_from => [ "BASE_unix" ],
1325 cflags => "-O3 -fomit-frame-pointer",
1326 ex_libs => add("-lsocket -lnsl"),
1327 bn_ops => "BN_LLONG",
1328 thread_scheme => "(unknown)",
1330 perlasm_scheme => "elf-1",
1331 dso_scheme => "dlfcn",
1332 shared_target => "svr3-shared",
1333 shared_cflag => "-fPIC",
1337 # Below targets assume AIX >=5. Caveat lector. If you are accustomed
1338 # to control compilation "bitness" by setting $OBJECT_MODE environment
1339 # variable, then you should know that in OpenSSL case it's considered
1340 # only in ./config. Once configured, build procedure remains "deaf" to
1341 # current value of $OBJECT_MODE.
1343 inherit_from => [ "BASE_unix" ],
1346 lib_cppflags => "-DB_ENDIAN",
1347 lflags => "-Wl,-bsvr4",
1348 thread_scheme => "pthreads",
1349 dso_scheme => "dlfcn",
1350 shared_target => "aix",
1351 module_ldflags => "-Wl,-G,-bsymbolic,-bnoentry",
1352 shared_ldflag => "-Wl,-G,-bsymbolic,-bnoentry",
1353 shared_defflag => "-Wl,-bE:",
1354 shared_fipsflag => "-Wl,-binitfini:_init:_cleanup",
1355 perl_platform => 'AIX',
1358 inherit_from => [ "aix-common" ],
1360 CFLAGS => picker(debug => "-O0 -g",
1362 cflags => add(threads("-pthread")),
1363 ex_libs => add(threads("-pthread")),
1364 bn_ops => "BN_LLONG RC4_CHAR",
1365 asm_arch => 'ppc32',
1366 perlasm_scheme => "aix32",
1367 shared_ldflag => add_before("-shared -static-libgcc"),
1369 RANLIB => add("-X32"),
1372 inherit_from => [ "aix-common" ],
1374 CFLAGS => picker(debug => "-O0 -g",
1376 cflags => combine("-maix64", threads("-pthread")),
1377 ex_libs => add(threads("-pthread")),
1378 bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
1379 asm_arch => 'ppc64',
1380 perlasm_scheme => "aix64",
1381 shared_ldflag => add_before("-shared -static-libgcc"),
1382 shared_extension => "64.so.\$(SHLIB_VERSION_NUMBER)",
1384 RANLIB => add("-X64"),
1387 inherit_from => [ "aix64-gcc" ],
1388 perlasm_scheme => "aix64-as",
1391 inherit_from => [ "aix-common" ],
1393 CFLAGS => picker(debug => "-O0 -g",
1395 cflags => combine("-q32 -qmaxmem=16384 -qro -qroconst",
1396 threads("-qthreaded")),
1397 cppflags => threads("-D_THREAD_SAFE"),
1398 ex_libs => add(threads("-lpthreads")),
1399 bn_ops => "BN_LLONG RC4_CHAR",
1400 asm_arch => 'ppc32',
1401 perlasm_scheme => "aix32",
1402 shared_cflag => "-qpic",
1404 RANLIB => add("-X32"),
1407 inherit_from => [ "aix-common" ],
1409 CFLAGS => picker(debug => "-O0 -g",
1411 cflags => combine("-q64 -qmaxmem=16384 -qro -qroconst",
1412 threads("-qthreaded")),
1413 cppflags => threads("-D_THREAD_SAFE"),
1414 ex_libs => add(threads("-lpthreads")),
1415 bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
1416 asm_arch => 'ppc64',
1417 perlasm_scheme => "aix64",
1418 dso_scheme => "dlfcn",
1419 shared_cflag => "-qpic",
1420 shared_extension => "64.so.\$(SHLIB_VERSION_NUMBER)",
1422 RANLIB => add("-X64"),
1425 # SIEMENS BS2000/OSD: an EBCDIC-based mainframe
1427 inherit_from => [ "BASE_unix" ],
1430 cflags => "-XLLML -XLLMK -XL",
1431 cppflags => "-DCHARSET_EBCDIC",
1432 lib_cppflags => "-DB_ENDIAN",
1433 ex_libs => add("-lsocket -lnsl"),
1434 bn_ops => "THIRTY_TWO_BIT RC4_CHAR",
1435 thread_scheme => "(unknown)",
1438 #### Visual C targets
1440 # Win64 targets, WIN64I denotes IA-64/Itanium and WIN64A - AMD64
1442 # Note about /wd4090, disable warning C4090. This warning returns false
1443 # positives in some situations. Disabling it altogether masks both
1444 # legitimate and false cases, but as we compile on multiple platforms,
1445 # we rely on other compilers to catch legitimate cases.
1447 # Also note that we force threads no matter what. Configuring "no-threads"
1450 # UNICODE is defined in VC-common and applies to all targets. It used to
1451 # be an opt-in option for VC-WIN32, but not anymore. The original reason
1452 # was because ANSI API was *native* system interface for no longer
1453 # supported Windows 9x. Keep in mind that UNICODE only affects how
1454 # OpenSSL libraries interact with underlying OS, it doesn't affect API
1455 # that OpenSSL presents to application.
1458 inherit_from => [ "BASE_Windows" ],
1461 CPP => '$(CC) /EP /C',
1462 CFLAGS => "/W3 /wd4090 /nologo",
1465 LDFLAGS => "/nologo /debug",
1466 ldoutflag => "/out:",
1467 ldpostoutflag => "",
1468 ld_resp_delim => "\n",
1469 bin_lflags => "setargv.obj",
1470 makedepcmd => '$(CC) /Zs /showIncludes',
1471 makedep_scheme => 'VC',
1473 ARFLAGS => "/nologo",
1474 aroutflag => "/out:",
1475 ar_resp_delim => "\n",
1478 defines => add("OPENSSL_SYS_WIN32", "WIN32_LEAN_AND_MEAN",
1479 "UNICODE", "_UNICODE",
1480 "_CRT_SECURE_NO_DEPRECATE",
1481 "_WINSOCK_DEPRECATED_NO_WARNINGS"),
1482 lib_cflags => add("/Zi /Fdossl_static.pdb"),
1483 lib_defines => add("L_ENDIAN"),
1484 dso_cflags => "/Zi /Fddso.pdb",
1485 bin_cflags => "/Zi /Fdapp.pdb",
1486 # def_flag made to empty string so a .def file gets generated
1487 shared_defflag => '',
1488 shared_ldflag => "/dll",
1489 shared_target => "win-shared", # meaningless except it gives Configure a hint
1490 lddefflag => "/def:",
1492 ld_implib_flag => "/implib:",
1493 thread_scheme => "winthreads",
1494 dso_scheme => "win32",
1495 perl_platform => 'Windows::MSVC',
1496 # additional parameter to build_scheme denotes install-path "flavour"
1497 build_scheme => add("VC-common", { separator => undef }),
1499 "VC-noCE-common" => {
1500 inherit_from => [ "VC-common" ],
1502 CFLAGS => add(picker(debug => '/Od',
1504 cflags => add(picker(default => '/Gs0 /GF /Gy',
1507 ($disabled{shared} ? "" : "/MDd");
1511 ($disabled{shared} ? "" : "/MD");
1513 defines => add(picker(default => [], # works as type cast
1514 debug => [ "DEBUG", "_DEBUG" ])),
1515 lib_cflags => add(sub { $disabled{shared} ? "/MT /Zl" : () }),
1516 # Following might/should appears controversial, i.e. defining
1517 # /MDd without evaluating $disabled{shared}. It works in
1518 # non-shared build because static library is compiled with /Zl
1519 # and bares no reference to specific RTL. And it works in
1520 # shared build because multiple /MDd options are not prohibited.
1521 # But why /MDd in static build? Well, basically this is just a
1522 # reference point, which allows to catch eventual errors that
1523 # would prevent those who want to wrap OpenSSL into own .DLL.
1524 # Why not /MD in release build then? Well, some are likely to
1525 # prefer [non-debug] openssl.exe to be free from Micorosoft RTL
1527 bin_cflags => add(picker(debug => "/MDd",
1528 release => sub { $disabled{shared} ? "/MT" : () },
1530 bin_lflags => add("/subsystem:console /opt:ref"),
1531 ex_libs => add(sub {
1533 push @ex_libs, 'ws2_32.lib' unless $disabled{sock};
1534 push @ex_libs, 'gdi32.lib advapi32.lib crypt32.lib user32.lib';
1535 return join(" ", @ex_libs);
1538 "VC-WIN64-common" => {
1539 inherit_from => [ "VC-noCE-common" ],
1541 ex_libs => add(sub {
1543 push @ex_libs, 'bufferoverflowu.lib' if (`cl 2>&1` =~ /14\.00\.4[0-9]{4}\./);
1544 return join(" ", @_, @ex_libs);
1546 bn_ops => add("SIXTY_FOUR_BIT"),
1549 inherit_from => [ "VC-WIN64-common" ],
1551 ASFLAGS => "-d debug",
1554 uplink_arch => 'ia64',
1556 perlasm_scheme => "ias",
1557 multilib => "-ia64",
1560 inherit_from => [ "VC-WIN64-common" ],
1561 AS => sub { vc_win64a_info()->{AS} },
1562 ASFLAGS => sub { vc_win64a_info()->{ASFLAGS} },
1563 asoutflag => sub { vc_win64a_info()->{asoutflag} },
1564 asflags => sub { vc_win64a_info()->{asflags} },
1566 uplink_arch => 'x86_64',
1567 asm_arch => 'x86_64',
1568 perlasm_scheme => "auto",
1572 inherit_from => [ "VC-noCE-common" ],
1573 AS => sub { vc_win32_info()->{AS} },
1574 ASFLAGS => sub { vc_win32_info()->{ASFLAGS} },
1575 asoutflag => sub { vc_win32_info()->{asoutflag} },
1576 asflags => sub { vc_win32_info()->{asflags} },
1578 bn_ops => add("BN_LLONG"),
1579 uplink_arch => 'common',
1581 perlasm_scheme => sub { vc_win32_info()->{perlasm_scheme} },
1582 # "WOW" stands for "Windows on Windows", and "VC-WOW" engages
1583 # some installation path heuristics in windows-makefile.tmpl...
1584 build_scheme => add("VC-WOW", { separator => undef }),
1587 inherit_from => [ "VC-common" ],
1588 CFLAGS => add(picker(debug => "/Od",
1589 release => "/O1i")),
1590 CPPDEFINES => picker(debug => [ "DEBUG", "_DEBUG" ]),
1591 LDFLAGS => add("/nologo /opt:ref"),
1594 sub { vc_wince_info()->{cflags}; },
1595 sub { `cl 2>&1` =~ /Version ([0-9]+)\./ && $1>=14
1596 ? ($disabled{shared} ? " /MT" : " /MD")
1598 cppflags => sub { vc_wince_info()->{cppflags}; },
1599 lib_defines => add("NO_CHMOD", "OPENSSL_SMALL_FOOTPRINT"),
1600 lib_cppflags => sub { vc_wince_info()->{cppflags}; },
1602 add(combine(sub { defined(env('WCECOMPAT'))
1603 ? '$(WCECOMPAT)/include' : (); },
1604 sub { defined(env('PORTSDK_LIBPATH'))
1605 ? '$(PORTSDK_LIBPATH)/../../include'
1607 lflags => add(combine(sub { vc_wince_info()->{lflags}; },
1608 sub { defined(env('PORTSDK_LIBPATH'))
1609 ? "/entry:mainCRTstartup" : (); })),
1611 bn_ops => add("BN_LLONG"),
1612 ex_libs => add(sub {
1614 push @ex_libs, 'ws2.lib' unless $disabled{sock};
1615 push @ex_libs, 'crypt32.lib';
1616 if (defined(env('WCECOMPAT'))) {
1617 my $x = '$(WCECOMPAT)/lib';
1618 if (-f "$x/env('TARGETCPU')/wcecompatex.lib") {
1619 $x .= '/$(TARGETCPU)/wcecompatex.lib';
1621 $x .= '/wcecompatex.lib';
1625 push @ex_libs, '$(PORTSDK_LIBPATH)/portlib.lib'
1626 if (defined(env('PORTSDK_LIBPATH')));
1627 push @ex_libs, '/nodefaultlib coredll.lib corelibc.lib'
1628 if (env('TARGETCPU') =~ /^X86|^ARMV4[IT]/);
1629 return join(" ", @ex_libs);
1635 inherit_from => [ 'BASE_unix' ],
1638 CFLAGS => picker(default => "-Wall",
1641 cppflags => combine("-DUNICODE -D_UNICODE -DWIN32_LEAN_AND_MEAN",
1643 lib_cppflags => "-DL_ENDIAN",
1644 ex_libs => add("-lws2_32 -lgdi32 -lcrypt32"),
1645 thread_scheme => "winthreads",
1646 dso_scheme => "win32",
1647 shared_target => "mingw-shared",
1648 shared_cppflags => add("_WINDLL"),
1649 shared_ldflag => "-static-libgcc",
1651 perl_platform => 'mingw',
1654 inherit_from => [ "mingw-common" ],
1655 CFLAGS => add(picker(release => "-fomit-frame-pointer")),
1657 sys_id => "MINGW32",
1658 bn_ops => add("BN_LLONG"),
1660 uplink_arch => 'x86',
1661 perlasm_scheme => "coff",
1662 shared_rcflag => "--target=pe-i386",
1666 # As for uplink_arch. Applink makes it possible to use
1667 # .dll compiled with one compiler with application compiled with
1668 # another compiler. It's possible to engage Applink support in
1669 # mingw64 build, but it's not done, because until mingw64
1670 # supports structured exception handling, one can't seriously
1671 # consider its binaries for using with non-mingw64 run-time
1672 # environment. And as mingw64 is always consistent with itself,
1673 # Applink is never engaged and can as well be omitted.
1674 inherit_from => [ "mingw-common" ],
1676 sys_id => "MINGW64",
1677 bn_ops => add("SIXTY_FOUR_BIT"),
1678 asm_arch => 'x86_64',
1679 uplink_arch => undef,
1680 perlasm_scheme => "mingw64",
1681 shared_rcflag => "--target=pe-x86-64",
1687 inherit_from => [ "BASE_unix" ],
1690 lib_cppflags => "-DL_ENDIAN",
1694 inherit_from => [ "UEFI" ],
1696 perlasm_scheme => "win32n",
1699 inherit_from => [ "UEFI" ],
1700 asm_arch => 'x86_64',
1701 perlasm_scheme => "nasm",
1706 inherit_from => [ "BASE_unix" ],
1708 CFLAGS => "-O -Wall",
1709 lib_cppflags => "-DTERMIOS -DL_ENDIAN",
1711 bn_ops => "BN_LLONG",
1712 dso_scheme => "win32",
1716 "Cygwin-common" => {
1717 inherit_from => [ "BASE_unix" ],
1721 CFLAGS => picker(default => "-Wall",
1724 ex_libs => add("-lcrypt32"),
1725 lib_cppflags => "-DTERMIOS -DL_ENDIAN",
1727 thread_scheme => "pthread",
1728 dso_scheme => "dlfcn",
1729 shared_target => "cygwin-shared",
1730 shared_cppflags => "-D_WINDLL",
1732 perl_platform => 'Cygwin',
1735 inherit_from => [ "Cygwin-common" ],
1736 CFLAGS => add(picker(release => "-O3 -fomit-frame-pointer")),
1737 bn_ops => "BN_LLONG",
1739 perlasm_scheme => "coff",
1741 "Cygwin-x86_64" => {
1742 inherit_from => [ "Cygwin-common" ],
1744 bn_ops => "SIXTY_FOUR_BIT_LONG",
1745 asm_arch => 'x86_64',
1746 perlasm_scheme => "mingw64",
1748 # Backward compatibility for those using this target
1750 inherit_from => [ "Cygwin-x86" ]
1752 # In case someone constructs the Cygwin target name themself
1754 inherit_from => [ "Cygwin-x86" ]
1757 inherit_from => [ "Cygwin-x86" ]
1760 inherit_from => [ "Cygwin-x86" ]
1763 inherit_from => [ "Cygwin-x86" ]
1766 ##### MacOS X (a.k.a. Darwin) setup
1767 "darwin-common" => {
1768 inherit_from => [ "BASE_unix" ],
1771 CFLAGS => picker(debug => "-g -O0",
1773 cppflags => threads("-D_REENTRANT"),
1774 lflags => add("-Wl,-search_paths_first"),
1776 bn_ops => "BN_LLONG RC4_CHAR",
1777 thread_scheme => "pthreads",
1778 perlasm_scheme => "osx32",
1779 dso_scheme => "dlfcn",
1780 ranlib => "ranlib -c",
1781 shared_target => "darwin-shared",
1782 shared_cflag => "-fPIC",
1783 shared_extension => ".\$(SHLIB_VERSION_NUMBER).dylib",
1785 # Option "freeze" such as -std=gnu9x can't negatively interfere
1786 # with future defaults for below two targets, because MacOS X
1787 # for PPC has no future, it was discontinued by vendor in 2009.
1788 "darwin-ppc-cc" => { inherit_from => [ "darwin-ppc" ] }, # Historic alias
1790 inherit_from => [ "darwin-common" ],
1791 cflags => add("-arch ppc -std=gnu9x -Wa,-force_cpusubtype_ALL"),
1792 lib_cppflags => add("-DB_ENDIAN"),
1793 shared_cflag => add("-fno-common"),
1794 asm_arch => 'ppc32',
1795 perlasm_scheme => "osx32",
1797 "darwin64-ppc-cc" => { inherit_from => [ "darwin64-ppc" ] }, # Historic alias
1799 inherit_from => [ "darwin-common" ],
1800 cflags => add("-arch ppc64 -std=gnu9x"),
1801 lib_cppflags => add("-DB_ENDIAN"),
1802 bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
1803 asm_arch => 'ppc64',
1804 perlasm_scheme => "osx64",
1806 "darwin-i386-cc" => { inherit_from => [ "darwin-i386" ] }, # Historic alias
1808 inherit_from => [ "darwin-common" ],
1809 CFLAGS => add(picker(release => "-fomit-frame-pointer")),
1810 cflags => add("-arch i386"),
1811 lib_cppflags => add("-DL_ENDIAN"),
1812 bn_ops => "BN_LLONG RC4_INT",
1814 perlasm_scheme => "macosx",
1816 "darwin64-x86_64-cc" => { inherit_from => [ "darwin64-x86_64" ] }, # Historic alias
1817 "darwin64-x86_64" => {
1818 inherit_from => [ "darwin-common" ],
1819 CFLAGS => add("-Wall"),
1820 cflags => add("-arch x86_64"),
1821 lib_cppflags => add("-DL_ENDIAN"),
1822 bn_ops => "SIXTY_FOUR_BIT_LONG",
1823 asm_arch => 'x86_64',
1824 perlasm_scheme => "macosx",
1826 "darwin64-arm64-cc" => { inherit_from => [ "darwin64-arm64" ] }, # "Historic" alias
1827 "darwin64-arm64" => {
1828 inherit_from => [ "darwin-common" ],
1829 CFLAGS => add("-Wall"),
1830 cflags => add("-arch arm64"),
1831 lib_cppflags => add("-DL_ENDIAN"),
1832 bn_ops => "SIXTY_FOUR_BIT_LONG",
1833 asm_arch => 'aarch64',
1834 perlasm_scheme => "ios64",
1838 "hurd-generic32" => {
1839 inherit_from => [ "BASE_unix" ],
1842 CFLAGS => picker(default => "-Wall",
1845 CXXFLAGS => picker(default => "-Wall",
1848 cflags => threads("-pthread"),
1849 cxxflags => combine("-std=c++11", threads("-pthread")),
1850 ex_libs => add("-ldl", threads("-pthread")),
1851 bn_ops => "BN_LLONG RC4_CHAR",
1852 thread_scheme => "pthreads",
1853 dso_scheme => "dlfcn",
1854 shared_target => "linux-shared",
1855 shared_cflag => "-fPIC",
1856 shared_ldflag => sub { $disabled{pinshared} ? () : "-Wl,-znodelete" },
1859 "hurd-generic64" => {
1860 inherit_from => [ "hurd-generic32" ],
1861 bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
1864 #### X86 / X86_64 targets
1866 inherit_from => [ "hurd-generic32" ],
1867 CFLAGS => add(picker(release => "-fomit-frame-pointer")),
1868 cflags => add("-m32"),
1869 cxxflags => add("-m32"),
1870 lib_cppflags => add("-DL_ENDIAN"),
1871 bn_ops => "BN_LLONG",
1873 perlasm_scheme => 'elf',
1877 inherit_from => [ "hurd-generic64" ],
1878 cflags => add("-m64"),
1879 cxxflags => add("-m64"),
1880 lib_cppflags => add("-DL_ENDIAN"),
1881 bn_ops => "SIXTY_FOUR_BIT_LONG",
1882 asm_arch => 'x86_64',
1883 perlasm_scheme => 'elf',
1887 ##### VxWorks for various targets
1888 "vxworks-ppc60x" => {
1889 inherit_from => [ "BASE_unix" ],
1891 CFLAGS => "-O2 -Wall -fstrength-reduce",
1892 cflags => "-mrtp -mhard-float -mstrict-align -fno-implicit-fp -fno-builtin -fno-strict-aliasing",
1893 cppflags => combine("-D_REENTRANT -DPPC32_fp60x -DCPU=PPC32",
1894 "_DTOOL_FAMILY=gnu -DTOOL=gnu",
1895 "-I\$(WIND_BASE)/target/usr/h",
1896 "-I\$(WIND_BASE)/target/usr/h/wrn/coreip"),
1897 sys_id => "VXWORKS",
1898 lflags => add("-L \$(WIND_BASE)/target/usr/lib/ppc/PPC32/common"),
1899 ex_libs => add("-Wl,--defsym,__wrs_rtp_base=0xe0000000"),
1901 "vxworks-ppcgen" => {
1902 inherit_from => [ "BASE_unix" ],
1904 CFLAGS => "-O1 -Wall",
1905 cflags => "-mrtp -msoft-float -mstrict-align -fno-builtin -fno-strict-aliasing",
1906 cppflags => combine("-D_REENTRANT -DPPC32 -DCPU=PPC32",
1907 "-DTOOL_FAMILY=gnu -DTOOL=gnu",
1908 "-I\$(WIND_BASE)/target/usr/h",
1909 "-I\$(WIND_BASE)/target/usr/h/wrn/coreip"),
1910 sys_id => "VXWORKS",
1911 lflags => add("-L \$(WIND_BASE)/target/usr/lib/ppc/PPC32/sfcommon"),
1912 ex_libs => add("-Wl,--defsym,__wrs_rtp_base=0xe0000000"),
1914 "vxworks-ppc405" => {
1915 inherit_from => [ "BASE_unix" ],
1918 cflags => "-msoft-float -mlongcall",
1919 cppflags => combine("-D_REENTRANT -DPPC32 -DCPU=PPC405",
1920 "-DTOOL_FAMILY=gnu -DTOOL=gnu",
1921 "-I\$(WIND_BASE)/target/h"),
1922 sys_id => "VXWORKS",
1923 lflags => add("-r"),
1925 "vxworks-ppc750" => {
1926 inherit_from => [ "BASE_unix" ],
1928 CFLAGS => "-ansi -fvolatile -Wall \$(DEBUG_FLAG)",
1929 cflags => "-nostdinc -fno-builtin -fno-for-scope -fsigned-char -msoft-float -mlongcall",
1930 cppflags => combine("-DPPC750 -D_REENTRANT -DCPU=PPC604",
1931 "-I\$(WIND_BASE)/target/h"),
1932 sys_id => "VXWORKS",
1933 lflags => add("-r"),
1935 "vxworks-ppc750-debug" => {
1936 inherit_from => [ "BASE_unix" ],
1938 CFLAGS => "-ansi -fvolatile -Wall -g",
1939 cflags => "-nostdinc -fno-builtin -fno-for-scope -fsigned-char -msoft-float -mlongcall",
1940 cppflags => combine("-DPPC750 -D_REENTRANT -DCPU=PPC604",
1941 "-DPEDANTIC -DDEBUG",
1942 "-I\$(WIND_BASE)/target/h"),
1943 sys_id => "VXWORKS",
1944 lflags => add("-r"),
1946 "vxworks-ppc860" => {
1947 inherit_from => [ "BASE_unix" ],
1949 cflags => "-nostdinc -msoft-float",
1950 cppflags => combine("-DCPU=PPC860 -DNO_STRINGS_H",
1951 "-I\$(WIND_BASE)/target/h"),
1952 sys_id => "VXWORKS",
1953 lflags => add("-r"),
1955 "vxworks-simlinux" => {
1956 inherit_from => [ "BASE_unix" ],
1958 cflags => "-B\$(WIND_BASE)/host/\$(WIND_HOST_TYPE)/lib/gcc-lib/ -fno-builtin -fno-defer-pop",
1959 cppflags => combine("-D_VSB_CONFIG_FILE=\"\$(WIND_BASE)/target/lib/h/config/vsbConfig.h\"",
1960 "-DL_ENDIAN -DCPU=SIMLINUX -DNO_STRINGS_H",
1961 "-DTOOL_FAMILY=gnu -DTOOL=gnu",
1962 "-DOPENSSL_NO_HW_PADLOCK",
1963 "-I\$(WIND_BASE)/target/h",
1964 "-I\$(WIND_BASE)/target/h/wrn/coreip"),
1965 sys_id => "VXWORKS",
1966 lflags => add("-r"),
1967 ranlib => "ranlibpentium",
1970 inherit_from => [ "BASE_unix" ],
1972 CFLAGS => "-O -G 0",
1973 cflags => "-mrtp -mips2 -B\$(WIND_BASE)/host/\$(WIND_HOST_TYPE)/lib/gcc-lib/ -msoft-float -mno-branch-likely -fno-builtin -fno-defer-pop",
1974 cppflags => combine("-D_VSB_CONFIG_FILE=\"\$(WIND_BASE)/target/lib/h/config/vsbConfig.h\"",
1975 "-DCPU=MIPS32 -DNO_STRINGS_H",
1976 "-DTOOL_FAMILY=gnu -DTOOL=gnu",
1977 "-DOPENSSL_NO_HW_PADLOCK",
1978 threads("-D_REENTRANT"),
1979 "-I\$(WIND_BASE)/target/h",
1980 "-I\$(WIND_BASE)/target/h/wrn/coreip"),
1981 sys_id => "VXWORKS",
1982 lflags => add("-L \$(WIND_BASE)/target/usr/lib/mips/MIPSI32/sfcommon"),
1983 ex_libs => add("-Wl,--defsym,__wrs_rtp_base=0xe0000000"),
1984 thread_scheme => "pthreads",
1985 asm_arch => 'mips32',
1986 perlasm_scheme => "o32",
1987 ranlib => "ranlibmips",
1992 inherit_from => [ "BASE_unix" ],
1993 CC => sub { env('CC') },
1994 cppflags => threads("-D_REENTRANT"),
1995 ex_libs => add("\$(LDLIBS)"),
1996 bn_ops => "BN_LLONG",
1997 thread_scheme => "pthreads",
1998 dso_scheme => sub { env('LIBSSL_dlfcn') },
1999 shared_target => "linux-shared",
2000 shared_cflag => "-fPIC",
2001 ranlib => sub { env('RANLIB') },
2003 "uClinux-dist64" => {
2004 inherit_from => [ "BASE_unix" ],
2005 CC => sub { env('CC') },
2006 cppflags => threads("-D_REENTRANT"),
2007 ex_libs => add("\$(LDLIBS)"),
2008 bn_ops => "SIXTY_FOUR_BIT_LONG",
2009 thread_scheme => "pthreads",
2010 dso_scheme => sub { env('LIBSSL_dlfcn') },
2011 shared_target => "linux-shared",
2012 shared_cflag => "-fPIC",
2013 ranlib => sub { env('RANLIB') },
2017 # Most things happen in vms-generic.
2018 # Note that vms_info extracts the pointer size from the end of
2019 # the target name, and will assume that anything matching /-p\d+$/
2020 # indicates the pointer size setting for the desired target.
2022 inherit_from => [ "BASE_VMS" ],
2025 CPP => '$(CC)/PREPROCESS_ONLY=SYS$OUTPUT:',
2027 combine(picker(default => "/STANDARD=(ISOC94,RELAXED)/NOLIST/PREFIX=ALL",
2028 debug => "/NOOPTIMIZE/DEBUG",
2029 release => "/OPTIMIZE/NODEBUG"),
2030 sub { my @warnings =
2031 @{vms_info()->{disable_warns}};
2033 ? "/WARNINGS=DISABLE=(".join(",",@warnings).")" : (); }),
2034 cflag_incfirst => '/FIRST_INCLUDE=',
2036 add("OPENSSL_USE_NODELETE",
2038 return vms_info()->{def_zlib}
2039 ? "LIBZ=\"\"\"".vms_info()->{def_zlib}."\"\"\"" : ();
2041 lflags => picker(default => "/MAP='F\$PARSE(\".MAP\",\"\$\@\")'",
2042 debug => "/DEBUG/TRACEBACK",
2043 release => "/NODEBUG/NOTRACEBACK"),
2044 # Because of dso_cflags below, we can't set the generic |cflags| here,
2045 # as it can't be overridden, so we set separate C flags for libraries
2046 # and binaries instead.
2047 bin_cflags => add("/NAMES=(AS_IS,SHORTENED)/EXTERN_MODEL=STRICT_REFDEF"),
2048 lib_cflags => add("/NAMES=(AS_IS,SHORTENED)/EXTERN_MODEL=STRICT_REFDEF"),
2049 # Strictly speaking, DSOs should not need to have name shortening,
2050 # as all their exported symbols should be short enough to fit the
2051 # linker's 31 character per symbol name limit. However, providers
2052 # may be composed of more than one object file, and internal symbols
2053 # may and do surpass the 31 character limit.
2054 dso_cflags => add("/NAMES=(SHORTENED)"),
2055 ex_libs => add(sub { return vms_info()->{zlib} || (); }),
2056 shared_target => "vms-shared",
2057 # def_flag made to empty string so a .opt file gets generated
2058 shared_defflag => '',
2059 dso_scheme => "vms",
2060 thread_scheme => "pthreads",
2062 makedep_scheme => 'VMS C',
2063 AS => sub { vms_info()->{AS} },
2064 ASFLAGS => sub { vms_info()->{ASFLAGS} },
2065 asoutflag => sub { vms_info()->{asoutflag} },
2066 asflags => sub { vms_info()->{asflags} },
2067 perlasm_scheme => sub { vms_info()->{perlasm_scheme} },
2069 disable => add('pinshared', 'loadereng'),
2073 # From HELP CC/POINTER_SIZE:
2076 # LONG[=ARGV] The compiler assumes 64-bit pointers. If the ARGV option to
2077 # LONG or 64 is present, the main argument argv will be an
2078 # array of long pointers instead of an array of short pointers.
2080 # 64[=ARGV] Same as LONG.
2083 # We don't want the hassle of dealing with 32-bit pointers with argv, so
2084 # we force it to have 64-bit pointers, see the added cflags in the -p64
2085 # config targets below.
2088 inherit_from => [ "vms-generic" ],
2089 bn_ops => "SIXTY_FOUR_BIT RC4_INT",
2092 "vms-alpha-p32" => {
2093 inherit_from => [ "vms-alpha" ],
2094 cflags => add("/POINTER_SIZE=32"),
2095 pointer_size => "32",
2097 "vms-alpha-p64" => {
2098 inherit_from => [ "vms-alpha" ],
2099 cflags => add("/POINTER_SIZE=64=ARGV"),
2100 pointer_size => "64",
2103 inherit_from => [ "vms-generic" ],
2104 bn_ops => "SIXTY_FOUR_BIT RC4_INT",
2105 asm_arch => sub { vms_info()->{AS} ? 'ia64' : undef },
2106 perlasm_scheme => 'ias',
2111 inherit_from => [ "vms-ia64" ],
2112 cflags => add("/POINTER_SIZE=32"),
2113 pointer_size => "32",
2116 inherit_from => [ "vms-ia64" ],
2117 cflags => add("/POINTER_SIZE=64=ARGV"),
2118 pointer_size => "64",
2121 inherit_from => [ "vms-generic" ],
2122 bn_ops => "SIXTY_FOUR_BIT",