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",
10 asflags => "-f win64 -DNEAR -Ox -g",
12 } elsif ($disabled{asm}) {
13 $vc_win64a_info = { as => "ml64",
14 asflags => "/c /Cp /Cx /Zi",
17 $die->("NASM not found - please read INSTALL and NOTES.WIN for further details\n");
18 $vc_win64a_info = { as => "{unknown}",
23 return $vc_win64a_info;
26 my $vc_win32_info = {};
28 unless (%$vc_win32_info) {
29 my $ver=`nasm -v 2>NUL`;
30 my $vew=`nasmw -v 2>NUL`;
31 if ($ver ne "" || $vew ne "") {
32 $vc_win32_info = { as => $ver ge $vew ? "nasm" : "nasmw",
33 asflags => "-f win32",
35 perlasm_scheme => "win32n" };
36 } elsif ($disabled{asm}) {
37 $vc_win32_info = { as => "ml",
38 asflags => "/nologo /Cp /coff /c /Cx /Zi",
40 perlasm_scheme => "win32" };
42 $die->("NASM not found - please read INSTALL and NOTES.WIN for further details\n");
43 $vc_win32_info = { as => "{unknown}",
46 perlasm_scheme => "win32" };
49 return $vc_win32_info;
52 my $vc_wince_info = {};
54 unless (%$vc_wince_info) {
56 $die->('%OSVERSION% is not defined') if (!defined(env('OSVERSION')));
57 $die->('%PLATFORM% is not defined') if (!defined(env('PLATFORM')));
58 $die->('%TARGETCPU% is not defined') if (!defined(env('TARGETCPU')));
61 # Idea behind this is to mimic flags set by eVC++ IDE...
63 my $wcevers = env('OSVERSION'); # WCENNN
66 if ($wcevers =~ /^WCE([1-9])([0-9]{2})$/) {
68 $wceverdotnum = "$1.$2";
70 $die->('%OSVERSION% value is insane');
71 $wcevernum = "{unknown}";
72 $wceverdotnum = "{unknown}";
74 my $wcecdefs = "-D_WIN32_WCE=$wcevernum -DUNDER_CE=$wcevernum"; # -D_WIN32_WCE=NNN
75 my $wcelflag = "/subsystem:windowsce,$wceverdotnum"; # ...,N.NN
77 my $wceplatf = env('PLATFORM');
79 $wceplatf =~ tr/a-z0-9 /A-Z0-9_/;
80 $wcecdefs .= " -DWCE_PLATFORM_$wceplatf";
82 my $wcetgt = env('TARGETCPU'); # just shorter name...
83 SWITCH: for($wcetgt) {
84 /^X86/ && do { $wcecdefs.=" -Dx86 -D_X86_ -D_i386_ -Di_386_";
85 $wcelflag.=" /machine:X86"; last; };
86 /^ARMV4[IT]/ && do { $wcecdefs.=" -DARM -D_ARM_ -D$wcetgt";
87 $wcecdefs.=" -DTHUMB -D_THUMB_" if($wcetgt=~/T$/);
88 $wcecdefs.=" -QRarch4T -QRinterwork-return";
89 $wcelflag.=" /machine:THUMB"; last; };
90 /^ARM/ && do { $wcecdefs.=" -DARM -D_ARM_ -D$wcetgt";
91 $wcelflag.=" /machine:ARM"; last; };
92 /^MIPSIV/ && do { $wcecdefs.=" -DMIPS -D_MIPS_ -DR4000 -D$wcetgt";
93 $wcecdefs.=" -D_MIPS64 -QMmips4 -QMn32";
94 $wcelflag.=" /machine:MIPSFPU"; last; };
95 /^MIPS16/ && do { $wcecdefs.=" -DMIPS -D_MIPS_ -DR4000 -D$wcetgt";
96 $wcecdefs.=" -DMIPSII -QMmips16";
97 $wcelflag.=" /machine:MIPS16"; last; };
98 /^MIPSII/ && do { $wcecdefs.=" -DMIPS -D_MIPS_ -DR4000 -D$wcetgt";
99 $wcecdefs.=" -QMmips2";
100 $wcelflag.=" /machine:MIPS"; last; };
101 /^R4[0-9]{3}/ && do { $wcecdefs.=" -DMIPS -D_MIPS_ -DR4000";
102 $wcelflag.=" /machine:MIPS"; last; };
103 /^SH[0-9]/ && do { $wcecdefs.=" -D$wcetgt -D_${wcetgt}_ -DSHx";
104 $wcecdefs.=" -Qsh4" if ($wcetgt =~ /^SH4/);
105 $wcelflag.=" /machine:$wcetgt"; last; };
106 { $wcecdefs.=" -D$wcetgt -D_${wcetgt}_";
107 $wcelflag.=" /machine:$wcetgt"; last; };
110 $vc_wince_info = { cppflags => $wcecdefs,
111 lflags => $wcelflag };
113 return $vc_wince_info;
116 # Helper functions for the VMS configs
119 unless (%$vms_info) {
120 my $pointer_size = shift;
121 my $pointer_size_str = $pointer_size == 0 ? "" : "$pointer_size";
123 $vms_info->{disable_warns} = [ ];
124 $vms_info->{pointer_size} = $pointer_size_str;
125 if ($pointer_size == 64) {
126 `PIPE CC /NOCROSS_REFERENCE /NOLIST /NOOBJECT /WARNINGS = DISABLE = ( MAYLOSEDATA3, EMPTYFILE ) NL: 2> NL:`;
128 push @{$vms_info->{disable_warns}}, "MAYLOSEDATA3";
132 unless ($disabled{zlib}) {
133 my $default_zlib = 'GNV$LIBZSHR' . $pointer_size_str;
134 if (defined($disabled{"zlib-dynamic"})) {
135 $vms_info->{zlib} = $withargs{zlib_lib} || "$default_zlib/SHARE";
137 $vms_info->{def_zlib} = $withargs{zlib_lib} || $default_zlib;
138 # In case the --with-zlib-lib value contains something like
139 # /SHARE or /LIB or so at the end, remove it.
140 $vms_info->{def_zlib} =~ s|/.*$||g;
149 #### Basic configs that should work on any 32-bit box
152 cflags => picker(debug => "-O0 -g",
154 thread_scheme => "(unknown)",
155 bn_ops => "BN_LLONG",
160 thread_scheme => "(unknown)",
163 #### VOS Configurations
165 inherit_from => [ "BASE_unix" ],
167 cflags => picker(default => "-Wall",
170 cppflags => "-D_POSIX_C_SOURCE=200112L -D_BSD -D_VOS_EXTENDED_NAMES -DB_ENDIAN",
171 thread_scheme => "(unknown)",
173 lflags => add("-Wl,-map"),
174 bn_ops => "BN_LLONG",
175 shared_extension => ".so",
178 #### Solaris configurations
179 "solaris-common" => {
180 inherit_from => [ "BASE_unix" ],
182 cppflags => "-DFILIO_H",
183 ex_libs => add("-lsocket -lnsl -ldl"),
184 dso_scheme => "dlfcn",
185 thread_scheme => "pthreads",
186 shared_target => "solaris-shared",
187 shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
189 #### Solaris x86 with GNU C setups
190 "solaris-x86-gcc" => {
191 # NB. GNU C has to be configured to use GNU assembler, and not
192 # /usr/ccs/bin/as. Failure to comply will result in compile
193 # failures [at least] in 32-bit build.
194 inherit_from => [ "solaris-common", asm("x86_elf_asm") ],
196 cflags => add_before(picker(default => "-Wall",
198 release => "-O3 -fomit-frame-pointer"),
199 threads("-pthread")),
200 cppflags => add("-DL_DEBIAN"),
201 ex_libs => add(threads("-pthread")),
202 bn_ops => "BN_LLONG",
203 shared_cflag => "-fPIC",
204 shared_ldflag => "-shared -static-libgcc",
206 "solaris64-x86_64-gcc" => {
207 # -shared -static-libgcc might appear controversial, but modules
208 # taken from static libgcc do not have relocations and linking
209 # them into our shared objects doesn't have any negative side
210 # effects. On the contrary, doing so makes it possible to use
211 # gcc shared build with Sun C. Given that gcc generates faster
212 # code [thanks to inline assembler], I would actually recommend
213 # to consider using gcc shared build even with vendor compiler:-)
214 # -- <appro@openssl.org>
215 inherit_from => [ "solaris-common", asm("x86_64_asm") ],
217 cflags => add_before(picker(default => "-m64 -Wall",
220 threads("-pthread")),
221 cppflags => add("-DL_DEBIAN"),
222 ex_libs => add(threads("-pthread")),
223 bn_ops => "SIXTY_FOUR_BIT_LONG",
224 perlasm_scheme => "elf",
225 shared_cflag => "-fPIC",
226 shared_ldflag => "-shared -static-libgcc",
230 #### Solaris x86 with Sun C setups
231 # There used to be solaris-x86-cc target, but it was removed,
232 # primarily because vendor assembler can't assemble our modules
233 # with -KPIC flag. As result it, assembly support, was not even
234 # available as option. But its lack means lack of side-channel
235 # resistant code, which is incompatible with security by todays
236 # standards. Fortunately gcc is readily available prepackaged
237 # option, which we can firmly point at...
239 # On related note, solaris64-x86_64-cc target won't compile code
240 # paths utilizing AVX and post-Haswell instruction extensions.
241 # Consider switching to solaris64-x86_64-gcc even here...
243 "solaris64-x86_64-cc" => {
244 inherit_from => [ "solaris-common", asm("x86_64_asm") ],
246 cflags => add_before(picker(default => "-xarch=generic64 -xstrconst -Xa",
248 release => "-xO5 -xdepend -xbuiltin")),
249 cppflags => add("-DL_DEBIAN", threads("-D_REENTRANT")),
250 thread_scheme => "pthreads",
251 lflags => add(threads("-mt")),
252 ex_libs => add(threads("-lpthread")),
253 bn_ops => "SIXTY_FOUR_BIT_LONG",
254 perlasm_scheme => "elf",
255 shared_cflag => "-KPIC",
256 shared_ldflag => "-G -dy -z text",
260 #### SPARC Solaris with GNU C setups
261 "solaris-sparcv7-gcc" => {
262 inherit_from => [ "solaris-common" ],
264 cflags => add_before(picker(default => "-Wall",
267 threads("-pthread")),
268 cppflags => add("-DB_DEBIAN -DBN_DIV2W"),
269 ex_libs => add(threads("-pthread")),
270 bn_ops => "BN_LLONG RC4_CHAR",
271 shared_cflag => "-fPIC",
272 shared_ldflag => "-shared",
274 "solaris-sparcv8-gcc" => {
275 inherit_from => [ "solaris-sparcv7-gcc", asm("sparcv8_asm") ],
276 cflags => add_before("-mcpu=v8"),
278 "solaris-sparcv9-gcc" => {
279 # -m32 should be safe to add as long as driver recognizes
281 inherit_from => [ "solaris-sparcv7-gcc", asm("sparcv9_asm") ],
282 cflags => add_before("-m32 -mcpu=ultrasparc"),
284 "solaris64-sparcv9-gcc" => {
285 inherit_from => [ "solaris-sparcv9-gcc" ],
286 cflags => sub { my $f=join(" ",@_); $f =~ s/\-m32/-m64/; $f; },
287 bn_ops => "BN_LLONG RC4_CHAR",
291 #### SPARC Solaris with Sun C setups
292 # SC4.0 doesn't pass 'make test', upgrade to SC5.0 or SC4.2.
293 # SC4.2 is ok, better than gcc even on bn as long as you tell it -xarch=v8
294 # SC5.0 note: Compiler common patch 107357-01 or later is required!
295 "solaris-sparcv7-cc" => {
296 inherit_from => [ "solaris-common" ],
298 cflags => add_before(picker(default => "-xstrconst -Xa",
300 release => "-xO5 -xdepend")),
301 cppflags => add("-DB_DEBIAN -DBN_DIV2W",
302 threads("-D_REENTRANT")),
303 lflags => add(threads("-mt")),
304 ex_libs => add(threads("-lpthread")),
305 bn_ops => "BN_LLONG RC4_CHAR",
306 shared_cflag => "-KPIC",
307 shared_ldflag => "-G -dy -z text",
310 "solaris-sparcv8-cc" => {
311 inherit_from => [ "solaris-sparcv7-cc", asm("sparcv8_asm") ],
312 cflags => add_before("-xarch=v8"),
314 "solaris-sparcv9-cc" => {
315 inherit_from => [ "solaris-sparcv7-cc", asm("sparcv9_asm") ],
316 cflags => add_before("-xarch=v8plus"),
318 "solaris64-sparcv9-cc" => {
319 inherit_from => [ "solaris-sparcv7-cc", asm("sparcv9_asm") ],
320 cflags => add_before("-xarch=v9"),
321 bn_ops => "BN_LLONG RC4_CHAR",
325 #### IRIX 6.x configs
326 # Only N32 and N64 ABIs are supported.
327 "irix-mips3-gcc" => {
328 inherit_from => [ "BASE_unix", asm("mips64_asm") ],
330 cflags => combine(picker(default => "-mabi=n32",
333 cppflags => combine("-DB_DEBIAN -DBN_DIV3W",
334 threads("-D_SGI_MP_SOURCE")),
335 ex_libs => add(threads("-lpthread")),
336 bn_ops => "RC4_CHAR SIXTY_FOUR_BIT",
337 thread_scheme => "pthreads",
338 perlasm_scheme => "n32",
339 dso_scheme => "dlfcn",
340 shared_target => "irix-shared",
341 shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
345 inherit_from => [ "BASE_unix", asm("mips64_asm") ],
347 cflags => combine(picker(default => "-n32 -mips3 -use_readonly_const -G0 -rdata_shared",
350 cppflags => combine("-DB_DEBIAN -DBN_DIV3W",
351 threads("-D_SGI_MP_SOURCE")),
352 ex_libs => add(threads("-lpthread")),
353 bn_ops => "RC4_CHAR SIXTY_FOUR_BIT",
354 thread_scheme => "pthreads",
355 perlasm_scheme => "n32",
356 dso_scheme => "dlfcn",
357 shared_target => "irix-shared",
358 shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
362 "irix64-mips4-gcc" => {
363 inherit_from => [ "BASE_unix", asm("mips64_asm") ],
365 cflags => combine(picker(default => "-mabi=64 -mips4",
368 cppflags => combine("-DB_DEBIAN -DBN_DIV3W",
369 threads("-D_SGI_MP_SOURCE")),
370 ex_libs => add(threads("-lpthread")),
371 bn_ops => "RC4_CHAR SIXTY_FOUR_BIT_LONG",
372 thread_scheme => "pthreads",
373 perlasm_scheme => "64",
374 dso_scheme => "dlfcn",
375 shared_target => "irix-shared",
376 shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
379 "irix64-mips4-cc" => {
380 inherit_from => [ "BASE_unix", asm("mips64_asm") ],
382 cflags => combine(picker(default => "-64 -mips4 -use_readonly_const -G0 -rdata_shared",
385 cppflags => combine("-DB_DEBIAN -DBN_DIV3W",
386 threads("-D_SGI_MP_SOURCE")),
387 ex_libs => add(threads("-lpthread")),
388 bn_ops => "RC4_CHAR SIXTY_FOUR_BIT_LONG",
389 thread_scheme => "pthreads",
390 perlasm_scheme => "64",
391 dso_scheme => "dlfcn",
392 shared_target => "irix-shared",
393 shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
397 #### Unified HP-UX ANSI C configs.
399 # - Originally we were optimizing at +O4 level. It should be noted
400 # that the only difference between +O3 and +O4 is global inter-
401 # procedural analysis. As it has to be performed during the link
402 # stage the compiler leaves behind certain pseudo-code in lib*.a
403 # which might be release or even patch level specific. Generating
404 # the machine code for and analyzing the *whole* program appears
405 # to be *extremely* memory demanding while the performance gain is
406 # actually questionable. The situation is intensified by the default
407 # HP-UX data set size limit (infamous 'maxdsiz' tunable) of 64MB
408 # which is way too low for +O4. In other words, doesn't +O3 make
410 # - Keep in mind that the HP compiler by default generates code
411 # suitable for execution on the host you're currently compiling at.
412 # If the toolkit is meant to be used on various PA-RISC processors
413 # consider './Configure hpux-parisc-[g]cc +DAportable'.
414 # - -DMD32_XARRAY triggers workaround for compiler bug we ran into in
415 # 32-bit message digests. (For the moment of this writing) HP C
416 # doesn't seem to "digest" too many local variables (they make "him"
417 # chew forever:-). For more details look-up MD32_XARRAY comment in
418 # crypto/sha/sha_lcl.h.
419 # - originally there were 32-bit hpux-parisc2-* targets. They were
420 # scrapped, because a) they were not interchangeable with other 32-bit
421 # targets; b) performance-critical 32-bit assembly modules implement
422 # even PA-RISC 2.0-specific code paths, which are chosen at run-time,
423 # thus adequate performance is provided even with PA-RISC 1.1 build.
424 "hpux-parisc-gcc" => {
425 inherit_from => [ "BASE_unix" ],
427 cflags => combine(picker(debug => "-O0 -g",
429 threads("-pthread")),
430 cppflags => "-DB_DEBIAN -DBN_DIV2W",
431 ex_libs => add("-Wl,+s -ldld", threads("-pthread")),
432 bn_ops => "BN_LLONG",
433 thread_scheme => "pthreads",
435 shared_target => "hpux-shared",
436 shared_cflag => "-fPIC",
437 shared_ldflag => "-shared",
438 shared_extension => ".sl.\$(SHLIB_VERSION_NUMBER)",
440 "hpux-parisc1_1-gcc" => {
441 inherit_from => [ "hpux-parisc-gcc", asm("parisc11_asm") ],
442 multilib => "/pa1.1",
444 "hpux64-parisc2-gcc" => {
445 inherit_from => [ "BASE_unix", asm("parisc20_64_asm") ],
447 cflags => combine(picker(debug => "-O0 -g",
449 cppflags => combine("-DB_DEBIAN", threads("-D_REENTRANT")),
450 ex_libs => add("-ldl"),
451 bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
452 thread_scheme => "pthreads",
453 dso_scheme => "dlfcn",
454 shared_target => "hpux-shared",
455 shared_cflag => "-fpic",
456 shared_ldflag => "-shared",
457 shared_extension => ".sl.\$(SHLIB_VERSION_NUMBER)",
458 multilib => "/pa20_64",
461 # More attempts at unified 10.X and 11.X targets for HP C compiler.
462 "hpux-parisc-cc" => {
463 inherit_from => [ "BASE_unix" ],
465 cflags => combine(picker(default => "+Optrs_strongly_typed -Ae +ESlit",
466 debug => "+O0 +d -g",
468 cppflags => combine("-DB_DEBIAN -DBN_DIV2W -DMD32_XARRAY",
469 threads("-D_REENTRANT")),
470 ex_libs => add("-Wl,+s -ldld",threads("-lpthread")),
471 bn_ops => "RC4_CHAR",
472 thread_scheme => "pthreads",
474 shared_target => "hpux-shared",
475 shared_cflag => "+Z",
476 shared_ldflag => "-b",
477 shared_extension => ".sl.\$(SHLIB_VERSION_NUMBER)",
479 "hpux-parisc1_1-cc" => {
480 inherit_from => [ "hpux-parisc-cc", asm("parisc11_asm") ],
481 cflags => add_before("+DA1.1"),
482 multilib => "/pa1.1",
484 "hpux64-parisc2-cc" => {
485 inherit_from => [ "BASE_unix", asm("parisc20_64_asm") ],
487 cflags => combine(picker(default => "+DD64 +Optrs_strongly_typed -Ae +ESlit",
488 debug => "+O0 +d -g",
490 cppflags => combine("-DB_DEBIAN -DMD32_XARRAY",
491 threads("-D_REENTRANT")),
492 ex_libs => add("-ldl",threads("-lpthread")),
493 bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
494 thread_scheme => "pthreads",
495 dso_scheme => "dlfcn",
496 shared_target => "hpux-shared",
497 shared_cflag => "+Z",
498 shared_ldflag => "-b",
499 shared_extension => ".sl.\$(SHLIB_VERSION_NUMBER)",
500 multilib => "/pa20_64",
503 # HP/UX IA-64 targets
505 inherit_from => [ "BASE_unix", asm("ia64_asm") ],
507 cflags => combine(picker(default => "-Ae +DD32 +Olit=all -z",
508 debug => "+O0 +d -g",
510 cppflags => combine("-DB_DEBIAN", threads("-D_REENTRANT")),
511 ex_libs => add("-ldl",threads("-lpthread")),
512 bn_ops => "SIXTY_FOUR_BIT",
513 thread_scheme => "pthreads",
514 dso_scheme => "dlfcn",
515 shared_target => "hpux-shared",
516 shared_cflag => "+Z",
517 shared_ldflag => "-b",
518 shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
519 multilib => "/hpux32",
521 "hpux64-ia64-cc" => {
522 inherit_from => [ "BASE_unix", asm("ia64_asm") ],
524 cflags => combine(picker(default => "-Ae +DD64 +Olit=all -z",
525 debug => "+O0 +d -g",
527 cppflags => combine("-DB_DEBIAN", threads("-D_REENTRANT")),
528 ex_libs => add("-ldl", threads("-lpthread")),
529 bn_ops => "SIXTY_FOUR_BIT_LONG",
530 thread_scheme => "pthreads",
531 dso_scheme => "dlfcn",
532 shared_target => "hpux-shared",
533 shared_cflag => "+Z",
534 shared_ldflag => "-b",
535 shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
536 multilib => "/hpux64",
540 inherit_from => [ "BASE_unix", asm("ia64_asm") ],
542 cflags => combine(picker(debug => "-O0 -g",
544 threads("-pthread")),
545 cppflags => "-DB_DEBIAN",
546 ex_libs => add("-ldl", threads("-pthread")),
547 bn_ops => "SIXTY_FOUR_BIT",
548 thread_scheme => "pthreads",
549 dso_scheme => "dlfcn",
550 shared_target => "hpux-shared",
551 shared_cflag => "-fpic",
552 shared_ldflag => "-shared",
553 shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
554 multilib => "/hpux32",
556 "hpux64-ia64-gcc" => {
557 inherit_from => [ "BASE_unix", asm("ia64_asm") ],
559 cflags => combine(picker(default => "-mlp64",
562 threads("-pthread")),
563 cppflags => "-DB_DEBIAN",
564 ex_libs => add("-ldl", threads("-pthread")),
565 bn_ops => "SIXTY_FOUR_BIT_LONG",
566 thread_scheme => "pthreads",
567 dso_scheme => "dlfcn",
568 shared_target => "hpux-shared",
569 shared_cflag => "-fpic",
570 shared_ldflag => "-shared",
571 shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
572 multilib => "/hpux64",
575 #### HP MPE/iX http://jazz.external.hp.com/src/openssl/
577 inherit_from => [ "BASE_unix" ],
580 cppflags => "-D_ENDIAN -DBN_DIV2W -D_POSIX_SOURCE -D_SOCKET_SOURCE",
581 includes => [ "/SYSLOG/PUB" ],
583 lflags => add("-L/SYSLOG/PUB"),
584 ex_libs => add("-lsyslog -lsocket -lcurses"),
585 thread_scheme => "(unknown)",
586 bn_ops => "BN_LLONG",
589 #### DEC Alpha Tru64 targets. Tru64 is marketing name for OSF/1 version 4
590 #### and forward. In reality 'uname -s' still returns "OSF1". Originally
591 #### there were even osf1-* configs targeting prior versions provided,
592 #### but not anymore...
593 "tru64-alpha-gcc" => {
594 inherit_from => [ "BASE_unix", asm("alpha_asm") ],
596 cflags => combine("-std=c9x -O3", threads("-pthread")),
597 cppflags => "-D_XOPEN_SOURCE=500 -D_OSF_SOURCE",
598 ex_libs => add("-lrt", threads("-pthread")), # for mlock(2)
599 bn_ops => "SIXTY_FOUR_BIT_LONG",
600 thread_scheme => "pthreads",
601 dso_scheme => "dlfcn",
602 shared_target => "alpha-osf1-shared",
603 shared_extension => ".so",
605 "tru64-alpha-cc" => {
606 inherit_from => [ "BASE_unix", asm("alpha_asm") ],
608 cflags => combine("-std1 -tune host -fast -readonly_strings",
609 threads("-pthread")),
610 cppflags => "-D_XOPEN_SOURCE=500 -D_OSF_SOURCE",
611 ex_libs => add("-lrt", threads("-pthread")), # for mlock(2)
612 bn_ops => "SIXTY_FOUR_BIT_LONG",
613 thread_scheme => "pthreads",
614 dso_scheme => "dlfcn",
615 shared_target => "alpha-osf1-shared",
616 shared_ldflag => "-msym",
617 shared_extension => ".so",
621 #### Variety of LINUX:-)
623 # *-generic* is endian-neutral target, but ./config is free to
624 # throw in -D[BL]_ENDIAN, whichever appropriate...
625 "linux-generic32" => {
626 inherit_from => [ "BASE_unix" ],
629 cflags => combine(picker(default => "-Wall",
632 threads("-pthread")),
633 cppflags => "-DOPENSSL_USE_NODELETE",
634 ex_libs => add("-ldl", threads("-pthread")),
635 bn_ops => "BN_LLONG RC4_CHAR",
636 thread_scheme => "pthreads",
637 dso_scheme => "dlfcn",
638 shared_target => "linux-shared",
639 shared_cflag => "-fPIC",
640 shared_ldflag => "-Wl,-znodelete",
641 shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
643 "linux-generic64" => {
644 inherit_from => [ "linux-generic32" ],
645 bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
649 inherit_from => [ "linux-generic32", asm("ppc32_asm") ],
650 perlasm_scheme => "linux32",
653 inherit_from => [ "linux-generic64", asm("ppc64_asm") ],
654 cflags => add("-m64"),
655 cppflags => add("-DB_ENDIAN"),
656 perlasm_scheme => "linux64",
660 inherit_from => [ "linux-generic64", asm("ppc64_asm") ],
661 cflags => add("-m64"),
662 cppflags => add("-DL_ENDIAN"),
663 perlasm_scheme => "linux64le",
667 ################################################################
668 # Note that -march is not among compiler options in linux-armv4
669 # target description. Not specifying one is intentional to give
672 # a) rely on your compiler default by not specifying one;
673 # b) specify your target platform explicitly for optimal
674 # performance, e.g. -march=armv6 or -march=armv7-a;
675 # c) build "universal" binary that targets *range* of platforms
676 # by specifying minimum and maximum supported architecture;
678 # As for c) option. It actually makes no sense to specify
679 # maximum to be less than ARMv7, because it's the least
680 # requirement for run-time switch between platform-specific
681 # code paths. And without run-time switch performance would be
682 # equivalent to one for minimum. Secondly, there are some
683 # natural limitations that you'd have to accept and respect.
684 # Most notably you can *not* build "universal" binary for
685 # big-endian platform. This is because ARMv7 processor always
686 # picks instructions in little-endian order. Another similar
687 # limitation is that -mthumb can't "cross" -march=armv6t2
688 # boundary, because that's where it became Thumb-2. Well, this
689 # limitation is a bit artificial, because it's not really
690 # impossible, but it's deemed too tricky to support. And of
691 # course you have to be sure that your binutils are actually
692 # up to the task of handling maximum target platform. With all
693 # this in mind here is an example of how to configure
696 # ./Configure linux-armv4 -march=armv6 -D__ARM_MAX_ARCH__=8
698 inherit_from => [ "linux-generic32", asm("armv4_asm") ],
699 perlasm_scheme => "linux32",
702 inherit_from => [ "linux-generic64", asm("aarch64_asm") ],
703 perlasm_scheme => "linux64",
705 "linux-arm64ilp32" => { # https://wiki.linaro.org/Platform/arm64-ilp32
706 inherit_from => [ "linux-generic32", asm("aarch64_asm") ],
707 cflags => add("-mabi=ilp32"),
708 bn_ops => "SIXTY_FOUR_BIT RC4_CHAR",
709 perlasm_scheme => "linux64",
713 # Configure script adds minimally required -march for assembly
714 # support, if no -march was specified at command line.
715 inherit_from => [ "linux-generic32", asm("mips32_asm") ],
716 cflags => add("-mabi=32"),
717 cppflags => add("-DBN_DIV3W"),
718 perlasm_scheme => "o32",
720 # mips32 and mips64 below refer to contemporary MIPS Architecture
721 # specifications, MIPS32 and MIPS64, rather than to kernel bitness.
723 inherit_from => [ "linux-generic32", asm("mips64_asm") ],
724 cflags => add("-mabi=n32"),
725 cppflags => add("-DBN_DIV3W"),
726 bn_ops => "SIXTY_FOUR_BIT RC4_CHAR",
727 perlasm_scheme => "n32",
730 "linux64-mips64" => {
731 inherit_from => [ "linux-generic64", asm("mips64_asm") ],
732 cflags => add("-mabi=64"),
733 cppflags => add("-DBN_DIV3W"),
734 perlasm_scheme => "64",
738 #### IA-32 targets...
739 #### These two targets are a bit aged and are to be used on older Linux
740 #### machines where gcc doesn't understand -m32 and -m64
742 inherit_from => [ "linux-generic32", asm("x86_elf_asm") ],
743 cflags => add(picker(release => "-fomit-frame-pointer")),
744 cppflags => add("-DL_ENDIAN"),
745 bn_ops => "BN_LLONG",
748 inherit_from => [ "BASE_unix", asm("x86_asm") ],
750 cflags => add(picker(default => "-Wall",
752 release => "-O3 -fomit-frame-pointer")),
753 cppflags => add("-DL_ENDIAN"),
754 bn_ops => "BN_LLONG",
755 thread_scheme => "(unknown)",
756 perlasm_scheme => "a.out",
759 #### X86 / X86_64 targets
761 inherit_from => [ "linux-generic32", asm("x86_asm") ],
762 cflags => add(picker(default => "-m32",
763 release => "-fomit-frame-pointer")),
764 cppflags => add("-DL_ENDIAN"),
765 bn_ops => "BN_LLONG",
766 perlasm_scheme => "elf",
768 "linux-x86-clang" => {
769 inherit_from => [ "linux-x86" ],
772 cflags => add("-Wextra"),
775 inherit_from => [ "linux-generic64", asm("x86_64_asm") ],
776 cflags => add("-m64"),
777 cppflags => add("-DL_ENDIAN"),
778 bn_ops => "SIXTY_FOUR_BIT_LONG",
779 perlasm_scheme => "elf",
782 "linux-x86_64-clang" => {
783 inherit_from => [ "linux-x86_64" ],
786 cflags => add("-Wextra"),
789 inherit_from => [ "linux-generic32", asm("x86_64_asm") ],
790 cflags => add("-mx32"),
791 cppflags => add("-DL_ENDIAN"),
792 bn_ops => "SIXTY_FOUR_BIT",
793 perlasm_scheme => "elf32",
798 inherit_from => [ "linux-generic64", asm("ia64_asm") ],
799 bn_ops => "SIXTY_FOUR_BIT_LONG",
803 inherit_from => [ "linux-generic64", asm("s390x_asm") ],
804 cflags => add("-m64"),
805 cppflags => add("-DB_ENDIAN"),
806 perlasm_scheme => "64",
810 #### So called "highgprs" target for z/Architecture CPUs
811 # "Highgprs" is kernel feature first implemented in Linux
812 # 2.6.32, see /proc/cpuinfo. The idea is to preserve most
813 # significant bits of general purpose registers not only
814 # upon 32-bit process context switch, but even on
815 # asynchronous signal delivery to such process. This makes
816 # it possible to deploy 64-bit instructions even in legacy
817 # application context and achieve better [or should we say
818 # adequate] performance. The build is binary compatible with
819 # linux-generic32, and the idea is to be able to install the
820 # resulting libcrypto.so alongside generic one, e.g. as
821 # /lib/highgprs/libcrypto.so.x.y, for ldconfig and run-time
822 # linker to autodiscover. Unfortunately it doesn't work just
823 # yet, because of couple of bugs in glibc
824 # sysdeps/s390/dl-procinfo.c affecting ldconfig and ld.so.1...
826 inherit_from => [ "linux-generic32", asm("s390x_asm") ],
827 cflags => add("-m31 -Wa,-mzarch"),
828 cppflags => add("-DB_ENDIAN"),
829 bn_asm_src => sub { my $r=join(" ",@_); $r=~s|asm/s390x\.S|bn_asm.c|; $r; },
830 perlasm_scheme => "31",
831 multilib => "/highgprs",
834 #### SPARC Linux setups
836 inherit_from => [ "linux-generic32", asm("sparcv8_asm") ],
837 cflags => add("-mcpu=v8"),
838 cppflags => add("-DB_ENDIAN -DBN_DIV2W"),
841 # it's a real mess with -mcpu=ultrasparc option under Linux,
842 # but -Wa,-Av8plus should do the trick no matter what.
843 inherit_from => [ "linux-generic32", asm("sparcv9_asm") ],
844 cflags => add("-m32 -mcpu=ultrasparc -Wa,-Av8plus"),
845 cppflags => add("-DB_ENDIAN -DBN_DIV2W"),
847 "linux64-sparcv9" => {
848 # GCC 3.1 is a requirement
849 inherit_from => [ "linux-generic64", asm("sparcv9_asm") ],
850 cflags => add("-m64 -mcpu=ultrasparc"),
851 cppflags => add("-DB_ENDIAN"),
852 bn_ops => "BN_LLONG RC4_CHAR",
856 "linux-alpha-gcc" => {
857 inherit_from => [ "linux-generic64", asm("alpha_asm") ],
858 cppflags => add("-DL_ENDIAN"),
859 bn_ops => "SIXTY_FOUR_BIT_LONG",
861 "linux-c64xplus" => {
862 inherit_from => [ "BASE_unix" ],
863 # TI_CGT_C6000_7.3.x is a requirement
865 cflags => "--linux -ea=.s -eo=.o -mv6400+ -o2 -ox -ms -pden",
866 cppflags => combine("-DOPENSSL_SMALL_FOOTPRINT",
867 threads("-D_REENTRANT")),
868 bn_ops => "BN_LLONG",
869 cpuid_asm_src => "c64xpluscpuid.s",
870 bn_asm_src => "asm/bn-c64xplus.asm c64xplus-gf2m.s",
871 aes_asm_src => "aes-c64xplus.s aes_cbc.c aes-ctr.fake",
872 sha1_asm_src => "sha1-c64xplus.s sha256-c64xplus.s sha512-c64xplus.s",
873 rc4_asm_src => "rc4-c64xplus.s",
874 modes_asm_src => "ghash-c64xplus.s",
875 chacha_asm_src => "chacha-c64xplus.s",
876 poly1305_asm_src => "poly1305-c64xplus.s",
877 thread_scheme => "pthreads",
878 perlasm_scheme => "void",
879 dso_scheme => "dlfcn",
880 shared_target => "linux-shared",
881 shared_cflag => "--pic",
882 shared_ldflag => add("-z --sysv --shared"),
883 shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
887 #### Android: linux-* but without pointers to headers and libs.
889 # It takes pair of prior-set environment variables to make it work:
891 # CROSS_SYSROOT=/some/where/android-ndk-<ver>/platforms/android-<apiver>/arch-<arch>
892 # CROSS_COMPILE=<prefix>
894 # As well as PATH adjusted to cover ${CROSS_COMPILE}gcc and company.
895 # For example to compile for ICS and ARM with NDK 10d, you'd:
897 # ANDROID_NDK=/some/where/android-ndk-10d
898 # CROSS_SYSROOT=$ANDROID_NDK/platforms/android-14/arch-arm
899 # CROSS_COMPILE=arm-linux-androideabi-
900 # PATH=$ANDROID_NDK/toolchains/arm-linux-androideabi-4.8/prebuild/linux-x86_64/bin
903 inherit_from => [ "linux-generic32" ],
904 # Special note about unconditional -fPIC and -pie. The underlying
905 # reason is that Lollipop refuses to run non-PIE. But what about
906 # older systems and NDKs? -fPIC was never problem, so the only
907 # concern is -pie. Older toolchains, e.g. r4, appear to handle it
908 # and binaries turn mostly functional. "Mostly" means that oldest
909 # Androids, such as Froyo, fail to handle executable, but newer
910 # systems are perfectly capable of executing binaries targeting
911 # Froyo. Keep in mind that in the nutshell Android builds are
912 # about JNI, i.e. shared libraries, not applications.
913 cflags => add(picker(default => "-mandroid -fPIC --sysroot=\$(CROSS_SYSROOT) -Wa,--noexecstack")),
914 bin_cflags => "-pie",
917 inherit_from => [ "android", asm("x86_asm") ],
918 cflags => add(picker(release => "-fomit-frame-pointer")),
919 bn_ops => "BN_LLONG",
920 perlasm_scheme => "android",
922 ################################################################
923 # Contemporary Android applications can provide multiple JNI
924 # providers in .apk, targeting multiple architectures. Among
925 # them there is "place" for two ARM flavours: generic eabi and
926 # armv7-a/hard-float. However, it should be noted that OpenSSL's
927 # ability to engage NEON is not constrained by ABI choice, nor
928 # is your ability to call OpenSSL from your application code
929 # compiled with floating-point ABI other than default 'soft'.
930 # [Latter thanks to __attribute__((pcs("aapcs"))) declaration.]
931 # This means that choice of ARM libraries you provide in .apk
932 # is driven by application needs. For example if application
933 # itself benefits from NEON or is floating-point intensive, then
934 # it might be appropriate to provide both libraries. Otherwise
935 # just generic eabi would do. But in latter case it would be
938 # ./Configure android-armeabi -D__ARM_MAX_ARCH__=8
940 # in order to build "universal" binary and allow OpenSSL take
941 # advantage of NEON when it's available.
943 "android-armeabi" => {
944 inherit_from => [ "android", asm("armv4_asm") ],
947 inherit_from => [ "android", asm("mips32_asm") ],
948 perlasm_scheme => "o32",
952 inherit_from => [ "linux-generic64" ],
953 cflags => add(picker(default => "-mandroid -fPIC --sysroot=\$(CROSS_SYSROOT) -Wa,--noexecstack")),
954 bin_cflags => "-pie",
956 "android64-aarch64" => {
957 inherit_from => [ "android64", asm("aarch64_asm") ],
958 perlasm_scheme => "linux64",
960 "android64-x86_64" => {
961 inherit_from => [ "android64", asm("x86_64_asm") ],
962 perlasm_scheme => "elf",
964 "android64-mips64" => {
965 ############################################################
966 # You are more than likely have to specify target processor
967 # on ./Configure command line. Trouble is that toolchain's
968 # default is MIPS64r6 (at least in r10d), but there are no
969 # such processors around (or they are too rare to spot one).
970 # Actual problem is that MIPS64r6 is binary incompatible
971 # with previous MIPS ISA versions, in sense that unlike
972 # prior versions original MIPS binary code will fail.
974 inherit_from => [ "android64", asm("mips64_asm") ],
975 perlasm_scheme => "64",
980 # As for thread cflag. Idea is to maintain "collective" set of
981 # flags, which would cover all BSD flavors. -pthread applies
982 # to them all, but is treated differently. OpenBSD expands is
983 # as -D_POSIX_THREAD -lc_r, which is sufficient. FreeBSD 4.x
984 # expands it as -lc_r, which has to be accompanied by explicit
985 # -D_THREAD_SAFE and sometimes -D_REENTRANT. FreeBSD 5.x
986 # expands it as -lc_r, which seems to be sufficient?
987 inherit_from => [ "BASE_unix" ],
989 cflags => combine(picker(default => "-Wall",
992 threads("-pthread")),
993 cppflags => threads("-D_THREAD_SAFE -D_REENTRANT"),
994 ex_libs => add(threads("-pthread")),
995 enable => add("devcryptoeng"),
996 bn_ops => "BN_LLONG",
997 thread_scheme => "pthreads",
998 dso_scheme => "dlfcn",
999 shared_target => "bsd-gcc-shared",
1000 shared_cflag => "-fPIC",
1001 shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
1003 "BSD-generic64" => {
1004 inherit_from => [ "BSD-generic32" ],
1005 bn_ops => "SIXTY_FOUR_BIT_LONG",
1009 inherit_from => [ "BSD-generic32", asm("x86_asm") ],
1010 cflags => add(picker(release => "-fomit-frame-pointer")),
1011 cppflags => add("-DL_ENDIAN"),
1012 bn_ops => "BN_LLONG",
1013 shared_target => "bsd-shared",
1014 perlasm_scheme => "a.out",
1017 inherit_from => [ "BSD-x86" ],
1018 perlasm_scheme => "elf",
1022 inherit_from => [ "BSD-generic32", asm("sparcv8_asm") ],
1023 cflags => add("-mcpu=v8"),
1024 cppflags => add("-DB_ENDIAN"),
1027 # -DMD32_REG_T=int doesn't actually belong in sparc64 target, it
1028 # simply *happens* to work around a compiler bug in gcc 3.3.3,
1029 # triggered by RIPEMD160 code.
1030 inherit_from => [ "BSD-generic64", asm("sparcv9_asm") ],
1031 cppflags => add("-DB_ENDIAN -DMD32_REG_T=int"),
1032 bn_ops => "BN_LLONG",
1036 inherit_from => [ "BSD-generic64", asm("ia64_asm") ],
1037 cppflags => add("-DL_ENDIAN"),
1038 bn_ops => "SIXTY_FOUR_BIT_LONG",
1042 inherit_from => [ "BSD-generic64", asm("x86_64_asm") ],
1043 cppflags => add("-DL_ENDIAN"),
1044 bn_ops => "SIXTY_FOUR_BIT_LONG",
1045 perlasm_scheme => "elf",
1049 inherit_from => [ "BASE_unix", asm("x86_elf_asm") ],
1051 cflags => "-fomit-frame-pointer -O3 -Wall",
1052 cppflags => "-DPERL5 -DL_ENDIAN",
1053 ex_libs => add("-ldl"),
1054 bn_ops => "BN_LLONG",
1055 thread_scheme => "(unknown)",
1056 dso_scheme => "dlfcn",
1057 shared_target => "bsd-gcc-shared",
1058 shared_cflag => "-fPIC",
1059 shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
1063 inherit_from => [ "BASE_unix" ],
1065 cflags => "-O -Wall",
1066 unistd => "<libc.h>",
1067 bn_ops => "BN_LLONG",
1068 thread_scheme => "(unknown)",
1071 inherit_from => [ "BASE_unix" ],
1073 cflags => "-O3 -Wall",
1074 unistd => "<libc.h>",
1075 bn_ops => "BN_LLONG",
1076 thread_scheme => "(unknown)",
1081 inherit_from => [ "BASE_unix" ],
1084 cppflags => "-DL_ENDIAN -DTERMIO",
1085 thread_scheme => "(unknown)",
1088 inherit_from => [ "BASE_unix" ],
1090 ex_libs => add("-lsocket"),
1091 dso_scheme => "dlfcn",
1092 shared_target => "bsd-gcc-shared",
1093 shared_cflag => "-fPIC",
1094 shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
1097 inherit_from => [ "BASE_unix", asm("x86_elf_asm") ],
1099 cflags => "-O2 -Wall",
1100 cppflags => "-DL_ENDIAN",
1101 ex_libs => add("-lsocket"),
1102 dso_scheme => "dlfcn",
1103 shared_target => "bsd-gcc-shared",
1104 shared_cflag => "-fPIC",
1105 shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
1108 #### SCO/Caldera targets.
1110 # Originally we had like unixware-*, unixware-*-pentium, unixware-*-p6, etc.
1111 # Now we only have blended unixware-* as it's the only one used by ./config.
1112 # If you want to optimize for particular microarchitecture, bypass ./config
1113 # and './Configure unixware-7 -Kpentium_pro' or whatever appropriate.
1114 # Note that not all targets include assembler support. Mostly because of
1115 # lack of motivation to support out-of-date platforms with out-of-date
1116 # compiler drivers and assemblers.
1118 # UnixWare 2.0x fails destest with -O.
1120 inherit_from => [ "BASE_unix" ],
1122 cflags => combine(threads("-Kthread")),
1123 cppflags => "-DFILIO_H -DNO_STRINGS_H",
1124 ex_libs => add("-lsocket -lnsl -lresolv -lx"),
1125 thread_scheme => "uithreads",
1128 inherit_from => [ "BASE_unix" ],
1130 cflags => combine("-O", threads("-Kthread")),
1131 cppflags => "-DFILIO_H",
1132 ex_libs => add("-lsocket -lnsl -lresolv -lx"),
1133 thread_scheme => "uithreads",
1136 inherit_from => [ "BASE_unix", asm("x86_elf_asm") ],
1138 cflags => combine("-O -Kalloca", threads("-Kthread")),
1139 cppflags => "-DFILIO_H",
1140 ex_libs => add("-lsocket -lnsl"),
1141 thread_scheme => "uithreads",
1142 bn_ops => "BN_LLONG",
1143 perlasm_scheme => "elf-1",
1144 dso_scheme => "dlfcn",
1145 shared_target => "svr5-shared",
1146 shared_cflag => "-Kpic",
1147 shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
1149 "unixware-7-gcc" => {
1150 inherit_from => [ "BASE_unix", asm("x86_elf_asm") ],
1152 cflags => combine("-O3 -fomit-frame-pointer -Wall"),
1153 cppflags => add("-DL_ENDIAN -DFILIO_H",
1154 threads("-D_REENTRANT")),
1155 ex_libs => add("-lsocket -lnsl"),
1156 bn_ops => "BN_LLONG",
1157 thread_scheme => "pthreads",
1158 perlasm_scheme => "elf-1",
1159 dso_scheme => "dlfcn",
1160 shared_target => "gnu-shared",
1161 shared_cflag => "-fPIC",
1162 shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
1164 # SCO 5 - Ben Laurie says the -O breaks the SCO cc.
1166 inherit_from => [ "BASE_unix", asm("x86_elf_asm") ],
1169 ex_libs => add("-lsocket -lnsl"),
1170 thread_scheme => "(unknown)",
1171 perlasm_scheme => "elf-1",
1172 dso_scheme => "dlfcn",
1173 shared_target => "svr3-shared",
1174 shared_cflag => "-Kpic",
1175 shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
1178 inherit_from => [ "BASE_unix", asm("x86_elf_asm") ],
1180 cflags => "-O3 -fomit-frame-pointer",
1181 ex_libs => add("-lsocket -lnsl"),
1182 bn_ops => "BN_LLONG",
1183 thread_scheme => "(unknown)",
1184 perlasm_scheme => "elf-1",
1185 dso_scheme => "dlfcn",
1186 shared_target => "svr3-shared",
1187 shared_cflag => "-fPIC",
1188 shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
1192 # Below targets assume AIX >=5. Caveat lector. If you are accustomed
1193 # to control compilation "bitness" by setting $OBJECT_MODE environment
1194 # variable, then you should know that in OpenSSL case it's considered
1195 # only in ./config. Once configured, build procedure remains "deaf" to
1196 # current value of $OBJECT_MODE.
1198 inherit_from => [ "BASE_unix", asm("ppc32_asm") ],
1200 cflags => combine(picker(debug => "-O0 -g",
1202 threads("-pthread")),
1203 cppflags => "-DB_ENDIAN",
1204 ex_libs => add(threads("-pthread")),
1206 bn_ops => "BN_LLONG RC4_CHAR",
1207 thread_scheme => "pthreads",
1208 perlasm_scheme => "aix32",
1209 dso_scheme => "dlfcn",
1210 shared_target => "aix-shared",
1211 shared_ldflag => "-shared -static-libgcc -Wl,-G",
1212 shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
1216 inherit_from => [ "BASE_unix", asm("ppc64_asm") ],
1218 cflags => combine(picker(default => "-maix64",
1221 threads("-pthread")),
1222 cppflags => "-DB_ENDIAN",
1223 ex_libs => add(threads("-pthread")),
1225 bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
1226 thread_scheme => "pthreads",
1227 perlasm_scheme => "aix64",
1228 dso_scheme => "dlfcn",
1229 shared_target => "aix-shared",
1230 shared_ldflag => "-shared -static-libgcc -Wl,-G",
1231 shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
1235 inherit_from => [ "BASE_unix", asm("ppc32_asm") ],
1237 cflags => combine(picker(default => "-q32 -qmaxmem=16384 -qro -qroconst",
1240 threads("-qthreaded")),
1241 cppflags => combine("-DB_ENDIAN", threads("-D_THREAD_SAFE")),
1243 bn_ops => "BN_LLONG RC4_CHAR",
1244 thread_scheme => "pthreads",
1245 ex_libs => threads("-lpthreads"),
1246 perlasm_scheme => "aix32",
1247 dso_scheme => "dlfcn",
1248 shared_target => "aix-shared",
1249 shared_ldflag => "-G",
1250 shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
1254 inherit_from => [ "BASE_unix", asm("ppc64_asm") ],
1256 cflags => combine(picker(default => "-q64 -qmaxmem=16384 -qro -qroconst",
1259 threads("-qthreaded")),
1260 cppflags => combine("-DB_ENDIAN", threads("-D_THREAD_SAFE")),
1262 bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
1263 thread_scheme => "pthreads",
1264 ex_libs => threads("-lpthreads"),
1265 perlasm_scheme => "aix64",
1266 dso_scheme => "dlfcn",
1267 shared_target => "aix-shared",
1268 shared_ldflag => "-G",
1269 shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
1273 # SIEMENS BS2000/OSD: an EBCDIC-based mainframe
1275 inherit_from => [ "BASE_unix" ],
1277 cflags => "-O -XLLML -XLLMK -XL",
1278 cppflags => "-DB_ENDIAN -DCHARSET_EBCDIC",
1279 ex_libs => add("-lsocket -lnsl"),
1280 bn_ops => "THIRTY_TWO_BIT RC4_CHAR",
1281 thread_scheme => "(unknown)",
1284 #### Visual C targets
1286 # Win64 targets, WIN64I denotes IA-64 and WIN64A - AMD64
1288 # Note about -wd4090, disable warning C4090. This warning returns false
1289 # positives in some situations. Disabling it altogether masks both
1290 # legitimate and false cases, but as we compile on multiple platforms,
1291 # we rely on other compilers to catch legitimate cases.
1293 # Also note that we force threads no matter what. Configuring "no-threads"
1296 inherit_from => [ "BASE_Windows" ],
1299 cflags => "-W3 -wd4090 -Gs0 -GF -Gy -nologo",
1300 defines => add("OPENSSL_SYS_WIN32", "WIN32_LEAN_AND_MEAN",
1301 "L_ENDIAN", "_CRT_SECURE_NO_DEPRECATE",
1302 "_WINSOCK_DEPRECATED_NO_WARNINGS",
1303 sub { my @defs = ();
1304 unless ($disabled{"zlib-dynamic"}) {
1306 $withargs{zlib_lib} // "ZLIB1";
1309 'LIBZ="' . $zlib . '"');
1314 lib_cflags => add("/Zi /Fdossl_static"),
1315 dso_cflags => "/Zi /Fddso",
1316 bin_cflags => "/Zi /Fdapp",
1317 lflags => add("/debug"),
1318 shared_ldflag => "/dll",
1319 shared_target => "win-shared", # meaningless except it gives Configure a hint
1320 thread_scheme => "winthreads",
1321 dso_scheme => "win32",
1322 apps_aux_src => add("win32_init.c"),
1324 "VC-noCE-common" => {
1325 inherit_from => [ "VC-common" ],
1327 cflags => add(picker(debug =>
1329 ($disabled{shared} ? "" : "/MDd")
1334 ($disabled{shared} ? "" : "/MD")
1337 defines => add(picker(default => [ "UNICODE", "_UNICODE" ],
1338 debug => [ "DEBUG", "_DEBUG" ])),
1339 lib_cflags => add(sub { $disabled{shared} ? "/MT /Zl" : () }),
1340 # Following might/should appears controversial, i.e. defining
1341 # /MDd without evaluating $disabled{shared}. It works in
1342 # non-shared build because static library is compiled with /Zl
1343 # and bares no reference to specific RTL. And it works in
1344 # shared build because multiple /MDd options are not prohibited.
1345 # But why /MDd in static build? Well, basically this is just a
1346 # reference point, which allows to catch eventual errors that
1347 # would prevent those who want to wrap OpenSSL into own .DLL.
1348 # Why not /MD in release build then? Well, some are likely to
1349 # prefer [non-debug] openssl.exe to be free from Micorosoft RTL
1351 bin_cflags => add(picker(debug => "/MDd",
1352 release => sub { $disabled{shared} ? "/MT" : () },
1354 bin_lflags => add("/subsystem:console /opt:ref"),
1355 ex_libs => add(sub {
1357 push @ex_libs, 'ws2_32.lib' unless $disabled{sock};
1358 push @ex_libs, 'gdi32.lib advapi32.lib crypt32.lib user32.lib';
1359 return join(" ", @ex_libs);
1362 "VC-WIN64-common" => {
1363 inherit_from => [ "VC-noCE-common" ],
1365 ex_libs => add(sub {
1367 push @ex_libs, 'bufferoverflowu.lib' if (`cl 2>&1` =~ /14\.00\.4[0-9]{4}\./);
1368 return join(" ", @_, @ex_libs);
1370 bn_ops => "SIXTY_FOUR_BIT EXPORT_VAR_AS_FN",
1371 build_scheme => add("VC-W64", { separator => undef }),
1374 inherit_from => [ "VC-WIN64-common", asm("ia64_asm"),
1375 sub { $disabled{shared} ? () : "ia64_uplink" } ],
1377 asflags => "-d debug",
1380 bn_asm_src => sub { return undef unless @_;
1381 my $r=join(" ",@_); $r=~s|bn-ia64.s|bn_asm.c|; $r; },
1382 perlasm_scheme => "ias",
1383 multilib => "-ia64",
1386 inherit_from => [ "VC-WIN64-common", asm("x86_64_asm"),
1387 sub { $disabled{shared} ? () : "x86_64_uplink" } ],
1388 as => sub { vc_win64a_info()->{as} },
1389 asflags => sub { vc_win64a_info()->{asflags} },
1390 asoutflag => sub { vc_win64a_info()->{asoutflag} },
1392 bn_asm_src => sub { return undef unless @_;
1393 my $r=join(" ",@_); $r=~s|asm/x86_64-gcc|bn_asm|; $r; },
1394 perlasm_scheme => "auto",
1398 # x86 Win32 target defaults to ANSI API, if you want UNICODE,
1399 # configure with 'perl Configure VC-WIN32 -DUNICODE -D_UNICODE'
1400 inherit_from => [ "VC-noCE-common", asm("x86_asm"),
1401 sub { $disabled{shared} ? () : "uplink_common" } ],
1402 cflags => add("-WX"),
1403 as => sub { vc_win32_info()->{as} },
1404 asflags => sub { vc_win32_info()->{asflags} },
1405 asoutflag => sub { vc_win32_info()->{asoutflag} },
1406 ex_libs => add(sub {
1408 # WIN32 UNICODE build gets linked with unicows.lib for
1409 # backward compatibility with Win9x.
1410 push @ex_libs, 'unicows.lib'
1411 if (grep { $_ eq "UNICODE" } @user_defines);
1412 return join(" ", @ex_libs, @_);
1415 bn_ops => "BN_LLONG EXPORT_VAR_AS_FN",
1416 perlasm_scheme => sub { vc_win32_info()->{perlasm_scheme} },
1417 build_scheme => add("VC-W32", { separator => undef }),
1420 inherit_from => [ "VC-common" ],
1422 asflags => "/nologo /Cp /coff /c /Cx /Zi",
1427 combine('/W3 /WX /GF /Gy /nologo',
1428 sub { vc_wince_info()->{cflags}; },
1429 sub { `cl 2>&1` =~ /Version ([0-9]+)\./ && $1>=14
1430 ? ($disabled{shared} ? " /MT" : " /MD")
1434 cppflags => sub { vc_wince_info()->{defines}; },
1436 picker(default => [ "UNICODE", "_UNICODE", "OPENSSL_SYS_WINCE",
1437 "WIN32_LEAN_AND_MEAN", "L_ENDIAN", "DSO_WIN32",
1438 "NO_CHMOD", "OPENSSL_SMALL_FOOTPRINT" ],
1439 debug => [ "DEBUG", "_DEBUG" ]),
1441 combine(sub { defined(env('WCECOMPAT'))
1442 ? '$(WCECOMPAT)/include' : (); },
1443 sub { defined(env('PORTSDK_LIBPATH'))
1444 ? '$(PORTSDK_LIBPATH)/../../include' : (); }),
1445 lflags => add(combine("/nologo /opt:ref",
1446 sub { vc_wince_info()->{lflags}; },
1447 sub { defined(env('PORTSDK_LIBPATH'))
1448 ? "/entry:mainCRTstartup" : (); })),
1450 bn_ops => "BN_LLONG EXPORT_VAR_AS_FN",
1451 ex_libs => add(sub {
1453 push @ex_libs, 'ws2.lib' unless $disabled{sock};
1454 push @ex_libs, 'crypt32.lib';
1455 if (defined(env('WCECOMPAT'))) {
1456 my $x = '$(WCECOMPAT)/lib';
1457 if (-f "$x/env('TARGETCPU')/wcecompatex.lib") {
1458 $x .= '/$(TARGETCPU)/wcecompatex.lib';
1460 $x .= '/wcecompatex.lib';
1464 push @ex_libs, '$(PORTSDK_LIBPATH)/portlib.lib'
1465 if (defined(env('PORTSDK_LIBPATH')));
1466 push @ex_libs, ' /nodefaultlib coredll.lib corelibc.lib'
1467 if (env('TARGETCPU') eq "X86");
1470 build_scheme => add("VC-WCE", { separator => undef }),
1475 inherit_from => [ "BASE_unix", asm("x86_asm"),
1476 sub { $disabled{shared} ? () : "x86_uplink" } ],
1478 cflags => picker(default => "-m32 -Wall",
1480 release => "-O3 -fomit-frame-pointer"),
1481 cppflags => combine("-DL_ENDIAN -DWIN32_LEAN_AND_MEAN",
1482 "-DUNICODE -D_UNICODE", threads("-D_MT")),
1483 sys_id => "MINGW32",
1484 ex_libs => add("-lws2_32 -lgdi32 -lcrypt32"),
1485 bn_ops => "BN_LLONG EXPORT_VAR_AS_FN",
1486 thread_scheme => "winthreads",
1487 perlasm_scheme => "coff",
1488 dso_scheme => "win32",
1489 shared_target => "mingw-shared",
1490 shared_cppflags => add("_WINDLL"),
1491 shared_ldflag => "-static-libgcc",
1492 shared_rcflag => "--target=pe-i386",
1493 shared_extension => ".dll",
1495 apps_aux_src => add("win32_init.c"),
1498 # As for OPENSSL_USE_APPLINK. Applink makes it possible to use
1499 # .dll compiled with one compiler with application compiled with
1500 # another compiler. It's possible to engage Applink support in
1501 # mingw64 build, but it's not done, because till mingw64
1502 # supports structured exception handling, one can't seriously
1503 # consider its binaries for using with non-mingw64 run-time
1504 # environment. And as mingw64 is always consistent with itself,
1505 # Applink is never engaged and can as well be omitted.
1506 inherit_from => [ "BASE_unix", asm("x86_64_asm") ],
1508 cflags => picker(default => "-m64 -Wall",
1511 cppflags => combine("-DL_ENDIAN -DWIN32_LEAN_AND_MEAN",
1512 "-DUNICODE -D_UNICODE", threads("-D_MT")),
1513 sys_id => "MINGW64",
1514 ex_libs => add("-lws2_32 -lgdi32 -lcrypt32"),
1515 bn_ops => "SIXTY_FOUR_BIT EXPORT_VAR_AS_FN",
1516 thread_scheme => "winthreads",
1517 perlasm_scheme => "mingw64",
1518 dso_scheme => "win32",
1519 shared_target => "mingw-shared",
1520 shared_cppflags => add("_WINDLL"),
1521 shared_ldflag => "-static-libgcc",
1522 shared_rcflag => "--target=pe-x86-64",
1523 shared_extension => ".dll",
1525 apps_aux_src => add("win32_init.c"),
1530 inherit_from => [ "BASE_unix" ],
1533 cppflags => "-DL_ENDIAN",
1539 inherit_from => [ "BASE_unix" ],
1541 cflags => "-O -Wall",
1542 cppflags => "-DTERMIOS -DL_ENDIAN",
1544 bn_ops => "BN_LLONG",
1545 dso_scheme => "win32",
1550 inherit_from => [ "BASE_unix", asm("x86_asm") ],
1552 cflags => picker(default => "-Wall",
1554 release => "-O3 -fomit-frame-pointer"),
1555 cppflags => "-DTERMIOS -DL_ENDIAN",
1557 bn_ops => "BN_LLONG",
1558 thread_scheme => "pthread",
1559 perlasm_scheme => "coff",
1560 dso_scheme => "dlfcn",
1561 shared_target => "cygwin-shared",
1562 shared_cppflags => "-D_WINDLL",
1563 shared_extension => ".dll",
1565 "Cygwin-x86_64" => {
1566 inherit_from => [ "BASE_unix", asm("x86_64_asm") ],
1568 cflags => picker(default => "-Wall",
1571 cppflags => "-DTERMIOS -DL_ENDIAN",
1573 bn_ops => "SIXTY_FOUR_BIT_LONG",
1574 thread_scheme => "pthread",
1575 perlasm_scheme => "mingw64",
1576 dso_scheme => "dlfcn",
1577 shared_target => "cygwin-shared",
1578 shared_cppflags => "-D_WINDLL",
1579 shared_extension => ".dll",
1581 # Backward compatibility for those using this target
1583 inherit_from => [ "Cygwin-x86" ]
1585 # In case someone constructs the Cygwin target name themself
1587 inherit_from => [ "Cygwin-x86" ]
1590 inherit_from => [ "Cygwin-x86" ]
1593 inherit_from => [ "Cygwin-x86" ]
1596 inherit_from => [ "Cygwin-x86" ]
1599 ##### MacOS X (a.k.a. Darwin) setup
1600 "darwin-common" => {
1601 inherit_from => [ "BASE_unix" ],
1604 cflags => picker(default => "",
1607 cppflags => threads("-D_REENTRANT"),
1609 plib_lflags => "-Wl,-search_paths_first",
1610 bn_ops => "BN_LLONG RC4_CHAR",
1611 thread_scheme => "pthreads",
1612 perlasm_scheme => "osx32",
1613 dso_scheme => "dlfcn",
1614 ranlib => "ranlib -c",
1615 shared_target => "darwin-shared",
1616 shared_cflag => "-fPIC",
1617 shared_extension => ".\$(SHLIB_VERSION_NUMBER).dylib",
1619 # Option "freeze" such as -std=gnu9x can't negatively interfere
1620 # with future defaults for below two targets, because MacOS X
1621 # for PPC has no future, it was discontinued by vendor in 2009.
1622 "darwin-ppc-cc" => {
1623 inherit_from => [ "darwin-common", asm("ppc32_asm") ],
1624 cflags => add("-arch ppc -std=gnu9x -Wa,-force_cpusubtype_ALL"),
1625 cppflags => add("-DB_ENDIAN"),
1626 perlasm_scheme => "osx32",
1628 "darwin64-ppc-cc" => {
1629 inherit_from => [ "darwin-common", asm("ppc64_asm") ],
1630 cflags => add("-arch ppc64 -std=gnu9x"),
1631 cppflags => add("-DB_ENDIAN"),
1632 bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
1633 perlasm_scheme => "osx64",
1635 "darwin-i386-cc" => {
1636 inherit_from => [ "darwin-common", asm("x86_asm") ],
1637 cflags => add(picker(default => "-arch i386",
1638 release => "-fomit-frame-pointer")),
1639 cppflags => add("-DL_ENDIAN"),
1640 bn_ops => "BN_LLONG RC4_INT",
1641 perlasm_scheme => "macosx",
1643 "darwin64-x86_64-cc" => {
1644 inherit_from => [ "darwin-common", asm("x86_64_asm") ],
1645 cflags => add("-arch x86_64 -Wall"),
1646 cppflags => add("-DL_ENDIAN"),
1647 bn_ops => "SIXTY_FOUR_BIT_LONG",
1648 perlasm_scheme => "macosx",
1653 # It takes three prior-set environment variables to make it work:
1655 # CROSS_COMPILE=/where/toolchain/is/usr/bin/ [note ending slash]
1656 # CROSS_TOP=/where/SDKs/are
1657 # CROSS_SDK=iPhoneOSx.y.sdk
1659 # Exact paths vary with Xcode releases, but for couple of last ones
1660 # they would look like this:
1662 # CROSS_COMPILE=`xcode-select --print-path`/Toolchains/XcodeDefault.xctoolchain/usr/bin/
1663 # CROSS_TOP=`xcode-select --print-path`/Platforms/iPhoneOS.platform/Developer
1664 # CROSS_SDK=iPhoneOS.sdk
1666 "iphoneos-cross" => {
1667 inherit_from => [ "darwin-common" ],
1668 cflags => add("-isysroot \$(CROSS_TOP)/SDKs/\$(CROSS_SDK) -fno-common"),
1672 inherit_from => [ "darwin-common", asm("armv4_asm") ],
1673 # It should be possible to go below iOS 6 and even add -arch armv6,
1674 # thus targeting iPhone pre-3GS, but it's assumed to be irrelevant
1676 cflags => add("-arch armv7 -mios-version-min=6.0.0 -isysroot \$(CROSS_TOP)/SDKs/\$(CROSS_SDK) -fno-common"),
1678 perlasm_scheme => "ios32",
1681 inherit_from => [ "darwin-common", asm("aarch64_asm") ],
1682 cflags => add("-arch arm64 -mios-version-min=7.0.0 -isysroot \$(CROSS_TOP)/SDKs/\$(CROSS_SDK) -fno-common"),
1684 bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
1685 perlasm_scheme => "ios64",
1690 inherit_from => [ "BASE_unix" ],
1691 inherit_from => [ asm("x86_elf_asm") ],
1693 cflags => combine("-O3 -fomit-frame-pointer -Wall",
1694 threads("-pthread")),
1695 cppflags => "-DL_ENDIAN",
1696 ex_libs => add("-ldl", threads("-pthread")),
1697 bn_ops => "BN_LLONG",
1698 thread_scheme => "pthreads",
1699 dso_scheme => "dlfcn",
1700 shared_target => "linux-shared",
1701 shared_cflag => "-fPIC",
1702 shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
1705 ##### VxWorks for various targets
1706 "vxworks-ppc60x" => {
1707 inherit_from => [ "BASE_unix" ],
1709 cflags => "-mrtp -mhard-float -mstrict-align -fno-implicit-fp -O2 -fstrength-reduce -fno-builtin -fno-strict-aliasing -Wall",
1710 cppflags => combine("-D_REENTRANT -DPPC32_fp60x -DCPU=PPC32",
1711 "_DTOOL_FAMILY=gnu -DTOOL=gnu",
1712 "-I\$(WIND_BASE)/target/usr/h",
1713 "-I\$(WIND_BASE)/target/usr/h/wrn/coreip"),
1714 sys_id => "VXWORKS",
1715 lflags => add("-L \$(WIND_BASE)/target/usr/lib/ppc/PPC32/common"),
1716 ex_libs => add("-Wl,--defsym,__wrs_rtp_base=0xe0000000"),
1718 "vxworks-ppcgen" => {
1719 inherit_from => [ "BASE_unix" ],
1721 cflags => "-mrtp -msoft-float -mstrict-align -O1 -fno-builtin -fno-strict-aliasing -Wall",
1722 cppflags => combine("-D_REENTRANT -DPPC32 -DCPU=PPC32",
1723 "-DTOOL_FAMILY=gnu -DTOOL=gnu",
1724 "-I\$(WIND_BASE)/target/usr/h",
1725 "-I\$(WIND_BASE)/target/usr/h/wrn/coreip"),
1726 sys_id => "VXWORKS",
1727 lflags => add("-L \$(WIND_BASE)/target/usr/lib/ppc/PPC32/sfcommon"),
1728 ex_libs => add("-Wl,--defsym,__wrs_rtp_base=0xe0000000"),
1730 "vxworks-ppc405" => {
1731 inherit_from => [ "BASE_unix" ],
1733 cflags => "-g -msoft-float -mlongcall",
1734 cppflags => combine("-D_REENTRANT -DPPC32 -DCPU=PPC405",
1735 "-DTOOL_FAMILY=gnu -DTOOL=gnu",
1736 "-I\$(WIND_BASE)/target/h"),
1737 sys_id => "VXWORKS",
1738 lflags => add("-r"),
1740 "vxworks-ppc750" => {
1741 inherit_from => [ "BASE_unix" ],
1743 cflags => "-ansi -nostdinc -fvolatile -fno-builtin -fno-for-scope -fsigned-char -Wall -msoft-float -mlongcall \$(DEBUG_FLAG)",
1744 cppflags => combine("-DPPC750 -D_REENTRANT -DCPU=PPC604",
1745 "-I\$(WIND_BASE)/target/h"),
1746 sys_id => "VXWORKS",
1747 lflags => add("-r"),
1749 "vxworks-ppc750-debug" => {
1750 inherit_from => [ "BASE_unix" ],
1752 cflags => "-ansi -nostdinc -fvolatile -fno-builtin -fno-for-scope -fsigned-char -Wall -msoft-float -mlongcall -g",
1753 cppflags => combine("-DPPC750 -D_REENTRANT -DCPU=PPC604",
1754 "-DPEDANTIC -DDEBUG",
1755 "-I\$(WIND_BASE)/target/h"),
1756 sys_id => "VXWORKS",
1757 lflags => add("-r"),
1759 "vxworks-ppc860" => {
1760 inherit_from => [ "BASE_unix" ],
1762 cflags => "-nostdinc -msoft-float",
1763 cppflags => combine("-DCPU=PPC860 -DNO_STRINGS_H",
1764 "-I\$(WIND_BASE)/target/h"),
1765 sys_id => "VXWORKS",
1766 lflags => add("-r"),
1768 "vxworks-simlinux" => {
1769 inherit_from => [ "BASE_unix" ],
1771 cflags => "-B\$(WIND_BASE)/host/\$(WIND_HOST_TYPE)/lib/gcc-lib/ -fno-builtin -fno-defer-pop",
1772 cppflags => combine("-D_VSB_CONFIG_FILE=\"\$(WIND_BASE)/target/lib/h/config/vsbConfig.h\"",
1773 "-DL_ENDIAN -DCPU=SIMLINUX -DNO_STRINGS_H",
1774 "-DTOOL_FAMILY=gnu -DTOOL=gnu",
1775 "-DOPENSSL_NO_HW_PADLOCK",
1776 "-I\$(WIND_BASE)/target/h",
1777 "-I\$(WIND_BASE)/target/h/wrn/coreip"),
1778 sys_id => "VXWORKS",
1779 lflags => add("-r"),
1780 ranlib => "ranlibpentium",
1783 inherit_from => [ "BASE_unix", asm("mips32_asm") ],
1785 cflags => "-mrtp -mips2 -O -G 0 -B\$(WIND_BASE)/host/\$(WIND_HOST_TYPE)/lib/gcc-lib/ -msoft-float -mno-branch-likely -fno-builtin -fno-defer-pop",
1786 cppflags => combine("-D_VSB_CONFIG_FILE=\"\$(WIND_BASE)/target/lib/h/config/vsbConfig.h\"",
1787 "-DCPU=MIPS32 -DNO_STRINGS_H",
1788 "-DTOOL_FAMILY=gnu -DTOOL=gnu",
1789 "-DOPENSSL_NO_HW_PADLOCK",
1790 threads("-D_REENTRANT"),
1791 "-I\$(WIND_BASE)/target/h",
1792 "-I\$(WIND_BASE)/target/h/wrn/coreip"),
1793 sys_id => "VXWORKS",
1794 lflags => add("-L \$(WIND_BASE)/target/usr/lib/mips/MIPSI32/sfcommon"),
1795 ex_libs => add("-Wl,--defsym,__wrs_rtp_base=0xe0000000"),
1796 thread_scheme => "pthreads",
1797 perlasm_scheme => "o32",
1798 ranlib => "ranlibmips",
1803 inherit_from => [ "BASE_unix" ],
1804 cc => sub { env('CC') },
1805 cppflags => threads("-D_REENTRANT"),
1806 ex_libs => add("\$(LDLIBS)"),
1807 bn_ops => "BN_LLONG",
1808 thread_scheme => "pthreads",
1809 dso_scheme => sub { env('LIBSSL_dlfcn') },
1810 shared_target => "linux-shared",
1811 shared_cflag => "-fPIC",
1812 shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
1813 ranlib => sub { env('RANLIB') },
1815 "uClinux-dist64" => {
1816 inherit_from => [ "BASE_unix" ],
1817 cc => sub { env('CC') },
1818 cppflags => threads("-D_REENTRANT"),
1819 ex_libs => add("\$(LDLIBS)"),
1820 bn_ops => "SIXTY_FOUR_BIT_LONG",
1821 thread_scheme => "pthreads",
1822 dso_scheme => sub { env('LIBSSL_dlfcn') },
1823 shared_target => "linux-shared",
1824 shared_cflag => "-fPIC",
1825 shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
1826 ranlib => sub { env('RANLIB') },
1831 inherit_from => [ "BASE_VMS" ],
1834 cflags => picker(default => "/STANDARD=(ISOC94,RELAXED)/NOLIST/PREFIX=ALL",
1835 debug => "/NOOPTIMIZE/DEBUG",
1836 release => "/OPTIMIZE/NODEBUG"),
1837 defines => add("OPENSSL_USE_NODELETE"),
1838 lflags => picker(default => "/MAP='F\$PARSE(\".MAP\",\"\$\@\")'",
1839 debug => "/DEBUG/TRACEBACK",
1840 release => "/NODEBUG/NOTRACEBACK"),
1841 lib_cflags => add("/NAMES=(AS_IS,SHORTENED)/EXTERN_MODEL=STRICT_REFDEF"),
1842 # no_inst_lib_cflags is used instead of lib_cflags by descrip.mms.tmpl
1843 # for object files belonging to selected internal libraries
1844 no_inst_lib_cflags => "",
1845 shared_target => "vms-shared",
1846 dso_scheme => "vms",
1847 thread_scheme => "pthreads",
1849 apps_aux_src => "vms_decc_init.c vms_term_sock.c",
1853 inherit_from => [ "vms-generic" ],
1854 cflags => add(sub { my @warnings =
1855 @{vms_info(0)->{disable_warns}};
1857 ? "/WARNINGS=DISABLE=(".join(",",@warnings).")" : (); }),
1860 return vms_info(0)->{def_zlib}
1861 ? "LIBZ=\"\"\"".vms_info(0)->{def_zlib}."\"\"\"" : ();
1863 ex_libs => add(sub { return vms_info(0)->{zlib} || (); }),
1864 pointer_size => sub { return vms_info(0)->{pointer_size} },
1866 #debug_aflags => "/NOOPTIMIZE/DEBUG",
1867 #release_aflags => "/OPTIMIZE/NODEBUG",
1868 bn_opts => "SIXTY_FOUR_BIT RC4_INT",
1870 "vms-alpha-p32" => {
1871 inherit_from => [ "vms-generic" ],
1873 add("/POINTER_SIZE=32",
1874 sub { my @warnings =
1875 @{vms_info(32)->{disable_warns}};
1877 ? "/WARNINGS=DISABLE=(".join(",",@warnings).")" : ();
1881 return vms_info(32)->{def_zlib}
1882 ? "LIBZ=\"\"\"".vms_info(32)->{def_zlib}."\"\"\"" : ();
1884 ex_libs => add(sub { return vms_info(32)->{zlib} || (); }),
1885 pointer_size => sub { return vms_info(32)->{pointer_size} },
1887 "vms-alpha-p64" => {
1888 inherit_from => [ "vms-generic" ],
1890 add("/POINTER_SIZE=64=ARGV",
1891 sub { my @warnings =
1892 @{vms_info(64)->{disable_warns}};
1894 ? "/WARNINGS=DISABLE=(".join(",",@warnings).")" : ();
1898 return vms_info(64)->{def_zlib}
1899 ? "LIBZ=\"\"\"".vms_info(64)->{def_zlib}."\"\"\"" : ();
1901 ex_libs => add(sub { return vms_info(64)->{zlib} || (); }),
1902 pointer_size => sub { return vms_info(64)->{pointer_size} },
1905 inherit_from => [ "vms-generic" ],
1906 cflags => add(sub { my @warnings =
1907 @{vms_info(0)->{disable_warns}};
1909 ? "/WARNINGS=DISABLE=(".join(",",@warnings).")" : (); }),
1912 return vms_info(0)->{def_zlib}
1913 ? "LIBZ=\"\"\"".vms_info(0)->{def_zlib}."\"\"\"" : ();
1915 ex_libs => add(sub { return vms_info(0)->{zlib} || (); }),
1916 pointer_size => sub { return vms_info(0)->{pointer_size} },
1918 #debug_aflags => "/NOOPTIMIZE/DEBUG",
1919 #release_aflags => "/OPTIMIZE/NODEBUG",
1920 bn_opts => "SIXTY_FOUR_BIT RC4_INT",
1923 inherit_from => [ "vms-generic" ],
1925 add("/POINTER_SIZE=32",
1926 sub { my @warnings =
1927 @{vms_info(32)->{disable_warns}};
1929 ? "/WARNINGS=DISABLE=(".join(",",@warnings).")" : ();
1933 return vms_info(32)->{def_zlib}
1934 ? "LIBZ=\"\"\"".vms_info(32)->{def_zlib}."\"\"\"" : ();
1936 ex_libs => add(sub { return vms_info(32)->{zlib} || (); }),
1937 pointer_size => sub { return vms_info(32)->{pointer_size} },
1940 inherit_from => [ "vms-generic" ],
1942 add("/POINTER_SIZE=64=ARGV",
1943 sub { my @warnings =
1944 @{vms_info(64)->{disable_warns}};
1946 ? "/WARNINGS=DISABLE=(".join(",",@warnings).")" : ();
1950 return vms_info(64)->{def_zlib}
1951 ? "LIBZ=\"\"\"".vms_info(64)->{def_zlib}."\"\"\"" : ();
1953 ex_libs => add(sub { return vms_info(64)->{zlib} || (); }),
1954 pointer_size => sub { return vms_info(64)->{pointer_size} },