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 my $pointer_size_str = $config{target} =~ m|-p(\d+)$| ? $1 : "";
121 # For the case where Configure iterate through all config targets, such
122 # as when listing them and their details, we reset info if the pointer
124 if (%$vms_info && $vms_info->{pointer_size} ne $pointer_size_str) {
128 unless (%$vms_info) {
129 $vms_info->{disable_warns} = [ ];
130 $vms_info->{pointer_size} = $pointer_size_str;
131 if ($pointer_size_str eq "64") {
132 `PIPE CC /NOCROSS_REFERENCE /NOLIST /NOOBJECT /WARNINGS = DISABLE = ( MAYLOSEDATA3, EMPTYFILE ) NL: 2> NL:`;
134 push @{$vms_info->{disable_warns}}, "MAYLOSEDATA3";
138 unless ($disabled{zlib}) {
139 my $default_zlib = 'GNV$LIBZSHR' . $pointer_size_str;
140 if (defined($disabled{"zlib-dynamic"})) {
141 $vms_info->{zlib} = $withargs{zlib_lib} || "$default_zlib/SHARE";
143 $vms_info->{def_zlib} = $withargs{zlib_lib} || $default_zlib;
144 # In case the --with-zlib-lib value contains something like
145 # /SHARE or /LIB or so at the end, remove it.
146 $vms_info->{def_zlib} =~ s|/.*$||g;
150 if ($config{target} =~ /-ia64/) {
151 `PIPE ias -H 2> NL:`;
153 $vms_info->{as} = "ias";
154 $vms_info->{asflags} = '-d debug "-N" vms_upcase';
155 $vms_info->{asoutflag} = "-o";
156 $vms_info->{perlasm_scheme} = "ias";
165 #### Basic configs that should work on any 32-bit box
167 inherit_from => [ "BASE_unix" ],
169 cflags => picker(debug => "-O0 -g",
171 thread_scheme => "(unknown)",
172 bn_ops => "BN_LLONG",
175 inherit_from => [ "BASE_unix" ],
178 thread_scheme => "(unknown)",
181 #### VOS Configurations
183 inherit_from => [ "BASE_unix" ],
185 cflags => picker(default => "-Wall",
188 cppflags => "-D_POSIX_C_SOURCE=200112L -D_BSD -D_VOS_EXTENDED_NAMES -DB_ENDIAN",
189 thread_scheme => "(unknown)",
191 lflags => add("-Wl,-map"),
192 bn_ops => "BN_LLONG",
193 shared_extension => ".so",
196 #### Solaris configurations
197 "solaris-common" => {
198 inherit_from => [ "BASE_unix" ],
200 cppflags => "-DFILIO_H",
201 ex_libs => add("-lsocket -lnsl -ldl"),
202 dso_scheme => "dlfcn",
203 thread_scheme => "pthreads",
204 shared_target => "solaris-shared",
205 shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
207 #### Solaris x86 with GNU C setups
208 "solaris-x86-gcc" => {
209 # NB. GNU C has to be configured to use GNU assembler, and not
210 # /usr/ccs/bin/as. Failure to comply will result in compile
211 # failures [at least] in 32-bit build.
212 inherit_from => [ "solaris-common", asm("x86_elf_asm") ],
214 cflags => add_before(picker(default => "-Wall",
216 release => "-O3 -fomit-frame-pointer"),
217 threads("-pthread")),
218 cppflags => add("-DL_ENDIAN"),
219 ex_libs => add(threads("-pthread")),
220 bn_ops => "BN_LLONG",
221 shared_cflag => "-fPIC",
222 shared_ldflag => "-shared -static-libgcc",
224 "solaris64-x86_64-gcc" => {
225 # -shared -static-libgcc might appear controversial, but modules
226 # taken from static libgcc do not have relocations and linking
227 # them into our shared objects doesn't have any negative side
228 # effects. On the contrary, doing so makes it possible to use
229 # gcc shared build with Sun C. Given that gcc generates faster
230 # code [thanks to inline assembler], I would actually recommend
231 # to consider using gcc shared build even with vendor compiler:-)
232 # -- <appro@openssl.org>
233 inherit_from => [ "solaris-common", asm("x86_64_asm") ],
235 cflags => add_before(picker(default => "-m64 -Wall",
238 threads("-pthread")),
239 cppflags => add("-DL_ENDIAN"),
240 ex_libs => add(threads("-pthread")),
241 bn_ops => "SIXTY_FOUR_BIT_LONG",
242 perlasm_scheme => "elf",
243 shared_cflag => "-fPIC",
244 shared_ldflag => "-shared -static-libgcc",
248 #### Solaris x86 with Sun C setups
249 # There used to be solaris-x86-cc target, but it was removed,
250 # primarily because vendor assembler can't assemble our modules
251 # with -KPIC flag. As result it, assembly support, was not even
252 # available as option. But its lack means lack of side-channel
253 # resistant code, which is incompatible with security by todays
254 # standards. Fortunately gcc is readily available prepackaged
255 # option, which we can firmly point at...
257 # On related note, solaris64-x86_64-cc target won't compile code
258 # paths utilizing AVX and post-Haswell instruction extensions.
259 # Consider switching to solaris64-x86_64-gcc even here...
261 "solaris64-x86_64-cc" => {
262 inherit_from => [ "solaris-common", asm("x86_64_asm") ],
264 cflags => add_before(picker(default => "-xarch=generic64 -xstrconst -Xa",
266 release => "-xO5 -xdepend -xbuiltin")),
267 cppflags => add("-DL_ENDIAN", threads("-D_REENTRANT")),
268 thread_scheme => "pthreads",
269 lflags => add(threads("-mt")),
270 ex_libs => add(threads("-lpthread")),
271 bn_ops => "SIXTY_FOUR_BIT_LONG",
272 perlasm_scheme => "elf",
273 shared_cflag => "-KPIC",
274 shared_ldflag => "-G -dy -z text",
278 #### SPARC Solaris with GNU C setups
279 "solaris-sparcv7-gcc" => {
280 inherit_from => [ "solaris-common" ],
282 cflags => add_before(picker(default => "-Wall",
285 threads("-pthread")),
286 cppflags => add("-DB_ENDIAN -DBN_DIV2W"),
287 ex_libs => add(threads("-pthread")),
288 bn_ops => "BN_LLONG RC4_CHAR",
289 shared_cflag => "-fPIC",
290 shared_ldflag => "-shared",
292 "solaris-sparcv8-gcc" => {
293 inherit_from => [ "solaris-sparcv7-gcc", asm("sparcv8_asm") ],
294 cflags => add_before("-mcpu=v8"),
296 "solaris-sparcv9-gcc" => {
297 # -m32 should be safe to add as long as driver recognizes
299 inherit_from => [ "solaris-sparcv7-gcc", asm("sparcv9_asm") ],
300 cflags => add_before("-m32 -mcpu=ultrasparc"),
302 "solaris64-sparcv9-gcc" => {
303 inherit_from => [ "solaris-sparcv9-gcc" ],
304 cflags => sub { my $f=join(" ",@_); $f =~ s/\-m32/-m64/; $f; },
305 bn_ops => "BN_LLONG RC4_CHAR",
309 #### SPARC Solaris with Sun C setups
310 # SC4.0 doesn't pass 'make test', upgrade to SC5.0 or SC4.2.
311 # SC4.2 is ok, better than gcc even on bn as long as you tell it -xarch=v8
312 # SC5.0 note: Compiler common patch 107357-01 or later is required!
313 "solaris-sparcv7-cc" => {
314 inherit_from => [ "solaris-common" ],
316 cflags => add_before(picker(default => "-xstrconst -Xa",
318 release => "-xO5 -xdepend")),
319 cppflags => add("-DB_ENDIAN -DBN_DIV2W",
320 threads("-D_REENTRANT")),
321 lflags => add(threads("-mt")),
322 ex_libs => add(threads("-lpthread")),
323 bn_ops => "BN_LLONG RC4_CHAR",
324 shared_cflag => "-KPIC",
325 shared_ldflag => "-G -dy -z text",
328 "solaris-sparcv8-cc" => {
329 inherit_from => [ "solaris-sparcv7-cc", asm("sparcv8_asm") ],
330 cflags => add_before("-xarch=v8"),
332 "solaris-sparcv9-cc" => {
333 inherit_from => [ "solaris-sparcv7-cc", asm("sparcv9_asm") ],
334 cflags => add_before("-xarch=v8plus"),
336 "solaris64-sparcv9-cc" => {
337 inherit_from => [ "solaris-sparcv7-cc", asm("sparcv9_asm") ],
338 cflags => add_before("-xarch=v9"),
339 bn_ops => "BN_LLONG RC4_CHAR",
343 #### IRIX 6.x configs
344 # Only N32 and N64 ABIs are supported.
345 "irix-mips3-gcc" => {
346 inherit_from => [ "BASE_unix", asm("mips64_asm") ],
348 cflags => combine(picker(default => "-mabi=n32",
351 cppflags => combine("-DB_ENDIAN -DBN_DIV3W",
352 threads("-D_SGI_MP_SOURCE")),
353 ex_libs => add(threads("-lpthread")),
354 bn_ops => "RC4_CHAR SIXTY_FOUR_BIT",
355 thread_scheme => "pthreads",
356 perlasm_scheme => "n32",
357 dso_scheme => "dlfcn",
358 shared_target => "irix-shared",
359 shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
363 inherit_from => [ "BASE_unix", asm("mips64_asm") ],
365 cflags => combine(picker(default => "-n32 -mips3 -use_readonly_const -G0 -rdata_shared",
368 cppflags => combine("-DB_ENDIAN -DBN_DIV3W",
369 threads("-D_SGI_MP_SOURCE")),
370 ex_libs => add(threads("-lpthread")),
371 bn_ops => "RC4_CHAR SIXTY_FOUR_BIT",
372 thread_scheme => "pthreads",
373 perlasm_scheme => "n32",
374 dso_scheme => "dlfcn",
375 shared_target => "irix-shared",
376 shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
380 "irix64-mips4-gcc" => {
381 inherit_from => [ "BASE_unix", asm("mips64_asm") ],
383 cflags => combine(picker(default => "-mabi=64 -mips4",
386 cppflags => combine("-DB_ENDIAN -DBN_DIV3W",
387 threads("-D_SGI_MP_SOURCE")),
388 ex_libs => add(threads("-lpthread")),
389 bn_ops => "RC4_CHAR SIXTY_FOUR_BIT_LONG",
390 thread_scheme => "pthreads",
391 perlasm_scheme => "64",
392 dso_scheme => "dlfcn",
393 shared_target => "irix-shared",
394 shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
397 "irix64-mips4-cc" => {
398 inherit_from => [ "BASE_unix", asm("mips64_asm") ],
400 cflags => combine(picker(default => "-64 -mips4 -use_readonly_const -G0 -rdata_shared",
403 cppflags => combine("-DB_ENDIAN -DBN_DIV3W",
404 threads("-D_SGI_MP_SOURCE")),
405 ex_libs => add(threads("-lpthread")),
406 bn_ops => "RC4_CHAR SIXTY_FOUR_BIT_LONG",
407 thread_scheme => "pthreads",
408 perlasm_scheme => "64",
409 dso_scheme => "dlfcn",
410 shared_target => "irix-shared",
411 shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
415 #### Unified HP-UX ANSI C configs.
417 # - Originally we were optimizing at +O4 level. It should be noted
418 # that the only difference between +O3 and +O4 is global inter-
419 # procedural analysis. As it has to be performed during the link
420 # stage the compiler leaves behind certain pseudo-code in lib*.a
421 # which might be release or even patch level specific. Generating
422 # the machine code for and analyzing the *whole* program appears
423 # to be *extremely* memory demanding while the performance gain is
424 # actually questionable. The situation is intensified by the default
425 # HP-UX data set size limit (infamous 'maxdsiz' tunable) of 64MB
426 # which is way too low for +O4. In other words, doesn't +O3 make
428 # - Keep in mind that the HP compiler by default generates code
429 # suitable for execution on the host you're currently compiling at.
430 # If the toolkit is meant to be used on various PA-RISC processors
431 # consider './Configure hpux-parisc-[g]cc +DAportable'.
432 # - -DMD32_XARRAY triggers workaround for compiler bug we ran into in
433 # 32-bit message digests. (For the moment of this writing) HP C
434 # doesn't seem to "digest" too many local variables (they make "him"
435 # chew forever:-). For more details look-up MD32_XARRAY comment in
436 # crypto/sha/sha_lcl.h.
437 # - originally there were 32-bit hpux-parisc2-* targets. They were
438 # scrapped, because a) they were not interchangeable with other 32-bit
439 # targets; b) performance-critical 32-bit assembly modules implement
440 # even PA-RISC 2.0-specific code paths, which are chosen at run-time,
441 # thus adequate performance is provided even with PA-RISC 1.1 build.
442 "hpux-parisc-gcc" => {
443 inherit_from => [ "BASE_unix" ],
445 cflags => combine(picker(debug => "-O0 -g",
447 threads("-pthread")),
448 cppflags => "-DB_ENDIAN -DBN_DIV2W",
449 ex_libs => add("-Wl,+s -ldld", threads("-pthread")),
450 bn_ops => "BN_LLONG",
451 thread_scheme => "pthreads",
453 shared_target => "hpux-shared",
454 shared_cflag => "-fPIC",
455 shared_ldflag => "-shared",
456 shared_extension => ".sl.\$(SHLIB_VERSION_NUMBER)",
458 "hpux-parisc1_1-gcc" => {
459 inherit_from => [ "hpux-parisc-gcc", asm("parisc11_asm") ],
460 multilib => "/pa1.1",
462 "hpux64-parisc2-gcc" => {
463 inherit_from => [ "BASE_unix", asm("parisc20_64_asm") ],
465 cflags => combine(picker(debug => "-O0 -g",
467 cppflags => combine("-DB_ENDIAN", threads("-D_REENTRANT")),
468 ex_libs => add("-ldl"),
469 bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
470 thread_scheme => "pthreads",
471 dso_scheme => "dlfcn",
472 shared_target => "hpux-shared",
473 shared_cflag => "-fpic",
474 shared_ldflag => "-shared",
475 shared_extension => ".sl.\$(SHLIB_VERSION_NUMBER)",
476 multilib => "/pa20_64",
479 # More attempts at unified 10.X and 11.X targets for HP C compiler.
480 "hpux-parisc-cc" => {
481 inherit_from => [ "BASE_unix" ],
483 cflags => combine(picker(default => "+Optrs_strongly_typed -Ae +ESlit",
484 debug => "+O0 +d -g",
486 cppflags => combine("-DB_ENDIAN -DBN_DIV2W -DMD32_XARRAY",
487 threads("-D_REENTRANT")),
488 ex_libs => add("-Wl,+s -ldld",threads("-lpthread")),
489 bn_ops => "RC4_CHAR",
490 thread_scheme => "pthreads",
492 shared_target => "hpux-shared",
493 shared_cflag => "+Z",
494 shared_ldflag => "-b",
495 shared_extension => ".sl.\$(SHLIB_VERSION_NUMBER)",
497 "hpux-parisc1_1-cc" => {
498 inherit_from => [ "hpux-parisc-cc", asm("parisc11_asm") ],
499 cflags => add_before("+DA1.1"),
500 multilib => "/pa1.1",
502 "hpux64-parisc2-cc" => {
503 inherit_from => [ "BASE_unix", asm("parisc20_64_asm") ],
505 cflags => combine(picker(default => "+DD64 +Optrs_strongly_typed -Ae +ESlit",
506 debug => "+O0 +d -g",
508 cppflags => combine("-DB_ENDIAN -DMD32_XARRAY",
509 threads("-D_REENTRANT")),
510 ex_libs => add("-ldl",threads("-lpthread")),
511 bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
512 thread_scheme => "pthreads",
513 dso_scheme => "dlfcn",
514 shared_target => "hpux-shared",
515 shared_cflag => "+Z",
516 shared_ldflag => "-b",
517 shared_extension => ".sl.\$(SHLIB_VERSION_NUMBER)",
518 multilib => "/pa20_64",
521 # HP/UX IA-64 targets
523 inherit_from => [ "BASE_unix", asm("ia64_asm") ],
525 cflags => combine(picker(default => "-Ae +DD32 +Olit=all -z",
526 debug => "+O0 +d -g",
528 cppflags => combine("-DB_ENDIAN", threads("-D_REENTRANT")),
529 ex_libs => add("-ldl",threads("-lpthread")),
530 bn_ops => "SIXTY_FOUR_BIT",
531 thread_scheme => "pthreads",
532 dso_scheme => "dlfcn",
533 shared_target => "hpux-shared",
534 shared_cflag => "+Z",
535 shared_ldflag => "-b",
536 shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
537 multilib => "/hpux32",
539 "hpux64-ia64-cc" => {
540 inherit_from => [ "BASE_unix", asm("ia64_asm") ],
542 cflags => combine(picker(default => "-Ae +DD64 +Olit=all -z",
543 debug => "+O0 +d -g",
545 cppflags => combine("-DB_ENDIAN", threads("-D_REENTRANT")),
546 ex_libs => add("-ldl", threads("-lpthread")),
547 bn_ops => "SIXTY_FOUR_BIT_LONG",
548 thread_scheme => "pthreads",
549 dso_scheme => "dlfcn",
550 shared_target => "hpux-shared",
551 shared_cflag => "+Z",
552 shared_ldflag => "-b",
553 shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
554 multilib => "/hpux64",
558 inherit_from => [ "BASE_unix", asm("ia64_asm") ],
560 cflags => combine(picker(debug => "-O0 -g",
562 threads("-pthread")),
563 cppflags => "-DB_ENDIAN",
564 ex_libs => add("-ldl", threads("-pthread")),
565 bn_ops => "SIXTY_FOUR_BIT",
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 => "/hpux32",
574 "hpux64-ia64-gcc" => {
575 inherit_from => [ "BASE_unix", asm("ia64_asm") ],
577 cflags => combine(picker(default => "-mlp64",
580 threads("-pthread")),
581 cppflags => "-DB_ENDIAN",
582 ex_libs => add("-ldl", threads("-pthread")),
583 bn_ops => "SIXTY_FOUR_BIT_LONG",
584 thread_scheme => "pthreads",
585 dso_scheme => "dlfcn",
586 shared_target => "hpux-shared",
587 shared_cflag => "-fpic",
588 shared_ldflag => "-shared",
589 shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
590 multilib => "/hpux64",
593 #### HP MPE/iX http://jazz.external.hp.com/src/openssl/
595 inherit_from => [ "BASE_unix" ],
598 cppflags => "-D_ENDIAN -DBN_DIV2W -D_POSIX_SOURCE -D_SOCKET_SOURCE",
599 includes => add("/SYSLOG/PUB"),
601 lflags => add("-L/SYSLOG/PUB"),
602 ex_libs => add("-lsyslog -lsocket -lcurses"),
603 thread_scheme => "(unknown)",
604 bn_ops => "BN_LLONG",
607 #### DEC Alpha Tru64 targets. Tru64 is marketing name for OSF/1 version 4
608 #### and forward. In reality 'uname -s' still returns "OSF1". Originally
609 #### there were even osf1-* configs targeting prior versions provided,
610 #### but not anymore...
611 "tru64-alpha-gcc" => {
612 inherit_from => [ "BASE_unix", asm("alpha_asm") ],
614 cflags => combine("-std=c9x -O3", threads("-pthread")),
615 cppflags => "-D_XOPEN_SOURCE=500 -D_OSF_SOURCE",
616 ex_libs => add("-lrt", threads("-pthread")), # for mlock(2)
617 bn_ops => "SIXTY_FOUR_BIT_LONG",
618 thread_scheme => "pthreads",
619 dso_scheme => "dlfcn",
620 shared_target => "alpha-osf1-shared",
621 shared_extension => ".so",
623 "tru64-alpha-cc" => {
624 inherit_from => [ "BASE_unix", asm("alpha_asm") ],
626 cflags => combine("-std1 -tune host -fast -readonly_strings",
627 threads("-pthread")),
628 cppflags => "-D_XOPEN_SOURCE=500 -D_OSF_SOURCE",
629 ex_libs => add("-lrt", threads("-pthread")), # for mlock(2)
630 bn_ops => "SIXTY_FOUR_BIT_LONG",
631 thread_scheme => "pthreads",
632 dso_scheme => "dlfcn",
633 shared_target => "alpha-osf1-shared",
634 shared_ldflag => "-msym",
635 shared_extension => ".so",
639 #### Variety of LINUX:-)
641 # *-generic* is endian-neutral target, but ./config is free to
642 # throw in -D[BL]_ENDIAN, whichever appropriate...
643 "linux-generic32" => {
644 inherit_from => [ "BASE_unix" ],
647 cflags => combine(picker(default => "-Wall",
650 threads("-pthread")),
651 cxxflags => combine(picker(default => "-std=c++11 -Wall",
654 threads("-pthread")),
655 cppflags => "-DOPENSSL_USE_NODELETE",
656 ex_libs => add("-ldl", threads("-pthread")),
657 bn_ops => "BN_LLONG RC4_CHAR",
658 thread_scheme => "pthreads",
659 dso_scheme => "dlfcn",
660 shared_target => "linux-shared",
661 shared_cflag => "-fPIC",
662 shared_ldflag => "-Wl,-znodelete",
663 shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
665 "linux-generic64" => {
666 inherit_from => [ "linux-generic32" ],
667 bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
671 inherit_from => [ "linux-generic32", asm("ppc32_asm") ],
672 perlasm_scheme => "linux32",
675 inherit_from => [ "linux-generic64", asm("ppc64_asm") ],
676 cflags => add("-m64"),
677 cppflags => add("-DB_ENDIAN"),
678 perlasm_scheme => "linux64",
682 inherit_from => [ "linux-generic64", asm("ppc64_asm") ],
683 cflags => add("-m64"),
684 cppflags => add("-DL_ENDIAN"),
685 perlasm_scheme => "linux64le",
689 ################################################################
690 # Note that -march is not among compiler options in linux-armv4
691 # target description. Not specifying one is intentional to give
694 # a) rely on your compiler default by not specifying one;
695 # b) specify your target platform explicitly for optimal
696 # performance, e.g. -march=armv6 or -march=armv7-a;
697 # c) build "universal" binary that targets *range* of platforms
698 # by specifying minimum and maximum supported architecture;
700 # As for c) option. It actually makes no sense to specify
701 # maximum to be less than ARMv7, because it's the least
702 # requirement for run-time switch between platform-specific
703 # code paths. And without run-time switch performance would be
704 # equivalent to one for minimum. Secondly, there are some
705 # natural limitations that you'd have to accept and respect.
706 # Most notably you can *not* build "universal" binary for
707 # big-endian platform. This is because ARMv7 processor always
708 # picks instructions in little-endian order. Another similar
709 # limitation is that -mthumb can't "cross" -march=armv6t2
710 # boundary, because that's where it became Thumb-2. Well, this
711 # limitation is a bit artificial, because it's not really
712 # impossible, but it's deemed too tricky to support. And of
713 # course you have to be sure that your binutils are actually
714 # up to the task of handling maximum target platform. With all
715 # this in mind here is an example of how to configure
718 # ./Configure linux-armv4 -march=armv6 -D__ARM_MAX_ARCH__=8
720 inherit_from => [ "linux-generic32", asm("armv4_asm") ],
721 perlasm_scheme => "linux32",
724 inherit_from => [ "linux-generic64", asm("aarch64_asm") ],
725 perlasm_scheme => "linux64",
727 "linux-arm64ilp32" => { # https://wiki.linaro.org/Platform/arm64-ilp32
728 inherit_from => [ "linux-generic32", asm("aarch64_asm") ],
729 cflags => add("-mabi=ilp32"),
730 bn_ops => "SIXTY_FOUR_BIT RC4_CHAR",
731 perlasm_scheme => "linux64",
735 # Configure script adds minimally required -march for assembly
736 # support, if no -march was specified at command line.
737 inherit_from => [ "linux-generic32", asm("mips32_asm") ],
738 cflags => add("-mabi=32"),
739 cppflags => add("-DBN_DIV3W"),
740 perlasm_scheme => "o32",
742 # mips32 and mips64 below refer to contemporary MIPS Architecture
743 # specifications, MIPS32 and MIPS64, rather than to kernel bitness.
745 inherit_from => [ "linux-generic32", asm("mips64_asm") ],
746 cflags => add("-mabi=n32"),
747 cppflags => add("-DBN_DIV3W"),
748 bn_ops => "SIXTY_FOUR_BIT RC4_CHAR",
749 perlasm_scheme => "n32",
752 "linux64-mips64" => {
753 inherit_from => [ "linux-generic64", asm("mips64_asm") ],
754 cflags => add("-mabi=64"),
755 cppflags => add("-DBN_DIV3W"),
756 perlasm_scheme => "64",
760 #### IA-32 targets...
761 #### These two targets are a bit aged and are to be used on older Linux
762 #### machines where gcc doesn't understand -m32 and -m64
764 inherit_from => [ "linux-generic32", asm("x86_elf_asm") ],
765 cflags => add(picker(release => "-fomit-frame-pointer")),
766 cppflags => add("-DL_ENDIAN"),
767 bn_ops => "BN_LLONG",
770 inherit_from => [ "BASE_unix", asm("x86_asm") ],
772 cflags => add(picker(default => "-Wall",
774 release => "-O3 -fomit-frame-pointer")),
775 cppflags => add("-DL_ENDIAN"),
776 bn_ops => "BN_LLONG",
777 thread_scheme => "(unknown)",
778 perlasm_scheme => "a.out",
781 #### X86 / X86_64 targets
783 inherit_from => [ "linux-generic32", asm("x86_asm") ],
784 cflags => add(picker(default => "-m32",
785 release => "-fomit-frame-pointer")),
786 cppflags => add("-DL_ENDIAN"),
787 bn_ops => "BN_LLONG",
788 perlasm_scheme => "elf",
790 "linux-x86-clang" => {
791 inherit_from => [ "linux-x86" ],
794 cflags => add("-Wextra"),
797 inherit_from => [ "linux-generic64", asm("x86_64_asm") ],
798 cflags => add("-m64"),
799 cppflags => add("-DL_ENDIAN"),
800 bn_ops => "SIXTY_FOUR_BIT_LONG",
801 perlasm_scheme => "elf",
804 "linux-x86_64-clang" => {
805 inherit_from => [ "linux-x86_64" ],
808 cflags => add("-Wextra"),
811 inherit_from => [ "linux-generic32", asm("x86_64_asm") ],
812 cflags => add("-mx32"),
813 cppflags => add("-DL_ENDIAN"),
814 bn_ops => "SIXTY_FOUR_BIT",
815 perlasm_scheme => "elf32",
820 inherit_from => [ "linux-generic64", asm("ia64_asm") ],
821 bn_ops => "SIXTY_FOUR_BIT_LONG",
825 inherit_from => [ "linux-generic64", asm("s390x_asm") ],
826 cflags => add("-m64"),
827 cppflags => add("-DB_ENDIAN"),
828 perlasm_scheme => "64",
832 #### So called "highgprs" target for z/Architecture CPUs
833 # "Highgprs" is kernel feature first implemented in Linux
834 # 2.6.32, see /proc/cpuinfo. The idea is to preserve most
835 # significant bits of general purpose registers not only
836 # upon 32-bit process context switch, but even on
837 # asynchronous signal delivery to such process. This makes
838 # it possible to deploy 64-bit instructions even in legacy
839 # application context and achieve better [or should we say
840 # adequate] performance. The build is binary compatible with
841 # linux-generic32, and the idea is to be able to install the
842 # resulting libcrypto.so alongside generic one, e.g. as
843 # /lib/highgprs/libcrypto.so.x.y, for ldconfig and run-time
844 # linker to autodiscover. Unfortunately it doesn't work just
845 # yet, because of couple of bugs in glibc
846 # sysdeps/s390/dl-procinfo.c affecting ldconfig and ld.so.1...
848 inherit_from => [ "linux-generic32", asm("s390x_asm") ],
849 cflags => add("-m31 -Wa,-mzarch"),
850 cppflags => add("-DB_ENDIAN"),
851 bn_asm_src => sub { my $r=join(" ",@_); $r=~s|asm/s390x\.S|bn_asm.c|; $r; },
852 perlasm_scheme => "31",
853 multilib => "/highgprs",
856 #### SPARC Linux setups
858 inherit_from => [ "linux-generic32", asm("sparcv8_asm") ],
859 cflags => add("-mcpu=v8"),
860 cppflags => add("-DB_ENDIAN -DBN_DIV2W"),
863 # it's a real mess with -mcpu=ultrasparc option under Linux,
864 # but -Wa,-Av8plus should do the trick no matter what.
865 inherit_from => [ "linux-generic32", asm("sparcv9_asm") ],
866 cflags => add("-m32 -mcpu=ultrasparc -Wa,-Av8plus"),
867 cppflags => add("-DB_ENDIAN -DBN_DIV2W"),
869 "linux64-sparcv9" => {
870 # GCC 3.1 is a requirement
871 inherit_from => [ "linux-generic64", asm("sparcv9_asm") ],
872 cflags => add("-m64 -mcpu=ultrasparc"),
873 cppflags => add("-DB_ENDIAN"),
874 bn_ops => "BN_LLONG RC4_CHAR",
878 "linux-alpha-gcc" => {
879 inherit_from => [ "linux-generic64", asm("alpha_asm") ],
880 cppflags => add("-DL_ENDIAN"),
881 bn_ops => "SIXTY_FOUR_BIT_LONG",
883 "linux-c64xplus" => {
884 inherit_from => [ "BASE_unix" ],
885 # TI_CGT_C6000_7.3.x is a requirement
887 cflags => "--linux -ea=.s -eo=.o -mv6400+ -o2 -ox -ms -pden",
888 cppflags => combine("-DOPENSSL_SMALL_FOOTPRINT",
889 threads("-D_REENTRANT")),
890 bn_ops => "BN_LLONG",
891 cpuid_asm_src => "c64xpluscpuid.s",
892 bn_asm_src => "asm/bn-c64xplus.asm c64xplus-gf2m.s",
893 aes_asm_src => "aes-c64xplus.s aes_cbc.c aes-ctr.fake",
894 sha1_asm_src => "sha1-c64xplus.s sha256-c64xplus.s sha512-c64xplus.s",
895 rc4_asm_src => "rc4-c64xplus.s",
896 modes_asm_src => "ghash-c64xplus.s",
897 chacha_asm_src => "chacha-c64xplus.s",
898 poly1305_asm_src => "poly1305-c64xplus.s",
899 thread_scheme => "pthreads",
900 perlasm_scheme => "void",
901 dso_scheme => "dlfcn",
902 shared_target => "linux-shared",
903 shared_cflag => "--pic",
904 shared_ldflag => add("-z --sysv --shared"),
905 shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
909 #### Android: linux-* but without pointers to headers and libs.
911 # It takes pair of prior-set environment variables to make it work:
913 # CROSS_SYSROOT=/some/where/android-ndk-<ver>/platforms/android-<apiver>/arch-<arch>
914 # CROSS_COMPILE=<prefix>
916 # As well as PATH adjusted to cover ${CROSS_COMPILE}gcc and company.
917 # For example to compile for ICS and ARM with NDK 10d, you'd:
919 # ANDROID_NDK=/some/where/android-ndk-10d
920 # CROSS_SYSROOT=$ANDROID_NDK/platforms/android-14/arch-arm
921 # CROSS_COMPILE=arm-linux-androideabi-
922 # PATH=$ANDROID_NDK/toolchains/arm-linux-androideabi-4.8/prebuild/linux-x86_64/bin
925 inherit_from => [ "linux-generic32" ],
926 # Special note about unconditional -fPIC and -pie. The underlying
927 # reason is that Lollipop refuses to run non-PIE. But what about
928 # older systems and NDKs? -fPIC was never problem, so the only
929 # concern is -pie. Older toolchains, e.g. r4, appear to handle it
930 # and binaries turn mostly functional. "Mostly" means that oldest
931 # Androids, such as Froyo, fail to handle executable, but newer
932 # systems are perfectly capable of executing binaries targeting
933 # Froyo. Keep in mind that in the nutshell Android builds are
934 # about JNI, i.e. shared libraries, not applications.
935 cflags => add(picker(default => "-mandroid -fPIC --sysroot=\$(CROSS_SYSROOT) -Wa,--noexecstack")),
936 bin_cflags => "-pie",
939 inherit_from => [ "android", asm("x86_asm") ],
940 cflags => add(picker(release => "-fomit-frame-pointer")),
941 bn_ops => "BN_LLONG",
942 perlasm_scheme => "android",
944 ################################################################
945 # Contemporary Android applications can provide multiple JNI
946 # providers in .apk, targeting multiple architectures. Among
947 # them there is "place" for two ARM flavours: generic eabi and
948 # armv7-a/hard-float. However, it should be noted that OpenSSL's
949 # ability to engage NEON is not constrained by ABI choice, nor
950 # is your ability to call OpenSSL from your application code
951 # compiled with floating-point ABI other than default 'soft'.
952 # [Latter thanks to __attribute__((pcs("aapcs"))) declaration.]
953 # This means that choice of ARM libraries you provide in .apk
954 # is driven by application needs. For example if application
955 # itself benefits from NEON or is floating-point intensive, then
956 # it might be appropriate to provide both libraries. Otherwise
957 # just generic eabi would do. But in latter case it would be
960 # ./Configure android-armeabi -D__ARM_MAX_ARCH__=8
962 # in order to build "universal" binary and allow OpenSSL take
963 # advantage of NEON when it's available.
965 "android-armeabi" => {
966 inherit_from => [ "android", asm("armv4_asm") ],
969 inherit_from => [ "android", asm("mips32_asm") ],
970 perlasm_scheme => "o32",
974 inherit_from => [ "linux-generic64" ],
975 cflags => add(picker(default => "-mandroid -fPIC --sysroot=\$(CROSS_SYSROOT) -Wa,--noexecstack")),
976 bin_cflags => "-pie",
978 "android64-aarch64" => {
979 inherit_from => [ "android64", asm("aarch64_asm") ],
980 perlasm_scheme => "linux64",
982 "android64-x86_64" => {
983 inherit_from => [ "android64", asm("x86_64_asm") ],
984 perlasm_scheme => "elf",
986 "android64-mips64" => {
987 ############################################################
988 # You are more than likely have to specify target processor
989 # on ./Configure command line. Trouble is that toolchain's
990 # default is MIPS64r6 (at least in r10d), but there are no
991 # such processors around (or they are too rare to spot one).
992 # Actual problem is that MIPS64r6 is binary incompatible
993 # with previous MIPS ISA versions, in sense that unlike
994 # prior versions original MIPS binary code will fail.
996 inherit_from => [ "android64", asm("mips64_asm") ],
997 perlasm_scheme => "64",
1001 "BSD-generic32" => {
1002 # As for thread cflag. Idea is to maintain "collective" set of
1003 # flags, which would cover all BSD flavors. -pthread applies
1004 # to them all, but is treated differently. OpenBSD expands is
1005 # as -D_POSIX_THREAD -lc_r, which is sufficient. FreeBSD 4.x
1006 # expands it as -lc_r, which has to be accompanied by explicit
1007 # -D_THREAD_SAFE and sometimes -D_REENTRANT. FreeBSD 5.x
1008 # expands it as -lc_r, which seems to be sufficient?
1009 inherit_from => [ "BASE_unix" ],
1011 cflags => combine(picker(default => "-Wall",
1014 threads("-pthread")),
1015 cppflags => threads("-D_THREAD_SAFE -D_REENTRANT"),
1016 ex_libs => add(threads("-pthread")),
1017 enable => add("devcryptoeng"),
1018 bn_ops => "BN_LLONG",
1019 thread_scheme => "pthreads",
1020 dso_scheme => "dlfcn",
1021 shared_target => "bsd-gcc-shared",
1022 shared_cflag => "-fPIC",
1023 shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
1025 "BSD-generic64" => {
1026 inherit_from => [ "BSD-generic32" ],
1027 bn_ops => "SIXTY_FOUR_BIT_LONG",
1031 inherit_from => [ "BSD-generic32", asm("x86_asm") ],
1032 cflags => add(picker(release => "-fomit-frame-pointer")),
1033 cppflags => add("-DL_ENDIAN"),
1034 bn_ops => "BN_LLONG",
1035 shared_target => "bsd-shared",
1036 perlasm_scheme => "a.out",
1039 inherit_from => [ "BSD-x86" ],
1040 perlasm_scheme => "elf",
1044 inherit_from => [ "BSD-generic32", asm("sparcv8_asm") ],
1045 cflags => add("-mcpu=v8"),
1046 cppflags => add("-DB_ENDIAN"),
1049 # -DMD32_REG_T=int doesn't actually belong in sparc64 target, it
1050 # simply *happens* to work around a compiler bug in gcc 3.3.3,
1051 # triggered by RIPEMD160 code.
1052 inherit_from => [ "BSD-generic64", asm("sparcv9_asm") ],
1053 cppflags => add("-DB_ENDIAN -DMD32_REG_T=int"),
1054 bn_ops => "BN_LLONG",
1058 inherit_from => [ "BSD-generic64", asm("ia64_asm") ],
1059 cppflags => add("-DL_ENDIAN"),
1060 bn_ops => "SIXTY_FOUR_BIT_LONG",
1064 inherit_from => [ "BSD-generic64", asm("x86_64_asm") ],
1065 cppflags => add("-DL_ENDIAN"),
1066 bn_ops => "SIXTY_FOUR_BIT_LONG",
1067 perlasm_scheme => "elf",
1071 inherit_from => [ "BASE_unix", asm("x86_elf_asm") ],
1073 cflags => "-fomit-frame-pointer -O3 -Wall",
1074 cppflags => "-DPERL5 -DL_ENDIAN",
1075 ex_libs => add("-ldl"),
1076 bn_ops => "BN_LLONG",
1077 thread_scheme => "(unknown)",
1078 dso_scheme => "dlfcn",
1079 shared_target => "bsd-gcc-shared",
1080 shared_cflag => "-fPIC",
1081 shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
1085 inherit_from => [ "BASE_unix" ],
1087 cflags => "-O -Wall",
1088 unistd => "<libc.h>",
1089 bn_ops => "BN_LLONG",
1090 thread_scheme => "(unknown)",
1093 inherit_from => [ "BASE_unix" ],
1095 cflags => "-O3 -Wall",
1096 unistd => "<libc.h>",
1097 bn_ops => "BN_LLONG",
1098 thread_scheme => "(unknown)",
1103 inherit_from => [ "BASE_unix" ],
1106 cppflags => "-DL_ENDIAN -DTERMIO",
1107 thread_scheme => "(unknown)",
1110 inherit_from => [ "BASE_unix" ],
1112 ex_libs => add("-lsocket"),
1113 dso_scheme => "dlfcn",
1114 shared_target => "bsd-gcc-shared",
1115 shared_cflag => "-fPIC",
1116 shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
1119 inherit_from => [ "BASE_unix", asm("x86_elf_asm") ],
1121 cflags => "-O2 -Wall",
1122 cppflags => "-DL_ENDIAN",
1123 ex_libs => add("-lsocket"),
1124 dso_scheme => "dlfcn",
1125 shared_target => "bsd-gcc-shared",
1126 shared_cflag => "-fPIC",
1127 shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
1130 #### SCO/Caldera targets.
1132 # Originally we had like unixware-*, unixware-*-pentium, unixware-*-p6, etc.
1133 # Now we only have blended unixware-* as it's the only one used by ./config.
1134 # If you want to optimize for particular microarchitecture, bypass ./config
1135 # and './Configure unixware-7 -Kpentium_pro' or whatever appropriate.
1136 # Note that not all targets include assembler support. Mostly because of
1137 # lack of motivation to support out-of-date platforms with out-of-date
1138 # compiler drivers and assemblers.
1140 # UnixWare 2.0x fails destest with -O.
1142 inherit_from => [ "BASE_unix" ],
1144 cflags => combine(threads("-Kthread")),
1145 cppflags => "-DFILIO_H -DNO_STRINGS_H",
1146 ex_libs => add("-lsocket -lnsl -lresolv -lx"),
1147 thread_scheme => "uithreads",
1150 inherit_from => [ "BASE_unix" ],
1152 cflags => combine("-O", threads("-Kthread")),
1153 cppflags => "-DFILIO_H",
1154 ex_libs => add("-lsocket -lnsl -lresolv -lx"),
1155 thread_scheme => "uithreads",
1158 inherit_from => [ "BASE_unix", asm("x86_elf_asm") ],
1160 cflags => combine("-O -Kalloca", threads("-Kthread")),
1161 cppflags => "-DFILIO_H",
1162 ex_libs => add("-lsocket -lnsl"),
1163 thread_scheme => "uithreads",
1164 bn_ops => "BN_LLONG",
1165 perlasm_scheme => "elf-1",
1166 dso_scheme => "dlfcn",
1167 shared_target => "svr5-shared",
1168 shared_cflag => "-Kpic",
1169 shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
1171 "unixware-7-gcc" => {
1172 inherit_from => [ "BASE_unix", asm("x86_elf_asm") ],
1174 cflags => combine("-O3 -fomit-frame-pointer -Wall"),
1175 cppflags => add("-DL_ENDIAN -DFILIO_H",
1176 threads("-D_REENTRANT")),
1177 ex_libs => add("-lsocket -lnsl"),
1178 bn_ops => "BN_LLONG",
1179 thread_scheme => "pthreads",
1180 perlasm_scheme => "elf-1",
1181 dso_scheme => "dlfcn",
1182 shared_target => "gnu-shared",
1183 shared_cflag => "-fPIC",
1184 shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
1186 # SCO 5 - Ben Laurie says the -O breaks the SCO cc.
1188 inherit_from => [ "BASE_unix", asm("x86_elf_asm") ],
1191 ex_libs => add("-lsocket -lnsl"),
1192 thread_scheme => "(unknown)",
1193 perlasm_scheme => "elf-1",
1194 dso_scheme => "dlfcn",
1195 shared_target => "svr3-shared",
1196 shared_cflag => "-Kpic",
1197 shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
1200 inherit_from => [ "BASE_unix", asm("x86_elf_asm") ],
1202 cflags => "-O3 -fomit-frame-pointer",
1203 ex_libs => add("-lsocket -lnsl"),
1204 bn_ops => "BN_LLONG",
1205 thread_scheme => "(unknown)",
1206 perlasm_scheme => "elf-1",
1207 dso_scheme => "dlfcn",
1208 shared_target => "svr3-shared",
1209 shared_cflag => "-fPIC",
1210 shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
1214 # Below targets assume AIX >=5. Caveat lector. If you are accustomed
1215 # to control compilation "bitness" by setting $OBJECT_MODE environment
1216 # variable, then you should know that in OpenSSL case it's considered
1217 # only in ./config. Once configured, build procedure remains "deaf" to
1218 # current value of $OBJECT_MODE.
1220 inherit_from => [ "BASE_unix", asm("ppc32_asm") ],
1222 cflags => combine(picker(debug => "-O0 -g",
1224 threads("-pthread")),
1225 cppflags => "-DB_ENDIAN",
1226 ex_libs => add(threads("-pthread")),
1228 bn_ops => "BN_LLONG RC4_CHAR",
1229 thread_scheme => "pthreads",
1230 perlasm_scheme => "aix32",
1231 dso_scheme => "dlfcn",
1232 shared_target => "aix-shared",
1233 shared_ldflag => "-shared -static-libgcc -Wl,-G",
1234 shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
1238 inherit_from => [ "BASE_unix", asm("ppc64_asm") ],
1240 cflags => combine(picker(default => "-maix64",
1243 threads("-pthread")),
1244 cppflags => "-DB_ENDIAN",
1245 ex_libs => add(threads("-pthread")),
1247 bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
1248 thread_scheme => "pthreads",
1249 perlasm_scheme => "aix64",
1250 dso_scheme => "dlfcn",
1251 shared_target => "aix-shared",
1252 shared_ldflag => "-shared -static-libgcc -Wl,-G",
1253 shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
1257 inherit_from => [ "BASE_unix", asm("ppc32_asm") ],
1259 cflags => combine(picker(default => "-q32 -qmaxmem=16384 -qro -qroconst",
1262 threads("-qthreaded")),
1263 cppflags => combine("-DB_ENDIAN", threads("-D_THREAD_SAFE")),
1265 bn_ops => "BN_LLONG RC4_CHAR",
1266 thread_scheme => "pthreads",
1267 ex_libs => threads("-lpthreads"),
1268 perlasm_scheme => "aix32",
1269 dso_scheme => "dlfcn",
1270 shared_target => "aix-shared",
1271 shared_ldflag => "-G",
1272 shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
1276 inherit_from => [ "BASE_unix", asm("ppc64_asm") ],
1278 cflags => combine(picker(default => "-q64 -qmaxmem=16384 -qro -qroconst",
1281 threads("-qthreaded")),
1282 cppflags => combine("-DB_ENDIAN", threads("-D_THREAD_SAFE")),
1284 bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
1285 thread_scheme => "pthreads",
1286 ex_libs => threads("-lpthreads"),
1287 perlasm_scheme => "aix64",
1288 dso_scheme => "dlfcn",
1289 shared_target => "aix-shared",
1290 shared_ldflag => "-G",
1291 shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
1295 # SIEMENS BS2000/OSD: an EBCDIC-based mainframe
1297 inherit_from => [ "BASE_unix" ],
1299 cflags => "-O -XLLML -XLLMK -XL",
1300 cppflags => "-DB_ENDIAN -DCHARSET_EBCDIC",
1301 ex_libs => add("-lsocket -lnsl"),
1302 bn_ops => "THIRTY_TWO_BIT RC4_CHAR",
1303 thread_scheme => "(unknown)",
1306 #### Visual C targets
1308 # Win64 targets, WIN64I denotes IA-64 and WIN64A - AMD64
1310 # Note about -wd4090, disable warning C4090. This warning returns false
1311 # positives in some situations. Disabling it altogether masks both
1312 # legitimate and false cases, but as we compile on multiple platforms,
1313 # we rely on other compilers to catch legitimate cases.
1315 # Also note that we force threads no matter what. Configuring "no-threads"
1318 inherit_from => [ "BASE_Windows" ],
1321 cpp => '$(CC) /EP /C',
1322 cflags => "-W3 -wd4090 -Gs0 -GF -Gy -nologo",
1323 defines => add("OPENSSL_SYS_WIN32", "WIN32_LEAN_AND_MEAN",
1324 "L_ENDIAN", "_CRT_SECURE_NO_DEPRECATE",
1325 "_WINSOCK_DEPRECATED_NO_WARNINGS",
1326 sub { my @defs = ();
1327 unless ($disabled{"zlib-dynamic"}) {
1329 $withargs{zlib_lib} // "ZLIB1";
1332 'LIBZ="' . $zlib . '"');
1337 lib_cflags => add("/Zi /Fdossl_static"),
1338 dso_cflags => "/Zi /Fddso",
1339 bin_cflags => "/Zi /Fdapp",
1340 lflags => add("/debug"),
1341 shared_ldflag => "/dll",
1342 shared_target => "win-shared", # meaningless except it gives Configure a hint
1343 thread_scheme => "winthreads",
1344 dso_scheme => "win32",
1345 apps_aux_src => add("win32_init.c"),
1347 "VC-noCE-common" => {
1348 inherit_from => [ "VC-common" ],
1350 cflags => add(picker(debug =>
1352 ($disabled{shared} ? "" : "/MDd")
1357 ($disabled{shared} ? "" : "/MD")
1360 defines => add(picker(default => [ "UNICODE", "_UNICODE" ],
1361 debug => [ "DEBUG", "_DEBUG" ])),
1362 lib_cflags => add(sub { $disabled{shared} ? "/MT /Zl" : () }),
1363 # Following might/should appears controversial, i.e. defining
1364 # /MDd without evaluating $disabled{shared}. It works in
1365 # non-shared build because static library is compiled with /Zl
1366 # and bares no reference to specific RTL. And it works in
1367 # shared build because multiple /MDd options are not prohibited.
1368 # But why /MDd in static build? Well, basically this is just a
1369 # reference point, which allows to catch eventual errors that
1370 # would prevent those who want to wrap OpenSSL into own .DLL.
1371 # Why not /MD in release build then? Well, some are likely to
1372 # prefer [non-debug] openssl.exe to be free from Micorosoft RTL
1374 bin_cflags => add(picker(debug => "/MDd",
1375 release => sub { $disabled{shared} ? "/MT" : () },
1377 bin_lflags => add("/subsystem:console /opt:ref"),
1378 ex_libs => add(sub {
1380 push @ex_libs, 'ws2_32.lib' unless $disabled{sock};
1381 push @ex_libs, 'gdi32.lib advapi32.lib crypt32.lib user32.lib';
1382 return join(" ", @ex_libs);
1385 "VC-WIN64-common" => {
1386 inherit_from => [ "VC-noCE-common" ],
1388 ex_libs => add(sub {
1390 push @ex_libs, 'bufferoverflowu.lib' if (`cl 2>&1` =~ /14\.00\.4[0-9]{4}\./);
1391 return join(" ", @_, @ex_libs);
1393 bn_ops => "SIXTY_FOUR_BIT EXPORT_VAR_AS_FN",
1394 build_scheme => add("VC-W64", { separator => undef }),
1397 inherit_from => [ "VC-WIN64-common", asm("ia64_asm"),
1398 sub { $disabled{shared} ? () : "ia64_uplink" } ],
1400 asflags => "-d debug",
1403 bn_asm_src => sub { return undef unless @_;
1404 my $r=join(" ",@_); $r=~s|bn-ia64.s|bn_asm.c|; $r; },
1405 perlasm_scheme => "ias",
1406 multilib => "-ia64",
1409 inherit_from => [ "VC-WIN64-common", asm("x86_64_asm"),
1410 sub { $disabled{shared} ? () : "x86_64_uplink" } ],
1411 as => sub { vc_win64a_info()->{as} },
1412 asflags => sub { vc_win64a_info()->{asflags} },
1413 asoutflag => sub { vc_win64a_info()->{asoutflag} },
1415 bn_asm_src => sub { return undef unless @_;
1416 my $r=join(" ",@_); $r=~s|asm/x86_64-gcc|bn_asm|; $r; },
1417 perlasm_scheme => "auto",
1421 # x86 Win32 target defaults to ANSI API, if you want UNICODE,
1422 # configure with 'perl Configure VC-WIN32 -DUNICODE -D_UNICODE'
1423 inherit_from => [ "VC-noCE-common", asm("x86_asm"),
1424 sub { $disabled{shared} ? () : "uplink_common" } ],
1425 cflags => add("-WX"),
1426 as => sub { vc_win32_info()->{as} },
1427 asflags => sub { vc_win32_info()->{asflags} },
1428 asoutflag => sub { vc_win32_info()->{asoutflag} },
1429 ex_libs => add(sub {
1431 # WIN32 UNICODE build gets linked with unicows.lib for
1432 # backward compatibility with Win9x.
1433 push @ex_libs, 'unicows.lib'
1434 if (grep { $_ eq "UNICODE" } @{$user{CPPDEFINES}});
1435 return join(" ", @ex_libs, @_);
1438 bn_ops => "BN_LLONG EXPORT_VAR_AS_FN",
1439 perlasm_scheme => sub { vc_win32_info()->{perlasm_scheme} },
1440 build_scheme => add("VC-W32", { separator => undef }),
1443 inherit_from => [ "VC-common" ],
1445 asflags => "/nologo /Cp /coff /c /Cx /Zi",
1450 combine('/W3 /WX /GF /Gy /nologo',
1451 sub { vc_wince_info()->{cflags}; },
1452 sub { `cl 2>&1` =~ /Version ([0-9]+)\./ && $1>=14
1453 ? ($disabled{shared} ? " /MT" : " /MD")
1457 cppflags => sub { vc_wince_info()->{cppflags}; },
1459 picker(default => [ "UNICODE", "_UNICODE", "OPENSSL_SYS_WINCE",
1460 "WIN32_LEAN_AND_MEAN", "L_ENDIAN", "DSO_WIN32",
1461 "NO_CHMOD", "OPENSSL_SMALL_FOOTPRINT" ],
1462 debug => [ "DEBUG", "_DEBUG" ]),
1464 add(combine(sub { defined(env('WCECOMPAT'))
1465 ? '$(WCECOMPAT)/include' : (); },
1466 sub { defined(env('PORTSDK_LIBPATH'))
1467 ? '$(PORTSDK_LIBPATH)/../../include'
1469 lflags => add(combine("/nologo /opt:ref",
1470 sub { vc_wince_info()->{lflags}; },
1471 sub { defined(env('PORTSDK_LIBPATH'))
1472 ? "/entry:mainCRTstartup" : (); })),
1474 bn_ops => "BN_LLONG EXPORT_VAR_AS_FN",
1475 ex_libs => add(sub {
1477 push @ex_libs, 'ws2.lib' unless $disabled{sock};
1478 push @ex_libs, 'crypt32.lib';
1479 if (defined(env('WCECOMPAT'))) {
1480 my $x = '$(WCECOMPAT)/lib';
1481 if (-f "$x/env('TARGETCPU')/wcecompatex.lib") {
1482 $x .= '/$(TARGETCPU)/wcecompatex.lib';
1484 $x .= '/wcecompatex.lib';
1488 push @ex_libs, '$(PORTSDK_LIBPATH)/portlib.lib'
1489 if (defined(env('PORTSDK_LIBPATH')));
1490 push @ex_libs, ' /nodefaultlib coredll.lib corelibc.lib'
1491 if (env('TARGETCPU') eq "X86");
1494 build_scheme => add("VC-WCE", { separator => undef }),
1499 inherit_from => [ "BASE_unix", asm("x86_asm"),
1500 sub { $disabled{shared} ? () : "x86_uplink" } ],
1502 cflags => picker(default => "-m32 -Wall",
1504 release => "-O3 -fomit-frame-pointer"),
1505 cppflags => combine("-DL_ENDIAN -DWIN32_LEAN_AND_MEAN",
1506 "-DUNICODE -D_UNICODE", threads("-D_MT")),
1507 sys_id => "MINGW32",
1508 ex_libs => add("-lws2_32 -lgdi32 -lcrypt32"),
1509 bn_ops => "BN_LLONG EXPORT_VAR_AS_FN",
1510 thread_scheme => "winthreads",
1511 perlasm_scheme => "coff",
1512 dso_scheme => "win32",
1513 shared_target => "mingw-shared",
1514 shared_cppflags => add("_WINDLL"),
1515 shared_ldflag => "-static-libgcc",
1516 shared_rcflag => "--target=pe-i386",
1517 shared_extension => ".dll",
1519 apps_aux_src => add("win32_init.c"),
1522 # As for OPENSSL_USE_APPLINK. Applink makes it possible to use
1523 # .dll compiled with one compiler with application compiled with
1524 # another compiler. It's possible to engage Applink support in
1525 # mingw64 build, but it's not done, because till mingw64
1526 # supports structured exception handling, one can't seriously
1527 # consider its binaries for using with non-mingw64 run-time
1528 # environment. And as mingw64 is always consistent with itself,
1529 # Applink is never engaged and can as well be omitted.
1530 inherit_from => [ "BASE_unix", asm("x86_64_asm") ],
1532 cflags => picker(default => "-m64 -Wall",
1535 cppflags => combine("-DL_ENDIAN -DWIN32_LEAN_AND_MEAN",
1536 "-DUNICODE -D_UNICODE", threads("-D_MT")),
1537 sys_id => "MINGW64",
1538 ex_libs => add("-lws2_32 -lgdi32 -lcrypt32"),
1539 bn_ops => "SIXTY_FOUR_BIT EXPORT_VAR_AS_FN",
1540 thread_scheme => "winthreads",
1541 perlasm_scheme => "mingw64",
1542 dso_scheme => "win32",
1543 shared_target => "mingw-shared",
1544 shared_cppflags => add("_WINDLL"),
1545 shared_ldflag => "-static-libgcc",
1546 shared_rcflag => "--target=pe-x86-64",
1547 shared_extension => ".dll",
1549 apps_aux_src => add("win32_init.c"),
1554 inherit_from => [ "BASE_unix" ],
1557 cppflags => "-DL_ENDIAN",
1563 inherit_from => [ "BASE_unix" ],
1565 cflags => "-O -Wall",
1566 cppflags => "-DTERMIOS -DL_ENDIAN",
1568 bn_ops => "BN_LLONG",
1569 dso_scheme => "win32",
1574 inherit_from => [ "BASE_unix", asm("x86_asm") ],
1576 cflags => picker(default => "-Wall",
1578 release => "-O3 -fomit-frame-pointer"),
1579 cppflags => "-DTERMIOS -DL_ENDIAN",
1581 bn_ops => "BN_LLONG",
1582 thread_scheme => "pthread",
1583 perlasm_scheme => "coff",
1584 dso_scheme => "dlfcn",
1585 shared_target => "cygwin-shared",
1586 shared_cppflags => "-D_WINDLL",
1587 shared_extension => ".dll",
1589 "Cygwin-x86_64" => {
1590 inherit_from => [ "BASE_unix", asm("x86_64_asm") ],
1592 cflags => picker(default => "-Wall",
1595 cppflags => "-DTERMIOS -DL_ENDIAN",
1597 bn_ops => "SIXTY_FOUR_BIT_LONG",
1598 thread_scheme => "pthread",
1599 perlasm_scheme => "mingw64",
1600 dso_scheme => "dlfcn",
1601 shared_target => "cygwin-shared",
1602 shared_cppflags => "-D_WINDLL",
1603 shared_extension => ".dll",
1605 # Backward compatibility for those using this target
1607 inherit_from => [ "Cygwin-x86" ]
1609 # In case someone constructs the Cygwin target name themself
1611 inherit_from => [ "Cygwin-x86" ]
1614 inherit_from => [ "Cygwin-x86" ]
1617 inherit_from => [ "Cygwin-x86" ]
1620 inherit_from => [ "Cygwin-x86" ]
1623 ##### MacOS X (a.k.a. Darwin) setup
1624 "darwin-common" => {
1625 inherit_from => [ "BASE_unix" ],
1628 cflags => picker(default => "",
1631 cppflags => threads("-D_REENTRANT"),
1633 plib_lflags => "-Wl,-search_paths_first",
1634 bn_ops => "BN_LLONG RC4_CHAR",
1635 thread_scheme => "pthreads",
1636 perlasm_scheme => "osx32",
1637 dso_scheme => "dlfcn",
1638 ranlib => "ranlib -c",
1639 shared_target => "darwin-shared",
1640 shared_cflag => "-fPIC",
1641 shared_extension => ".\$(SHLIB_VERSION_NUMBER).dylib",
1643 # Option "freeze" such as -std=gnu9x can't negatively interfere
1644 # with future defaults for below two targets, because MacOS X
1645 # for PPC has no future, it was discontinued by vendor in 2009.
1646 "darwin-ppc-cc" => {
1647 inherit_from => [ "darwin-common", asm("ppc32_asm") ],
1648 cflags => add("-arch ppc -std=gnu9x -Wa,-force_cpusubtype_ALL"),
1649 cppflags => add("-DB_ENDIAN"),
1650 perlasm_scheme => "osx32",
1652 "darwin64-ppc-cc" => {
1653 inherit_from => [ "darwin-common", asm("ppc64_asm") ],
1654 cflags => add("-arch ppc64 -std=gnu9x"),
1655 cppflags => add("-DB_ENDIAN"),
1656 bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
1657 perlasm_scheme => "osx64",
1659 "darwin-i386-cc" => {
1660 inherit_from => [ "darwin-common", asm("x86_asm") ],
1661 cflags => add(picker(default => "-arch i386",
1662 release => "-fomit-frame-pointer")),
1663 cppflags => add("-DL_ENDIAN"),
1664 bn_ops => "BN_LLONG RC4_INT",
1665 perlasm_scheme => "macosx",
1667 "darwin64-x86_64-cc" => {
1668 inherit_from => [ "darwin-common", asm("x86_64_asm") ],
1669 cflags => add("-arch x86_64 -Wall"),
1670 cppflags => add("-DL_ENDIAN"),
1671 bn_ops => "SIXTY_FOUR_BIT_LONG",
1672 perlasm_scheme => "macosx",
1677 # It takes three prior-set environment variables to make it work:
1679 # CROSS_COMPILE=/where/toolchain/is/usr/bin/ [note ending slash]
1680 # CROSS_TOP=/where/SDKs/are
1681 # CROSS_SDK=iPhoneOSx.y.sdk
1683 # Exact paths vary with Xcode releases, but for couple of last ones
1684 # they would look like this:
1686 # CROSS_COMPILE=`xcode-select --print-path`/Toolchains/XcodeDefault.xctoolchain/usr/bin/
1687 # CROSS_TOP=`xcode-select --print-path`/Platforms/iPhoneOS.platform/Developer
1688 # CROSS_SDK=iPhoneOS.sdk
1690 "iphoneos-cross" => {
1691 inherit_from => [ "darwin-common" ],
1692 cflags => add("-isysroot \$(CROSS_TOP)/SDKs/\$(CROSS_SDK) -fno-common"),
1696 inherit_from => [ "darwin-common", asm("armv4_asm") ],
1697 # It should be possible to go below iOS 6 and even add -arch armv6,
1698 # thus targeting iPhone pre-3GS, but it's assumed to be irrelevant
1700 cflags => add("-arch armv7 -mios-version-min=6.0.0 -isysroot \$(CROSS_TOP)/SDKs/\$(CROSS_SDK) -fno-common"),
1702 perlasm_scheme => "ios32",
1705 inherit_from => [ "darwin-common", asm("aarch64_asm") ],
1706 cflags => add("-arch arm64 -mios-version-min=7.0.0 -isysroot \$(CROSS_TOP)/SDKs/\$(CROSS_SDK) -fno-common"),
1708 bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
1709 perlasm_scheme => "ios64",
1714 inherit_from => [ "BASE_unix" ],
1715 inherit_from => [ asm("x86_elf_asm") ],
1717 cflags => combine("-O3 -fomit-frame-pointer -Wall",
1718 threads("-pthread")),
1719 cppflags => "-DL_ENDIAN",
1720 ex_libs => add("-ldl", threads("-pthread")),
1721 bn_ops => "BN_LLONG",
1722 thread_scheme => "pthreads",
1723 dso_scheme => "dlfcn",
1724 shared_target => "linux-shared",
1725 shared_cflag => "-fPIC",
1726 shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
1729 ##### VxWorks for various targets
1730 "vxworks-ppc60x" => {
1731 inherit_from => [ "BASE_unix" ],
1733 cflags => "-mrtp -mhard-float -mstrict-align -fno-implicit-fp -O2 -fstrength-reduce -fno-builtin -fno-strict-aliasing -Wall",
1734 cppflags => combine("-D_REENTRANT -DPPC32_fp60x -DCPU=PPC32",
1735 "_DTOOL_FAMILY=gnu -DTOOL=gnu",
1736 "-I\$(WIND_BASE)/target/usr/h",
1737 "-I\$(WIND_BASE)/target/usr/h/wrn/coreip"),
1738 sys_id => "VXWORKS",
1739 lflags => add("-L \$(WIND_BASE)/target/usr/lib/ppc/PPC32/common"),
1740 ex_libs => add("-Wl,--defsym,__wrs_rtp_base=0xe0000000"),
1742 "vxworks-ppcgen" => {
1743 inherit_from => [ "BASE_unix" ],
1745 cflags => "-mrtp -msoft-float -mstrict-align -O1 -fno-builtin -fno-strict-aliasing -Wall",
1746 cppflags => combine("-D_REENTRANT -DPPC32 -DCPU=PPC32",
1747 "-DTOOL_FAMILY=gnu -DTOOL=gnu",
1748 "-I\$(WIND_BASE)/target/usr/h",
1749 "-I\$(WIND_BASE)/target/usr/h/wrn/coreip"),
1750 sys_id => "VXWORKS",
1751 lflags => add("-L \$(WIND_BASE)/target/usr/lib/ppc/PPC32/sfcommon"),
1752 ex_libs => add("-Wl,--defsym,__wrs_rtp_base=0xe0000000"),
1754 "vxworks-ppc405" => {
1755 inherit_from => [ "BASE_unix" ],
1757 cflags => "-g -msoft-float -mlongcall",
1758 cppflags => combine("-D_REENTRANT -DPPC32 -DCPU=PPC405",
1759 "-DTOOL_FAMILY=gnu -DTOOL=gnu",
1760 "-I\$(WIND_BASE)/target/h"),
1761 sys_id => "VXWORKS",
1762 lflags => add("-r"),
1764 "vxworks-ppc750" => {
1765 inherit_from => [ "BASE_unix" ],
1767 cflags => "-ansi -nostdinc -fvolatile -fno-builtin -fno-for-scope -fsigned-char -Wall -msoft-float -mlongcall \$(DEBUG_FLAG)",
1768 cppflags => combine("-DPPC750 -D_REENTRANT -DCPU=PPC604",
1769 "-I\$(WIND_BASE)/target/h"),
1770 sys_id => "VXWORKS",
1771 lflags => add("-r"),
1773 "vxworks-ppc750-debug" => {
1774 inherit_from => [ "BASE_unix" ],
1776 cflags => "-ansi -nostdinc -fvolatile -fno-builtin -fno-for-scope -fsigned-char -Wall -msoft-float -mlongcall -g",
1777 cppflags => combine("-DPPC750 -D_REENTRANT -DCPU=PPC604",
1778 "-DPEDANTIC -DDEBUG",
1779 "-I\$(WIND_BASE)/target/h"),
1780 sys_id => "VXWORKS",
1781 lflags => add("-r"),
1783 "vxworks-ppc860" => {
1784 inherit_from => [ "BASE_unix" ],
1786 cflags => "-nostdinc -msoft-float",
1787 cppflags => combine("-DCPU=PPC860 -DNO_STRINGS_H",
1788 "-I\$(WIND_BASE)/target/h"),
1789 sys_id => "VXWORKS",
1790 lflags => add("-r"),
1792 "vxworks-simlinux" => {
1793 inherit_from => [ "BASE_unix" ],
1795 cflags => "-B\$(WIND_BASE)/host/\$(WIND_HOST_TYPE)/lib/gcc-lib/ -fno-builtin -fno-defer-pop",
1796 cppflags => combine("-D_VSB_CONFIG_FILE=\"\$(WIND_BASE)/target/lib/h/config/vsbConfig.h\"",
1797 "-DL_ENDIAN -DCPU=SIMLINUX -DNO_STRINGS_H",
1798 "-DTOOL_FAMILY=gnu -DTOOL=gnu",
1799 "-DOPENSSL_NO_HW_PADLOCK",
1800 "-I\$(WIND_BASE)/target/h",
1801 "-I\$(WIND_BASE)/target/h/wrn/coreip"),
1802 sys_id => "VXWORKS",
1803 lflags => add("-r"),
1804 ranlib => "ranlibpentium",
1807 inherit_from => [ "BASE_unix", asm("mips32_asm") ],
1809 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",
1810 cppflags => combine("-D_VSB_CONFIG_FILE=\"\$(WIND_BASE)/target/lib/h/config/vsbConfig.h\"",
1811 "-DCPU=MIPS32 -DNO_STRINGS_H",
1812 "-DTOOL_FAMILY=gnu -DTOOL=gnu",
1813 "-DOPENSSL_NO_HW_PADLOCK",
1814 threads("-D_REENTRANT"),
1815 "-I\$(WIND_BASE)/target/h",
1816 "-I\$(WIND_BASE)/target/h/wrn/coreip"),
1817 sys_id => "VXWORKS",
1818 lflags => add("-L \$(WIND_BASE)/target/usr/lib/mips/MIPSI32/sfcommon"),
1819 ex_libs => add("-Wl,--defsym,__wrs_rtp_base=0xe0000000"),
1820 thread_scheme => "pthreads",
1821 perlasm_scheme => "o32",
1822 ranlib => "ranlibmips",
1827 inherit_from => [ "BASE_unix" ],
1828 cc => sub { env('CC') },
1829 cppflags => threads("-D_REENTRANT"),
1830 ex_libs => add("\$(LDLIBS)"),
1831 bn_ops => "BN_LLONG",
1832 thread_scheme => "pthreads",
1833 dso_scheme => sub { env('LIBSSL_dlfcn') },
1834 shared_target => "linux-shared",
1835 shared_cflag => "-fPIC",
1836 shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
1837 ranlib => sub { env('RANLIB') },
1839 "uClinux-dist64" => {
1840 inherit_from => [ "BASE_unix" ],
1841 cc => sub { env('CC') },
1842 cppflags => threads("-D_REENTRANT"),
1843 ex_libs => add("\$(LDLIBS)"),
1844 bn_ops => "SIXTY_FOUR_BIT_LONG",
1845 thread_scheme => "pthreads",
1846 dso_scheme => sub { env('LIBSSL_dlfcn') },
1847 shared_target => "linux-shared",
1848 shared_cflag => "-fPIC",
1849 shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
1850 ranlib => sub { env('RANLIB') },
1854 # Most things happen in vms-generic.
1855 # Note that vms_info extracts the pointer size from the end of
1856 # the target name, and will assume that anything matching /-p\d+$/
1857 # indicates the pointer size setting for the desired target.
1859 inherit_from => [ "BASE_VMS" ],
1862 cpp => '$(CC)/PREPROCESS_ONLY=SYS$OUTPUT:',
1864 combine(picker(default => "/STANDARD=(ISOC94,RELAXED)/NOLIST/PREFIX=ALL",
1865 debug => "/NOOPTIMIZE/DEBUG",
1866 release => "/OPTIMIZE/NODEBUG"),
1867 sub { my @warnings =
1868 @{vms_info()->{disable_warns}};
1870 ? "/WARNINGS=DISABLE=(".join(",",@warnings).")" : (); }),
1872 add("OPENSSL_USE_NODELETE",
1874 return vms_info()->{def_zlib}
1875 ? "LIBZ=\"\"\"".vms_info()->{def_zlib}."\"\"\"" : ();
1877 lflags => picker(default => "/MAP='F\$PARSE(\".MAP\",\"\$\@\")'",
1878 debug => "/DEBUG/TRACEBACK",
1879 release => "/NODEBUG/NOTRACEBACK"),
1880 lib_cflags => add("/NAMES=(AS_IS,SHORTENED)/EXTERN_MODEL=STRICT_REFDEF"),
1881 # no_inst_lib_cflags is used instead of lib_cflags by descrip.mms.tmpl
1882 # for object files belonging to selected internal libraries
1883 no_inst_lib_cflags => "",
1884 ex_libs => add(sub { return vms_info()->{zlib} || (); }),
1885 shared_target => "vms-shared",
1886 dso_scheme => "vms",
1887 thread_scheme => "pthreads",
1889 as => sub { vms_info()->{as} },
1890 asflags => sub { vms_info()->{asflags} },
1891 asoutflag => sub { vms_info()->{asoutflag} },
1892 perlasm_scheme => sub { vms_info()->{perlasm_scheme} },
1894 apps_aux_src => "vms_term_sock.c",
1895 apps_init_src => "vms_decc_init.c",
1898 # From HELP CC/POINTER_SIZE:
1901 # LONG[=ARGV] The compiler assumes 64-bit pointers. If the ARGV option to
1902 # LONG or 64 is present, the main argument argv will be an
1903 # array of long pointers instead of an array of short pointers.
1905 # 64[=ARGV] Same as LONG.
1908 # We don't want the hassle of dealing with 32-bit pointers with argv, so
1909 # we force it to have 64-bit pointers, see the added cflags in the -p64
1910 # config targets below.
1913 inherit_from => [ "vms-generic" ],
1914 bn_ops => "SIXTY_FOUR_BIT RC4_INT",
1917 "vms-alpha-p32" => {
1918 inherit_from => [ "vms-alpha" ],
1919 cflags => add("/POINTER_SIZE=32"),
1920 pointer_size => "32",
1922 "vms-alpha-p64" => {
1923 inherit_from => [ "vms-alpha" ],
1924 cflags => add("/POINTER_SIZE=64=ARGV"),
1925 pointer_size => "64",
1928 inherit_from => [ "vms-generic" ],
1929 bn_ops => "SIXTY_FOUR_BIT RC4_INT",
1933 inherit_from => [ "vms-ia64" ],
1934 cflags => add("/POINTER_SIZE=32"),
1935 pointer_size => "32",
1938 inherit_from => [ "vms-ia64" ],
1939 cflags => add("/POINTER_SIZE=64=ARGV"),
1940 pointer_size => "64",