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
151 inherit_from => [ "BASE_unix" ],
153 cflags => picker(debug => "-O0 -g",
155 thread_scheme => "(unknown)",
156 bn_ops => "BN_LLONG",
159 inherit_from => [ "BASE_unix" ],
162 thread_scheme => "(unknown)",
165 #### VOS Configurations
167 inherit_from => [ "BASE_unix" ],
169 cflags => picker(default => "-Wall",
172 cppflags => "-D_POSIX_C_SOURCE=200112L -D_BSD -D_VOS_EXTENDED_NAMES -DB_ENDIAN",
173 thread_scheme => "(unknown)",
175 lflags => add("-Wl,-map"),
176 bn_ops => "BN_LLONG",
177 shared_extension => ".so",
180 #### Solaris configurations
181 "solaris-common" => {
182 inherit_from => [ "BASE_unix" ],
184 cppflags => "-DFILIO_H",
185 ex_libs => add("-lsocket -lnsl -ldl"),
186 dso_scheme => "dlfcn",
187 thread_scheme => "pthreads",
188 shared_target => "solaris-shared",
189 shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
191 #### Solaris x86 with GNU C setups
192 "solaris-x86-gcc" => {
193 # NB. GNU C has to be configured to use GNU assembler, and not
194 # /usr/ccs/bin/as. Failure to comply will result in compile
195 # failures [at least] in 32-bit build.
196 inherit_from => [ "solaris-common", asm("x86_elf_asm") ],
198 cflags => add_before(picker(default => "-Wall",
200 release => "-O3 -fomit-frame-pointer"),
201 threads("-pthread")),
202 cppflags => add("-DL_DEBIAN"),
203 ex_libs => add(threads("-pthread")),
204 bn_ops => "BN_LLONG",
205 shared_cflag => "-fPIC",
206 shared_ldflag => "-shared -static-libgcc",
208 "solaris64-x86_64-gcc" => {
209 # -shared -static-libgcc might appear controversial, but modules
210 # taken from static libgcc do not have relocations and linking
211 # them into our shared objects doesn't have any negative side
212 # effects. On the contrary, doing so makes it possible to use
213 # gcc shared build with Sun C. Given that gcc generates faster
214 # code [thanks to inline assembler], I would actually recommend
215 # to consider using gcc shared build even with vendor compiler:-)
216 # -- <appro@openssl.org>
217 inherit_from => [ "solaris-common", asm("x86_64_asm") ],
219 cflags => add_before(picker(default => "-m64 -Wall",
222 threads("-pthread")),
223 cppflags => add("-DL_DEBIAN"),
224 ex_libs => add(threads("-pthread")),
225 bn_ops => "SIXTY_FOUR_BIT_LONG",
226 perlasm_scheme => "elf",
227 shared_cflag => "-fPIC",
228 shared_ldflag => "-shared -static-libgcc",
232 #### Solaris x86 with Sun C setups
233 # There used to be solaris-x86-cc target, but it was removed,
234 # primarily because vendor assembler can't assemble our modules
235 # with -KPIC flag. As result it, assembly support, was not even
236 # available as option. But its lack means lack of side-channel
237 # resistant code, which is incompatible with security by todays
238 # standards. Fortunately gcc is readily available prepackaged
239 # option, which we can firmly point at...
241 # On related note, solaris64-x86_64-cc target won't compile code
242 # paths utilizing AVX and post-Haswell instruction extensions.
243 # Consider switching to solaris64-x86_64-gcc even here...
245 "solaris64-x86_64-cc" => {
246 inherit_from => [ "solaris-common", asm("x86_64_asm") ],
248 cflags => add_before(picker(default => "-xarch=generic64 -xstrconst -Xa",
250 release => "-xO5 -xdepend -xbuiltin")),
251 cppflags => add("-DL_DEBIAN", threads("-D_REENTRANT")),
252 thread_scheme => "pthreads",
253 lflags => add(threads("-mt")),
254 ex_libs => add(threads("-lpthread")),
255 bn_ops => "SIXTY_FOUR_BIT_LONG",
256 perlasm_scheme => "elf",
257 shared_cflag => "-KPIC",
258 shared_ldflag => "-G -dy -z text",
262 #### SPARC Solaris with GNU C setups
263 "solaris-sparcv7-gcc" => {
264 inherit_from => [ "solaris-common" ],
266 cflags => add_before(picker(default => "-Wall",
269 threads("-pthread")),
270 cppflags => add("-DB_DEBIAN -DBN_DIV2W"),
271 ex_libs => add(threads("-pthread")),
272 bn_ops => "BN_LLONG RC4_CHAR",
273 shared_cflag => "-fPIC",
274 shared_ldflag => "-shared",
276 "solaris-sparcv8-gcc" => {
277 inherit_from => [ "solaris-sparcv7-gcc", asm("sparcv8_asm") ],
278 cflags => add_before("-mcpu=v8"),
280 "solaris-sparcv9-gcc" => {
281 # -m32 should be safe to add as long as driver recognizes
283 inherit_from => [ "solaris-sparcv7-gcc", asm("sparcv9_asm") ],
284 cflags => add_before("-m32 -mcpu=ultrasparc"),
286 "solaris64-sparcv9-gcc" => {
287 inherit_from => [ "solaris-sparcv9-gcc" ],
288 cflags => sub { my $f=join(" ",@_); $f =~ s/\-m32/-m64/; $f; },
289 bn_ops => "BN_LLONG RC4_CHAR",
293 #### SPARC Solaris with Sun C setups
294 # SC4.0 doesn't pass 'make test', upgrade to SC5.0 or SC4.2.
295 # SC4.2 is ok, better than gcc even on bn as long as you tell it -xarch=v8
296 # SC5.0 note: Compiler common patch 107357-01 or later is required!
297 "solaris-sparcv7-cc" => {
298 inherit_from => [ "solaris-common" ],
300 cflags => add_before(picker(default => "-xstrconst -Xa",
302 release => "-xO5 -xdepend")),
303 cppflags => add("-DB_DEBIAN -DBN_DIV2W",
304 threads("-D_REENTRANT")),
305 lflags => add(threads("-mt")),
306 ex_libs => add(threads("-lpthread")),
307 bn_ops => "BN_LLONG RC4_CHAR",
308 shared_cflag => "-KPIC",
309 shared_ldflag => "-G -dy -z text",
312 "solaris-sparcv8-cc" => {
313 inherit_from => [ "solaris-sparcv7-cc", asm("sparcv8_asm") ],
314 cflags => add_before("-xarch=v8"),
316 "solaris-sparcv9-cc" => {
317 inherit_from => [ "solaris-sparcv7-cc", asm("sparcv9_asm") ],
318 cflags => add_before("-xarch=v8plus"),
320 "solaris64-sparcv9-cc" => {
321 inherit_from => [ "solaris-sparcv7-cc", asm("sparcv9_asm") ],
322 cflags => add_before("-xarch=v9"),
323 bn_ops => "BN_LLONG RC4_CHAR",
327 #### IRIX 6.x configs
328 # Only N32 and N64 ABIs are supported.
329 "irix-mips3-gcc" => {
330 inherit_from => [ "BASE_unix", asm("mips64_asm") ],
332 cflags => combine(picker(default => "-mabi=n32",
335 cppflags => combine("-DB_DEBIAN -DBN_DIV3W",
336 threads("-D_SGI_MP_SOURCE")),
337 ex_libs => add(threads("-lpthread")),
338 bn_ops => "RC4_CHAR SIXTY_FOUR_BIT",
339 thread_scheme => "pthreads",
340 perlasm_scheme => "n32",
341 dso_scheme => "dlfcn",
342 shared_target => "irix-shared",
343 shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
347 inherit_from => [ "BASE_unix", asm("mips64_asm") ],
349 cflags => combine(picker(default => "-n32 -mips3 -use_readonly_const -G0 -rdata_shared",
352 cppflags => combine("-DB_DEBIAN -DBN_DIV3W",
353 threads("-D_SGI_MP_SOURCE")),
354 ex_libs => add(threads("-lpthread")),
355 bn_ops => "RC4_CHAR SIXTY_FOUR_BIT",
356 thread_scheme => "pthreads",
357 perlasm_scheme => "n32",
358 dso_scheme => "dlfcn",
359 shared_target => "irix-shared",
360 shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
364 "irix64-mips4-gcc" => {
365 inherit_from => [ "BASE_unix", asm("mips64_asm") ],
367 cflags => combine(picker(default => "-mabi=64 -mips4",
370 cppflags => combine("-DB_DEBIAN -DBN_DIV3W",
371 threads("-D_SGI_MP_SOURCE")),
372 ex_libs => add(threads("-lpthread")),
373 bn_ops => "RC4_CHAR SIXTY_FOUR_BIT_LONG",
374 thread_scheme => "pthreads",
375 perlasm_scheme => "64",
376 dso_scheme => "dlfcn",
377 shared_target => "irix-shared",
378 shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
381 "irix64-mips4-cc" => {
382 inherit_from => [ "BASE_unix", asm("mips64_asm") ],
384 cflags => combine(picker(default => "-64 -mips4 -use_readonly_const -G0 -rdata_shared",
387 cppflags => combine("-DB_DEBIAN -DBN_DIV3W",
388 threads("-D_SGI_MP_SOURCE")),
389 ex_libs => add(threads("-lpthread")),
390 bn_ops => "RC4_CHAR SIXTY_FOUR_BIT_LONG",
391 thread_scheme => "pthreads",
392 perlasm_scheme => "64",
393 dso_scheme => "dlfcn",
394 shared_target => "irix-shared",
395 shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
399 #### Unified HP-UX ANSI C configs.
401 # - Originally we were optimizing at +O4 level. It should be noted
402 # that the only difference between +O3 and +O4 is global inter-
403 # procedural analysis. As it has to be performed during the link
404 # stage the compiler leaves behind certain pseudo-code in lib*.a
405 # which might be release or even patch level specific. Generating
406 # the machine code for and analyzing the *whole* program appears
407 # to be *extremely* memory demanding while the performance gain is
408 # actually questionable. The situation is intensified by the default
409 # HP-UX data set size limit (infamous 'maxdsiz' tunable) of 64MB
410 # which is way too low for +O4. In other words, doesn't +O3 make
412 # - Keep in mind that the HP compiler by default generates code
413 # suitable for execution on the host you're currently compiling at.
414 # If the toolkit is meant to be used on various PA-RISC processors
415 # consider './Configure hpux-parisc-[g]cc +DAportable'.
416 # - -DMD32_XARRAY triggers workaround for compiler bug we ran into in
417 # 32-bit message digests. (For the moment of this writing) HP C
418 # doesn't seem to "digest" too many local variables (they make "him"
419 # chew forever:-). For more details look-up MD32_XARRAY comment in
420 # crypto/sha/sha_lcl.h.
421 # - originally there were 32-bit hpux-parisc2-* targets. They were
422 # scrapped, because a) they were not interchangeable with other 32-bit
423 # targets; b) performance-critical 32-bit assembly modules implement
424 # even PA-RISC 2.0-specific code paths, which are chosen at run-time,
425 # thus adequate performance is provided even with PA-RISC 1.1 build.
426 "hpux-parisc-gcc" => {
427 inherit_from => [ "BASE_unix" ],
429 cflags => combine(picker(debug => "-O0 -g",
431 threads("-pthread")),
432 cppflags => "-DB_DEBIAN -DBN_DIV2W",
433 ex_libs => add("-Wl,+s -ldld", threads("-pthread")),
434 bn_ops => "BN_LLONG",
435 thread_scheme => "pthreads",
437 shared_target => "hpux-shared",
438 shared_cflag => "-fPIC",
439 shared_ldflag => "-shared",
440 shared_extension => ".sl.\$(SHLIB_VERSION_NUMBER)",
442 "hpux-parisc1_1-gcc" => {
443 inherit_from => [ "hpux-parisc-gcc", asm("parisc11_asm") ],
444 multilib => "/pa1.1",
446 "hpux64-parisc2-gcc" => {
447 inherit_from => [ "BASE_unix", asm("parisc20_64_asm") ],
449 cflags => combine(picker(debug => "-O0 -g",
451 cppflags => combine("-DB_DEBIAN", threads("-D_REENTRANT")),
452 ex_libs => add("-ldl"),
453 bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
454 thread_scheme => "pthreads",
455 dso_scheme => "dlfcn",
456 shared_target => "hpux-shared",
457 shared_cflag => "-fpic",
458 shared_ldflag => "-shared",
459 shared_extension => ".sl.\$(SHLIB_VERSION_NUMBER)",
460 multilib => "/pa20_64",
463 # More attempts at unified 10.X and 11.X targets for HP C compiler.
464 "hpux-parisc-cc" => {
465 inherit_from => [ "BASE_unix" ],
467 cflags => combine(picker(default => "+Optrs_strongly_typed -Ae +ESlit",
468 debug => "+O0 +d -g",
470 cppflags => combine("-DB_DEBIAN -DBN_DIV2W -DMD32_XARRAY",
471 threads("-D_REENTRANT")),
472 ex_libs => add("-Wl,+s -ldld",threads("-lpthread")),
473 bn_ops => "RC4_CHAR",
474 thread_scheme => "pthreads",
476 shared_target => "hpux-shared",
477 shared_cflag => "+Z",
478 shared_ldflag => "-b",
479 shared_extension => ".sl.\$(SHLIB_VERSION_NUMBER)",
481 "hpux-parisc1_1-cc" => {
482 inherit_from => [ "hpux-parisc-cc", asm("parisc11_asm") ],
483 cflags => add_before("+DA1.1"),
484 multilib => "/pa1.1",
486 "hpux64-parisc2-cc" => {
487 inherit_from => [ "BASE_unix", asm("parisc20_64_asm") ],
489 cflags => combine(picker(default => "+DD64 +Optrs_strongly_typed -Ae +ESlit",
490 debug => "+O0 +d -g",
492 cppflags => combine("-DB_DEBIAN -DMD32_XARRAY",
493 threads("-D_REENTRANT")),
494 ex_libs => add("-ldl",threads("-lpthread")),
495 bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
496 thread_scheme => "pthreads",
497 dso_scheme => "dlfcn",
498 shared_target => "hpux-shared",
499 shared_cflag => "+Z",
500 shared_ldflag => "-b",
501 shared_extension => ".sl.\$(SHLIB_VERSION_NUMBER)",
502 multilib => "/pa20_64",
505 # HP/UX IA-64 targets
507 inherit_from => [ "BASE_unix", asm("ia64_asm") ],
509 cflags => combine(picker(default => "-Ae +DD32 +Olit=all -z",
510 debug => "+O0 +d -g",
512 cppflags => combine("-DB_DEBIAN", threads("-D_REENTRANT")),
513 ex_libs => add("-ldl",threads("-lpthread")),
514 bn_ops => "SIXTY_FOUR_BIT",
515 thread_scheme => "pthreads",
516 dso_scheme => "dlfcn",
517 shared_target => "hpux-shared",
518 shared_cflag => "+Z",
519 shared_ldflag => "-b",
520 shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
521 multilib => "/hpux32",
523 "hpux64-ia64-cc" => {
524 inherit_from => [ "BASE_unix", asm("ia64_asm") ],
526 cflags => combine(picker(default => "-Ae +DD64 +Olit=all -z",
527 debug => "+O0 +d -g",
529 cppflags => combine("-DB_DEBIAN", threads("-D_REENTRANT")),
530 ex_libs => add("-ldl", threads("-lpthread")),
531 bn_ops => "SIXTY_FOUR_BIT_LONG",
532 thread_scheme => "pthreads",
533 dso_scheme => "dlfcn",
534 shared_target => "hpux-shared",
535 shared_cflag => "+Z",
536 shared_ldflag => "-b",
537 shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
538 multilib => "/hpux64",
542 inherit_from => [ "BASE_unix", asm("ia64_asm") ],
544 cflags => combine(picker(debug => "-O0 -g",
546 threads("-pthread")),
547 cppflags => "-DB_DEBIAN",
548 ex_libs => add("-ldl", threads("-pthread")),
549 bn_ops => "SIXTY_FOUR_BIT",
550 thread_scheme => "pthreads",
551 dso_scheme => "dlfcn",
552 shared_target => "hpux-shared",
553 shared_cflag => "-fpic",
554 shared_ldflag => "-shared",
555 shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
556 multilib => "/hpux32",
558 "hpux64-ia64-gcc" => {
559 inherit_from => [ "BASE_unix", asm("ia64_asm") ],
561 cflags => combine(picker(default => "-mlp64",
564 threads("-pthread")),
565 cppflags => "-DB_DEBIAN",
566 ex_libs => add("-ldl", threads("-pthread")),
567 bn_ops => "SIXTY_FOUR_BIT_LONG",
568 thread_scheme => "pthreads",
569 dso_scheme => "dlfcn",
570 shared_target => "hpux-shared",
571 shared_cflag => "-fpic",
572 shared_ldflag => "-shared",
573 shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
574 multilib => "/hpux64",
577 #### HP MPE/iX http://jazz.external.hp.com/src/openssl/
579 inherit_from => [ "BASE_unix" ],
582 cppflags => "-D_ENDIAN -DBN_DIV2W -D_POSIX_SOURCE -D_SOCKET_SOURCE",
583 includes => [ "/SYSLOG/PUB" ],
585 lflags => add("-L/SYSLOG/PUB"),
586 ex_libs => add("-lsyslog -lsocket -lcurses"),
587 thread_scheme => "(unknown)",
588 bn_ops => "BN_LLONG",
591 #### DEC Alpha Tru64 targets. Tru64 is marketing name for OSF/1 version 4
592 #### and forward. In reality 'uname -s' still returns "OSF1". Originally
593 #### there were even osf1-* configs targeting prior versions provided,
594 #### but not anymore...
595 "tru64-alpha-gcc" => {
596 inherit_from => [ "BASE_unix", asm("alpha_asm") ],
598 cflags => combine("-std=c9x -O3", threads("-pthread")),
599 cppflags => "-D_XOPEN_SOURCE=500 -D_OSF_SOURCE",
600 ex_libs => add("-lrt", threads("-pthread")), # for mlock(2)
601 bn_ops => "SIXTY_FOUR_BIT_LONG",
602 thread_scheme => "pthreads",
603 dso_scheme => "dlfcn",
604 shared_target => "alpha-osf1-shared",
605 shared_extension => ".so",
607 "tru64-alpha-cc" => {
608 inherit_from => [ "BASE_unix", asm("alpha_asm") ],
610 cflags => combine("-std1 -tune host -fast -readonly_strings",
611 threads("-pthread")),
612 cppflags => "-D_XOPEN_SOURCE=500 -D_OSF_SOURCE",
613 ex_libs => add("-lrt", threads("-pthread")), # for mlock(2)
614 bn_ops => "SIXTY_FOUR_BIT_LONG",
615 thread_scheme => "pthreads",
616 dso_scheme => "dlfcn",
617 shared_target => "alpha-osf1-shared",
618 shared_ldflag => "-msym",
619 shared_extension => ".so",
623 #### Variety of LINUX:-)
625 # *-generic* is endian-neutral target, but ./config is free to
626 # throw in -D[BL]_ENDIAN, whichever appropriate...
627 "linux-generic32" => {
628 inherit_from => [ "BASE_unix" ],
631 cflags => combine(picker(default => "-Wall",
634 threads("-pthread")),
635 cxxflags => combine(picker(default => "-std=c++11 -Wall",
638 threads("-pthread")),
639 cppflags => "-DOPENSSL_USE_NODELETE",
640 ex_libs => add("-ldl", threads("-pthread")),
641 bn_ops => "BN_LLONG RC4_CHAR",
642 thread_scheme => "pthreads",
643 dso_scheme => "dlfcn",
644 shared_target => "linux-shared",
645 shared_cflag => "-fPIC",
646 shared_ldflag => "-Wl,-znodelete",
647 shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
649 "linux-generic64" => {
650 inherit_from => [ "linux-generic32" ],
651 bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
655 inherit_from => [ "linux-generic32", asm("ppc32_asm") ],
656 perlasm_scheme => "linux32",
659 inherit_from => [ "linux-generic64", asm("ppc64_asm") ],
660 cflags => add("-m64"),
661 cppflags => add("-DB_ENDIAN"),
662 perlasm_scheme => "linux64",
666 inherit_from => [ "linux-generic64", asm("ppc64_asm") ],
667 cflags => add("-m64"),
668 cppflags => add("-DL_ENDIAN"),
669 perlasm_scheme => "linux64le",
673 ################################################################
674 # Note that -march is not among compiler options in linux-armv4
675 # target description. Not specifying one is intentional to give
678 # a) rely on your compiler default by not specifying one;
679 # b) specify your target platform explicitly for optimal
680 # performance, e.g. -march=armv6 or -march=armv7-a;
681 # c) build "universal" binary that targets *range* of platforms
682 # by specifying minimum and maximum supported architecture;
684 # As for c) option. It actually makes no sense to specify
685 # maximum to be less than ARMv7, because it's the least
686 # requirement for run-time switch between platform-specific
687 # code paths. And without run-time switch performance would be
688 # equivalent to one for minimum. Secondly, there are some
689 # natural limitations that you'd have to accept and respect.
690 # Most notably you can *not* build "universal" binary for
691 # big-endian platform. This is because ARMv7 processor always
692 # picks instructions in little-endian order. Another similar
693 # limitation is that -mthumb can't "cross" -march=armv6t2
694 # boundary, because that's where it became Thumb-2. Well, this
695 # limitation is a bit artificial, because it's not really
696 # impossible, but it's deemed too tricky to support. And of
697 # course you have to be sure that your binutils are actually
698 # up to the task of handling maximum target platform. With all
699 # this in mind here is an example of how to configure
702 # ./Configure linux-armv4 -march=armv6 -D__ARM_MAX_ARCH__=8
704 inherit_from => [ "linux-generic32", asm("armv4_asm") ],
705 perlasm_scheme => "linux32",
708 inherit_from => [ "linux-generic64", asm("aarch64_asm") ],
709 perlasm_scheme => "linux64",
711 "linux-arm64ilp32" => { # https://wiki.linaro.org/Platform/arm64-ilp32
712 inherit_from => [ "linux-generic32", asm("aarch64_asm") ],
713 cflags => add("-mabi=ilp32"),
714 bn_ops => "SIXTY_FOUR_BIT RC4_CHAR",
715 perlasm_scheme => "linux64",
719 # Configure script adds minimally required -march for assembly
720 # support, if no -march was specified at command line.
721 inherit_from => [ "linux-generic32", asm("mips32_asm") ],
722 cflags => add("-mabi=32"),
723 cppflags => add("-DBN_DIV3W"),
724 perlasm_scheme => "o32",
726 # mips32 and mips64 below refer to contemporary MIPS Architecture
727 # specifications, MIPS32 and MIPS64, rather than to kernel bitness.
729 inherit_from => [ "linux-generic32", asm("mips64_asm") ],
730 cflags => add("-mabi=n32"),
731 cppflags => add("-DBN_DIV3W"),
732 bn_ops => "SIXTY_FOUR_BIT RC4_CHAR",
733 perlasm_scheme => "n32",
736 "linux64-mips64" => {
737 inherit_from => [ "linux-generic64", asm("mips64_asm") ],
738 cflags => add("-mabi=64"),
739 cppflags => add("-DBN_DIV3W"),
740 perlasm_scheme => "64",
744 #### IA-32 targets...
745 #### These two targets are a bit aged and are to be used on older Linux
746 #### machines where gcc doesn't understand -m32 and -m64
748 inherit_from => [ "linux-generic32", asm("x86_elf_asm") ],
749 cflags => add(picker(release => "-fomit-frame-pointer")),
750 cppflags => add("-DL_ENDIAN"),
751 bn_ops => "BN_LLONG",
754 inherit_from => [ "BASE_unix", asm("x86_asm") ],
756 cflags => add(picker(default => "-Wall",
758 release => "-O3 -fomit-frame-pointer")),
759 cppflags => add("-DL_ENDIAN"),
760 bn_ops => "BN_LLONG",
761 thread_scheme => "(unknown)",
762 perlasm_scheme => "a.out",
765 #### X86 / X86_64 targets
767 inherit_from => [ "linux-generic32", asm("x86_asm") ],
768 cflags => add(picker(default => "-m32",
769 release => "-fomit-frame-pointer")),
770 cppflags => add("-DL_ENDIAN"),
771 bn_ops => "BN_LLONG",
772 perlasm_scheme => "elf",
774 "linux-x86-clang" => {
775 inherit_from => [ "linux-x86" ],
778 cflags => add("-Wextra"),
781 inherit_from => [ "linux-generic64", asm("x86_64_asm") ],
782 cflags => add("-m64"),
783 cppflags => add("-DL_ENDIAN"),
784 bn_ops => "SIXTY_FOUR_BIT_LONG",
785 perlasm_scheme => "elf",
788 "linux-x86_64-clang" => {
789 inherit_from => [ "linux-x86_64" ],
792 cflags => add("-Wextra"),
795 inherit_from => [ "linux-generic32", asm("x86_64_asm") ],
796 cflags => add("-mx32"),
797 cppflags => add("-DL_ENDIAN"),
798 bn_ops => "SIXTY_FOUR_BIT",
799 perlasm_scheme => "elf32",
804 inherit_from => [ "linux-generic64", asm("ia64_asm") ],
805 bn_ops => "SIXTY_FOUR_BIT_LONG",
809 inherit_from => [ "linux-generic64", asm("s390x_asm") ],
810 cflags => add("-m64"),
811 cppflags => add("-DB_ENDIAN"),
812 perlasm_scheme => "64",
816 #### So called "highgprs" target for z/Architecture CPUs
817 # "Highgprs" is kernel feature first implemented in Linux
818 # 2.6.32, see /proc/cpuinfo. The idea is to preserve most
819 # significant bits of general purpose registers not only
820 # upon 32-bit process context switch, but even on
821 # asynchronous signal delivery to such process. This makes
822 # it possible to deploy 64-bit instructions even in legacy
823 # application context and achieve better [or should we say
824 # adequate] performance. The build is binary compatible with
825 # linux-generic32, and the idea is to be able to install the
826 # resulting libcrypto.so alongside generic one, e.g. as
827 # /lib/highgprs/libcrypto.so.x.y, for ldconfig and run-time
828 # linker to autodiscover. Unfortunately it doesn't work just
829 # yet, because of couple of bugs in glibc
830 # sysdeps/s390/dl-procinfo.c affecting ldconfig and ld.so.1...
832 inherit_from => [ "linux-generic32", asm("s390x_asm") ],
833 cflags => add("-m31 -Wa,-mzarch"),
834 cppflags => add("-DB_ENDIAN"),
835 bn_asm_src => sub { my $r=join(" ",@_); $r=~s|asm/s390x\.S|bn_asm.c|; $r; },
836 perlasm_scheme => "31",
837 multilib => "/highgprs",
840 #### SPARC Linux setups
842 inherit_from => [ "linux-generic32", asm("sparcv8_asm") ],
843 cflags => add("-mcpu=v8"),
844 cppflags => add("-DB_ENDIAN -DBN_DIV2W"),
847 # it's a real mess with -mcpu=ultrasparc option under Linux,
848 # but -Wa,-Av8plus should do the trick no matter what.
849 inherit_from => [ "linux-generic32", asm("sparcv9_asm") ],
850 cflags => add("-m32 -mcpu=ultrasparc -Wa,-Av8plus"),
851 cppflags => add("-DB_ENDIAN -DBN_DIV2W"),
853 "linux64-sparcv9" => {
854 # GCC 3.1 is a requirement
855 inherit_from => [ "linux-generic64", asm("sparcv9_asm") ],
856 cflags => add("-m64 -mcpu=ultrasparc"),
857 cppflags => add("-DB_ENDIAN"),
858 bn_ops => "BN_LLONG RC4_CHAR",
862 "linux-alpha-gcc" => {
863 inherit_from => [ "linux-generic64", asm("alpha_asm") ],
864 cppflags => add("-DL_ENDIAN"),
865 bn_ops => "SIXTY_FOUR_BIT_LONG",
867 "linux-c64xplus" => {
868 inherit_from => [ "BASE_unix" ],
869 # TI_CGT_C6000_7.3.x is a requirement
871 cflags => "--linux -ea=.s -eo=.o -mv6400+ -o2 -ox -ms -pden",
872 cppflags => combine("-DOPENSSL_SMALL_FOOTPRINT",
873 threads("-D_REENTRANT")),
874 bn_ops => "BN_LLONG",
875 cpuid_asm_src => "c64xpluscpuid.s",
876 bn_asm_src => "asm/bn-c64xplus.asm c64xplus-gf2m.s",
877 aes_asm_src => "aes-c64xplus.s aes_cbc.c aes-ctr.fake",
878 sha1_asm_src => "sha1-c64xplus.s sha256-c64xplus.s sha512-c64xplus.s",
879 rc4_asm_src => "rc4-c64xplus.s",
880 modes_asm_src => "ghash-c64xplus.s",
881 chacha_asm_src => "chacha-c64xplus.s",
882 poly1305_asm_src => "poly1305-c64xplus.s",
883 thread_scheme => "pthreads",
884 perlasm_scheme => "void",
885 dso_scheme => "dlfcn",
886 shared_target => "linux-shared",
887 shared_cflag => "--pic",
888 shared_ldflag => add("-z --sysv --shared"),
889 shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
893 #### Android: linux-* but without pointers to headers and libs.
895 # It takes pair of prior-set environment variables to make it work:
897 # CROSS_SYSROOT=/some/where/android-ndk-<ver>/platforms/android-<apiver>/arch-<arch>
898 # CROSS_COMPILE=<prefix>
900 # As well as PATH adjusted to cover ${CROSS_COMPILE}gcc and company.
901 # For example to compile for ICS and ARM with NDK 10d, you'd:
903 # ANDROID_NDK=/some/where/android-ndk-10d
904 # CROSS_SYSROOT=$ANDROID_NDK/platforms/android-14/arch-arm
905 # CROSS_COMPILE=arm-linux-androideabi-
906 # PATH=$ANDROID_NDK/toolchains/arm-linux-androideabi-4.8/prebuild/linux-x86_64/bin
909 inherit_from => [ "linux-generic32" ],
910 # Special note about unconditional -fPIC and -pie. The underlying
911 # reason is that Lollipop refuses to run non-PIE. But what about
912 # older systems and NDKs? -fPIC was never problem, so the only
913 # concern is -pie. Older toolchains, e.g. r4, appear to handle it
914 # and binaries turn mostly functional. "Mostly" means that oldest
915 # Androids, such as Froyo, fail to handle executable, but newer
916 # systems are perfectly capable of executing binaries targeting
917 # Froyo. Keep in mind that in the nutshell Android builds are
918 # about JNI, i.e. shared libraries, not applications.
919 cflags => add(picker(default => "-mandroid -fPIC --sysroot=\$(CROSS_SYSROOT) -Wa,--noexecstack")),
920 bin_cflags => "-pie",
923 inherit_from => [ "android", asm("x86_asm") ],
924 cflags => add(picker(release => "-fomit-frame-pointer")),
925 bn_ops => "BN_LLONG",
926 perlasm_scheme => "android",
928 ################################################################
929 # Contemporary Android applications can provide multiple JNI
930 # providers in .apk, targeting multiple architectures. Among
931 # them there is "place" for two ARM flavours: generic eabi and
932 # armv7-a/hard-float. However, it should be noted that OpenSSL's
933 # ability to engage NEON is not constrained by ABI choice, nor
934 # is your ability to call OpenSSL from your application code
935 # compiled with floating-point ABI other than default 'soft'.
936 # [Latter thanks to __attribute__((pcs("aapcs"))) declaration.]
937 # This means that choice of ARM libraries you provide in .apk
938 # is driven by application needs. For example if application
939 # itself benefits from NEON or is floating-point intensive, then
940 # it might be appropriate to provide both libraries. Otherwise
941 # just generic eabi would do. But in latter case it would be
944 # ./Configure android-armeabi -D__ARM_MAX_ARCH__=8
946 # in order to build "universal" binary and allow OpenSSL take
947 # advantage of NEON when it's available.
949 "android-armeabi" => {
950 inherit_from => [ "android", asm("armv4_asm") ],
953 inherit_from => [ "android", asm("mips32_asm") ],
954 perlasm_scheme => "o32",
958 inherit_from => [ "linux-generic64" ],
959 cflags => add(picker(default => "-mandroid -fPIC --sysroot=\$(CROSS_SYSROOT) -Wa,--noexecstack")),
960 bin_cflags => "-pie",
962 "android64-aarch64" => {
963 inherit_from => [ "android64", asm("aarch64_asm") ],
964 perlasm_scheme => "linux64",
966 "android64-x86_64" => {
967 inherit_from => [ "android64", asm("x86_64_asm") ],
968 perlasm_scheme => "elf",
970 "android64-mips64" => {
971 ############################################################
972 # You are more than likely have to specify target processor
973 # on ./Configure command line. Trouble is that toolchain's
974 # default is MIPS64r6 (at least in r10d), but there are no
975 # such processors around (or they are too rare to spot one).
976 # Actual problem is that MIPS64r6 is binary incompatible
977 # with previous MIPS ISA versions, in sense that unlike
978 # prior versions original MIPS binary code will fail.
980 inherit_from => [ "android64", asm("mips64_asm") ],
981 perlasm_scheme => "64",
986 # As for thread cflag. Idea is to maintain "collective" set of
987 # flags, which would cover all BSD flavors. -pthread applies
988 # to them all, but is treated differently. OpenBSD expands is
989 # as -D_POSIX_THREAD -lc_r, which is sufficient. FreeBSD 4.x
990 # expands it as -lc_r, which has to be accompanied by explicit
991 # -D_THREAD_SAFE and sometimes -D_REENTRANT. FreeBSD 5.x
992 # expands it as -lc_r, which seems to be sufficient?
993 inherit_from => [ "BASE_unix" ],
995 cflags => combine(picker(default => "-Wall",
998 threads("-pthread")),
999 cppflags => threads("-D_THREAD_SAFE -D_REENTRANT"),
1000 ex_libs => add(threads("-pthread")),
1001 enable => add("devcryptoeng"),
1002 bn_ops => "BN_LLONG",
1003 thread_scheme => "pthreads",
1004 dso_scheme => "dlfcn",
1005 shared_target => "bsd-gcc-shared",
1006 shared_cflag => "-fPIC",
1007 shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
1009 "BSD-generic64" => {
1010 inherit_from => [ "BSD-generic32" ],
1011 bn_ops => "SIXTY_FOUR_BIT_LONG",
1015 inherit_from => [ "BSD-generic32", asm("x86_asm") ],
1016 cflags => add(picker(release => "-fomit-frame-pointer")),
1017 cppflags => add("-DL_ENDIAN"),
1018 bn_ops => "BN_LLONG",
1019 shared_target => "bsd-shared",
1020 perlasm_scheme => "a.out",
1023 inherit_from => [ "BSD-x86" ],
1024 perlasm_scheme => "elf",
1028 inherit_from => [ "BSD-generic32", asm("sparcv8_asm") ],
1029 cflags => add("-mcpu=v8"),
1030 cppflags => add("-DB_ENDIAN"),
1033 # -DMD32_REG_T=int doesn't actually belong in sparc64 target, it
1034 # simply *happens* to work around a compiler bug in gcc 3.3.3,
1035 # triggered by RIPEMD160 code.
1036 inherit_from => [ "BSD-generic64", asm("sparcv9_asm") ],
1037 cppflags => add("-DB_ENDIAN -DMD32_REG_T=int"),
1038 bn_ops => "BN_LLONG",
1042 inherit_from => [ "BSD-generic64", asm("ia64_asm") ],
1043 cppflags => add("-DL_ENDIAN"),
1044 bn_ops => "SIXTY_FOUR_BIT_LONG",
1048 inherit_from => [ "BSD-generic64", asm("x86_64_asm") ],
1049 cppflags => add("-DL_ENDIAN"),
1050 bn_ops => "SIXTY_FOUR_BIT_LONG",
1051 perlasm_scheme => "elf",
1055 inherit_from => [ "BASE_unix", asm("x86_elf_asm") ],
1057 cflags => "-fomit-frame-pointer -O3 -Wall",
1058 cppflags => "-DPERL5 -DL_ENDIAN",
1059 ex_libs => add("-ldl"),
1060 bn_ops => "BN_LLONG",
1061 thread_scheme => "(unknown)",
1062 dso_scheme => "dlfcn",
1063 shared_target => "bsd-gcc-shared",
1064 shared_cflag => "-fPIC",
1065 shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
1069 inherit_from => [ "BASE_unix" ],
1071 cflags => "-O -Wall",
1072 unistd => "<libc.h>",
1073 bn_ops => "BN_LLONG",
1074 thread_scheme => "(unknown)",
1077 inherit_from => [ "BASE_unix" ],
1079 cflags => "-O3 -Wall",
1080 unistd => "<libc.h>",
1081 bn_ops => "BN_LLONG",
1082 thread_scheme => "(unknown)",
1087 inherit_from => [ "BASE_unix" ],
1090 cppflags => "-DL_ENDIAN -DTERMIO",
1091 thread_scheme => "(unknown)",
1094 inherit_from => [ "BASE_unix" ],
1096 ex_libs => add("-lsocket"),
1097 dso_scheme => "dlfcn",
1098 shared_target => "bsd-gcc-shared",
1099 shared_cflag => "-fPIC",
1100 shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
1103 inherit_from => [ "BASE_unix", asm("x86_elf_asm") ],
1105 cflags => "-O2 -Wall",
1106 cppflags => "-DL_ENDIAN",
1107 ex_libs => add("-lsocket"),
1108 dso_scheme => "dlfcn",
1109 shared_target => "bsd-gcc-shared",
1110 shared_cflag => "-fPIC",
1111 shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
1114 #### SCO/Caldera targets.
1116 # Originally we had like unixware-*, unixware-*-pentium, unixware-*-p6, etc.
1117 # Now we only have blended unixware-* as it's the only one used by ./config.
1118 # If you want to optimize for particular microarchitecture, bypass ./config
1119 # and './Configure unixware-7 -Kpentium_pro' or whatever appropriate.
1120 # Note that not all targets include assembler support. Mostly because of
1121 # lack of motivation to support out-of-date platforms with out-of-date
1122 # compiler drivers and assemblers.
1124 # UnixWare 2.0x fails destest with -O.
1126 inherit_from => [ "BASE_unix" ],
1128 cflags => combine(threads("-Kthread")),
1129 cppflags => "-DFILIO_H -DNO_STRINGS_H",
1130 ex_libs => add("-lsocket -lnsl -lresolv -lx"),
1131 thread_scheme => "uithreads",
1134 inherit_from => [ "BASE_unix" ],
1136 cflags => combine("-O", threads("-Kthread")),
1137 cppflags => "-DFILIO_H",
1138 ex_libs => add("-lsocket -lnsl -lresolv -lx"),
1139 thread_scheme => "uithreads",
1142 inherit_from => [ "BASE_unix", asm("x86_elf_asm") ],
1144 cflags => combine("-O -Kalloca", threads("-Kthread")),
1145 cppflags => "-DFILIO_H",
1146 ex_libs => add("-lsocket -lnsl"),
1147 thread_scheme => "uithreads",
1148 bn_ops => "BN_LLONG",
1149 perlasm_scheme => "elf-1",
1150 dso_scheme => "dlfcn",
1151 shared_target => "svr5-shared",
1152 shared_cflag => "-Kpic",
1153 shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
1155 "unixware-7-gcc" => {
1156 inherit_from => [ "BASE_unix", asm("x86_elf_asm") ],
1158 cflags => combine("-O3 -fomit-frame-pointer -Wall"),
1159 cppflags => add("-DL_ENDIAN -DFILIO_H",
1160 threads("-D_REENTRANT")),
1161 ex_libs => add("-lsocket -lnsl"),
1162 bn_ops => "BN_LLONG",
1163 thread_scheme => "pthreads",
1164 perlasm_scheme => "elf-1",
1165 dso_scheme => "dlfcn",
1166 shared_target => "gnu-shared",
1167 shared_cflag => "-fPIC",
1168 shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
1170 # SCO 5 - Ben Laurie says the -O breaks the SCO cc.
1172 inherit_from => [ "BASE_unix", asm("x86_elf_asm") ],
1175 ex_libs => add("-lsocket -lnsl"),
1176 thread_scheme => "(unknown)",
1177 perlasm_scheme => "elf-1",
1178 dso_scheme => "dlfcn",
1179 shared_target => "svr3-shared",
1180 shared_cflag => "-Kpic",
1181 shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
1184 inherit_from => [ "BASE_unix", asm("x86_elf_asm") ],
1186 cflags => "-O3 -fomit-frame-pointer",
1187 ex_libs => add("-lsocket -lnsl"),
1188 bn_ops => "BN_LLONG",
1189 thread_scheme => "(unknown)",
1190 perlasm_scheme => "elf-1",
1191 dso_scheme => "dlfcn",
1192 shared_target => "svr3-shared",
1193 shared_cflag => "-fPIC",
1194 shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
1198 # Below targets assume AIX >=5. Caveat lector. If you are accustomed
1199 # to control compilation "bitness" by setting $OBJECT_MODE environment
1200 # variable, then you should know that in OpenSSL case it's considered
1201 # only in ./config. Once configured, build procedure remains "deaf" to
1202 # current value of $OBJECT_MODE.
1204 inherit_from => [ "BASE_unix", asm("ppc32_asm") ],
1206 cflags => combine(picker(debug => "-O0 -g",
1208 threads("-pthread")),
1209 cppflags => "-DB_ENDIAN",
1210 ex_libs => add(threads("-pthread")),
1212 bn_ops => "BN_LLONG RC4_CHAR",
1213 thread_scheme => "pthreads",
1214 perlasm_scheme => "aix32",
1215 dso_scheme => "dlfcn",
1216 shared_target => "aix-shared",
1217 shared_ldflag => "-shared -static-libgcc -Wl,-G",
1218 shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
1222 inherit_from => [ "BASE_unix", asm("ppc64_asm") ],
1224 cflags => combine(picker(default => "-maix64",
1227 threads("-pthread")),
1228 cppflags => "-DB_ENDIAN",
1229 ex_libs => add(threads("-pthread")),
1231 bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
1232 thread_scheme => "pthreads",
1233 perlasm_scheme => "aix64",
1234 dso_scheme => "dlfcn",
1235 shared_target => "aix-shared",
1236 shared_ldflag => "-shared -static-libgcc -Wl,-G",
1237 shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
1241 inherit_from => [ "BASE_unix", asm("ppc32_asm") ],
1243 cflags => combine(picker(default => "-q32 -qmaxmem=16384 -qro -qroconst",
1246 threads("-qthreaded")),
1247 cppflags => combine("-DB_ENDIAN", threads("-D_THREAD_SAFE")),
1249 bn_ops => "BN_LLONG RC4_CHAR",
1250 thread_scheme => "pthreads",
1251 ex_libs => threads("-lpthreads"),
1252 perlasm_scheme => "aix32",
1253 dso_scheme => "dlfcn",
1254 shared_target => "aix-shared",
1255 shared_ldflag => "-G",
1256 shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
1260 inherit_from => [ "BASE_unix", asm("ppc64_asm") ],
1262 cflags => combine(picker(default => "-q64 -qmaxmem=16384 -qro -qroconst",
1265 threads("-qthreaded")),
1266 cppflags => combine("-DB_ENDIAN", threads("-D_THREAD_SAFE")),
1268 bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
1269 thread_scheme => "pthreads",
1270 ex_libs => threads("-lpthreads"),
1271 perlasm_scheme => "aix64",
1272 dso_scheme => "dlfcn",
1273 shared_target => "aix-shared",
1274 shared_ldflag => "-G",
1275 shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
1279 # SIEMENS BS2000/OSD: an EBCDIC-based mainframe
1281 inherit_from => [ "BASE_unix" ],
1283 cflags => "-O -XLLML -XLLMK -XL",
1284 cppflags => "-DB_ENDIAN -DCHARSET_EBCDIC",
1285 ex_libs => add("-lsocket -lnsl"),
1286 bn_ops => "THIRTY_TWO_BIT RC4_CHAR",
1287 thread_scheme => "(unknown)",
1290 #### Visual C targets
1292 # Win64 targets, WIN64I denotes IA-64 and WIN64A - AMD64
1294 # Note about -wd4090, disable warning C4090. This warning returns false
1295 # positives in some situations. Disabling it altogether masks both
1296 # legitimate and false cases, but as we compile on multiple platforms,
1297 # we rely on other compilers to catch legitimate cases.
1299 # Also note that we force threads no matter what. Configuring "no-threads"
1302 inherit_from => [ "BASE_Windows" ],
1305 cflags => "-W3 -wd4090 -Gs0 -GF -Gy -nologo",
1306 defines => add("OPENSSL_SYS_WIN32", "WIN32_LEAN_AND_MEAN",
1307 "L_ENDIAN", "_CRT_SECURE_NO_DEPRECATE",
1308 "_WINSOCK_DEPRECATED_NO_WARNINGS",
1309 sub { my @defs = ();
1310 unless ($disabled{"zlib-dynamic"}) {
1312 $withargs{zlib_lib} // "ZLIB1";
1315 'LIBZ="' . $zlib . '"');
1320 lib_cflags => add("/Zi /Fdossl_static"),
1321 dso_cflags => "/Zi /Fddso",
1322 bin_cflags => "/Zi /Fdapp",
1323 lflags => add("/debug"),
1324 shared_ldflag => "/dll",
1325 shared_target => "win-shared", # meaningless except it gives Configure a hint
1326 thread_scheme => "winthreads",
1327 dso_scheme => "win32",
1328 apps_aux_src => add("win32_init.c"),
1330 "VC-noCE-common" => {
1331 inherit_from => [ "VC-common" ],
1333 cflags => add(picker(debug =>
1335 ($disabled{shared} ? "" : "/MDd")
1340 ($disabled{shared} ? "" : "/MD")
1343 defines => add(picker(default => [ "UNICODE", "_UNICODE" ],
1344 debug => [ "DEBUG", "_DEBUG" ])),
1345 lib_cflags => add(sub { $disabled{shared} ? "/MT /Zl" : () }),
1346 # Following might/should appears controversial, i.e. defining
1347 # /MDd without evaluating $disabled{shared}. It works in
1348 # non-shared build because static library is compiled with /Zl
1349 # and bares no reference to specific RTL. And it works in
1350 # shared build because multiple /MDd options are not prohibited.
1351 # But why /MDd in static build? Well, basically this is just a
1352 # reference point, which allows to catch eventual errors that
1353 # would prevent those who want to wrap OpenSSL into own .DLL.
1354 # Why not /MD in release build then? Well, some are likely to
1355 # prefer [non-debug] openssl.exe to be free from Micorosoft RTL
1357 bin_cflags => add(picker(debug => "/MDd",
1358 release => sub { $disabled{shared} ? "/MT" : () },
1360 bin_lflags => add("/subsystem:console /opt:ref"),
1361 ex_libs => add(sub {
1363 push @ex_libs, 'ws2_32.lib' unless $disabled{sock};
1364 push @ex_libs, 'gdi32.lib advapi32.lib crypt32.lib user32.lib';
1365 return join(" ", @ex_libs);
1368 "VC-WIN64-common" => {
1369 inherit_from => [ "VC-noCE-common" ],
1371 ex_libs => add(sub {
1373 push @ex_libs, 'bufferoverflowu.lib' if (`cl 2>&1` =~ /14\.00\.4[0-9]{4}\./);
1374 return join(" ", @_, @ex_libs);
1376 bn_ops => "SIXTY_FOUR_BIT EXPORT_VAR_AS_FN",
1377 build_scheme => add("VC-W64", { separator => undef }),
1380 inherit_from => [ "VC-WIN64-common", asm("ia64_asm"),
1381 sub { $disabled{shared} ? () : "ia64_uplink" } ],
1383 asflags => "-d debug",
1386 bn_asm_src => sub { return undef unless @_;
1387 my $r=join(" ",@_); $r=~s|bn-ia64.s|bn_asm.c|; $r; },
1388 perlasm_scheme => "ias",
1389 multilib => "-ia64",
1392 inherit_from => [ "VC-WIN64-common", asm("x86_64_asm"),
1393 sub { $disabled{shared} ? () : "x86_64_uplink" } ],
1394 as => sub { vc_win64a_info()->{as} },
1395 asflags => sub { vc_win64a_info()->{asflags} },
1396 asoutflag => sub { vc_win64a_info()->{asoutflag} },
1398 bn_asm_src => sub { return undef unless @_;
1399 my $r=join(" ",@_); $r=~s|asm/x86_64-gcc|bn_asm|; $r; },
1400 perlasm_scheme => "auto",
1404 # x86 Win32 target defaults to ANSI API, if you want UNICODE,
1405 # configure with 'perl Configure VC-WIN32 -DUNICODE -D_UNICODE'
1406 inherit_from => [ "VC-noCE-common", asm("x86_asm"),
1407 sub { $disabled{shared} ? () : "uplink_common" } ],
1408 cflags => add("-WX"),
1409 as => sub { vc_win32_info()->{as} },
1410 asflags => sub { vc_win32_info()->{asflags} },
1411 asoutflag => sub { vc_win32_info()->{asoutflag} },
1412 ex_libs => add(sub {
1414 # WIN32 UNICODE build gets linked with unicows.lib for
1415 # backward compatibility with Win9x.
1416 push @ex_libs, 'unicows.lib'
1417 if (grep { $_ eq "UNICODE" } @{$user{CPPDEFINES}});
1418 return join(" ", @ex_libs, @_);
1421 bn_ops => "BN_LLONG EXPORT_VAR_AS_FN",
1422 perlasm_scheme => sub { vc_win32_info()->{perlasm_scheme} },
1423 build_scheme => add("VC-W32", { separator => undef }),
1426 inherit_from => [ "VC-common" ],
1428 asflags => "/nologo /Cp /coff /c /Cx /Zi",
1433 combine('/W3 /WX /GF /Gy /nologo',
1434 sub { vc_wince_info()->{cflags}; },
1435 sub { `cl 2>&1` =~ /Version ([0-9]+)\./ && $1>=14
1436 ? ($disabled{shared} ? " /MT" : " /MD")
1440 cppflags => sub { vc_wince_info()->{cppflags}; },
1442 picker(default => [ "UNICODE", "_UNICODE", "OPENSSL_SYS_WINCE",
1443 "WIN32_LEAN_AND_MEAN", "L_ENDIAN", "DSO_WIN32",
1444 "NO_CHMOD", "OPENSSL_SMALL_FOOTPRINT" ],
1445 debug => [ "DEBUG", "_DEBUG" ]),
1447 combine(sub { defined(env('WCECOMPAT'))
1448 ? '$(WCECOMPAT)/include' : (); },
1449 sub { defined(env('PORTSDK_LIBPATH'))
1450 ? '$(PORTSDK_LIBPATH)/../../include' : (); }),
1451 lflags => add(combine("/nologo /opt:ref",
1452 sub { vc_wince_info()->{lflags}; },
1453 sub { defined(env('PORTSDK_LIBPATH'))
1454 ? "/entry:mainCRTstartup" : (); })),
1456 bn_ops => "BN_LLONG EXPORT_VAR_AS_FN",
1457 ex_libs => add(sub {
1459 push @ex_libs, 'ws2.lib' unless $disabled{sock};
1460 push @ex_libs, 'crypt32.lib';
1461 if (defined(env('WCECOMPAT'))) {
1462 my $x = '$(WCECOMPAT)/lib';
1463 if (-f "$x/env('TARGETCPU')/wcecompatex.lib") {
1464 $x .= '/$(TARGETCPU)/wcecompatex.lib';
1466 $x .= '/wcecompatex.lib';
1470 push @ex_libs, '$(PORTSDK_LIBPATH)/portlib.lib'
1471 if (defined(env('PORTSDK_LIBPATH')));
1472 push @ex_libs, ' /nodefaultlib coredll.lib corelibc.lib'
1473 if (env('TARGETCPU') eq "X86");
1476 build_scheme => add("VC-WCE", { separator => undef }),
1481 inherit_from => [ "BASE_unix", asm("x86_asm"),
1482 sub { $disabled{shared} ? () : "x86_uplink" } ],
1484 cflags => picker(default => "-m32 -Wall",
1486 release => "-O3 -fomit-frame-pointer"),
1487 cppflags => combine("-DL_ENDIAN -DWIN32_LEAN_AND_MEAN",
1488 "-DUNICODE -D_UNICODE", threads("-D_MT")),
1489 sys_id => "MINGW32",
1490 ex_libs => add("-lws2_32 -lgdi32 -lcrypt32"),
1491 bn_ops => "BN_LLONG EXPORT_VAR_AS_FN",
1492 thread_scheme => "winthreads",
1493 perlasm_scheme => "coff",
1494 dso_scheme => "win32",
1495 shared_target => "mingw-shared",
1496 shared_cppflags => add("_WINDLL"),
1497 shared_ldflag => "-static-libgcc",
1498 shared_rcflag => "--target=pe-i386",
1499 shared_extension => ".dll",
1501 apps_aux_src => add("win32_init.c"),
1504 # As for OPENSSL_USE_APPLINK. Applink makes it possible to use
1505 # .dll compiled with one compiler with application compiled with
1506 # another compiler. It's possible to engage Applink support in
1507 # mingw64 build, but it's not done, because till mingw64
1508 # supports structured exception handling, one can't seriously
1509 # consider its binaries for using with non-mingw64 run-time
1510 # environment. And as mingw64 is always consistent with itself,
1511 # Applink is never engaged and can as well be omitted.
1512 inherit_from => [ "BASE_unix", asm("x86_64_asm") ],
1514 cflags => picker(default => "-m64 -Wall",
1517 cppflags => combine("-DL_ENDIAN -DWIN32_LEAN_AND_MEAN",
1518 "-DUNICODE -D_UNICODE", threads("-D_MT")),
1519 sys_id => "MINGW64",
1520 ex_libs => add("-lws2_32 -lgdi32 -lcrypt32"),
1521 bn_ops => "SIXTY_FOUR_BIT EXPORT_VAR_AS_FN",
1522 thread_scheme => "winthreads",
1523 perlasm_scheme => "mingw64",
1524 dso_scheme => "win32",
1525 shared_target => "mingw-shared",
1526 shared_cppflags => add("_WINDLL"),
1527 shared_ldflag => "-static-libgcc",
1528 shared_rcflag => "--target=pe-x86-64",
1529 shared_extension => ".dll",
1531 apps_aux_src => add("win32_init.c"),
1536 inherit_from => [ "BASE_unix" ],
1539 cppflags => "-DL_ENDIAN",
1545 inherit_from => [ "BASE_unix" ],
1547 cflags => "-O -Wall",
1548 cppflags => "-DTERMIOS -DL_ENDIAN",
1550 bn_ops => "BN_LLONG",
1551 dso_scheme => "win32",
1556 inherit_from => [ "BASE_unix", asm("x86_asm") ],
1558 cflags => picker(default => "-Wall",
1560 release => "-O3 -fomit-frame-pointer"),
1561 cppflags => "-DTERMIOS -DL_ENDIAN",
1563 bn_ops => "BN_LLONG",
1564 thread_scheme => "pthread",
1565 perlasm_scheme => "coff",
1566 dso_scheme => "dlfcn",
1567 shared_target => "cygwin-shared",
1568 shared_cppflags => "-D_WINDLL",
1569 shared_extension => ".dll",
1571 "Cygwin-x86_64" => {
1572 inherit_from => [ "BASE_unix", asm("x86_64_asm") ],
1574 cflags => picker(default => "-Wall",
1577 cppflags => "-DTERMIOS -DL_ENDIAN",
1579 bn_ops => "SIXTY_FOUR_BIT_LONG",
1580 thread_scheme => "pthread",
1581 perlasm_scheme => "mingw64",
1582 dso_scheme => "dlfcn",
1583 shared_target => "cygwin-shared",
1584 shared_cppflags => "-D_WINDLL",
1585 shared_extension => ".dll",
1587 # Backward compatibility for those using this target
1589 inherit_from => [ "Cygwin-x86" ]
1591 # In case someone constructs the Cygwin target name themself
1593 inherit_from => [ "Cygwin-x86" ]
1596 inherit_from => [ "Cygwin-x86" ]
1599 inherit_from => [ "Cygwin-x86" ]
1602 inherit_from => [ "Cygwin-x86" ]
1605 ##### MacOS X (a.k.a. Darwin) setup
1606 "darwin-common" => {
1607 inherit_from => [ "BASE_unix" ],
1610 cflags => picker(default => "",
1613 cppflags => threads("-D_REENTRANT"),
1615 plib_lflags => "-Wl,-search_paths_first",
1616 bn_ops => "BN_LLONG RC4_CHAR",
1617 thread_scheme => "pthreads",
1618 perlasm_scheme => "osx32",
1619 dso_scheme => "dlfcn",
1620 ranlib => "ranlib -c",
1621 shared_target => "darwin-shared",
1622 shared_cflag => "-fPIC",
1623 shared_extension => ".\$(SHLIB_VERSION_NUMBER).dylib",
1625 # Option "freeze" such as -std=gnu9x can't negatively interfere
1626 # with future defaults for below two targets, because MacOS X
1627 # for PPC has no future, it was discontinued by vendor in 2009.
1628 "darwin-ppc-cc" => {
1629 inherit_from => [ "darwin-common", asm("ppc32_asm") ],
1630 cflags => add("-arch ppc -std=gnu9x -Wa,-force_cpusubtype_ALL"),
1631 cppflags => add("-DB_ENDIAN"),
1632 perlasm_scheme => "osx32",
1634 "darwin64-ppc-cc" => {
1635 inherit_from => [ "darwin-common", asm("ppc64_asm") ],
1636 cflags => add("-arch ppc64 -std=gnu9x"),
1637 cppflags => add("-DB_ENDIAN"),
1638 bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
1639 perlasm_scheme => "osx64",
1641 "darwin-i386-cc" => {
1642 inherit_from => [ "darwin-common", asm("x86_asm") ],
1643 cflags => add(picker(default => "-arch i386",
1644 release => "-fomit-frame-pointer")),
1645 cppflags => add("-DL_ENDIAN"),
1646 bn_ops => "BN_LLONG RC4_INT",
1647 perlasm_scheme => "macosx",
1649 "darwin64-x86_64-cc" => {
1650 inherit_from => [ "darwin-common", asm("x86_64_asm") ],
1651 cflags => add("-arch x86_64 -Wall"),
1652 cppflags => add("-DL_ENDIAN"),
1653 bn_ops => "SIXTY_FOUR_BIT_LONG",
1654 perlasm_scheme => "macosx",
1659 # It takes three prior-set environment variables to make it work:
1661 # CROSS_COMPILE=/where/toolchain/is/usr/bin/ [note ending slash]
1662 # CROSS_TOP=/where/SDKs/are
1663 # CROSS_SDK=iPhoneOSx.y.sdk
1665 # Exact paths vary with Xcode releases, but for couple of last ones
1666 # they would look like this:
1668 # CROSS_COMPILE=`xcode-select --print-path`/Toolchains/XcodeDefault.xctoolchain/usr/bin/
1669 # CROSS_TOP=`xcode-select --print-path`/Platforms/iPhoneOS.platform/Developer
1670 # CROSS_SDK=iPhoneOS.sdk
1672 "iphoneos-cross" => {
1673 inherit_from => [ "darwin-common" ],
1674 cflags => add("-isysroot \$(CROSS_TOP)/SDKs/\$(CROSS_SDK) -fno-common"),
1678 inherit_from => [ "darwin-common", asm("armv4_asm") ],
1679 # It should be possible to go below iOS 6 and even add -arch armv6,
1680 # thus targeting iPhone pre-3GS, but it's assumed to be irrelevant
1682 cflags => add("-arch armv7 -mios-version-min=6.0.0 -isysroot \$(CROSS_TOP)/SDKs/\$(CROSS_SDK) -fno-common"),
1684 perlasm_scheme => "ios32",
1687 inherit_from => [ "darwin-common", asm("aarch64_asm") ],
1688 cflags => add("-arch arm64 -mios-version-min=7.0.0 -isysroot \$(CROSS_TOP)/SDKs/\$(CROSS_SDK) -fno-common"),
1690 bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
1691 perlasm_scheme => "ios64",
1696 inherit_from => [ "BASE_unix" ],
1697 inherit_from => [ asm("x86_elf_asm") ],
1699 cflags => combine("-O3 -fomit-frame-pointer -Wall",
1700 threads("-pthread")),
1701 cppflags => "-DL_ENDIAN",
1702 ex_libs => add("-ldl", threads("-pthread")),
1703 bn_ops => "BN_LLONG",
1704 thread_scheme => "pthreads",
1705 dso_scheme => "dlfcn",
1706 shared_target => "linux-shared",
1707 shared_cflag => "-fPIC",
1708 shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
1711 ##### VxWorks for various targets
1712 "vxworks-ppc60x" => {
1713 inherit_from => [ "BASE_unix" ],
1715 cflags => "-mrtp -mhard-float -mstrict-align -fno-implicit-fp -O2 -fstrength-reduce -fno-builtin -fno-strict-aliasing -Wall",
1716 cppflags => combine("-D_REENTRANT -DPPC32_fp60x -DCPU=PPC32",
1717 "_DTOOL_FAMILY=gnu -DTOOL=gnu",
1718 "-I\$(WIND_BASE)/target/usr/h",
1719 "-I\$(WIND_BASE)/target/usr/h/wrn/coreip"),
1720 sys_id => "VXWORKS",
1721 lflags => add("-L \$(WIND_BASE)/target/usr/lib/ppc/PPC32/common"),
1722 ex_libs => add("-Wl,--defsym,__wrs_rtp_base=0xe0000000"),
1724 "vxworks-ppcgen" => {
1725 inherit_from => [ "BASE_unix" ],
1727 cflags => "-mrtp -msoft-float -mstrict-align -O1 -fno-builtin -fno-strict-aliasing -Wall",
1728 cppflags => combine("-D_REENTRANT -DPPC32 -DCPU=PPC32",
1729 "-DTOOL_FAMILY=gnu -DTOOL=gnu",
1730 "-I\$(WIND_BASE)/target/usr/h",
1731 "-I\$(WIND_BASE)/target/usr/h/wrn/coreip"),
1732 sys_id => "VXWORKS",
1733 lflags => add("-L \$(WIND_BASE)/target/usr/lib/ppc/PPC32/sfcommon"),
1734 ex_libs => add("-Wl,--defsym,__wrs_rtp_base=0xe0000000"),
1736 "vxworks-ppc405" => {
1737 inherit_from => [ "BASE_unix" ],
1739 cflags => "-g -msoft-float -mlongcall",
1740 cppflags => combine("-D_REENTRANT -DPPC32 -DCPU=PPC405",
1741 "-DTOOL_FAMILY=gnu -DTOOL=gnu",
1742 "-I\$(WIND_BASE)/target/h"),
1743 sys_id => "VXWORKS",
1744 lflags => add("-r"),
1746 "vxworks-ppc750" => {
1747 inherit_from => [ "BASE_unix" ],
1749 cflags => "-ansi -nostdinc -fvolatile -fno-builtin -fno-for-scope -fsigned-char -Wall -msoft-float -mlongcall \$(DEBUG_FLAG)",
1750 cppflags => combine("-DPPC750 -D_REENTRANT -DCPU=PPC604",
1751 "-I\$(WIND_BASE)/target/h"),
1752 sys_id => "VXWORKS",
1753 lflags => add("-r"),
1755 "vxworks-ppc750-debug" => {
1756 inherit_from => [ "BASE_unix" ],
1758 cflags => "-ansi -nostdinc -fvolatile -fno-builtin -fno-for-scope -fsigned-char -Wall -msoft-float -mlongcall -g",
1759 cppflags => combine("-DPPC750 -D_REENTRANT -DCPU=PPC604",
1760 "-DPEDANTIC -DDEBUG",
1761 "-I\$(WIND_BASE)/target/h"),
1762 sys_id => "VXWORKS",
1763 lflags => add("-r"),
1765 "vxworks-ppc860" => {
1766 inherit_from => [ "BASE_unix" ],
1768 cflags => "-nostdinc -msoft-float",
1769 cppflags => combine("-DCPU=PPC860 -DNO_STRINGS_H",
1770 "-I\$(WIND_BASE)/target/h"),
1771 sys_id => "VXWORKS",
1772 lflags => add("-r"),
1774 "vxworks-simlinux" => {
1775 inherit_from => [ "BASE_unix" ],
1777 cflags => "-B\$(WIND_BASE)/host/\$(WIND_HOST_TYPE)/lib/gcc-lib/ -fno-builtin -fno-defer-pop",
1778 cppflags => combine("-D_VSB_CONFIG_FILE=\"\$(WIND_BASE)/target/lib/h/config/vsbConfig.h\"",
1779 "-DL_ENDIAN -DCPU=SIMLINUX -DNO_STRINGS_H",
1780 "-DTOOL_FAMILY=gnu -DTOOL=gnu",
1781 "-DOPENSSL_NO_HW_PADLOCK",
1782 "-I\$(WIND_BASE)/target/h",
1783 "-I\$(WIND_BASE)/target/h/wrn/coreip"),
1784 sys_id => "VXWORKS",
1785 lflags => add("-r"),
1786 ranlib => "ranlibpentium",
1789 inherit_from => [ "BASE_unix", asm("mips32_asm") ],
1791 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",
1792 cppflags => combine("-D_VSB_CONFIG_FILE=\"\$(WIND_BASE)/target/lib/h/config/vsbConfig.h\"",
1793 "-DCPU=MIPS32 -DNO_STRINGS_H",
1794 "-DTOOL_FAMILY=gnu -DTOOL=gnu",
1795 "-DOPENSSL_NO_HW_PADLOCK",
1796 threads("-D_REENTRANT"),
1797 "-I\$(WIND_BASE)/target/h",
1798 "-I\$(WIND_BASE)/target/h/wrn/coreip"),
1799 sys_id => "VXWORKS",
1800 lflags => add("-L \$(WIND_BASE)/target/usr/lib/mips/MIPSI32/sfcommon"),
1801 ex_libs => add("-Wl,--defsym,__wrs_rtp_base=0xe0000000"),
1802 thread_scheme => "pthreads",
1803 perlasm_scheme => "o32",
1804 ranlib => "ranlibmips",
1809 inherit_from => [ "BASE_unix" ],
1810 cc => sub { env('CC') },
1811 cppflags => threads("-D_REENTRANT"),
1812 ex_libs => add("\$(LDLIBS)"),
1813 bn_ops => "BN_LLONG",
1814 thread_scheme => "pthreads",
1815 dso_scheme => sub { env('LIBSSL_dlfcn') },
1816 shared_target => "linux-shared",
1817 shared_cflag => "-fPIC",
1818 shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
1819 ranlib => sub { env('RANLIB') },
1821 "uClinux-dist64" => {
1822 inherit_from => [ "BASE_unix" ],
1823 cc => sub { env('CC') },
1824 cppflags => threads("-D_REENTRANT"),
1825 ex_libs => add("\$(LDLIBS)"),
1826 bn_ops => "SIXTY_FOUR_BIT_LONG",
1827 thread_scheme => "pthreads",
1828 dso_scheme => sub { env('LIBSSL_dlfcn') },
1829 shared_target => "linux-shared",
1830 shared_cflag => "-fPIC",
1831 shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
1832 ranlib => sub { env('RANLIB') },
1837 inherit_from => [ "BASE_VMS" ],
1840 cflags => picker(default => "/STANDARD=(ISOC94,RELAXED)/NOLIST/PREFIX=ALL",
1841 debug => "/NOOPTIMIZE/DEBUG",
1842 release => "/OPTIMIZE/NODEBUG"),
1843 defines => add("OPENSSL_USE_NODELETE"),
1844 lflags => picker(default => "/MAP='F\$PARSE(\".MAP\",\"\$\@\")'",
1845 debug => "/DEBUG/TRACEBACK",
1846 release => "/NODEBUG/NOTRACEBACK"),
1847 lib_cflags => add("/NAMES=(AS_IS,SHORTENED)/EXTERN_MODEL=STRICT_REFDEF"),
1848 # no_inst_lib_cflags is used instead of lib_cflags by descrip.mms.tmpl
1849 # for object files belonging to selected internal libraries
1850 no_inst_lib_cflags => "",
1851 shared_target => "vms-shared",
1852 dso_scheme => "vms",
1853 thread_scheme => "pthreads",
1855 apps_aux_src => "vms_decc_init.c vms_term_sock.c",
1859 inherit_from => [ "vms-generic" ],
1860 cflags => add(sub { my @warnings =
1861 @{vms_info(0)->{disable_warns}};
1863 ? "/WARNINGS=DISABLE=(".join(",",@warnings).")" : (); }),
1866 return vms_info(0)->{def_zlib}
1867 ? "LIBZ=\"\"\"".vms_info(0)->{def_zlib}."\"\"\"" : ();
1869 ex_libs => add(sub { return vms_info(0)->{zlib} || (); }),
1870 pointer_size => sub { return vms_info(0)->{pointer_size} },
1872 #debug_aflags => "/NOOPTIMIZE/DEBUG",
1873 #release_aflags => "/OPTIMIZE/NODEBUG",
1874 bn_opts => "SIXTY_FOUR_BIT RC4_INT",
1876 "vms-alpha-p32" => {
1877 inherit_from => [ "vms-generic" ],
1879 add("/POINTER_SIZE=32",
1880 sub { my @warnings =
1881 @{vms_info(32)->{disable_warns}};
1883 ? "/WARNINGS=DISABLE=(".join(",",@warnings).")" : ();
1887 return vms_info(32)->{def_zlib}
1888 ? "LIBZ=\"\"\"".vms_info(32)->{def_zlib}."\"\"\"" : ();
1890 ex_libs => add(sub { return vms_info(32)->{zlib} || (); }),
1891 pointer_size => sub { return vms_info(32)->{pointer_size} },
1893 "vms-alpha-p64" => {
1894 inherit_from => [ "vms-generic" ],
1896 add("/POINTER_SIZE=64=ARGV",
1897 sub { my @warnings =
1898 @{vms_info(64)->{disable_warns}};
1900 ? "/WARNINGS=DISABLE=(".join(",",@warnings).")" : ();
1904 return vms_info(64)->{def_zlib}
1905 ? "LIBZ=\"\"\"".vms_info(64)->{def_zlib}."\"\"\"" : ();
1907 ex_libs => add(sub { return vms_info(64)->{zlib} || (); }),
1908 pointer_size => sub { return vms_info(64)->{pointer_size} },
1911 inherit_from => [ "vms-generic" ],
1912 cflags => add(sub { my @warnings =
1913 @{vms_info(0)->{disable_warns}};
1915 ? "/WARNINGS=DISABLE=(".join(",",@warnings).")" : (); }),
1918 return vms_info(0)->{def_zlib}
1919 ? "LIBZ=\"\"\"".vms_info(0)->{def_zlib}."\"\"\"" : ();
1921 ex_libs => add(sub { return vms_info(0)->{zlib} || (); }),
1922 pointer_size => sub { return vms_info(0)->{pointer_size} },
1924 #debug_aflags => "/NOOPTIMIZE/DEBUG",
1925 #release_aflags => "/OPTIMIZE/NODEBUG",
1926 bn_opts => "SIXTY_FOUR_BIT RC4_INT",
1929 inherit_from => [ "vms-generic" ],
1931 add("/POINTER_SIZE=32",
1932 sub { my @warnings =
1933 @{vms_info(32)->{disable_warns}};
1935 ? "/WARNINGS=DISABLE=(".join(",",@warnings).")" : ();
1939 return vms_info(32)->{def_zlib}
1940 ? "LIBZ=\"\"\"".vms_info(32)->{def_zlib}."\"\"\"" : ();
1942 ex_libs => add(sub { return vms_info(32)->{zlib} || (); }),
1943 pointer_size => sub { return vms_info(32)->{pointer_size} },
1946 inherit_from => [ "vms-generic" ],
1948 add("/POINTER_SIZE=64=ARGV",
1949 sub { my @warnings =
1950 @{vms_info(64)->{disable_warns}};
1952 ? "/WARNINGS=DISABLE=(".join(",",@warnings).")" : ();
1956 return vms_info(64)->{def_zlib}
1957 ? "LIBZ=\"\"\"".vms_info(64)->{def_zlib}."\"\"\"" : ();
1959 ex_libs => add(sub { return vms_info(64)->{zlib} || (); }),
1960 pointer_size => sub { return vms_info(64)->{pointer_size} },