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-clang" => {
865 inherit_from => [ "linux-x86" ],
868 ex_libs => add(threads("-latomic")),
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",
880 "linux-x86_64-clang" => {
881 inherit_from => [ "linux-x86_64" ],
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",
897 inherit_from => [ "linux-generic64" ],
898 bn_ops => "SIXTY_FOUR_BIT_LONG",
900 perlasm_scheme => 'void',
904 inherit_from => [ "linux-generic64" ],
905 cflags => add("-m64"),
906 cxxflags => add("-m64"),
907 lib_cppflags => add("-DB_ENDIAN"),
909 perlasm_scheme => "64",
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...
929 inherit_from => [ "linux-generic32" ],
930 cflags => add("-m31 -Wa,-mzarch"),
931 cxxflags => add("-m31 -Wa,-mzarch"),
932 lib_cppflags => add("-DB_ENDIAN"),
934 perlasm_scheme => "31",
935 multilib => "/highgprs",
938 #### SPARC Linux setups
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',
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',
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',
970 "linux-alpha-gcc" => {
971 inherit_from => [ "linux-generic64" ],
972 lib_cppflags => add("-DL_ENDIAN"),
973 bn_ops => "SIXTY_FOUR_BIT_LONG",
975 perlasm_scheme => "void",
977 "linux-c64xplus" => {
978 inherit_from => [ "BASE_unix" ],
979 # TI_CGT_C6000_7.3.x is a requirement
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"),
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" ],
1008 CFLAGS => picker(default => "-Wall",
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",
1021 "BSD-generic64" => {
1022 inherit_from => [ "BSD-generic32" ],
1023 bn_ops => "SIXTY_FOUR_BIT_LONG",
1027 inherit_from => [ "BSD-generic32" ],
1028 CFLAGS => add(picker(release => "-fomit-frame-pointer")),
1029 lib_cppflags => add("-DL_ENDIAN"),
1030 bn_ops => "BN_LLONG",
1032 perlasm_scheme => "a.out",
1035 inherit_from => [ "BSD-x86" ],
1036 perlasm_scheme => "elf",
1040 inherit_from => [ "BSD-generic32" ],
1041 cflags => add("-mcpu=v8"),
1042 lib_cppflags => add("-DB_ENDIAN"),
1043 asm_arch => 'sparcv8',
1044 perlasm_scheme => 'void',
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',
1058 inherit_from => [ "BSD-generic64" ],
1059 lib_cppflags => add("-DL_ENDIAN"),
1060 bn_ops => "SIXTY_FOUR_BIT_LONG",
1062 perlasm_scheme => 'void',
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",
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",
1082 inherit_from => [ "BSD-generic32" ],
1083 asm_arch => 'ppc32',
1084 perlasm_scheme => "linux32",
1085 lib_cppflags => add("-DB_ENDIAN"),
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",
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",
1106 # riscv below refers to contemporary RISCV Architecture
1109 inherit_from => [ "BSD-generic64"],
1110 perlasm_scheme => "linux64",
1111 asm_arch => 'riscv64',
1115 inherit_from => [ "BSD-generic32"],
1116 perlasm_scheme => "linux32",
1117 asm_arch => 'riscv32',
1121 ################################################################
1122 # Note that -march is not among compiler options in linux-armv4
1123 # target description. Not specifying one is intentional to give
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;
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:
1150 # ./Configure BSD-armv4 -march=armv6 -D__ARM_MAX_ARCH__=8
1152 inherit_from => [ "BSD-generic32" ],
1153 asm_arch => 'armv4',
1154 perlasm_scheme => "linux32",
1158 inherit_from => [ "BASE_unix" ],
1160 CFLAGS => "-fomit-frame-pointer -O3 -Wall",
1161 lib_cppflags => "-DPERL5 -DL_ENDIAN",
1162 ex_libs => add("-ldl"),
1163 bn_ops => "BN_LLONG",
1165 perlasm_scheme => "elf",
1166 thread_scheme => "(unknown)",
1167 dso_scheme => "dlfcn",
1168 shared_target => "bsd-gcc-shared",
1169 shared_cflag => "-fPIC",
1172 #### SCO/Caldera targets.
1174 # Originally we had like unixware-*, unixware-*-pentium, unixware-*-p6, etc.
1175 # Now we only have blended unixware-* as it's the only one used by ./config.
1176 # If you want to optimize for particular microarchitecture, bypass ./config
1177 # and './Configure unixware-7 -Kpentium_pro' or whatever appropriate.
1178 # Note that not all targets include assembler support. Mostly because of
1179 # lack of motivation to support out-of-date platforms with out-of-date
1180 # compiler drivers and assemblers.
1182 # UnixWare 2.0x fails destest with -O.
1184 inherit_from => [ "BASE_unix" ],
1186 cflags => threads("-Kthread"),
1187 lib_cppflags => "-DFILIO_H -DNO_STRINGS_H",
1188 ex_libs => add("-lsocket -lnsl -lresolv -lx"),
1189 thread_scheme => "uithreads",
1192 inherit_from => [ "BASE_unix" ],
1195 cflags => threads("-Kthread"),
1196 lib_cppflags => "-DFILIO_H",
1197 ex_libs => add("-lsocket -lnsl -lresolv -lx"),
1198 thread_scheme => "uithreads",
1201 inherit_from => [ "BASE_unix" ],
1204 cflags => combine("-Kalloca", threads("-Kthread")),
1205 lib_cppflags => "-DFILIO_H",
1206 ex_libs => add("-lsocket -lnsl"),
1207 thread_scheme => "uithreads",
1208 bn_ops => "BN_LLONG",
1210 perlasm_scheme => "elf-1",
1211 dso_scheme => "dlfcn",
1212 shared_target => "svr5-shared",
1213 shared_cflag => "-Kpic",
1215 "unixware-7-gcc" => {
1216 inherit_from => [ "BASE_unix" ],
1218 CFLAGS => "-O3 -fomit-frame-pointer -Wall",
1219 cppflags => add(threads("-D_REENTRANT")),
1220 lib_cppflags => add("-DL_ENDIAN -DFILIO_H"),
1221 ex_libs => add("-lsocket -lnsl"),
1222 bn_ops => "BN_LLONG",
1223 thread_scheme => "pthreads",
1225 perlasm_scheme => "elf-1",
1226 dso_scheme => "dlfcn",
1227 shared_target => "gnu-shared",
1228 shared_cflag => "-fPIC",
1230 # SCO 5 - Ben Laurie says the -O breaks the SCO cc.
1232 inherit_from => [ "BASE_unix" ],
1235 ex_libs => add("-lsocket -lnsl"),
1236 thread_scheme => "(unknown)",
1238 perlasm_scheme => "elf-1",
1239 dso_scheme => "dlfcn",
1240 shared_target => "svr3-shared",
1241 shared_cflag => "-Kpic",
1244 inherit_from => [ "BASE_unix" ],
1246 cflags => "-O3 -fomit-frame-pointer",
1247 ex_libs => add("-lsocket -lnsl"),
1248 bn_ops => "BN_LLONG",
1249 thread_scheme => "(unknown)",
1251 perlasm_scheme => "elf-1",
1252 dso_scheme => "dlfcn",
1253 shared_target => "svr3-shared",
1254 shared_cflag => "-fPIC",
1258 # Below targets assume AIX >=5. Caveat lector. If you are accustomed
1259 # to control compilation "bitness" by setting $OBJECT_MODE environment
1260 # variable, then you should know that in OpenSSL case it's considered
1261 # only in ./config. Once configured, build procedure remains "deaf" to
1262 # current value of $OBJECT_MODE.
1264 inherit_from => [ "BASE_unix" ],
1267 lib_cppflags => "-DB_ENDIAN",
1268 lflags => "-Wl,-bsvr4",
1269 thread_scheme => "pthreads",
1270 dso_scheme => "dlfcn",
1271 shared_target => "aix",
1272 module_ldflags => "-Wl,-G,-bsymbolic,-bnoentry",
1273 shared_ldflag => "-Wl,-G,-bsymbolic,-bnoentry",
1274 shared_defflag => "-Wl,-bE:",
1275 shared_fipsflag => "-Wl,-binitfini:_init:_cleanup",
1276 perl_platform => 'AIX',
1279 inherit_from => [ "aix-common" ],
1281 CFLAGS => picker(debug => "-O0 -g",
1283 cflags => add(threads("-pthread")),
1284 ex_libs => add(threads("-pthread")),
1285 bn_ops => "BN_LLONG RC4_CHAR",
1286 asm_arch => 'ppc32',
1287 perlasm_scheme => "aix32",
1288 shared_ldflag => add_before("-shared -static-libgcc"),
1290 RANLIB => add("-X32"),
1293 inherit_from => [ "aix-common" ],
1295 CFLAGS => picker(debug => "-O0 -g",
1297 cflags => combine("-maix64", threads("-pthread")),
1298 ex_libs => add(threads("-pthread")),
1299 bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
1300 asm_arch => 'ppc64',
1301 perlasm_scheme => "aix64",
1302 shared_ldflag => add_before("-shared -static-libgcc"),
1303 shared_extension => "64.so.\$(SHLIB_VERSION_NUMBER)",
1305 RANLIB => add("-X64"),
1308 inherit_from => [ "aix64-gcc" ],
1309 perlasm_scheme => "aix64-as",
1312 inherit_from => [ "aix-common" ],
1314 CFLAGS => picker(debug => "-O0 -g",
1316 cflags => combine("-q32 -qmaxmem=16384 -qro -qroconst",
1317 threads("-qthreaded")),
1318 cppflags => threads("-D_THREAD_SAFE"),
1319 ex_libs => add(threads("-lpthreads")),
1320 bn_ops => "BN_LLONG RC4_CHAR",
1321 asm_arch => 'ppc32',
1322 perlasm_scheme => "aix32",
1323 shared_cflag => "-qpic",
1325 RANLIB => add("-X32"),
1328 inherit_from => [ "aix-common" ],
1330 CFLAGS => picker(debug => "-O0 -g",
1332 cflags => combine("-q64 -qmaxmem=16384 -qro -qroconst",
1333 threads("-qthreaded")),
1334 cppflags => threads("-D_THREAD_SAFE"),
1335 ex_libs => add(threads("-lpthreads")),
1336 bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
1337 asm_arch => 'ppc64',
1338 perlasm_scheme => "aix64",
1339 dso_scheme => "dlfcn",
1340 shared_cflag => "-qpic",
1341 shared_extension => "64.so.\$(SHLIB_VERSION_NUMBER)",
1343 RANLIB => add("-X64"),
1346 # SIEMENS BS2000/OSD: an EBCDIC-based mainframe
1348 inherit_from => [ "BASE_unix" ],
1351 cflags => "-XLLML -XLLMK -XL",
1352 cppflags => "-DCHARSET_EBCDIC",
1353 lib_cppflags => "-DB_ENDIAN",
1354 ex_libs => add("-lsocket -lnsl"),
1355 bn_ops => "THIRTY_TWO_BIT RC4_CHAR",
1356 thread_scheme => "(unknown)",
1359 #### Visual C targets
1361 # Win64 targets, WIN64I denotes IA-64/Itanium and WIN64A - AMD64
1363 # Note about /wd4090, disable warning C4090. This warning returns false
1364 # positives in some situations. Disabling it altogether masks both
1365 # legitimate and false cases, but as we compile on multiple platforms,
1366 # we rely on other compilers to catch legitimate cases.
1368 # Also note that we force threads no matter what. Configuring "no-threads"
1371 # UNICODE is defined in VC-common and applies to all targets. It used to
1372 # be an opt-in option for VC-WIN32, but not anymore. The original reason
1373 # was because ANSI API was *native* system interface for no longer
1374 # supported Windows 9x. Keep in mind that UNICODE only affects how
1375 # OpenSSL libraries interact with underlying OS, it doesn't affect API
1376 # that OpenSSL presents to application.
1379 inherit_from => [ "BASE_Windows" ],
1382 CPP => '$(CC) /EP /C',
1383 CFLAGS => "/W3 /wd4090 /nologo",
1386 LDFLAGS => "/nologo /debug",
1387 ldoutflag => "/out:",
1388 ldpostoutflag => "",
1389 ld_resp_delim => "\n",
1390 bin_lflags => "setargv.obj",
1391 makedepcmd => '$(CC) /Zs /showIncludes',
1392 makedep_scheme => 'VC',
1394 ARFLAGS => "/nologo",
1395 aroutflag => "/out:",
1396 ar_resp_delim => "\n",
1399 defines => add("OPENSSL_SYS_WIN32", "WIN32_LEAN_AND_MEAN",
1400 "UNICODE", "_UNICODE",
1401 "_CRT_SECURE_NO_DEPRECATE",
1402 "_WINSOCK_DEPRECATED_NO_WARNINGS"),
1403 lib_cflags => add("/Zi /Fdossl_static.pdb"),
1404 lib_defines => add("L_ENDIAN"),
1405 dso_cflags => "/Zi /Fddso.pdb",
1406 bin_cflags => "/Zi /Fdapp.pdb",
1407 # def_flag made to empty string so a .def file gets generated
1408 shared_defflag => '',
1409 shared_ldflag => "/dll",
1410 shared_target => "win-shared", # meaningless except it gives Configure a hint
1411 lddefflag => "/def:",
1413 ld_implib_flag => "/implib:",
1414 thread_scheme => "winthreads",
1415 dso_scheme => "win32",
1416 perl_platform => 'Windows::MSVC',
1417 # additional parameter to build_scheme denotes install-path "flavour"
1418 build_scheme => add("VC-common", { separator => undef }),
1420 "VC-noCE-common" => {
1421 inherit_from => [ "VC-common" ],
1423 CFLAGS => add(picker(debug => '/Od',
1425 cflags => add(picker(default => '/Gs0 /GF /Gy',
1428 ($disabled{shared} ? "" : "/MDd");
1432 ($disabled{shared} ? "" : "/MD");
1434 defines => add(picker(default => [], # works as type cast
1435 debug => [ "DEBUG", "_DEBUG" ])),
1436 lib_cflags => add(sub { $disabled{shared} ? "/MT /Zl" : () }),
1437 # Following might/should appears controversial, i.e. defining
1438 # /MDd without evaluating $disabled{shared}. It works in
1439 # non-shared build because static library is compiled with /Zl
1440 # and bares no reference to specific RTL. And it works in
1441 # shared build because multiple /MDd options are not prohibited.
1442 # But why /MDd in static build? Well, basically this is just a
1443 # reference point, which allows to catch eventual errors that
1444 # would prevent those who want to wrap OpenSSL into own .DLL.
1445 # Why not /MD in release build then? Well, some are likely to
1446 # prefer [non-debug] openssl.exe to be free from Micorosoft RTL
1448 bin_cflags => add(picker(debug => "/MDd",
1449 release => sub { $disabled{shared} ? "/MT" : () },
1451 bin_lflags => add("/subsystem:console /opt:ref"),
1452 ex_libs => add(sub {
1454 push @ex_libs, 'ws2_32.lib' unless $disabled{sock};
1455 push @ex_libs, 'gdi32.lib advapi32.lib crypt32.lib user32.lib';
1456 return join(" ", @ex_libs);
1459 "VC-WIN64-common" => {
1460 inherit_from => [ "VC-noCE-common" ],
1462 ex_libs => add(sub {
1464 push @ex_libs, 'bufferoverflowu.lib' if (`cl 2>&1` =~ /14\.00\.4[0-9]{4}\./);
1465 return join(" ", @_, @ex_libs);
1467 bn_ops => add("SIXTY_FOUR_BIT"),
1470 inherit_from => [ "VC-WIN64-common" ],
1472 ASFLAGS => "-d debug",
1475 uplink_arch => 'ia64',
1477 perlasm_scheme => "ias",
1478 multilib => "-ia64",
1481 inherit_from => [ "VC-WIN64-common" ],
1482 AS => sub { vc_win64a_info()->{AS} },
1483 ASFLAGS => sub { vc_win64a_info()->{ASFLAGS} },
1484 asoutflag => sub { vc_win64a_info()->{asoutflag} },
1485 asflags => sub { vc_win64a_info()->{asflags} },
1487 uplink_arch => 'x86_64',
1488 asm_arch => 'x86_64',
1489 perlasm_scheme => "auto",
1493 inherit_from => [ "VC-noCE-common" ],
1494 AS => sub { vc_win32_info()->{AS} },
1495 ASFLAGS => sub { vc_win32_info()->{ASFLAGS} },
1496 asoutflag => sub { vc_win32_info()->{asoutflag} },
1497 asflags => sub { vc_win32_info()->{asflags} },
1499 bn_ops => add("BN_LLONG"),
1500 uplink_arch => 'common',
1502 perlasm_scheme => sub { vc_win32_info()->{perlasm_scheme} },
1503 # "WOW" stands for "Windows on Windows", and "VC-WOW" engages
1504 # some installation path heuristics in windows-makefile.tmpl...
1505 build_scheme => add("VC-WOW", { separator => undef }),
1508 inherit_from => [ "VC-common" ],
1509 CFLAGS => add(picker(debug => "/Od",
1510 release => "/O1i")),
1511 CPPDEFINES => picker(debug => [ "DEBUG", "_DEBUG" ]),
1512 LDFLAGS => add("/nologo /opt:ref"),
1515 sub { vc_wince_info()->{cflags}; },
1516 sub { `cl 2>&1` =~ /Version ([0-9]+)\./ && $1>=14
1517 ? ($disabled{shared} ? " /MT" : " /MD")
1519 cppflags => sub { vc_wince_info()->{cppflags}; },
1520 lib_defines => add("NO_CHMOD", "OPENSSL_SMALL_FOOTPRINT"),
1521 lib_cppflags => sub { vc_wince_info()->{cppflags}; },
1523 add(combine(sub { defined(env('WCECOMPAT'))
1524 ? '$(WCECOMPAT)/include' : (); },
1525 sub { defined(env('PORTSDK_LIBPATH'))
1526 ? '$(PORTSDK_LIBPATH)/../../include'
1528 lflags => add(combine(sub { vc_wince_info()->{lflags}; },
1529 sub { defined(env('PORTSDK_LIBPATH'))
1530 ? "/entry:mainCRTstartup" : (); })),
1532 bn_ops => add("BN_LLONG"),
1533 ex_libs => add(sub {
1535 push @ex_libs, 'ws2.lib' unless $disabled{sock};
1536 push @ex_libs, 'crypt32.lib';
1537 if (defined(env('WCECOMPAT'))) {
1538 my $x = '$(WCECOMPAT)/lib';
1539 if (-f "$x/env('TARGETCPU')/wcecompatex.lib") {
1540 $x .= '/$(TARGETCPU)/wcecompatex.lib';
1542 $x .= '/wcecompatex.lib';
1546 push @ex_libs, '$(PORTSDK_LIBPATH)/portlib.lib'
1547 if (defined(env('PORTSDK_LIBPATH')));
1548 push @ex_libs, '/nodefaultlib coredll.lib corelibc.lib'
1549 if (env('TARGETCPU') =~ /^X86|^ARMV4[IT]/);
1550 return join(" ", @ex_libs);
1556 inherit_from => [ 'BASE_unix' ],
1559 CFLAGS => picker(default => "-Wall",
1562 cppflags => combine("-DUNICODE -D_UNICODE -DWIN32_LEAN_AND_MEAN",
1564 lib_cppflags => "-DL_ENDIAN",
1565 ex_libs => add("-lws2_32 -lgdi32 -lcrypt32"),
1566 thread_scheme => "winthreads",
1567 dso_scheme => "win32",
1568 shared_target => "mingw-shared",
1569 shared_cppflags => add("_WINDLL"),
1570 shared_ldflag => "-static-libgcc",
1572 perl_platform => 'mingw',
1575 inherit_from => [ "mingw-common" ],
1576 CFLAGS => add(picker(release => "-fomit-frame-pointer")),
1578 sys_id => "MINGW32",
1579 bn_ops => add("BN_LLONG"),
1581 uplink_arch => 'x86',
1582 perlasm_scheme => "coff",
1583 shared_rcflag => "--target=pe-i386",
1587 # As for uplink_arch. Applink makes it possible to use
1588 # .dll compiled with one compiler with application compiled with
1589 # another compiler. It's possible to engage Applink support in
1590 # mingw64 build, but it's not done, because until mingw64
1591 # supports structured exception handling, one can't seriously
1592 # consider its binaries for using with non-mingw64 run-time
1593 # environment. And as mingw64 is always consistent with itself,
1594 # Applink is never engaged and can as well be omitted.
1595 inherit_from => [ "mingw-common" ],
1597 sys_id => "MINGW64",
1598 bn_ops => add("SIXTY_FOUR_BIT"),
1599 asm_arch => 'x86_64',
1600 uplink_arch => undef,
1601 perlasm_scheme => "mingw64",
1602 shared_rcflag => "--target=pe-x86-64",
1608 inherit_from => [ "BASE_unix" ],
1611 lib_cppflags => "-DL_ENDIAN",
1615 inherit_from => [ "UEFI" ],
1617 perlasm_scheme => "win32n",
1620 inherit_from => [ "UEFI" ],
1621 asm_arch => 'x86_64',
1622 perlasm_scheme => "nasm",
1627 inherit_from => [ "BASE_unix" ],
1629 CFLAGS => "-O -Wall",
1630 lib_cppflags => "-DTERMIOS -DL_ENDIAN",
1632 bn_ops => "BN_LLONG",
1633 dso_scheme => "win32",
1637 "Cygwin-common" => {
1638 inherit_from => [ "BASE_unix" ],
1642 CFLAGS => picker(default => "-Wall",
1645 lib_cppflags => "-DTERMIOS -DL_ENDIAN",
1647 thread_scheme => "pthread",
1648 dso_scheme => "dlfcn",
1649 shared_target => "cygwin-shared",
1650 shared_cppflags => "-D_WINDLL",
1652 perl_platform => 'Cygwin',
1655 inherit_from => [ "Cygwin-common" ],
1656 CFLAGS => add(picker(release => "-O3 -fomit-frame-pointer")),
1657 bn_ops => "BN_LLONG",
1659 perlasm_scheme => "coff",
1661 "Cygwin-x86_64" => {
1662 inherit_from => [ "Cygwin-common" ],
1664 bn_ops => "SIXTY_FOUR_BIT_LONG",
1665 asm_arch => 'x86_64',
1666 perlasm_scheme => "mingw64",
1668 # Backward compatibility for those using this target
1670 inherit_from => [ "Cygwin-x86" ]
1672 # In case someone constructs the Cygwin target name themself
1674 inherit_from => [ "Cygwin-x86" ]
1677 inherit_from => [ "Cygwin-x86" ]
1680 inherit_from => [ "Cygwin-x86" ]
1683 inherit_from => [ "Cygwin-x86" ]
1686 ##### MacOS X (a.k.a. Darwin) setup
1687 "darwin-common" => {
1688 inherit_from => [ "BASE_unix" ],
1691 CFLAGS => picker(debug => "-g -O0",
1693 cppflags => threads("-D_REENTRANT"),
1694 lflags => add("-Wl,-search_paths_first"),
1696 bn_ops => "BN_LLONG RC4_CHAR",
1697 thread_scheme => "pthreads",
1698 perlasm_scheme => "osx32",
1699 dso_scheme => "dlfcn",
1700 ranlib => "ranlib -c",
1701 shared_target => "darwin-shared",
1702 shared_cflag => "-fPIC",
1703 shared_extension => ".\$(SHLIB_VERSION_NUMBER).dylib",
1705 # Option "freeze" such as -std=gnu9x can't negatively interfere
1706 # with future defaults for below two targets, because MacOS X
1707 # for PPC has no future, it was discontinued by vendor in 2009.
1708 "darwin-ppc-cc" => { inherit_from => [ "darwin-ppc" ] }, # Historic alias
1710 inherit_from => [ "darwin-common" ],
1711 cflags => add("-arch ppc -std=gnu9x -Wa,-force_cpusubtype_ALL"),
1712 lib_cppflags => add("-DB_ENDIAN"),
1713 shared_cflag => add("-fno-common"),
1714 asm_arch => 'ppc32',
1715 perlasm_scheme => "osx32",
1717 "darwin64-ppc-cc" => { inherit_from => [ "darwin64-ppc" ] }, # Historic alias
1719 inherit_from => [ "darwin-common" ],
1720 cflags => add("-arch ppc64 -std=gnu9x"),
1721 lib_cppflags => add("-DB_ENDIAN"),
1722 bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
1723 asm_arch => 'ppc64',
1724 perlasm_scheme => "osx64",
1726 "darwin-i386-cc" => { inherit_from => [ "darwin-i386" ] }, # Historic alias
1728 inherit_from => [ "darwin-common" ],
1729 CFLAGS => add(picker(release => "-fomit-frame-pointer")),
1730 cflags => add("-arch i386"),
1731 lib_cppflags => add("-DL_ENDIAN"),
1732 bn_ops => "BN_LLONG RC4_INT",
1734 perlasm_scheme => "macosx",
1736 "darwin64-x86_64-cc" => { inherit_from => [ "darwin64-x86_64" ] }, # Historic alias
1737 "darwin64-x86_64" => {
1738 inherit_from => [ "darwin-common" ],
1739 CFLAGS => add("-Wall"),
1740 cflags => add("-arch x86_64"),
1741 lib_cppflags => add("-DL_ENDIAN"),
1742 bn_ops => "SIXTY_FOUR_BIT_LONG",
1743 asm_arch => 'x86_64',
1744 perlasm_scheme => "macosx",
1746 "darwin64-arm64-cc" => { inherit_from => [ "darwin64-arm64" ] }, # "Historic" alias
1747 "darwin64-arm64" => {
1748 inherit_from => [ "darwin-common" ],
1749 CFLAGS => add("-Wall"),
1750 cflags => add("-arch arm64"),
1751 lib_cppflags => add("-DL_ENDIAN"),
1752 bn_ops => "SIXTY_FOUR_BIT_LONG",
1753 asm_arch => 'aarch64',
1754 perlasm_scheme => "ios64",
1759 inherit_from => [ "BASE_unix" ],
1761 CFLAGS => "-O3 -fomit-frame-pointer -Wall",
1762 cflags => threads("-pthread"),
1763 lib_cppflags => "-DL_ENDIAN",
1764 ex_libs => add("-ldl", threads("-pthread")),
1765 bn_ops => "BN_LLONG",
1767 perlasm_scheme => 'elf',
1768 thread_scheme => "pthreads",
1769 dso_scheme => "dlfcn",
1770 shared_target => "linux-shared",
1771 shared_cflag => "-fPIC",
1774 ##### VxWorks for various targets
1775 "vxworks-ppc60x" => {
1776 inherit_from => [ "BASE_unix" ],
1778 CFLAGS => "-O2 -Wall -fstrength-reduce",
1779 cflags => "-mrtp -mhard-float -mstrict-align -fno-implicit-fp -fno-builtin -fno-strict-aliasing",
1780 cppflags => combine("-D_REENTRANT -DPPC32_fp60x -DCPU=PPC32",
1781 "_DTOOL_FAMILY=gnu -DTOOL=gnu",
1782 "-I\$(WIND_BASE)/target/usr/h",
1783 "-I\$(WIND_BASE)/target/usr/h/wrn/coreip"),
1784 sys_id => "VXWORKS",
1785 lflags => add("-L \$(WIND_BASE)/target/usr/lib/ppc/PPC32/common"),
1786 ex_libs => add("-Wl,--defsym,__wrs_rtp_base=0xe0000000"),
1788 "vxworks-ppcgen" => {
1789 inherit_from => [ "BASE_unix" ],
1791 CFLAGS => "-O1 -Wall",
1792 cflags => "-mrtp -msoft-float -mstrict-align -fno-builtin -fno-strict-aliasing",
1793 cppflags => combine("-D_REENTRANT -DPPC32 -DCPU=PPC32",
1794 "-DTOOL_FAMILY=gnu -DTOOL=gnu",
1795 "-I\$(WIND_BASE)/target/usr/h",
1796 "-I\$(WIND_BASE)/target/usr/h/wrn/coreip"),
1797 sys_id => "VXWORKS",
1798 lflags => add("-L \$(WIND_BASE)/target/usr/lib/ppc/PPC32/sfcommon"),
1799 ex_libs => add("-Wl,--defsym,__wrs_rtp_base=0xe0000000"),
1801 "vxworks-ppc405" => {
1802 inherit_from => [ "BASE_unix" ],
1805 cflags => "-msoft-float -mlongcall",
1806 cppflags => combine("-D_REENTRANT -DPPC32 -DCPU=PPC405",
1807 "-DTOOL_FAMILY=gnu -DTOOL=gnu",
1808 "-I\$(WIND_BASE)/target/h"),
1809 sys_id => "VXWORKS",
1810 lflags => add("-r"),
1812 "vxworks-ppc750" => {
1813 inherit_from => [ "BASE_unix" ],
1815 CFLAGS => "-ansi -fvolatile -Wall \$(DEBUG_FLAG)",
1816 cflags => "-nostdinc -fno-builtin -fno-for-scope -fsigned-char -msoft-float -mlongcall",
1817 cppflags => combine("-DPPC750 -D_REENTRANT -DCPU=PPC604",
1818 "-I\$(WIND_BASE)/target/h"),
1819 sys_id => "VXWORKS",
1820 lflags => add("-r"),
1822 "vxworks-ppc750-debug" => {
1823 inherit_from => [ "BASE_unix" ],
1825 CFLAGS => "-ansi -fvolatile -Wall -g",
1826 cflags => "-nostdinc -fno-builtin -fno-for-scope -fsigned-char -msoft-float -mlongcall",
1827 cppflags => combine("-DPPC750 -D_REENTRANT -DCPU=PPC604",
1828 "-DPEDANTIC -DDEBUG",
1829 "-I\$(WIND_BASE)/target/h"),
1830 sys_id => "VXWORKS",
1831 lflags => add("-r"),
1833 "vxworks-ppc860" => {
1834 inherit_from => [ "BASE_unix" ],
1836 cflags => "-nostdinc -msoft-float",
1837 cppflags => combine("-DCPU=PPC860 -DNO_STRINGS_H",
1838 "-I\$(WIND_BASE)/target/h"),
1839 sys_id => "VXWORKS",
1840 lflags => add("-r"),
1842 "vxworks-simlinux" => {
1843 inherit_from => [ "BASE_unix" ],
1845 cflags => "-B\$(WIND_BASE)/host/\$(WIND_HOST_TYPE)/lib/gcc-lib/ -fno-builtin -fno-defer-pop",
1846 cppflags => combine("-D_VSB_CONFIG_FILE=\"\$(WIND_BASE)/target/lib/h/config/vsbConfig.h\"",
1847 "-DL_ENDIAN -DCPU=SIMLINUX -DNO_STRINGS_H",
1848 "-DTOOL_FAMILY=gnu -DTOOL=gnu",
1849 "-DOPENSSL_NO_HW_PADLOCK",
1850 "-I\$(WIND_BASE)/target/h",
1851 "-I\$(WIND_BASE)/target/h/wrn/coreip"),
1852 sys_id => "VXWORKS",
1853 lflags => add("-r"),
1854 ranlib => "ranlibpentium",
1857 inherit_from => [ "BASE_unix" ],
1859 CFLAGS => "-O -G 0",
1860 cflags => "-mrtp -mips2 -B\$(WIND_BASE)/host/\$(WIND_HOST_TYPE)/lib/gcc-lib/ -msoft-float -mno-branch-likely -fno-builtin -fno-defer-pop",
1861 cppflags => combine("-D_VSB_CONFIG_FILE=\"\$(WIND_BASE)/target/lib/h/config/vsbConfig.h\"",
1862 "-DCPU=MIPS32 -DNO_STRINGS_H",
1863 "-DTOOL_FAMILY=gnu -DTOOL=gnu",
1864 "-DOPENSSL_NO_HW_PADLOCK",
1865 threads("-D_REENTRANT"),
1866 "-I\$(WIND_BASE)/target/h",
1867 "-I\$(WIND_BASE)/target/h/wrn/coreip"),
1868 sys_id => "VXWORKS",
1869 lflags => add("-L \$(WIND_BASE)/target/usr/lib/mips/MIPSI32/sfcommon"),
1870 ex_libs => add("-Wl,--defsym,__wrs_rtp_base=0xe0000000"),
1871 thread_scheme => "pthreads",
1872 asm_arch => 'mips32',
1873 perlasm_scheme => "o32",
1874 ranlib => "ranlibmips",
1879 inherit_from => [ "BASE_unix" ],
1880 CC => sub { env('CC') },
1881 cppflags => threads("-D_REENTRANT"),
1882 ex_libs => add("\$(LDLIBS)"),
1883 bn_ops => "BN_LLONG",
1884 thread_scheme => "pthreads",
1885 dso_scheme => sub { env('LIBSSL_dlfcn') },
1886 shared_target => "linux-shared",
1887 shared_cflag => "-fPIC",
1888 ranlib => sub { env('RANLIB') },
1890 "uClinux-dist64" => {
1891 inherit_from => [ "BASE_unix" ],
1892 CC => sub { env('CC') },
1893 cppflags => threads("-D_REENTRANT"),
1894 ex_libs => add("\$(LDLIBS)"),
1895 bn_ops => "SIXTY_FOUR_BIT_LONG",
1896 thread_scheme => "pthreads",
1897 dso_scheme => sub { env('LIBSSL_dlfcn') },
1898 shared_target => "linux-shared",
1899 shared_cflag => "-fPIC",
1900 ranlib => sub { env('RANLIB') },
1904 # Most things happen in vms-generic.
1905 # Note that vms_info extracts the pointer size from the end of
1906 # the target name, and will assume that anything matching /-p\d+$/
1907 # indicates the pointer size setting for the desired target.
1909 inherit_from => [ "BASE_VMS" ],
1912 CPP => '$(CC)/PREPROCESS_ONLY=SYS$OUTPUT:',
1914 combine(picker(default => "/STANDARD=(ISOC94,RELAXED)/NOLIST/PREFIX=ALL",
1915 debug => "/NOOPTIMIZE/DEBUG",
1916 release => "/OPTIMIZE/NODEBUG"),
1917 sub { my @warnings =
1918 @{vms_info()->{disable_warns}};
1920 ? "/WARNINGS=DISABLE=(".join(",",@warnings).")" : (); }),
1921 cflag_incfirst => '/FIRST_INCLUDE=',
1923 add("OPENSSL_USE_NODELETE",
1925 return vms_info()->{def_zlib}
1926 ? "LIBZ=\"\"\"".vms_info()->{def_zlib}."\"\"\"" : ();
1928 lflags => picker(default => "/MAP='F\$PARSE(\".MAP\",\"\$\@\")'",
1929 debug => "/DEBUG/TRACEBACK",
1930 release => "/NODEBUG/NOTRACEBACK"),
1931 # Because of dso_cflags below, we can't set the generic |cflags| here,
1932 # as it can't be overridden, so we set separate C flags for libraries
1933 # and binaries instead.
1934 bin_cflags => add("/NAMES=(AS_IS,SHORTENED)/EXTERN_MODEL=STRICT_REFDEF"),
1935 lib_cflags => add("/NAMES=(AS_IS,SHORTENED)/EXTERN_MODEL=STRICT_REFDEF"),
1936 # Strictly speaking, DSOs should not need to have name shortening,
1937 # as all their exported symbols should be short enough to fit the
1938 # linker's 31 character per symbol name limit. However, providers
1939 # may be composed of more than one object file, and internal symbols
1940 # may and do surpass the 31 character limit.
1941 dso_cflags => add("/NAMES=(SHORTENED)"),
1942 ex_libs => add(sub { return vms_info()->{zlib} || (); }),
1943 shared_target => "vms-shared",
1944 # def_flag made to empty string so a .opt file gets generated
1945 shared_defflag => '',
1946 dso_scheme => "vms",
1947 thread_scheme => "pthreads",
1949 makedep_scheme => 'VMS C',
1950 AS => sub { vms_info()->{AS} },
1951 ASFLAGS => sub { vms_info()->{ASFLAGS} },
1952 asoutflag => sub { vms_info()->{asoutflag} },
1953 asflags => sub { vms_info()->{asflags} },
1954 perlasm_scheme => sub { vms_info()->{perlasm_scheme} },
1956 disable => add('pinshared', 'loadereng'),
1960 # From HELP CC/POINTER_SIZE:
1963 # LONG[=ARGV] The compiler assumes 64-bit pointers. If the ARGV option to
1964 # LONG or 64 is present, the main argument argv will be an
1965 # array of long pointers instead of an array of short pointers.
1967 # 64[=ARGV] Same as LONG.
1970 # We don't want the hassle of dealing with 32-bit pointers with argv, so
1971 # we force it to have 64-bit pointers, see the added cflags in the -p64
1972 # config targets below.
1975 inherit_from => [ "vms-generic" ],
1976 bn_ops => "SIXTY_FOUR_BIT RC4_INT",
1979 "vms-alpha-p32" => {
1980 inherit_from => [ "vms-alpha" ],
1981 cflags => add("/POINTER_SIZE=32"),
1982 pointer_size => "32",
1984 "vms-alpha-p64" => {
1985 inherit_from => [ "vms-alpha" ],
1986 cflags => add("/POINTER_SIZE=64=ARGV"),
1987 pointer_size => "64",
1990 inherit_from => [ "vms-generic" ],
1991 bn_ops => "SIXTY_FOUR_BIT RC4_INT",
1992 asm_arch => sub { vms_info()->{AS} ? 'ia64' : undef },
1993 perlasm_scheme => 'ias',
1998 inherit_from => [ "vms-ia64" ],
1999 cflags => add("/POINTER_SIZE=32"),
2000 pointer_size => "32",
2003 inherit_from => [ "vms-ia64" ],
2004 cflags => add("/POINTER_SIZE=64=ARGV"),
2005 pointer_size => "64",