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 $vms_info->{pointer_size} = $pointer_size_str;
139 if ($pointer_size_str eq "64") {
140 `PIPE CC /NOCROSS_REFERENCE /NOLIST /NOOBJECT /WARNINGS = DISABLE = ( MAYLOSEDATA3, EMPTYFILE ) NL: 2> NL:`;
142 push @{$vms_info->{disable_warns}}, "MAYLOSEDATA3";
146 unless ($disabled{zlib}) {
147 my $default_zlib = 'GNV$LIBZSHR' . $pointer_size_str;
148 if (defined($disabled{"zlib-dynamic"})) {
149 $vms_info->{zlib} = $withargs{zlib_lib} || "$default_zlib/SHARE";
151 $vms_info->{def_zlib} = $withargs{zlib_lib} || $default_zlib;
152 # In case the --with-zlib-lib value contains something like
153 # /SHARE or /LIB or so at the end, remove it.
154 $vms_info->{def_zlib} =~ s|/.*$||g;
158 if ($config{target} =~ /-ia64/) {
159 `PIPE ias -H 2> NL:`;
161 $vms_info->{AS} = "ias";
162 $vms_info->{ASFLAGS} = '-d debug';
163 $vms_info->{asflags} = '"-N" vms_upcase';
164 $vms_info->{asoutflag} = "-o ";
165 $vms_info->{perlasm_scheme} = "ias";
174 #### Basic configs that should work on any 32-bit box
176 inherit_from => [ "BASE_unix" ],
178 CFLAGS => picker(debug => "-O0 -g",
180 thread_scheme => "(unknown)",
181 bn_ops => "BN_LLONG",
184 inherit_from => [ "BASE_unix" ],
187 thread_scheme => "(unknown)",
190 #### VOS Configurations
192 inherit_from => [ "BASE_unix" ],
194 CFLAGS => picker(default => "-Wall",
197 cppflags => "-D_POSIX_C_SOURCE=200112L -D_BSD -D_VOS_EXTENDED_NAMES",
198 lib_cppflags => "-DB_ENDIAN",
199 thread_scheme => "(unknown)",
201 lflags => add("-Wl,-map"),
202 bn_ops => "BN_LLONG",
203 shared_extension => ".so",
206 #### Solaris configurations
207 "solaris-common" => {
208 inherit_from => [ "BASE_unix" ],
210 lib_cppflags => "-DFILIO_H",
211 ex_libs => add("-lsocket -lnsl -ldl"),
212 dso_scheme => "dlfcn",
213 thread_scheme => "pthreads",
214 shared_target => "solaris",
215 shared_ldflag => "-Wl,-Bsymbolic",
216 shared_defflag => "-Wl,-M,",
217 shared_sonameflag=> "-Wl,-h,",
219 #### Solaris x86 with GNU C setups
220 "solaris-x86-gcc" => {
221 # NB. GNU C has to be configured to use GNU assembler, and not
222 # /usr/ccs/bin/as. Failure to comply will result in compile
223 # failures [at least] in 32-bit build.
224 inherit_from => [ "solaris-common" ],
226 CFLAGS => add_before(picker(default => "-Wall",
228 release => "-O3 -fomit-frame-pointer")),
229 cflags => add(threads("-pthread")),
230 lib_cppflags => add("-DL_ENDIAN"),
231 ex_libs => add(threads("-pthread")),
232 bn_ops => "BN_LLONG",
233 shared_cflag => "-fPIC",
234 shared_ldflag => add_before("-shared -static-libgcc"),
236 perlasm_scheme => 'elf',
238 "solaris64-x86_64-gcc" => {
239 # -shared -static-libgcc might appear controversial, but modules
240 # taken from static libgcc do not have relocations and linking
241 # them into our shared objects doesn't have any negative side
242 # effects. On the contrary, doing so makes it possible to use
243 # gcc shared build with Sun C. Given that gcc generates faster
244 # code [thanks to inline assembler], I would actually recommend
245 # to consider using gcc shared build even with vendor compiler:-)
246 # -- <appro@openssl.org>
247 inherit_from => [ "solaris-common" ],
249 CFLAGS => add_before(picker(default => "-Wall",
252 cflags => add_before("-m64", threads("-pthread")),
253 lib_cppflags => add("-DL_ENDIAN"),
254 ex_libs => add(threads("-pthread")),
255 bn_ops => "SIXTY_FOUR_BIT_LONG",
256 asm_arch => 'x86_64',
257 perlasm_scheme => "elf",
258 shared_cflag => "-fPIC",
259 shared_ldflag => add_before("-shared -static-libgcc"),
263 #### Solaris x86 with Sun C setups
264 # There used to be solaris-x86-cc target, but it was removed,
265 # primarily because vendor assembler can't assemble our modules
266 # with -KPIC flag. As result it, assembly support, was not even
267 # available as option. But its lack means lack of side-channel
268 # resistant code, which is incompatible with security by todays
269 # standards. Fortunately gcc is readily available prepackaged
270 # option, which we can firmly point at...
272 # On related note, solaris64-x86_64-cc target won't compile code
273 # paths utilizing AVX and post-Haswell instruction extensions.
274 # Consider switching to solaris64-x86_64-gcc even here...
276 "solaris64-x86_64-cc" => {
277 inherit_from => [ "solaris-common" ],
279 CFLAGS => add_before(picker(debug => "-g",
280 release => "-xO5 -xdepend -xbuiltin")),
281 cflags => add_before("-xarch=generic64 -xstrconst -Xa"),
282 cppflags => add(threads("-D_REENTRANT")),
283 lib_cppflags => add("-DL_ENDIAN"),
284 thread_scheme => "pthreads",
285 lflags => add(threads("-mt")),
286 ex_libs => add(threads("-lpthread")),
287 bn_ops => "SIXTY_FOUR_BIT_LONG",
288 asm_arch => 'x86_64',
289 perlasm_scheme => "elf",
290 shared_cflag => "-KPIC",
291 shared_ldflag => add_before("-G -dy -z text"),
295 #### SPARC Solaris with GNU C setups
296 "solaris-sparcv7-gcc" => {
297 inherit_from => [ "solaris-common" ],
299 CFLAGS => add_before(picker(default => "-Wall",
302 cflags => add(threads("-pthread")),
303 lib_cppflags => add("-DB_ENDIAN -DBN_DIV2W"),
304 ex_libs => add(threads("-pthread")),
305 bn_ops => "BN_LLONG RC4_CHAR",
306 shared_cflag => "-fPIC",
307 shared_ldflag => add_before("-shared"),
309 "solaris-sparcv8-gcc" => {
310 inherit_from => [ "solaris-sparcv7-gcc" ],
311 cflags => add_before("-mcpu=v8"),
312 asm_arch => 'sparcv8',
313 perlasm_scheme => 'void',
315 "solaris-sparcv9-gcc" => {
316 # -m32 should be safe to add as long as driver recognizes
318 inherit_from => [ "solaris-sparcv7-gcc" ],
319 cflags => add_before("-m32 -mcpu=ultrasparc"),
320 asm_arch => 'sparcv9',
321 perlasm_scheme => 'void',
323 "solaris64-sparcv9-gcc" => {
324 inherit_from => [ "solaris-sparcv9-gcc" ],
325 cflags => sub { my $f=join(" ",@_); $f =~ s/\-m32/-m64/; $f; },
326 bn_ops => "BN_LLONG RC4_CHAR",
330 #### SPARC Solaris with Sun C setups
331 # SC4.0 doesn't pass 'make test', upgrade to SC5.0 or SC4.2.
332 # SC4.2 is ok, better than gcc even on bn as long as you tell it -xarch=v8
333 # SC5.0 note: Compiler common patch 107357-01 or later is required!
334 "solaris-sparcv7-cc" => {
335 inherit_from => [ "solaris-common" ],
337 CFLAGS => add_before(picker(debug => "-g",
338 release => "-xO5 -xdepend")),
339 cflags => add_before("-xstrconst -Xa"),
340 cppflags => add(threads("-D_REENTRANT")),
341 lib_cppflags => add("-DB_ENDIAN -DBN_DIV2W"),
342 lflags => add(threads("-mt")),
343 ex_libs => add(threads("-lpthread")),
344 bn_ops => "BN_LLONG RC4_CHAR",
345 shared_cflag => "-KPIC",
346 shared_ldflag => add_before("-G -dy -z text"),
349 "solaris-sparcv8-cc" => {
350 inherit_from => [ "solaris-sparcv7-cc" ],
351 cflags => add_before("-xarch=v8"),
352 asm_arch => 'sparcv8',
353 perlasm_scheme => 'void',
355 "solaris-sparcv9-cc" => {
356 inherit_from => [ "solaris-sparcv7-cc" ],
357 cflags => add_before("-xarch=v8plus"),
358 asm_arch => 'sparcv9',
359 perlasm_scheme => 'void',
361 "solaris64-sparcv9-cc" => {
362 inherit_from => [ "solaris-sparcv7-cc" ],
363 cflags => add_before("-xarch=v9"),
364 bn_ops => "BN_LLONG RC4_CHAR",
365 asm_arch => 'sparcv9',
366 perlasm_scheme => 'void',
370 #### IRIX 6.x configs
371 # Only N32 and N64 ABIs are supported.
373 inherit_from => [ "BASE_unix" ],
375 cppflags => threads("-D_SGI_MP_SOURCE"),
376 lib_cppflags => "-DB_ENDIAN",
377 ex_libs => add(threads("-lpthread")),
378 thread_scheme => "pthreads",
379 dso_scheme => "dlfcn",
380 shared_target => "self",
381 shared_ldflag => "-shared -Wl,-Bsymbolic",
382 shared_sonameflag=> "-Wl,-soname,",
384 "irix-mips3-gcc" => {
385 inherit_from => [ "irix-common" ],
387 CFLAGS => picker(debug => "-g -O0",
389 LDFLAGS => "-static-libgcc",
390 cflags => "-mabi=n32",
391 bn_ops => "RC4_CHAR SIXTY_FOUR_BIT",
392 asm_arch => 'mips64',
393 perlasm_scheme => "n32",
397 inherit_from => [ "irix-common" ],
399 CFLAGS => picker(debug => "-g -O0",
401 cflags => "-n32 -mips3 -use_readonly_const -G0 -rdata_shared",
402 bn_ops => "RC4_CHAR SIXTY_FOUR_BIT",
403 asm_arch => 'mips64',
404 perlasm_scheme => "n32",
408 "irix64-mips4-gcc" => {
409 inherit_from => [ "irix-common" ],
411 CFLAGS => picker(debug => "-g -O0",
413 LDFLAGS => "-static-libgcc",
414 cflags => "-mabi=64 -mips4",
415 bn_ops => "RC4_CHAR SIXTY_FOUR_BIT_LONG",
416 asm_arch => 'mips64',
417 perlasm_scheme => "64",
420 "irix64-mips4-cc" => {
421 inherit_from => [ "irix-common" ],
423 CFLAGS => picker(debug => "-g -O0",
425 cflags => "-64 -mips4 -use_readonly_const -G0 -rdata_shared",
426 bn_ops => "RC4_CHAR SIXTY_FOUR_BIT_LONG",
427 asm_arch => 'mips64',
428 perlasm_scheme => "64",
432 #### Unified HP-UX ANSI C configs.
434 # - Originally we were optimizing at +O4 level. It should be noted
435 # that the only difference between +O3 and +O4 is global inter-
436 # procedural analysis. As it has to be performed during the link
437 # stage the compiler leaves behind certain pseudo-code in lib*.a
438 # which might be release or even patch level specific. Generating
439 # the machine code for and analyzing the *whole* program appears
440 # to be *extremely* memory demanding while the performance gain is
441 # actually questionable. The situation is intensified by the default
442 # HP-UX data set size limit (infamous 'maxdsiz' tunable) of 64MB
443 # which is way too low for +O4. In other words, doesn't +O3 make
445 # - Keep in mind that the HP compiler by default generates code
446 # suitable for execution on the host you're currently compiling at.
447 # If the toolkit is meant to be used on various PA-RISC processors
448 # consider './Configure hpux-parisc-[g]cc +DAportable'.
449 # - -DMD32_XARRAY triggers workaround for compiler bug we ran into in
450 # 32-bit message digests. (For the moment of this writing) HP C
451 # doesn't seem to "digest" too many local variables (they make "him"
452 # chew forever:-). For more details look-up MD32_XARRAY comment in
453 # crypto/sha/sha_lcl.h.
454 # - originally there were 32-bit hpux-parisc2-* targets. They were
455 # scrapped, because a) they were not interchangeable with other 32-bit
456 # targets; b) performance-critical 32-bit assembly modules implement
457 # even PA-RISC 2.0-specific code paths, which are chosen at run-time,
458 # thus adequate performance is provided even with PA-RISC 1.1 build.
460 inherit_from => [ "BASE_unix" ],
462 defines => add("_XOPEN_SOURCE", "_XOPEN_SOURCE_EXTENDED",
463 "_HPUX_ALT_XOPEN_SOCKET_API"),
464 lib_cppflags => "-DB_ENDIAN",
465 thread_scheme => "pthreads",
466 dso_scheme => "dlfcn", # overridden in 32-bit PA-RISC builds
467 shared_target => "self",
468 bin_lflags => "-Wl,+s,+cdp,../:,+cdp,./:",
469 shared_ldflag => "-Wl,-B,symbolic,+vnocompatwarnings,-z,+s,+cdp,../:,+cdp,./:",
470 shared_sonameflag=> "-Wl,+h,",
472 "hpux-parisc-gcc" => {
473 inherit_from => [ "hpux-common" ],
475 CFLAGS => picker(debug => "-O0 -g",
477 cflags => add(threads("-pthread")),
478 lib_cppflags => add("-DBN_DIV2W"),
479 ex_libs => add("-ldld", threads("-pthread")),
480 bn_ops => "BN_LLONG RC4_CHAR",
482 shared_cflag => "-fPIC",
483 shared_ldflag => add_before("-shared"),
484 shared_extension => ".sl.\$(SHLIB_VERSION_NUMBER)",
486 "hpux-parisc1_1-gcc" => {
487 inherit_from => [ "hpux-parisc-gcc" ],
488 asm_arch => 'parisc11',
489 perlasm_scheme => "32",
490 multilib => "/pa1.1",
492 "hpux64-parisc2-gcc" => {
493 inherit_from => [ "hpux-common" ],
495 CFLAGS => combine(picker(debug => "-O0 -g",
497 cflags => add(threads("-pthread")),
498 ex_libs => add("-ldl", threads("-pthread")),
499 bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
500 asm_arch => 'parisc20_64',
501 perlasm_scheme => "64",
502 shared_cflag => "-fpic",
503 shared_ldflag => add_before("-shared"),
504 shared_extension => ".sl.\$(SHLIB_VERSION_NUMBER)",
505 multilib => "/pa20_64",
508 # More attempts at unified 10.X and 11.X targets for HP C compiler.
509 "hpux-parisc-cc" => {
510 inherit_from => [ "hpux-common" ],
512 CFLAGS => picker(debug => "+O0 +d -g",
514 cflags => "+Optrs_strongly_typed -Ae +ESlit",
515 cppflags => threads("-D_REENTRANT"),
516 lib_cppflags => add("-DBN_DIV2W -DMD32_XARRAY"),
517 ex_libs => add("-ldld", threads("-lpthread")),
518 bn_ops => "RC4_CHAR",
520 shared_cflag => "+Z",
521 shared_ldflag => add_before("-b"),
522 shared_extension => ".sl.\$(SHLIB_VERSION_NUMBER)",
524 "hpux-parisc1_1-cc" => {
525 inherit_from => [ "hpux-parisc-cc" ],
526 cflags => add_before("+DA1.1"),
527 asm_arch => 'parisc11',
528 perlasm_scheme => "32",
529 multilib => "/pa1.1",
531 "hpux64-parisc2-cc" => {
532 inherit_from => [ "hpux-common" ],
534 CFLAGS => picker(debug => "+O0 +d -g",
536 cflags => "+DD64 +Optrs_strongly_typed -Ae +ESlit",
537 cppflags => threads("-D_REENTRANT") ,
538 lib_cppflags => add("-DMD32_XARRAY"),
539 ex_libs => add("-ldl", threads("-lpthread")),
540 bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
541 asm_arch => 'parisc20_64',
542 perlasm_scheme => "64",
543 shared_cflag => "+Z",
544 shared_ldflag => add_before("-b"),
545 shared_extension => ".sl.\$(SHLIB_VERSION_NUMBER)",
546 multilib => "/pa20_64",
549 # HP/UX IA-64 targets
551 inherit_from => [ "hpux-common" ],
553 CFLAGS => picker(debug => "+O0 +d -g",
555 cflags => "-Ae +DD32 +Olit=all -z",
556 cppflags => add(threads("-D_REENTRANT")),
557 ex_libs => add("-ldl", threads("-lpthread")),
558 bn_ops => "SIXTY_FOUR_BIT",
560 perlasm_scheme => 'void',
561 shared_cflag => "+Z",
562 shared_ldflag => add_before("-b"),
563 multilib => "/hpux32",
565 "hpux64-ia64-cc" => {
566 inherit_from => [ "hpux-common" ],
568 CFLAGS => picker(debug => "+O0 +d -g",
570 cflags => "-Ae +DD64 +Olit=all -z",
571 cppflags => threads("-D_REENTRANT"),
572 ex_libs => add("-ldl", threads("-lpthread")),
573 bn_ops => "SIXTY_FOUR_BIT_LONG",
575 perlasm_scheme => 'void',
576 shared_cflag => "+Z",
577 shared_ldflag => add_before("-b"),
578 multilib => "/hpux64",
582 inherit_from => [ "hpux-common" ],
584 CFLAGS => picker(debug => "-O0 -g",
586 cflags => add(threads("-pthread")),
587 ex_libs => add("-ldl", threads("-pthread")),
588 bn_ops => "SIXTY_FOUR_BIT",
590 perlasm_scheme => 'void',
591 shared_cflag => "-fpic",
592 shared_ldflag => add_before("-shared"),
593 multilib => "/hpux32",
595 "hpux64-ia64-gcc" => {
596 inherit_from => [ "hpux-common" ],
598 CFLAGS => picker(debug => "-O0 -g",
600 cflags => combine("-mlp64", threads("-pthread")),
601 ex_libs => add("-ldl", threads("-pthread")),
602 bn_ops => "SIXTY_FOUR_BIT_LONG",
604 perlasm_scheme => 'void',
605 shared_cflag => "-fpic",
606 shared_ldflag => add_before("-shared"),
607 multilib => "/hpux64",
610 #### HP MPE/iX http://jazz.external.hp.com/src/openssl/
612 inherit_from => [ "BASE_unix" ],
615 cppflags => "-D_POSIX_SOURCE -D_SOCKET_SOURCE",
616 includes => [ "/SYSLOG/PUB" ],
617 lib_cppflags => "-DBN_DIV2W",
619 lflags => add("-L/SYSLOG/PUB"),
620 ex_libs => add("-lsyslog -lsocket -lcurses"),
621 thread_scheme => "(unknown)",
622 bn_ops => "BN_LLONG",
625 #### DEC Alpha Tru64 targets. Tru64 is marketing name for OSF/1 version 4
626 #### and forward. In reality 'uname -s' still returns "OSF1". Originally
627 #### there were even osf1-* configs targeting prior versions provided,
628 #### but not anymore...
629 "tru64-alpha-gcc" => {
630 inherit_from => [ "BASE_unix" ],
633 cflags => add("-std=c9x", threads("-pthread")),
634 cppflags => "-D_XOPEN_SOURCE=500 -D_OSF_SOURCE",
635 ex_libs => add("-lrt", threads("-pthread")), # for mlock(2)
636 bn_ops => "SIXTY_FOUR_BIT_LONG",
638 perlasm_scheme => "void",
639 thread_scheme => "pthreads",
640 dso_scheme => "dlfcn",
641 shared_target => "alpha-osf1-shared",
642 shared_extension => ".so",
644 "tru64-alpha-cc" => {
645 inherit_from => [ "BASE_unix" ],
647 CFLAGS => "-tune host -fast",
648 cflags => add("-std1 -readonly_strings",
649 threads("-pthread")),
650 cppflags => "-D_XOPEN_SOURCE=500 -D_OSF_SOURCE",
651 ex_libs => add("-lrt", threads("-pthread")), # for mlock(2)
652 bn_ops => "SIXTY_FOUR_BIT_LONG",
654 perlasm_scheme => "void",
655 thread_scheme => "pthreads",
656 dso_scheme => "dlfcn",
657 shared_target => "alpha-osf1-shared",
658 shared_ldflag => "-msym",
659 shared_extension => ".so",
663 #### Variety of LINUX:-)
665 # *-generic* is endian-neutral target, but ./config is free to
666 # throw in -D[BL]_ENDIAN, whichever appropriate...
667 "linux-generic32" => {
668 inherit_from => [ "BASE_unix" ],
671 CFLAGS => picker(default => "-Wall",
674 CXXFLAGS => picker(default => "-Wall",
677 cflags => threads("-pthread"),
678 cxxflags => combine("-std=c++11", threads("-pthread")),
679 lib_cppflags => "-DOPENSSL_USE_NODELETE",
680 ex_libs => add("-ldl", threads("-pthread")),
681 bn_ops => "BN_LLONG RC4_CHAR",
682 thread_scheme => "pthreads",
683 dso_scheme => "dlfcn",
684 shared_target => "linux-shared",
685 shared_cflag => "-fPIC",
686 shared_ldflag => sub { $disabled{pinshared} ? () : "-Wl,-znodelete" },
687 enable => [ "afalgeng" ],
689 "linux-generic64" => {
690 inherit_from => [ "linux-generic32" ],
691 bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
695 inherit_from => [ "linux-generic32" ],
697 perlasm_scheme => "linux32",
700 inherit_from => [ "linux-generic64" ],
701 cflags => add("-m64"),
702 cxxflags => add("-m64"),
703 lib_cppflags => add("-DB_ENDIAN"),
705 perlasm_scheme => "linux64",
709 inherit_from => [ "linux-generic64" ],
710 cflags => add("-m64"),
711 cxxflags => add("-m64"),
712 lib_cppflags => add("-DL_ENDIAN"),
714 perlasm_scheme => "linux64le",
718 ################################################################
719 # Note that -march is not among compiler options in linux-armv4
720 # target description. Not specifying one is intentional to give
723 # a) rely on your compiler default by not specifying one;
724 # b) specify your target platform explicitly for optimal
725 # performance, e.g. -march=armv6 or -march=armv7-a;
726 # c) build "universal" binary that targets *range* of platforms
727 # by specifying minimum and maximum supported architecture;
729 # As for c) option. It actually makes no sense to specify
730 # maximum to be less than ARMv7, because it's the least
731 # requirement for run-time switch between platform-specific
732 # code paths. And without run-time switch performance would be
733 # equivalent to one for minimum. Secondly, there are some
734 # natural limitations that you'd have to accept and respect.
735 # Most notably you can *not* build "universal" binary for
736 # big-endian platform. This is because ARMv7 processor always
737 # picks instructions in little-endian order. Another similar
738 # limitation is that -mthumb can't "cross" -march=armv6t2
739 # boundary, because that's where it became Thumb-2. Well, this
740 # limitation is a bit artificial, because it's not really
741 # impossible, but it's deemed too tricky to support. And of
742 # course you have to be sure that your binutils are actually
743 # up to the task of handling maximum target platform. With all
744 # this in mind here is an example of how to configure
747 # ./Configure linux-armv4 -march=armv6 -D__ARM_MAX_ARCH__=8
749 inherit_from => [ "linux-generic32" ],
751 perlasm_scheme => "linux32",
754 inherit_from => [ "linux-generic64" ],
755 asm_arch => 'aarch64',
756 perlasm_scheme => "linux64",
758 "linux-arm64ilp32" => { # https://wiki.linaro.org/Platform/arm64-ilp32
759 inherit_from => [ "linux-generic32" ],
760 cflags => add("-mabi=ilp32"),
761 cxxflags => add("-mabi=ilp32"),
762 bn_ops => "SIXTY_FOUR_BIT RC4_CHAR",
763 asm_arch => 'aarch64',
764 perlasm_scheme => "linux64",
768 # Configure script adds minimally required -march for assembly
769 # support, if no -march was specified at command line.
770 inherit_from => [ "linux-generic32" ],
771 cflags => add("-mabi=32"),
772 cxxflags => add("-mabi=32"),
773 asm_arch => 'mips32',
774 perlasm_scheme => "o32",
776 # mips32 and mips64 below refer to contemporary MIPS Architecture
777 # specifications, MIPS32 and MIPS64, rather than to kernel bitness.
779 inherit_from => [ "linux-generic32" ],
780 cflags => add("-mabi=n32"),
781 cxxflags => add("-mabi=n32"),
782 bn_ops => "SIXTY_FOUR_BIT RC4_CHAR",
783 asm_arch => 'mips64',
784 perlasm_scheme => "n32",
787 "linux64-mips64" => {
788 inherit_from => [ "linux-generic64" ],
789 cflags => add("-mabi=64"),
790 cxxflags => add("-mabi=64"),
791 asm_arch => 'mips64',
792 perlasm_scheme => "64",
796 #### IA-32 targets...
797 #### These two targets are a bit aged and are to be used on older Linux
798 #### machines where gcc doesn't understand -m32 and -m64
800 inherit_from => [ "linux-generic32" ],
801 CFLAGS => add(picker(release => "-fomit-frame-pointer")),
802 lib_cppflags => add("-DL_ENDIAN"),
803 bn_ops => "BN_LLONG",
805 perlasm_scheme => "elf",
808 inherit_from => [ "BASE_unix" ],
810 CFLAGS => add(picker(default => "-Wall",
812 release => "-O3 -fomit-frame-pointer")),
813 lib_cppflags => add("-DL_ENDIAN"),
814 bn_ops => "BN_LLONG",
815 thread_scheme => "(unknown)",
817 perlasm_scheme => "a.out",
820 #### X86 / X86_64 targets
822 inherit_from => [ "linux-generic32" ],
823 CFLAGS => add(picker(release => "-fomit-frame-pointer")),
824 cflags => add("-m32"),
825 cxxflags => add("-m32"),
826 lib_cppflags => add("-DL_ENDIAN"),
827 bn_ops => "BN_LLONG",
829 perlasm_scheme => "elf",
831 "linux-x86-clang" => {
832 inherit_from => [ "linux-x86" ],
837 inherit_from => [ "linux-generic64" ],
838 cflags => add("-m64"),
839 cxxflags => add("-m64"),
840 lib_cppflags => add("-DL_ENDIAN"),
841 bn_ops => "SIXTY_FOUR_BIT_LONG",
842 asm_arch => 'x86_64',
843 perlasm_scheme => "elf",
846 "linux-x86_64-clang" => {
847 inherit_from => [ "linux-x86_64" ],
852 inherit_from => [ "linux-generic32" ],
853 cflags => add("-mx32"),
854 cxxflags => add("-mx32"),
855 lib_cppflags => add("-DL_ENDIAN"),
856 bn_ops => "SIXTY_FOUR_BIT",
857 asm_arch => 'x86_64',
858 perlasm_scheme => "elf32",
863 inherit_from => [ "linux-generic64" ],
864 bn_ops => "SIXTY_FOUR_BIT_LONG",
866 perlasm_scheme => 'void',
870 inherit_from => [ "linux-generic64" ],
871 cflags => add("-m64"),
872 cxxflags => add("-m64"),
873 lib_cppflags => add("-DB_ENDIAN"),
875 perlasm_scheme => "64",
879 #### So called "highgprs" target for z/Architecture CPUs
880 # "Highgprs" is kernel feature first implemented in Linux
881 # 2.6.32, see /proc/cpuinfo. The idea is to preserve most
882 # significant bits of general purpose registers not only
883 # upon 32-bit process context switch, but even on
884 # asynchronous signal delivery to such process. This makes
885 # it possible to deploy 64-bit instructions even in legacy
886 # application context and achieve better [or should we say
887 # adequate] performance. The build is binary compatible with
888 # linux-generic32, and the idea is to be able to install the
889 # resulting libcrypto.so alongside generic one, e.g. as
890 # /lib/highgprs/libcrypto.so.x.y, for ldconfig and run-time
891 # linker to autodiscover. Unfortunately it doesn't work just
892 # yet, because of couple of bugs in glibc
893 # sysdeps/s390/dl-procinfo.c affecting ldconfig and ld.so.1...
895 inherit_from => [ "linux-generic32" ],
896 cflags => add("-m31 -Wa,-mzarch"),
897 cxxflags => add("-m31 -Wa,-mzarch"),
898 lib_cppflags => add("-DB_ENDIAN"),
900 perlasm_scheme => "31",
901 multilib => "/highgprs",
904 #### SPARC Linux setups
906 inherit_from => [ "linux-generic32" ],
907 cflags => add("-mcpu=v8"),
908 cxxflags => add("-mcpu=v8"),
909 lib_cppflags => add("-DB_ENDIAN -DBN_DIV2W"),
910 asm_arch => 'sparcv8',
911 perlasm_scheme => 'void',
914 # it's a real mess with -mcpu=ultrasparc option under Linux,
915 # but -Wa,-Av8plus should do the trick no matter what.
916 inherit_from => [ "linux-generic32" ],
917 cflags => add("-m32 -mcpu=ultrasparc -Wa,-Av8plus"),
918 cxxflags => add("-m32 -mcpu=ultrasparc -Wa,-Av8plus"),
919 lib_cppflags => add("-DB_ENDIAN -DBN_DIV2W"),
920 asm_arch => 'sparcv9',
921 perlasm_scheme => 'void',
923 "linux64-sparcv9" => {
924 # GCC 3.1 is a requirement
925 inherit_from => [ "linux-generic64" ],
926 cflags => add("-m64 -mcpu=ultrasparc"),
927 cxxflags => add("-m64 -mcpu=ultrasparc"),
928 lib_cppflags => add("-DB_ENDIAN"),
929 bn_ops => "BN_LLONG RC4_CHAR",
930 asm_arch => 'sparcv9',
931 perlasm_scheme => 'void',
935 "linux-alpha-gcc" => {
936 inherit_from => [ "linux-generic64" ],
937 lib_cppflags => add("-DL_ENDIAN"),
938 bn_ops => "SIXTY_FOUR_BIT_LONG",
940 perlasm_scheme => "void",
942 "linux-c64xplus" => {
943 inherit_from => [ "BASE_unix" ],
944 # TI_CGT_C6000_7.3.x is a requirement
946 CFLAGS => "-o2 -ox -ms",
947 cflags => "--linux -ea=.s -eo=.o -mv6400+ -pden",
948 cxxflags => "--linux -ea=.s -eo=.o -mv6400+ -pden",
949 cppflags => combine("-DOPENSSL_SMALL_FOOTPRINT",
950 threads("-D_REENTRANT")),
951 bn_ops => "BN_LLONG",
952 thread_scheme => "pthreads",
953 asm_arch => 'c64xplus',
954 perlasm_scheme => "void",
955 dso_scheme => "dlfcn",
956 shared_target => "linux-shared",
957 shared_cflag => "--pic",
958 shared_ldflag => add("-z --sysv --shared"),
964 # As for thread cflag. Idea is to maintain "collective" set of
965 # flags, which would cover all BSD flavors. -pthread applies
966 # to them all, but is treated differently. OpenBSD expands is
967 # as -D_POSIX_THREAD -lc_r, which is sufficient. FreeBSD 4.x
968 # expands it as -lc_r, which has to be accompanied by explicit
969 # -D_THREAD_SAFE and sometimes -D_REENTRANT. FreeBSD 5.x
970 # expands it as -lc_r, which seems to be sufficient?
971 inherit_from => [ "BASE_unix" ],
973 CFLAGS => picker(default => "-Wall",
976 cflags => threads("-pthread"),
977 cppflags => threads("-D_THREAD_SAFE -D_REENTRANT"),
978 ex_libs => add(threads("-pthread")),
979 enable => add("devcryptoeng"),
980 bn_ops => "BN_LLONG",
981 thread_scheme => "pthreads",
982 dso_scheme => "dlfcn",
983 shared_target => "bsd-gcc-shared",
984 shared_cflag => "-fPIC",
987 inherit_from => [ "BSD-generic32" ],
988 bn_ops => "SIXTY_FOUR_BIT_LONG",
992 inherit_from => [ "BSD-generic32" ],
993 CFLAGS => add(picker(release => "-fomit-frame-pointer")),
994 lib_cppflags => add("-DL_ENDIAN"),
995 bn_ops => "BN_LLONG",
996 shared_target => "bsd-shared",
998 perlasm_scheme => "a.out",
1001 inherit_from => [ "BSD-x86" ],
1002 perlasm_scheme => "elf",
1006 inherit_from => [ "BSD-generic32" ],
1007 cflags => add("-mcpu=v8"),
1008 lib_cppflags => add("-DB_ENDIAN"),
1009 asm_arch => 'sparcv8',
1010 perlasm_scheme => 'void',
1013 # -DMD32_REG_T=int doesn't actually belong in sparc64 target, it
1014 # simply *happens* to work around a compiler bug in gcc 3.3.3,
1015 # triggered by RIPEMD160 code.
1016 inherit_from => [ "BSD-generic64" ],
1017 lib_cppflags => add("-DB_ENDIAN -DMD32_REG_T=int"),
1018 bn_ops => "BN_LLONG",
1019 asm_arch => 'sparcv9',
1020 perlasm_scheme => 'void',
1024 inherit_from => [ "BSD-generic64" ],
1025 lib_cppflags => add("-DL_ENDIAN"),
1026 bn_ops => "SIXTY_FOUR_BIT_LONG",
1028 perlasm_scheme => 'void',
1032 inherit_from => [ "BSD-generic64" ],
1033 lib_cppflags => add("-DL_ENDIAN"),
1034 bn_ops => "SIXTY_FOUR_BIT_LONG",
1035 asm_arch => 'x86_64',
1036 perlasm_scheme => "elf",
1040 inherit_from => [ "BASE_unix" ],
1042 CFLAGS => "-fomit-frame-pointer -O3 -Wall",
1043 lib_cppflags => "-DPERL5 -DL_ENDIAN",
1044 ex_libs => add("-ldl"),
1045 bn_ops => "BN_LLONG",
1047 perlasm_scheme => "elf",
1048 thread_scheme => "(unknown)",
1049 dso_scheme => "dlfcn",
1050 shared_target => "bsd-gcc-shared",
1051 shared_cflag => "-fPIC",
1055 inherit_from => [ "BASE_unix" ],
1057 CFLAGS => "-O -Wall",
1058 unistd => "<libc.h>",
1059 bn_ops => "BN_LLONG",
1060 thread_scheme => "(unknown)",
1063 inherit_from => [ "BASE_unix" ],
1065 CFLAGS => "-O3 -Wall",
1066 unistd => "<libc.h>",
1067 bn_ops => "BN_LLONG",
1068 thread_scheme => "(unknown)",
1071 #### SCO/Caldera targets.
1073 # Originally we had like unixware-*, unixware-*-pentium, unixware-*-p6, etc.
1074 # Now we only have blended unixware-* as it's the only one used by ./config.
1075 # If you want to optimize for particular microarchitecture, bypass ./config
1076 # and './Configure unixware-7 -Kpentium_pro' or whatever appropriate.
1077 # Note that not all targets include assembler support. Mostly because of
1078 # lack of motivation to support out-of-date platforms with out-of-date
1079 # compiler drivers and assemblers.
1081 # UnixWare 2.0x fails destest with -O.
1083 inherit_from => [ "BASE_unix" ],
1085 cflags => threads("-Kthread"),
1086 lib_cppflags => "-DFILIO_H -DNO_STRINGS_H",
1087 ex_libs => add("-lsocket -lnsl -lresolv -lx"),
1088 thread_scheme => "uithreads",
1091 inherit_from => [ "BASE_unix" ],
1094 cflags => threads("-Kthread"),
1095 lib_cppflags => "-DFILIO_H",
1096 ex_libs => add("-lsocket -lnsl -lresolv -lx"),
1097 thread_scheme => "uithreads",
1100 inherit_from => [ "BASE_unix" ],
1103 cflags => combine("-Kalloca", threads("-Kthread")),
1104 lib_cppflags => "-DFILIO_H",
1105 ex_libs => add("-lsocket -lnsl"),
1106 thread_scheme => "uithreads",
1107 bn_ops => "BN_LLONG",
1109 perlasm_scheme => "elf-1",
1110 dso_scheme => "dlfcn",
1111 shared_target => "svr5-shared",
1112 shared_cflag => "-Kpic",
1114 "unixware-7-gcc" => {
1115 inherit_from => [ "BASE_unix" ],
1117 CFLAGS => "-O3 -fomit-frame-pointer -Wall",
1118 cppflags => add(threads("-D_REENTRANT")),
1119 lib_cppflags => add("-DL_ENDIAN -DFILIO_H"),
1120 ex_libs => add("-lsocket -lnsl"),
1121 bn_ops => "BN_LLONG",
1122 thread_scheme => "pthreads",
1124 perlasm_scheme => "elf-1",
1125 dso_scheme => "dlfcn",
1126 shared_target => "gnu-shared",
1127 shared_cflag => "-fPIC",
1129 # SCO 5 - Ben Laurie says the -O breaks the SCO cc.
1131 inherit_from => [ "BASE_unix" ],
1134 ex_libs => add("-lsocket -lnsl"),
1135 thread_scheme => "(unknown)",
1137 perlasm_scheme => "elf-1",
1138 dso_scheme => "dlfcn",
1139 shared_target => "svr3-shared",
1140 shared_cflag => "-Kpic",
1143 inherit_from => [ "BASE_unix" ],
1145 cflags => "-O3 -fomit-frame-pointer",
1146 ex_libs => add("-lsocket -lnsl"),
1147 bn_ops => "BN_LLONG",
1148 thread_scheme => "(unknown)",
1150 perlasm_scheme => "elf-1",
1151 dso_scheme => "dlfcn",
1152 shared_target => "svr3-shared",
1153 shared_cflag => "-fPIC",
1157 # Below targets assume AIX >=5. Caveat lector. If you are accustomed
1158 # to control compilation "bitness" by setting $OBJECT_MODE environment
1159 # variable, then you should know that in OpenSSL case it's considered
1160 # only in ./config. Once configured, build procedure remains "deaf" to
1161 # current value of $OBJECT_MODE.
1163 inherit_from => [ "BASE_unix" ],
1166 lib_cppflags => "-DB_ENDIAN",
1167 lflags => "-Wl,-bsvr4",
1168 thread_scheme => "pthreads",
1169 dso_scheme => "dlfcn",
1170 shared_target => "aix",
1171 module_ldflags => "-Wl,-G,-bsymbolic,-bnoentry",
1172 shared_ldflag => "-Wl,-G,-bsymbolic,-bnoentry",
1173 shared_defflag => "-Wl,-bE:",
1174 perl_platform => 'AIX',
1177 inherit_from => [ "aix-common" ],
1179 CFLAGS => picker(debug => "-O0 -g",
1181 cflags => add(threads("-pthread")),
1182 ex_libs => threads("-pthread"),
1183 bn_ops => "BN_LLONG RC4_CHAR",
1184 asm_arch => 'ppc32',
1185 perlasm_scheme => "aix32",
1186 shared_ldflag => add_before("-shared -static-libgcc"),
1188 RANLIB => add("-X32"),
1191 inherit_from => [ "aix-common" ],
1193 CFLAGS => picker(debug => "-O0 -g",
1195 cflags => combine("-maix64", threads("-pthread")),
1196 ex_libs => threads("-pthread"),
1197 bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
1198 asm_arch => 'ppc64',
1199 perlasm_scheme => "aix64",
1200 shared_ldflag => add_before("-shared -static-libgcc"),
1201 shared_extension => "64.so.\$(SHLIB_VERSION_NUMBER)",
1203 RANLIB => add("-X64"),
1206 inherit_from => [ "aix-common" ],
1208 CFLAGS => picker(debug => "-O0 -g",
1210 cflags => combine("-q32 -qmaxmem=16384 -qro -qroconst",
1211 threads("-qthreaded")),
1212 cppflags => threads("-D_THREAD_SAFE"),
1213 ex_libs => threads("-lpthreads"),
1214 bn_ops => "BN_LLONG RC4_CHAR",
1215 asm_arch => 'ppc32',
1216 perlasm_scheme => "aix32",
1217 shared_cflag => "-qpic",
1219 RANLIB => add("-X32"),
1222 inherit_from => [ "aix-common" ],
1224 CFLAGS => picker(debug => "-O0 -g",
1226 cflags => combine("-q64 -qmaxmem=16384 -qro -qroconst",
1227 threads("-qthreaded")),
1228 cppflags => threads("-D_THREAD_SAFE"),
1229 ex_libs => threads("-lpthreads"),
1230 bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
1231 asm_arch => 'ppc64',
1232 perlasm_scheme => "aix64",
1233 dso_scheme => "dlfcn",
1234 shared_cflag => "-qpic",
1235 shared_extension => "64.so.\$(SHLIB_VERSION_NUMBER)",
1237 RANLIB => add("-X64"),
1240 # SIEMENS BS2000/OSD: an EBCDIC-based mainframe
1242 inherit_from => [ "BASE_unix" ],
1245 cflags => "-XLLML -XLLMK -XL",
1246 cppflags => "-DCHARSET_EBCDIC",
1247 lib_cppflags => "-DB_ENDIAN",
1248 ex_libs => add("-lsocket -lnsl"),
1249 bn_ops => "THIRTY_TWO_BIT RC4_CHAR",
1250 thread_scheme => "(unknown)",
1253 #### Visual C targets
1255 # Win64 targets, WIN64I denotes IA-64/Itanium and WIN64A - AMD64
1257 # Note about /wd4090, disable warning C4090. This warning returns false
1258 # positives in some situations. Disabling it altogether masks both
1259 # legitimate and false cases, but as we compile on multiple platforms,
1260 # we rely on other compilers to catch legitimate cases.
1262 # Also note that we force threads no matter what. Configuring "no-threads"
1265 # UNICODE is defined in VC-common and applies to all targets. It used to
1266 # be an opt-in option for VC-WIN32, but not anymore. The original reason
1267 # was because ANSI API was *native* system interface for no longer
1268 # supported Windows 9x. Keep in mind that UNICODE only affects how
1269 # OpenSSL libraries interact with underlying OS, it doesn't affect API
1270 # that OpenSSL presents to application.
1273 inherit_from => [ "BASE_Windows" ],
1276 CPP => '$(CC) /EP /C',
1277 CFLAGS => "/W3 /wd4090 /nologo",
1278 LDFLAGS => add("/debug"),
1280 defines => add("OPENSSL_SYS_WIN32", "WIN32_LEAN_AND_MEAN",
1281 "UNICODE", "_UNICODE",
1282 "_CRT_SECURE_NO_DEPRECATE",
1283 "_WINSOCK_DEPRECATED_NO_WARNINGS"),
1284 lib_cflags => add("/Zi /Fdossl_static.pdb"),
1285 lib_defines => add("L_ENDIAN"),
1286 dso_cflags => "/Zi /Fddso.pdb",
1287 bin_cflags => "/Zi /Fdapp.pdb",
1288 # def_flag made to empty string so a .def file gets generated
1289 shared_defflag => '',
1290 shared_ldflag => "/dll",
1291 shared_target => "win-shared", # meaningless except it gives Configure a hint
1292 thread_scheme => "winthreads",
1293 dso_scheme => "win32",
1294 bn_ops => "EXPORT_VAR_AS_FN",
1295 perl_platform => 'Windows::MSVC',
1296 # additional parameter to build_scheme denotes install-path "flavour"
1297 build_scheme => add("VC-common", { separator => undef }),
1299 "VC-noCE-common" => {
1300 inherit_from => [ "VC-common" ],
1302 CFLAGS => add(picker(debug => '/Od',
1304 cflags => add(picker(default => '/Gs0 /GF /Gy',
1307 ($disabled{shared} ? "" : "/MDd");
1311 ($disabled{shared} ? "" : "/MD");
1313 defines => add(picker(default => [], # works as type cast
1314 debug => [ "DEBUG", "_DEBUG" ])),
1315 lib_cflags => add(sub { $disabled{shared} ? "/MT /Zl" : () }),
1316 # Following might/should appears controversial, i.e. defining
1317 # /MDd without evaluating $disabled{shared}. It works in
1318 # non-shared build because static library is compiled with /Zl
1319 # and bares no reference to specific RTL. And it works in
1320 # shared build because multiple /MDd options are not prohibited.
1321 # But why /MDd in static build? Well, basically this is just a
1322 # reference point, which allows to catch eventual errors that
1323 # would prevent those who want to wrap OpenSSL into own .DLL.
1324 # Why not /MD in release build then? Well, some are likely to
1325 # prefer [non-debug] openssl.exe to be free from Micorosoft RTL
1327 bin_cflags => add(picker(debug => "/MDd",
1328 release => sub { $disabled{shared} ? "/MT" : () },
1330 bin_lflags => add("/subsystem:console /opt:ref"),
1331 ex_libs => add(sub {
1333 push @ex_libs, 'ws2_32.lib' unless $disabled{sock};
1334 push @ex_libs, 'gdi32.lib advapi32.lib crypt32.lib user32.lib';
1335 return join(" ", @ex_libs);
1338 "VC-WIN64-common" => {
1339 inherit_from => [ "VC-noCE-common" ],
1341 ex_libs => add(sub {
1343 push @ex_libs, 'bufferoverflowu.lib' if (`cl 2>&1` =~ /14\.00\.4[0-9]{4}\./);
1344 return join(" ", @_, @ex_libs);
1346 bn_ops => add("SIXTY_FOUR_BIT"),
1349 inherit_from => [ "VC-WIN64-common" ],
1351 ASFLAGS => "-d debug",
1354 uplink_arch => 'ia64',
1356 perlasm_scheme => "ias",
1357 multilib => "-ia64",
1360 inherit_from => [ "VC-WIN64-common" ],
1361 AS => sub { vc_win64a_info()->{AS} },
1362 ASFLAGS => sub { vc_win64a_info()->{ASFLAGS} },
1363 asoutflag => sub { vc_win64a_info()->{asoutflag} },
1364 asflags => sub { vc_win64a_info()->{asflags} },
1366 uplink_arch => 'x86_64',
1367 asm_arch => 'x86_64',
1368 perlasm_scheme => "auto",
1372 inherit_from => [ "VC-noCE-common" ],
1373 CFLAGS => add("/WX"),
1374 AS => sub { vc_win32_info()->{AS} },
1375 ASFLAGS => sub { vc_win32_info()->{ASFLAGS} },
1376 asoutflag => sub { vc_win32_info()->{asoutflag} },
1377 asflags => sub { vc_win32_info()->{asflags} },
1379 bn_ops => add("BN_LLONG"),
1380 uplink_arch => 'common',
1382 perlasm_scheme => sub { vc_win32_info()->{perlasm_scheme} },
1383 # "WOW" stands for "Windows on Windows", and "VC-WOW" engages
1384 # some installation path heuristics in windows-makefile.tmpl...
1385 build_scheme => add("VC-WOW", { separator => undef }),
1388 inherit_from => [ "VC-common" ],
1389 CFLAGS => add(picker(debug => "/Od",
1390 release => "/O1i")),
1391 CPPDEFINES => picker(debug => [ "DEBUG", "_DEBUG" ]),
1392 LDFLAGS => add("/nologo /opt:ref"),
1395 sub { vc_wince_info()->{cflags}; },
1396 sub { `cl 2>&1` =~ /Version ([0-9]+)\./ && $1>=14
1397 ? ($disabled{shared} ? " /MT" : " /MD")
1399 cppflags => sub { vc_wince_info()->{cppflags}; },
1400 lib_defines => add("NO_CHMOD", "OPENSSL_SMALL_FOOTPRINT"),
1401 lib_cppflags => sub { vc_wince_info()->{cppflags}; },
1403 add(combine(sub { defined(env('WCECOMPAT'))
1404 ? '$(WCECOMPAT)/include' : (); },
1405 sub { defined(env('PORTSDK_LIBPATH'))
1406 ? '$(PORTSDK_LIBPATH)/../../include'
1408 lflags => add(combine(sub { vc_wince_info()->{lflags}; },
1409 sub { defined(env('PORTSDK_LIBPATH'))
1410 ? "/entry:mainCRTstartup" : (); })),
1412 bn_ops => add("BN_LLONG"),
1413 ex_libs => add(sub {
1415 push @ex_libs, 'ws2.lib' unless $disabled{sock};
1416 push @ex_libs, 'crypt32.lib';
1417 if (defined(env('WCECOMPAT'))) {
1418 my $x = '$(WCECOMPAT)/lib';
1419 if (-f "$x/env('TARGETCPU')/wcecompatex.lib") {
1420 $x .= '/$(TARGETCPU)/wcecompatex.lib';
1422 $x .= '/wcecompatex.lib';
1426 push @ex_libs, '$(PORTSDK_LIBPATH)/portlib.lib'
1427 if (defined(env('PORTSDK_LIBPATH')));
1428 push @ex_libs, ' /nodefaultlib coredll.lib corelibc.lib'
1429 if (env('TARGETCPU') eq "X86");
1436 inherit_from => [ 'BASE_unix' ],
1439 CFLAGS => picker(default => "-Wall",
1442 cppflags => combine("-DUNICODE -D_UNICODE -DWIN32_LEAN_AND_MEAN",
1444 lib_cppflags => "-DL_ENDIAN",
1445 ex_libs => add("-lws2_32 -lgdi32 -lcrypt32"),
1446 bn_ops => "EXPORT_VAR_AS_FN",
1447 thread_scheme => "winthreads",
1448 dso_scheme => "win32",
1449 shared_target => "mingw-shared",
1450 shared_cppflags => add("_WINDLL"),
1451 shared_ldflag => "-static-libgcc",
1453 perl_platform => 'mingw',
1456 inherit_from => [ "mingw-common" ],
1457 CFLAGS => add(picker(release => "-fomit-frame-pointer")),
1459 sys_id => "MINGW32",
1460 bn_ops => add("BN_LLONG"),
1462 uplink_arch => 'x86',
1463 perlasm_scheme => "coff",
1464 shared_rcflag => "--target=pe-i386",
1468 # As for uplink_arch. Applink makes it possible to use
1469 # .dll compiled with one compiler with application compiled with
1470 # another compiler. It's possible to engage Applink support in
1471 # mingw64 build, but it's not done, because until mingw64
1472 # supports structured exception handling, one can't seriously
1473 # consider its binaries for using with non-mingw64 run-time
1474 # environment. And as mingw64 is always consistent with itself,
1475 # Applink is never engaged and can as well be omitted.
1476 inherit_from => [ "mingw-common" ],
1478 sys_id => "MINGW64",
1479 bn_ops => add("SIXTY_FOUR_BIT"),
1480 asm_arch => 'x86_64',
1481 uplink_arch => undef,
1482 perlasm_scheme => "mingw64",
1483 shared_rcflag => "--target=pe-x86-64",
1489 inherit_from => [ "BASE_unix" ],
1492 lib_cppflags => "-DL_ENDIAN",
1498 inherit_from => [ "BASE_unix" ],
1500 CFLAGS => "-O -Wall",
1501 lib_cppflags => "-DTERMIOS -DL_ENDIAN",
1503 bn_ops => "BN_LLONG",
1504 dso_scheme => "win32",
1508 "Cygwin-common" => {
1509 inherit_from => [ "BASE_unix" ],
1513 CFLAGS => picker(default => "-Wall",
1516 lib_cppflags => "-DTERMIOS -DL_ENDIAN",
1518 thread_scheme => "pthread",
1519 dso_scheme => "dlfcn",
1520 shared_target => "cygwin-shared",
1521 shared_cppflags => "-D_WINDLL",
1523 perl_platform => 'Cygwin',
1526 inherit_from => [ "Cygwin-common" ],
1527 CFLAGS => add(picker(release => "-O3 -fomit-frame-pointer")),
1528 bn_ops => "BN_LLONG",
1530 perlasm_scheme => "coff",
1532 "Cygwin-x86_64" => {
1533 inherit_from => [ "Cygwin-common" ],
1535 bn_ops => "SIXTY_FOUR_BIT_LONG",
1536 asm_arch => 'x86_64',
1537 perlasm_scheme => "mingw64",
1539 # Backward compatibility for those using this target
1541 inherit_from => [ "Cygwin-x86" ]
1543 # In case someone constructs the Cygwin target name themself
1545 inherit_from => [ "Cygwin-x86" ]
1548 inherit_from => [ "Cygwin-x86" ]
1551 inherit_from => [ "Cygwin-x86" ]
1554 inherit_from => [ "Cygwin-x86" ]
1557 ##### MacOS X (a.k.a. Darwin) setup
1558 "darwin-common" => {
1559 inherit_from => [ "BASE_unix" ],
1562 CFLAGS => picker(debug => "-g -O0",
1564 cppflags => threads("-D_REENTRANT"),
1565 lflags => "-Wl,-search_paths_first",
1567 bn_ops => "BN_LLONG RC4_CHAR",
1568 thread_scheme => "pthreads",
1569 perlasm_scheme => "osx32",
1570 dso_scheme => "dlfcn",
1571 ranlib => "ranlib -c",
1572 shared_target => "darwin-shared",
1573 shared_cflag => "-fPIC",
1574 shared_extension => ".\$(SHLIB_VERSION_NUMBER).dylib",
1576 # Option "freeze" such as -std=gnu9x can't negatively interfere
1577 # with future defaults for below two targets, because MacOS X
1578 # for PPC has no future, it was discontinued by vendor in 2009.
1579 "darwin-ppc-cc" => {
1580 inherit_from => [ "darwin-common" ],
1581 cflags => add("-arch ppc -std=gnu9x -Wa,-force_cpusubtype_ALL"),
1582 lib_cppflags => add("-DB_ENDIAN"),
1583 shared_cflag => add("-fno-common"),
1584 asm_arch => 'ppc32',
1585 perlasm_scheme => "osx32",
1587 "darwin64-ppc-cc" => {
1588 inherit_from => [ "darwin-common" ],
1589 cflags => add("-arch ppc64 -std=gnu9x"),
1590 lib_cppflags => add("-DB_ENDIAN"),
1591 bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
1592 asm_arch => 'ppc64',
1593 perlasm_scheme => "osx64",
1595 "darwin-i386-cc" => {
1596 inherit_from => [ "darwin-common" ],
1597 CFLAGS => add(picker(release => "-fomit-frame-pointer")),
1598 cflags => add("-arch i386"),
1599 lib_cppflags => add("-DL_ENDIAN"),
1600 bn_ops => "BN_LLONG RC4_INT",
1602 perlasm_scheme => "macosx",
1604 "darwin64-x86_64-cc" => {
1605 inherit_from => [ "darwin-common" ],
1606 CFLAGS => add("-Wall"),
1607 cflags => add("-arch x86_64"),
1608 lib_cppflags => add("-DL_ENDIAN"),
1609 bn_ops => "SIXTY_FOUR_BIT_LONG",
1610 asm_arch => 'x86_64',
1611 perlasm_scheme => "macosx",
1616 inherit_from => [ "BASE_unix" ],
1618 CFLAGS => "-O3 -fomit-frame-pointer -Wall",
1619 cflags => threads("-pthread"),
1620 lib_cppflags => "-DL_ENDIAN",
1621 ex_libs => add("-ldl", threads("-pthread")),
1622 bn_ops => "BN_LLONG",
1624 perlasm_scheme => 'elf',
1625 thread_scheme => "pthreads",
1626 dso_scheme => "dlfcn",
1627 shared_target => "linux-shared",
1628 shared_cflag => "-fPIC",
1631 ##### VxWorks for various targets
1632 "vxworks-ppc60x" => {
1633 inherit_from => [ "BASE_unix" ],
1635 CFLAGS => "-O2 -Wall -fstrength-reduce",
1636 cflags => "-mrtp -mhard-float -mstrict-align -fno-implicit-fp -fno-builtin -fno-strict-aliasing",
1637 cppflags => combine("-D_REENTRANT -DPPC32_fp60x -DCPU=PPC32",
1638 "_DTOOL_FAMILY=gnu -DTOOL=gnu",
1639 "-I\$(WIND_BASE)/target/usr/h",
1640 "-I\$(WIND_BASE)/target/usr/h/wrn/coreip"),
1641 sys_id => "VXWORKS",
1642 lflags => add("-L \$(WIND_BASE)/target/usr/lib/ppc/PPC32/common"),
1643 ex_libs => add("-Wl,--defsym,__wrs_rtp_base=0xe0000000"),
1645 "vxworks-ppcgen" => {
1646 inherit_from => [ "BASE_unix" ],
1648 CFLAGS => "-O1 -Wall",
1649 cflags => "-mrtp -msoft-float -mstrict-align -fno-builtin -fno-strict-aliasing",
1650 cppflags => combine("-D_REENTRANT -DPPC32 -DCPU=PPC32",
1651 "-DTOOL_FAMILY=gnu -DTOOL=gnu",
1652 "-I\$(WIND_BASE)/target/usr/h",
1653 "-I\$(WIND_BASE)/target/usr/h/wrn/coreip"),
1654 sys_id => "VXWORKS",
1655 lflags => add("-L \$(WIND_BASE)/target/usr/lib/ppc/PPC32/sfcommon"),
1656 ex_libs => add("-Wl,--defsym,__wrs_rtp_base=0xe0000000"),
1658 "vxworks-ppc405" => {
1659 inherit_from => [ "BASE_unix" ],
1662 cflags => "-msoft-float -mlongcall",
1663 cppflags => combine("-D_REENTRANT -DPPC32 -DCPU=PPC405",
1664 "-DTOOL_FAMILY=gnu -DTOOL=gnu",
1665 "-I\$(WIND_BASE)/target/h"),
1666 sys_id => "VXWORKS",
1667 lflags => add("-r"),
1669 "vxworks-ppc750" => {
1670 inherit_from => [ "BASE_unix" ],
1672 CFLAGS => "-ansi -fvolatile -Wall \$(DEBUG_FLAG)",
1673 cflags => "-nostdinc -fno-builtin -fno-for-scope -fsigned-char -msoft-float -mlongcall",
1674 cppflags => combine("-DPPC750 -D_REENTRANT -DCPU=PPC604",
1675 "-I\$(WIND_BASE)/target/h"),
1676 sys_id => "VXWORKS",
1677 lflags => add("-r"),
1679 "vxworks-ppc750-debug" => {
1680 inherit_from => [ "BASE_unix" ],
1682 CFLAGS => "-ansi -fvolatile -Wall -g",
1683 cflags => "-nostdinc -fno-builtin -fno-for-scope -fsigned-char -msoft-float -mlongcall",
1684 cppflags => combine("-DPPC750 -D_REENTRANT -DCPU=PPC604",
1685 "-DPEDANTIC -DDEBUG",
1686 "-I\$(WIND_BASE)/target/h"),
1687 sys_id => "VXWORKS",
1688 lflags => add("-r"),
1690 "vxworks-ppc860" => {
1691 inherit_from => [ "BASE_unix" ],
1693 cflags => "-nostdinc -msoft-float",
1694 cppflags => combine("-DCPU=PPC860 -DNO_STRINGS_H",
1695 "-I\$(WIND_BASE)/target/h"),
1696 sys_id => "VXWORKS",
1697 lflags => add("-r"),
1699 "vxworks-simlinux" => {
1700 inherit_from => [ "BASE_unix" ],
1702 cflags => "-B\$(WIND_BASE)/host/\$(WIND_HOST_TYPE)/lib/gcc-lib/ -fno-builtin -fno-defer-pop",
1703 cppflags => combine("-D_VSB_CONFIG_FILE=\"\$(WIND_BASE)/target/lib/h/config/vsbConfig.h\"",
1704 "-DL_ENDIAN -DCPU=SIMLINUX -DNO_STRINGS_H",
1705 "-DTOOL_FAMILY=gnu -DTOOL=gnu",
1706 "-DOPENSSL_NO_HW_PADLOCK",
1707 "-I\$(WIND_BASE)/target/h",
1708 "-I\$(WIND_BASE)/target/h/wrn/coreip"),
1709 sys_id => "VXWORKS",
1710 lflags => add("-r"),
1711 ranlib => "ranlibpentium",
1714 inherit_from => [ "BASE_unix" ],
1716 CFLAGS => "-O -G 0",
1717 cflags => "-mrtp -mips2 -B\$(WIND_BASE)/host/\$(WIND_HOST_TYPE)/lib/gcc-lib/ -msoft-float -mno-branch-likely -fno-builtin -fno-defer-pop",
1718 cppflags => combine("-D_VSB_CONFIG_FILE=\"\$(WIND_BASE)/target/lib/h/config/vsbConfig.h\"",
1719 "-DCPU=MIPS32 -DNO_STRINGS_H",
1720 "-DTOOL_FAMILY=gnu -DTOOL=gnu",
1721 "-DOPENSSL_NO_HW_PADLOCK",
1722 threads("-D_REENTRANT"),
1723 "-I\$(WIND_BASE)/target/h",
1724 "-I\$(WIND_BASE)/target/h/wrn/coreip"),
1725 sys_id => "VXWORKS",
1726 lflags => add("-L \$(WIND_BASE)/target/usr/lib/mips/MIPSI32/sfcommon"),
1727 ex_libs => add("-Wl,--defsym,__wrs_rtp_base=0xe0000000"),
1728 thread_scheme => "pthreads",
1729 asm_arch => 'mips32',
1730 perlasm_scheme => "o32",
1731 ranlib => "ranlibmips",
1736 inherit_from => [ "BASE_unix" ],
1737 CC => sub { env('CC') },
1738 cppflags => threads("-D_REENTRANT"),
1739 ex_libs => add("\$(LDLIBS)"),
1740 bn_ops => "BN_LLONG",
1741 thread_scheme => "pthreads",
1742 dso_scheme => sub { env('LIBSSL_dlfcn') },
1743 shared_target => "linux-shared",
1744 shared_cflag => "-fPIC",
1745 ranlib => sub { env('RANLIB') },
1747 "uClinux-dist64" => {
1748 inherit_from => [ "BASE_unix" ],
1749 CC => sub { env('CC') },
1750 cppflags => threads("-D_REENTRANT"),
1751 ex_libs => add("\$(LDLIBS)"),
1752 bn_ops => "SIXTY_FOUR_BIT_LONG",
1753 thread_scheme => "pthreads",
1754 dso_scheme => sub { env('LIBSSL_dlfcn') },
1755 shared_target => "linux-shared",
1756 shared_cflag => "-fPIC",
1757 ranlib => sub { env('RANLIB') },
1761 # Most things happen in vms-generic.
1762 # Note that vms_info extracts the pointer size from the end of
1763 # the target name, and will assume that anything matching /-p\d+$/
1764 # indicates the pointer size setting for the desired target.
1766 inherit_from => [ "BASE_VMS" ],
1769 CPP => '$(CC)/PREPROCESS_ONLY=SYS$OUTPUT:',
1771 combine(picker(default => "/STANDARD=(ISOC94,RELAXED)/NOLIST/PREFIX=ALL",
1772 debug => "/NOOPTIMIZE/DEBUG",
1773 release => "/OPTIMIZE/NODEBUG"),
1774 sub { my @warnings =
1775 @{vms_info()->{disable_warns}};
1777 ? "/WARNINGS=DISABLE=(".join(",",@warnings).")" : (); }),
1779 add("OPENSSL_USE_NODELETE",
1781 return vms_info()->{def_zlib}
1782 ? "LIBZ=\"\"\"".vms_info()->{def_zlib}."\"\"\"" : ();
1784 lflags => picker(default => "/MAP='F\$PARSE(\".MAP\",\"\$\@\")'",
1785 debug => "/DEBUG/TRACEBACK",
1786 release => "/NODEBUG/NOTRACEBACK"),
1787 # Because of dso_cflags below, we can't set the generic |cflags| here,
1788 # as it can't be overriden, so we set separate C flags for libraries
1789 # and binaries instead.
1790 bin_cflags => add("/NAMES=(AS_IS,SHORTENED)/EXTERN_MODEL=STRICT_REFDEF"),
1791 lib_cflags => add("/NAMES=(AS_IS,SHORTENED)/EXTERN_MODEL=STRICT_REFDEF"),
1792 # For modules specifically, we assume that they only use public
1793 # OpenSSL symbols, and therefore don't need to mangle names on
1796 ex_libs => add(sub { return vms_info()->{zlib} || (); }),
1797 shared_target => "vms-shared",
1798 # def_flag made to empty string so a .opt file gets generated
1799 shared_defflag => '',
1800 dso_scheme => "vms",
1801 thread_scheme => "pthreads",
1803 AS => sub { vms_info()->{AS} },
1804 ASFLAGS => sub { vms_info()->{ASFLAGS} },
1805 asoutflag => sub { vms_info()->{asoutflag} },
1806 asflags => sub { vms_info()->{asflags} },
1807 perlasm_scheme => sub { vms_info()->{perlasm_scheme} },
1809 disable => add('pinshared'),
1813 # From HELP CC/POINTER_SIZE:
1816 # LONG[=ARGV] The compiler assumes 64-bit pointers. If the ARGV option to
1817 # LONG or 64 is present, the main argument argv will be an
1818 # array of long pointers instead of an array of short pointers.
1820 # 64[=ARGV] Same as LONG.
1823 # We don't want the hassle of dealing with 32-bit pointers with argv, so
1824 # we force it to have 64-bit pointers, see the added cflags in the -p64
1825 # config targets below.
1828 inherit_from => [ "vms-generic" ],
1829 bn_ops => "SIXTY_FOUR_BIT RC4_INT",
1832 "vms-alpha-p32" => {
1833 inherit_from => [ "vms-alpha" ],
1834 cflags => add("/POINTER_SIZE=32"),
1835 pointer_size => "32",
1837 "vms-alpha-p64" => {
1838 inherit_from => [ "vms-alpha" ],
1839 cflags => add("/POINTER_SIZE=64=ARGV"),
1840 pointer_size => "64",
1843 inherit_from => [ "vms-generic" ],
1844 bn_ops => "SIXTY_FOUR_BIT RC4_INT",
1845 asm_arch => sub { vms_info()->{AS} ? 'ia64' : undef },
1846 perlasm_scheme => 'ias',
1851 inherit_from => [ "vms-ia64" ],
1852 cflags => add("/POINTER_SIZE=32"),
1853 pointer_size => "32",
1856 inherit_from => [ "vms-ia64" ],
1857 cflags => add("/POINTER_SIZE=64=ARGV"),
1858 pointer_size => "64",