2 ## Standard openssl configuration targets.
4 # Helper functions for the Windows configs
5 my $vc_win64a_info = {};
7 unless (%$vc_win64a_info) {
8 if (`nasm -v 2>NUL` =~ /NASM version ([0-9]+\.[0-9]+)/ && $1 >= 2.0) {
9 $vc_win64a_info = { AS => "nasm",
11 asflags => "-Ox -f win64 -DNEAR",
13 } elsif ($disabled{asm}) {
14 $vc_win64a_info = { AS => "ml64",
16 asflags => "/c /Cp /Cx",
19 $die->("NASM not found - please read INSTALL and NOTES.WIN for further details\n");
20 $vc_win64a_info = { AS => "{unknown}",
26 return $vc_win64a_info;
29 my $vc_win32_info = {};
31 unless (%$vc_win32_info) {
32 my $ver=`nasm -v 2>NUL`;
33 my $vew=`nasmw -v 2>NUL`;
34 if ($ver ne "" || $vew ne "") {
35 $vc_win32_info = { AS => $ver ge $vew ? "nasm" : "nasmw",
37 asflags => "-f win32",
39 perlasm_scheme => "win32n" };
40 } elsif ($disabled{asm}) {
41 $vc_win32_info = { AS => "ml",
42 ASFLAGS => "/nologo /Zi",
43 asflags => "/Cp /coff /c /Cx",
45 perlasm_scheme => "win32" };
47 $die->("NASM not found - please read INSTALL and NOTES.WIN for further details\n");
48 $vc_win32_info = { AS => "{unknown}",
52 perlasm_scheme => "win32" };
55 return $vc_win32_info;
58 my $vc_wince_info = {};
60 unless (%$vc_wince_info) {
62 $die->('%OSVERSION% is not defined') if (!defined(env('OSVERSION')));
63 $die->('%PLATFORM% is not defined') if (!defined(env('PLATFORM')));
64 $die->('%TARGETCPU% is not defined') if (!defined(env('TARGETCPU')));
67 # Idea behind this is to mimic flags set by eVC++ IDE...
69 my $wcevers = env('OSVERSION'); # WCENNN
72 if ($wcevers =~ /^WCE([1-9])([0-9]{2})$/) {
74 $wceverdotnum = "$1.$2";
76 $die->('%OSVERSION% value is insane');
77 $wcevernum = "{unknown}";
78 $wceverdotnum = "{unknown}";
80 my $wcecdefs = "-D_WIN32_WCE=$wcevernum -DUNDER_CE=$wcevernum"; # -D_WIN32_WCE=NNN
81 my $wcelflag = "/subsystem:windowsce,$wceverdotnum"; # ...,N.NN
83 my $wceplatf = env('PLATFORM');
85 $wceplatf =~ tr/a-z0-9 /A-Z0-9_/;
86 $wcecdefs .= " -DWCE_PLATFORM_$wceplatf";
88 my $wcetgt = env('TARGETCPU'); # just shorter name...
89 SWITCH: for($wcetgt) {
90 /^X86/ && do { $wcecdefs.=" -Dx86 -D_X86_ -D_i386_ -Di_386_";
91 $wcelflag.=" /machine:X86"; last; };
92 /^ARMV4[IT]/ && do { $wcecdefs.=" -DARM -D_ARM_ -D$wcetgt";
93 $wcecdefs.=" -DTHUMB -D_THUMB_" if($wcetgt=~/T$/);
94 $wcecdefs.=" -QRarch4T -QRinterwork-return";
95 $wcelflag.=" /machine:THUMB"; last; };
96 /^ARM/ && do { $wcecdefs.=" -DARM -D_ARM_ -D$wcetgt";
97 $wcelflag.=" /machine:ARM"; last; };
98 /^MIPSIV/ && do { $wcecdefs.=" -DMIPS -D_MIPS_ -DR4000 -D$wcetgt";
99 $wcecdefs.=" -D_MIPS64 -QMmips4 -QMn32";
100 $wcelflag.=" /machine:MIPSFPU"; last; };
101 /^MIPS16/ && do { $wcecdefs.=" -DMIPS -D_MIPS_ -DR4000 -D$wcetgt";
102 $wcecdefs.=" -DMIPSII -QMmips16";
103 $wcelflag.=" /machine:MIPS16"; last; };
104 /^MIPSII/ && do { $wcecdefs.=" -DMIPS -D_MIPS_ -DR4000 -D$wcetgt";
105 $wcecdefs.=" -QMmips2";
106 $wcelflag.=" /machine:MIPS"; last; };
107 /^R4[0-9]{3}/ && do { $wcecdefs.=" -DMIPS -D_MIPS_ -DR4000";
108 $wcelflag.=" /machine:MIPS"; last; };
109 /^SH[0-9]/ && do { $wcecdefs.=" -D$wcetgt -D_${wcetgt}_ -DSHx";
110 $wcecdefs.=" -Qsh4" if ($wcetgt =~ /^SH4/);
111 $wcelflag.=" /machine:$wcetgt"; last; };
112 { $wcecdefs.=" -D$wcetgt -D_${wcetgt}_";
113 $wcelflag.=" /machine:$wcetgt"; last; };
116 $vc_wince_info = { cppflags => $wcecdefs,
117 lflags => $wcelflag };
119 return $vc_wince_info;
122 # Helper functions for the VMS configs
125 my $pointer_size_str = $config{target} =~ m|-p(\d+)$| ? $1 : "";
127 # For the case where Configure iterate through all config targets, such
128 # as when listing them and their details, we reset info if the pointer
130 if (%$vms_info && $vms_info->{pointer_size} ne $pointer_size_str) {
134 unless (%$vms_info) {
135 $vms_info->{disable_warns} = [ ];
136 $vms_info->{pointer_size} = $pointer_size_str;
137 if ($pointer_size_str eq "64") {
138 `PIPE CC /NOCROSS_REFERENCE /NOLIST /NOOBJECT /WARNINGS = DISABLE = ( MAYLOSEDATA3, EMPTYFILE ) NL: 2> NL:`;
140 push @{$vms_info->{disable_warns}}, "MAYLOSEDATA3";
144 unless ($disabled{zlib}) {
145 my $default_zlib = 'GNV$LIBZSHR' . $pointer_size_str;
146 if (defined($disabled{"zlib-dynamic"})) {
147 $vms_info->{zlib} = $withargs{zlib_lib} || "$default_zlib/SHARE";
149 $vms_info->{def_zlib} = $withargs{zlib_lib} || $default_zlib;
150 # In case the --with-zlib-lib value contains something like
151 # /SHARE or /LIB or so at the end, remove it.
152 $vms_info->{def_zlib} =~ s|/.*$||g;
156 if ($config{target} =~ /-ia64/) {
157 `PIPE ias -H 2> NL:`;
159 $vms_info->{AS} = "ias";
160 $vms_info->{ASFLAGS} = '-d debug';
161 $vms_info->{asflags} = '"-N" vms_upcase';
162 $vms_info->{asoutflag} = "-o";
163 $vms_info->{perlasm_scheme} = "ias";
172 #### Basic configs that should work on any 32-bit box
174 inherit_from => [ "BASE_unix" ],
176 CFLAGS => picker(debug => "-O0 -g",
178 thread_scheme => "(unknown)",
179 bn_ops => "BN_LLONG",
182 inherit_from => [ "BASE_unix" ],
185 thread_scheme => "(unknown)",
188 #### VOS Configurations
190 inherit_from => [ "BASE_unix" ],
192 CFLAGS => picker(default => "-Wall",
195 cppflags => "-D_POSIX_C_SOURCE=200112L -D_BSD -D_VOS_EXTENDED_NAMES -DB_ENDIAN",
196 thread_scheme => "(unknown)",
198 lflags => add("-Wl,-map"),
199 bn_ops => "BN_LLONG",
200 shared_extension => ".so",
203 #### Solaris configurations
204 "solaris-common" => {
205 inherit_from => [ "BASE_unix" ],
207 cppflags => "-DFILIO_H",
208 ex_libs => add("-lsocket -lnsl -ldl"),
209 dso_scheme => "dlfcn",
210 thread_scheme => "pthreads",
211 shared_target => "solaris-shared",
212 shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
214 #### Solaris x86 with GNU C setups
215 "solaris-x86-gcc" => {
216 # NB. GNU C has to be configured to use GNU assembler, and not
217 # /usr/ccs/bin/as. Failure to comply will result in compile
218 # failures [at least] in 32-bit build.
219 inherit_from => [ "solaris-common", asm("x86_elf_asm") ],
221 CFLAGS => add_before(picker(default => "-Wall",
223 release => "-O3 -fomit-frame-pointer")),
224 cflags => add(threads("-pthread")),
225 cppflags => add("-DL_ENDIAN"),
226 ex_libs => add(threads("-pthread")),
227 bn_ops => "BN_LLONG",
228 shared_cflag => "-fPIC",
229 shared_ldflag => "-shared -static-libgcc",
231 "solaris64-x86_64-gcc" => {
232 # -shared -static-libgcc might appear controversial, but modules
233 # taken from static libgcc do not have relocations and linking
234 # them into our shared objects doesn't have any negative side
235 # effects. On the contrary, doing so makes it possible to use
236 # gcc shared build with Sun C. Given that gcc generates faster
237 # code [thanks to inline assembler], I would actually recommend
238 # to consider using gcc shared build even with vendor compiler:-)
239 # -- <appro@openssl.org>
240 inherit_from => [ "solaris-common", asm("x86_64_asm") ],
242 CFLAGS => add_before(picker(default => "-Wall",
245 cflags => add_before("-m64", threads("-pthread")),
246 cppflags => add("-DL_ENDIAN"),
247 ex_libs => add(threads("-pthread")),
248 bn_ops => "SIXTY_FOUR_BIT_LONG",
249 perlasm_scheme => "elf",
250 shared_cflag => "-fPIC",
251 shared_ldflag => "-shared -static-libgcc",
255 #### Solaris x86 with Sun C setups
256 # There used to be solaris-x86-cc target, but it was removed,
257 # primarily because vendor assembler can't assemble our modules
258 # with -KPIC flag. As result it, assembly support, was not even
259 # available as option. But its lack means lack of side-channel
260 # resistant code, which is incompatible with security by todays
261 # standards. Fortunately gcc is readily available prepackaged
262 # option, which we can firmly point at...
264 # On related note, solaris64-x86_64-cc target won't compile code
265 # paths utilizing AVX and post-Haswell instruction extensions.
266 # Consider switching to solaris64-x86_64-gcc even here...
268 "solaris64-x86_64-cc" => {
269 inherit_from => [ "solaris-common", asm("x86_64_asm") ],
271 CFLAGS => add_before(picker(debug => "-g",
272 release => "-xO5 -xdepend -xbuiltin")),
273 cflags => add_before("-xarch=generic64 -xstrconst -Xa"),
274 cppflags => add("-DL_ENDIAN", threads("-D_REENTRANT")),
275 thread_scheme => "pthreads",
276 lflags => add(threads("-mt")),
277 ex_libs => add(threads("-lpthread")),
278 bn_ops => "SIXTY_FOUR_BIT_LONG",
279 perlasm_scheme => "elf",
280 shared_cflag => "-KPIC",
281 shared_ldflag => "-G -dy -z text",
285 #### SPARC Solaris with GNU C setups
286 "solaris-sparcv7-gcc" => {
287 inherit_from => [ "solaris-common" ],
289 CFLAGS => add_before(picker(default => "-Wall",
292 cflags => add(threads("-pthread")),
293 cppflags => add("-DB_ENDIAN -DBN_DIV2W"),
294 ex_libs => add(threads("-pthread")),
295 bn_ops => "BN_LLONG RC4_CHAR",
296 shared_cflag => "-fPIC",
297 shared_ldflag => "-shared",
299 "solaris-sparcv8-gcc" => {
300 inherit_from => [ "solaris-sparcv7-gcc", asm("sparcv8_asm") ],
301 cflags => add_before("-mcpu=v8"),
303 "solaris-sparcv9-gcc" => {
304 # -m32 should be safe to add as long as driver recognizes
306 inherit_from => [ "solaris-sparcv7-gcc", asm("sparcv9_asm") ],
307 cflags => add_before("-m32 -mcpu=ultrasparc"),
309 "solaris64-sparcv9-gcc" => {
310 inherit_from => [ "solaris-sparcv9-gcc" ],
311 cflags => sub { my $f=join(" ",@_); $f =~ s/\-m32/-m64/; $f; },
312 bn_ops => "BN_LLONG RC4_CHAR",
316 #### SPARC Solaris with Sun C setups
317 # SC4.0 doesn't pass 'make test', upgrade to SC5.0 or SC4.2.
318 # SC4.2 is ok, better than gcc even on bn as long as you tell it -xarch=v8
319 # SC5.0 note: Compiler common patch 107357-01 or later is required!
320 "solaris-sparcv7-cc" => {
321 inherit_from => [ "solaris-common" ],
323 CFLAGS => add_before(picker(debug => "-g",
324 release => "-xO5 -xdepend")),
325 cflags => add_before("-xstrconst -Xa"),
326 cppflags => add("-DB_ENDIAN -DBN_DIV2W",
327 threads("-D_REENTRANT")),
328 lflags => add(threads("-mt")),
329 ex_libs => add(threads("-lpthread")),
330 bn_ops => "BN_LLONG RC4_CHAR",
331 shared_cflag => "-KPIC",
332 shared_ldflag => "-G -dy -z text",
335 "solaris-sparcv8-cc" => {
336 inherit_from => [ "solaris-sparcv7-cc", asm("sparcv8_asm") ],
337 cflags => add_before("-xarch=v8"),
339 "solaris-sparcv9-cc" => {
340 inherit_from => [ "solaris-sparcv7-cc", asm("sparcv9_asm") ],
341 cflags => add_before("-xarch=v8plus"),
343 "solaris64-sparcv9-cc" => {
344 inherit_from => [ "solaris-sparcv7-cc", asm("sparcv9_asm") ],
345 cflags => add_before("-xarch=v9"),
346 bn_ops => "BN_LLONG RC4_CHAR",
350 #### IRIX 6.x configs
351 # Only N32 and N64 ABIs are supported.
352 "irix-mips3-gcc" => {
353 inherit_from => [ "BASE_unix", asm("mips64_asm") ],
355 CFLAGS => picker(debug => "-g -O0",
357 cflags => "-mabi=n32",
358 cppflags => combine("-DB_ENDIAN -DBN_DIV3W",
359 threads("-D_SGI_MP_SOURCE")),
360 ex_libs => add(threads("-lpthread")),
361 bn_ops => "RC4_CHAR SIXTY_FOUR_BIT",
362 thread_scheme => "pthreads",
363 perlasm_scheme => "n32",
364 dso_scheme => "dlfcn",
365 shared_target => "irix-shared",
366 shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
370 inherit_from => [ "BASE_unix", asm("mips64_asm") ],
372 CFLAGS => picker(debug => "-g -O0",
374 cflags => "-n32 -mips3 -use_readonly_const -G0 -rdata_shared",
375 cppflags => combine("-DB_ENDIAN -DBN_DIV3W",
376 threads("-D_SGI_MP_SOURCE")),
377 ex_libs => add(threads("-lpthread")),
378 bn_ops => "RC4_CHAR SIXTY_FOUR_BIT",
379 thread_scheme => "pthreads",
380 perlasm_scheme => "n32",
381 dso_scheme => "dlfcn",
382 shared_target => "irix-shared",
383 shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
387 "irix64-mips4-gcc" => {
388 inherit_from => [ "BASE_unix", asm("mips64_asm") ],
390 CFLAGS => picker(debug => "-g -O0",
392 cflags => "-mabi=64 -mips4",
393 cppflags => combine("-DB_ENDIAN -DBN_DIV3W",
394 threads("-D_SGI_MP_SOURCE")),
395 ex_libs => add(threads("-lpthread")),
396 bn_ops => "RC4_CHAR SIXTY_FOUR_BIT_LONG",
397 thread_scheme => "pthreads",
398 perlasm_scheme => "64",
399 dso_scheme => "dlfcn",
400 shared_target => "irix-shared",
401 shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
404 "irix64-mips4-cc" => {
405 inherit_from => [ "BASE_unix", asm("mips64_asm") ],
407 CFLAGS => picker(debug => "-g -O0",
409 cppflags => threads("-D_SGI_MP_SOURCE"),
410 cflags => "-64 -mips4 -use_readonly_const -G0 -rdata_shared",
411 cppflags => combine("-DB_ENDIAN -DBN_DIV3W",
412 threads("-D_SGI_MP_SOURCE")),
413 ex_libs => threads("-lpthread"),
414 bn_ops => "RC4_CHAR SIXTY_FOUR_BIT_LONG",
415 thread_scheme => "pthreads",
416 perlasm_scheme => "64",
417 dso_scheme => "dlfcn",
418 shared_target => "irix-shared",
419 shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
423 #### Unified HP-UX ANSI C configs.
425 # - Originally we were optimizing at +O4 level. It should be noted
426 # that the only difference between +O3 and +O4 is global inter-
427 # procedural analysis. As it has to be performed during the link
428 # stage the compiler leaves behind certain pseudo-code in lib*.a
429 # which might be release or even patch level specific. Generating
430 # the machine code for and analyzing the *whole* program appears
431 # to be *extremely* memory demanding while the performance gain is
432 # actually questionable. The situation is intensified by the default
433 # HP-UX data set size limit (infamous 'maxdsiz' tunable) of 64MB
434 # which is way too low for +O4. In other words, doesn't +O3 make
436 # - Keep in mind that the HP compiler by default generates code
437 # suitable for execution on the host you're currently compiling at.
438 # If the toolkit is meant to be used on various PA-RISC processors
439 # consider './Configure hpux-parisc-[g]cc +DAportable'.
440 # - -DMD32_XARRAY triggers workaround for compiler bug we ran into in
441 # 32-bit message digests. (For the moment of this writing) HP C
442 # doesn't seem to "digest" too many local variables (they make "him"
443 # chew forever:-). For more details look-up MD32_XARRAY comment in
444 # crypto/sha/sha_lcl.h.
445 # - originally there were 32-bit hpux-parisc2-* targets. They were
446 # scrapped, because a) they were not interchangeable with other 32-bit
447 # targets; b) performance-critical 32-bit assembly modules implement
448 # even PA-RISC 2.0-specific code paths, which are chosen at run-time,
449 # thus adequate performance is provided even with PA-RISC 1.1 build.
450 "hpux-parisc-gcc" => {
451 inherit_from => [ "BASE_unix" ],
453 CFLAGS => picker(debug => "-O0 -g",
455 cflags => add(threads("-pthread")),
456 cppflags => "-DB_ENDIAN -DBN_DIV2W",
457 ex_libs => add("-Wl,+s -ldld", threads("-pthread")),
458 bn_ops => "BN_LLONG",
459 thread_scheme => "pthreads",
461 shared_target => "hpux-shared",
462 shared_cflag => "-fPIC",
463 shared_ldflag => "-shared",
464 shared_extension => ".sl.\$(SHLIB_VERSION_NUMBER)",
466 "hpux-parisc1_1-gcc" => {
467 inherit_from => [ "hpux-parisc-gcc", asm("parisc11_asm") ],
468 multilib => "/pa1.1",
470 "hpux64-parisc2-gcc" => {
471 inherit_from => [ "BASE_unix", asm("parisc20_64_asm") ],
473 CFLAGS => combine(picker(debug => "-O0 -g",
475 cppflags => combine("-DB_ENDIAN", threads("-D_REENTRANT")),
476 ex_libs => add("-ldl"),
477 bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
478 thread_scheme => "pthreads",
479 dso_scheme => "dlfcn",
480 shared_target => "hpux-shared",
481 shared_cflag => "-fpic",
482 shared_ldflag => "-shared",
483 shared_extension => ".sl.\$(SHLIB_VERSION_NUMBER)",
484 multilib => "/pa20_64",
487 # More attempts at unified 10.X and 11.X targets for HP C compiler.
488 "hpux-parisc-cc" => {
489 inherit_from => [ "BASE_unix" ],
491 CFLAGS => picker(debug => "+O0 +d -g",
493 cflags => "+Optrs_strongly_typed -Ae +ESlit",
494 cppflags => combine("-DB_ENDIAN -DBN_DIV2W -DMD32_XARRAY",
495 threads("-D_REENTRANT")),
496 ex_libs => add("-Wl,+s -ldld",threads("-lpthread")),
497 bn_ops => "RC4_CHAR",
498 thread_scheme => "pthreads",
500 shared_target => "hpux-shared",
501 shared_cflag => "+Z",
502 shared_ldflag => "-b",
503 shared_extension => ".sl.\$(SHLIB_VERSION_NUMBER)",
505 "hpux-parisc1_1-cc" => {
506 inherit_from => [ "hpux-parisc-cc", asm("parisc11_asm") ],
507 cflags => add_before("+DA1.1"),
508 multilib => "/pa1.1",
510 "hpux64-parisc2-cc" => {
511 inherit_from => [ "BASE_unix", asm("parisc20_64_asm") ],
513 CFLAGS => picker(debug => "+O0 +d -g",
515 cflags => "+DD64 +Optrs_strongly_typed -Ae +ESlit",
516 cppflags => combine("-DB_ENDIAN -DMD32_XARRAY",
517 threads("-D_REENTRANT")),
518 ex_libs => add("-ldl",threads("-lpthread")),
519 bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
520 thread_scheme => "pthreads",
521 dso_scheme => "dlfcn",
522 shared_target => "hpux-shared",
523 shared_cflag => "+Z",
524 shared_ldflag => "-b",
525 shared_extension => ".sl.\$(SHLIB_VERSION_NUMBER)",
526 multilib => "/pa20_64",
529 # HP/UX IA-64 targets
531 inherit_from => [ "BASE_unix", asm("ia64_asm") ],
533 CFLAGS => picker(debug => "+O0 +d -g",
535 cflags => "-Ae +DD32 +Olit=all -z",
536 cppflags => combine("-DB_ENDIAN", threads("-D_REENTRANT")),
537 ex_libs => add("-ldl",threads("-lpthread")),
538 bn_ops => "SIXTY_FOUR_BIT",
539 thread_scheme => "pthreads",
540 dso_scheme => "dlfcn",
541 shared_target => "hpux-shared",
542 shared_cflag => "+Z",
543 shared_ldflag => "-b",
544 shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
545 multilib => "/hpux32",
547 "hpux64-ia64-cc" => {
548 inherit_from => [ "BASE_unix", asm("ia64_asm") ],
550 CFLAGS => picker(debug => "+O0 +d -g",
552 cflags => "-Ae +DD64 +Olit=all -z",
553 cppflags => combine("-DB_ENDIAN", threads("-D_REENTRANT")),
554 ex_libs => add("-ldl", threads("-lpthread")),
555 bn_ops => "SIXTY_FOUR_BIT_LONG",
556 thread_scheme => "pthreads",
557 dso_scheme => "dlfcn",
558 shared_target => "hpux-shared",
559 shared_cflag => "+Z",
560 shared_ldflag => "-b",
561 shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
562 multilib => "/hpux64",
566 inherit_from => [ "BASE_unix", asm("ia64_asm") ],
568 CFLAGS => picker(debug => "-O0 -g",
570 cflags => add(threads("-pthread")),
571 cppflags => "-DB_ENDIAN",
572 ex_libs => add("-ldl", threads("-pthread")),
573 bn_ops => "SIXTY_FOUR_BIT",
574 thread_scheme => "pthreads",
575 dso_scheme => "dlfcn",
576 shared_target => "hpux-shared",
577 shared_cflag => "-fpic",
578 shared_ldflag => "-shared",
579 shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
580 multilib => "/hpux32",
582 "hpux64-ia64-gcc" => {
583 inherit_from => [ "BASE_unix", asm("ia64_asm") ],
585 CFLAGS => picker(debug => "-O0 -g",
587 cflags => combine("-mlp64", threads("-pthread")),
588 cppflags => "-DB_ENDIAN",
589 ex_libs => add("-ldl", threads("-pthread")),
590 bn_ops => "SIXTY_FOUR_BIT_LONG",
591 thread_scheme => "pthreads",
592 dso_scheme => "dlfcn",
593 shared_target => "hpux-shared",
594 shared_cflag => "-fpic",
595 shared_ldflag => "-shared",
596 shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
597 multilib => "/hpux64",
600 #### HP MPE/iX http://jazz.external.hp.com/src/openssl/
602 inherit_from => [ "BASE_unix" ],
605 cppflags => "-D_ENDIAN -DBN_DIV2W -D_POSIX_SOURCE -D_SOCKET_SOURCE",
606 includes => add("/SYSLOG/PUB"),
608 lflags => add("-L/SYSLOG/PUB"),
609 ex_libs => add("-lsyslog -lsocket -lcurses"),
610 thread_scheme => "(unknown)",
611 bn_ops => "BN_LLONG",
614 #### DEC Alpha Tru64 targets. Tru64 is marketing name for OSF/1 version 4
615 #### and forward. In reality 'uname -s' still returns "OSF1". Originally
616 #### there were even osf1-* configs targeting prior versions provided,
617 #### but not anymore...
618 "tru64-alpha-gcc" => {
619 inherit_from => [ "BASE_unix", asm("alpha_asm") ],
622 cflags => add("-std=c9x", threads("-pthread")),
623 cppflags => "-D_XOPEN_SOURCE=500 -D_OSF_SOURCE",
624 ex_libs => add("-lrt", threads("-pthread")), # for mlock(2)
625 bn_ops => "SIXTY_FOUR_BIT_LONG",
626 thread_scheme => "pthreads",
627 dso_scheme => "dlfcn",
628 shared_target => "alpha-osf1-shared",
629 shared_extension => ".so",
631 "tru64-alpha-cc" => {
632 inherit_from => [ "BASE_unix", asm("alpha_asm") ],
634 CFLAGS => "-tune host -fast",
635 cflags => add("-std1 -readonly_strings",
636 threads("-pthread")),
637 cppflags => "-D_XOPEN_SOURCE=500 -D_OSF_SOURCE",
638 ex_libs => add("-lrt", threads("-pthread")), # for mlock(2)
639 bn_ops => "SIXTY_FOUR_BIT_LONG",
640 thread_scheme => "pthreads",
641 dso_scheme => "dlfcn",
642 shared_target => "alpha-osf1-shared",
643 shared_ldflag => "-msym",
644 shared_extension => ".so",
648 #### Variety of LINUX:-)
650 # *-generic* is endian-neutral target, but ./config is free to
651 # throw in -D[BL]_ENDIAN, whichever appropriate...
652 "linux-generic32" => {
653 inherit_from => [ "BASE_unix" ],
656 CFLAGS => picker(default => "-Wall",
659 CXXFLAGS => picker(default => "-Wall",
662 cflags => threads("-pthread"),
663 cxxflags => combine("-std=c++11", threads("-pthread")),
664 cppflags => "-DOPENSSL_USE_NODELETE",
665 ex_libs => add("-ldl", threads("-pthread")),
666 bn_ops => "BN_LLONG RC4_CHAR",
667 thread_scheme => "pthreads",
668 dso_scheme => "dlfcn",
669 shared_target => "linux-shared",
670 shared_cflag => "-fPIC",
671 shared_ldflag => "-Wl,-znodelete",
672 shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
674 "linux-generic64" => {
675 inherit_from => [ "linux-generic32" ],
676 bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
680 inherit_from => [ "linux-generic32", asm("ppc32_asm") ],
681 perlasm_scheme => "linux32",
684 inherit_from => [ "linux-generic64", asm("ppc64_asm") ],
685 cflags => add("-m64"),
686 cppflags => add("-DB_ENDIAN"),
687 perlasm_scheme => "linux64",
691 inherit_from => [ "linux-generic64", asm("ppc64_asm") ],
692 cflags => add("-m64"),
693 cppflags => add("-DL_ENDIAN"),
694 perlasm_scheme => "linux64le",
698 ################################################################
699 # Note that -march is not among compiler options in linux-armv4
700 # target description. Not specifying one is intentional to give
703 # a) rely on your compiler default by not specifying one;
704 # b) specify your target platform explicitly for optimal
705 # performance, e.g. -march=armv6 or -march=armv7-a;
706 # c) build "universal" binary that targets *range* of platforms
707 # by specifying minimum and maximum supported architecture;
709 # As for c) option. It actually makes no sense to specify
710 # maximum to be less than ARMv7, because it's the least
711 # requirement for run-time switch between platform-specific
712 # code paths. And without run-time switch performance would be
713 # equivalent to one for minimum. Secondly, there are some
714 # natural limitations that you'd have to accept and respect.
715 # Most notably you can *not* build "universal" binary for
716 # big-endian platform. This is because ARMv7 processor always
717 # picks instructions in little-endian order. Another similar
718 # limitation is that -mthumb can't "cross" -march=armv6t2
719 # boundary, because that's where it became Thumb-2. Well, this
720 # limitation is a bit artificial, because it's not really
721 # impossible, but it's deemed too tricky to support. And of
722 # course you have to be sure that your binutils are actually
723 # up to the task of handling maximum target platform. With all
724 # this in mind here is an example of how to configure
727 # ./Configure linux-armv4 -march=armv6 -D__ARM_MAX_ARCH__=8
729 inherit_from => [ "linux-generic32", asm("armv4_asm") ],
730 perlasm_scheme => "linux32",
733 inherit_from => [ "linux-generic64", asm("aarch64_asm") ],
734 perlasm_scheme => "linux64",
736 "linux-arm64ilp32" => { # https://wiki.linaro.org/Platform/arm64-ilp32
737 inherit_from => [ "linux-generic32", asm("aarch64_asm") ],
738 cflags => add("-mabi=ilp32"),
739 bn_ops => "SIXTY_FOUR_BIT RC4_CHAR",
740 perlasm_scheme => "linux64",
744 # Configure script adds minimally required -march for assembly
745 # support, if no -march was specified at command line.
746 inherit_from => [ "linux-generic32", asm("mips32_asm") ],
747 cflags => add("-mabi=32"),
748 cppflags => add("-DBN_DIV3W"),
749 perlasm_scheme => "o32",
751 # mips32 and mips64 below refer to contemporary MIPS Architecture
752 # specifications, MIPS32 and MIPS64, rather than to kernel bitness.
754 inherit_from => [ "linux-generic32", asm("mips64_asm") ],
755 cflags => add("-mabi=n32"),
756 cppflags => add("-DBN_DIV3W"),
757 bn_ops => "SIXTY_FOUR_BIT RC4_CHAR",
758 perlasm_scheme => "n32",
761 "linux64-mips64" => {
762 inherit_from => [ "linux-generic64", asm("mips64_asm") ],
763 cflags => add("-mabi=64"),
764 cppflags => add("-DBN_DIV3W"),
765 perlasm_scheme => "64",
769 #### IA-32 targets...
770 #### These two targets are a bit aged and are to be used on older Linux
771 #### machines where gcc doesn't understand -m32 and -m64
773 inherit_from => [ "linux-generic32", asm("x86_elf_asm") ],
774 CFLAGS => add(picker(release => "-fomit-frame-pointer")),
775 cppflags => add("-DL_ENDIAN"),
776 bn_ops => "BN_LLONG",
779 inherit_from => [ "BASE_unix", asm("x86_asm") ],
781 CFLAGS => add(picker(default => "-Wall",
783 release => "-O3 -fomit-frame-pointer")),
784 cppflags => add("-DL_ENDIAN"),
785 bn_ops => "BN_LLONG",
786 thread_scheme => "(unknown)",
787 perlasm_scheme => "a.out",
790 #### X86 / X86_64 targets
792 inherit_from => [ "linux-generic32", asm("x86_asm") ],
793 CFLAGS => add(picker(release => "-fomit-frame-pointer")),
794 cflags => add("-m32"),
795 cppflags => add("-DL_ENDIAN"),
796 bn_ops => "BN_LLONG",
797 perlasm_scheme => "elf",
799 "linux-x86-clang" => {
800 inherit_from => [ "linux-x86" ],
803 CFLAGS => add("-Wextra"),
806 inherit_from => [ "linux-generic64", asm("x86_64_asm") ],
807 cflags => add("-m64"),
808 cppflags => add("-DL_ENDIAN"),
809 bn_ops => "SIXTY_FOUR_BIT_LONG",
810 perlasm_scheme => "elf",
813 "linux-x86_64-clang" => {
814 inherit_from => [ "linux-x86_64" ],
817 CFLAGS => add("-Wextra"),
820 inherit_from => [ "linux-generic32", asm("x86_64_asm") ],
821 cflags => add("-mx32"),
822 cppflags => add("-DL_ENDIAN"),
823 bn_ops => "SIXTY_FOUR_BIT",
824 perlasm_scheme => "elf32",
829 inherit_from => [ "linux-generic64", asm("ia64_asm") ],
830 bn_ops => "SIXTY_FOUR_BIT_LONG",
834 inherit_from => [ "linux-generic64", asm("s390x_asm") ],
835 cflags => add("-m64"),
836 cppflags => add("-DB_ENDIAN"),
837 perlasm_scheme => "64",
841 #### So called "highgprs" target for z/Architecture CPUs
842 # "Highgprs" is kernel feature first implemented in Linux
843 # 2.6.32, see /proc/cpuinfo. The idea is to preserve most
844 # significant bits of general purpose registers not only
845 # upon 32-bit process context switch, but even on
846 # asynchronous signal delivery to such process. This makes
847 # it possible to deploy 64-bit instructions even in legacy
848 # application context and achieve better [or should we say
849 # adequate] performance. The build is binary compatible with
850 # linux-generic32, and the idea is to be able to install the
851 # resulting libcrypto.so alongside generic one, e.g. as
852 # /lib/highgprs/libcrypto.so.x.y, for ldconfig and run-time
853 # linker to autodiscover. Unfortunately it doesn't work just
854 # yet, because of couple of bugs in glibc
855 # sysdeps/s390/dl-procinfo.c affecting ldconfig and ld.so.1...
857 inherit_from => [ "linux-generic32", asm("s390x_asm") ],
858 cflags => add("-m31 -Wa,-mzarch"),
859 cppflags => add("-DB_ENDIAN"),
860 bn_asm_src => sub { my $r=join(" ",@_); $r=~s|asm/s390x\.S|bn_asm.c|; $r; },
861 perlasm_scheme => "31",
862 multilib => "/highgprs",
865 #### SPARC Linux setups
867 inherit_from => [ "linux-generic32", asm("sparcv8_asm") ],
868 cflags => add("-mcpu=v8"),
869 lib_cppflags => add("-DB_ENDIAN -DBN_DIV2W"),
872 # it's a real mess with -mcpu=ultrasparc option under Linux,
873 # but -Wa,-Av8plus should do the trick no matter what.
874 inherit_from => [ "linux-generic32", asm("sparcv9_asm") ],
875 cflags => add("-m32 -mcpu=ultrasparc -Wa,-Av8plus"),
876 lib_cppflags => add("-DB_ENDIAN -DBN_DIV2W"),
878 "linux64-sparcv9" => {
879 # GCC 3.1 is a requirement
880 inherit_from => [ "linux-generic64", asm("sparcv9_asm") ],
881 cflags => add("-m64 -mcpu=ultrasparc"),
882 lib_cppflags => add("-DB_ENDIAN"),
883 bn_ops => "BN_LLONG RC4_CHAR",
887 "linux-alpha-gcc" => {
888 inherit_from => [ "linux-generic64", asm("alpha_asm") ],
889 lib_cppflags => add("-DL_ENDIAN"),
890 bn_ops => "SIXTY_FOUR_BIT_LONG",
892 "linux-c64xplus" => {
893 inherit_from => [ "BASE_unix" ],
894 # TI_CGT_C6000_7.3.x is a requirement
896 CFLAGS => "-o2 -ox -ms",
897 cflags => "--linux -ea=.s -eo=.o -mv6400+ -pden",
898 cppflags => combine("-DOPENSSL_SMALL_FOOTPRINT",
899 threads("-D_REENTRANT")),
900 bn_ops => "BN_LLONG",
901 cpuid_asm_src => "c64xpluscpuid.s",
902 bn_asm_src => "asm/bn-c64xplus.asm c64xplus-gf2m.s",
903 aes_asm_src => "aes-c64xplus.s aes_cbc.c aes-ctr.fake",
904 sha1_asm_src => "sha1-c64xplus.s sha256-c64xplus.s sha512-c64xplus.s",
905 rc4_asm_src => "rc4-c64xplus.s",
906 modes_asm_src => "ghash-c64xplus.s",
907 chacha_asm_src => "chacha-c64xplus.s",
908 poly1305_asm_src => "poly1305-c64xplus.s",
909 thread_scheme => "pthreads",
910 perlasm_scheme => "void",
911 dso_scheme => "dlfcn",
912 shared_target => "linux-shared",
913 shared_cflag => "--pic",
914 shared_ldflag => add("-z --sysv --shared"),
915 shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
919 #### Android: linux-* but without pointers to headers and libs.
921 # It takes pair of prior-set environment variables to make it work:
923 # CROSS_SYSROOT=/some/where/android-ndk-<ver>/platforms/android-<apiver>/arch-<arch>
924 # CROSS_COMPILE=<prefix>
926 # As well as PATH adjusted to cover ${CROSS_COMPILE}gcc and company.
927 # For example to compile for ICS and ARM with NDK 10d, you'd:
929 # ANDROID_NDK=/some/where/android-ndk-10d
930 # CROSS_SYSROOT=$ANDROID_NDK/platforms/android-14/arch-arm
931 # CROSS_COMPILE=arm-linux-androideabi-
932 # PATH=$ANDROID_NDK/toolchains/arm-linux-androideabi-4.8/prebuild/linux-x86_64/bin
935 inherit_from => [ "linux-generic32" ],
936 # Special note about unconditional -fPIC and -pie. The underlying
937 # reason is that Lollipop refuses to run non-PIE. But what about
938 # older systems and NDKs? -fPIC was never problem, so the only
939 # concern is -pie. Older toolchains, e.g. r4, appear to handle it
940 # and binaries turn mostly functional. "Mostly" means that oldest
941 # Androids, such as Froyo, fail to handle executable, but newer
942 # systems are perfectly capable of executing binaries targeting
943 # Froyo. Keep in mind that in the nutshell Android builds are
944 # about JNI, i.e. shared libraries, not applications.
945 cflags => add(picker(default => "-mandroid -fPIC --sysroot=\$(CROSS_SYSROOT) -Wa,--noexecstack")),
946 bin_cflags => "-pie",
949 inherit_from => [ "android", asm("x86_asm") ],
950 CFLAGS => add(picker(release => "-fomit-frame-pointer")),
951 bn_ops => "BN_LLONG",
952 perlasm_scheme => "android",
954 ################################################################
955 # Contemporary Android applications can provide multiple JNI
956 # providers in .apk, targeting multiple architectures. Among
957 # them there is "place" for two ARM flavours: generic eabi and
958 # armv7-a/hard-float. However, it should be noted that OpenSSL's
959 # ability to engage NEON is not constrained by ABI choice, nor
960 # is your ability to call OpenSSL from your application code
961 # compiled with floating-point ABI other than default 'soft'.
962 # [Latter thanks to __attribute__((pcs("aapcs"))) declaration.]
963 # This means that choice of ARM libraries you provide in .apk
964 # is driven by application needs. For example if application
965 # itself benefits from NEON or is floating-point intensive, then
966 # it might be appropriate to provide both libraries. Otherwise
967 # just generic eabi would do. But in latter case it would be
970 # ./Configure android-armeabi -D__ARM_MAX_ARCH__=8
972 # in order to build "universal" binary and allow OpenSSL take
973 # advantage of NEON when it's available.
975 "android-armeabi" => {
976 inherit_from => [ "android", asm("armv4_asm") ],
979 inherit_from => [ "android", asm("mips32_asm") ],
980 perlasm_scheme => "o32",
984 inherit_from => [ "linux-generic64" ],
985 cflags => add(picker(default => "-mandroid -fPIC --sysroot=\$(CROSS_SYSROOT) -Wa,--noexecstack")),
986 bin_cflags => "-pie",
988 "android64-aarch64" => {
989 inherit_from => [ "android64", asm("aarch64_asm") ],
990 perlasm_scheme => "linux64",
992 "android64-x86_64" => {
993 inherit_from => [ "android64", asm("x86_64_asm") ],
994 perlasm_scheme => "elf",
996 "android64-mips64" => {
997 ############################################################
998 # You are more than likely have to specify target processor
999 # on ./Configure command line. Trouble is that toolchain's
1000 # default is MIPS64r6 (at least in r10d), but there are no
1001 # such processors around (or they are too rare to spot one).
1002 # Actual problem is that MIPS64r6 is binary incompatible
1003 # with previous MIPS ISA versions, in sense that unlike
1004 # prior versions original MIPS binary code will fail.
1006 inherit_from => [ "android64", asm("mips64_asm") ],
1007 perlasm_scheme => "64",
1011 "BSD-generic32" => {
1012 # As for thread cflag. Idea is to maintain "collective" set of
1013 # flags, which would cover all BSD flavors. -pthread applies
1014 # to them all, but is treated differently. OpenBSD expands is
1015 # as -D_POSIX_THREAD -lc_r, which is sufficient. FreeBSD 4.x
1016 # expands it as -lc_r, which has to be accompanied by explicit
1017 # -D_THREAD_SAFE and sometimes -D_REENTRANT. FreeBSD 5.x
1018 # expands it as -lc_r, which seems to be sufficient?
1019 inherit_from => [ "BASE_unix" ],
1021 CFLAGS => picker(default => "-Wall",
1024 cflags => threads("-pthread"),
1025 cppflags => threads("-D_THREAD_SAFE -D_REENTRANT"),
1026 ex_libs => add(threads("-pthread")),
1027 enable => add("devcryptoeng"),
1028 bn_ops => "BN_LLONG",
1029 thread_scheme => "pthreads",
1030 dso_scheme => "dlfcn",
1031 shared_target => "bsd-gcc-shared",
1032 shared_cflag => "-fPIC",
1033 shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
1035 "BSD-generic64" => {
1036 inherit_from => [ "BSD-generic32" ],
1037 bn_ops => "SIXTY_FOUR_BIT_LONG",
1041 inherit_from => [ "BSD-generic32", asm("x86_asm") ],
1042 CFLAGS => add(picker(release => "-fomit-frame-pointer")),
1043 cppflags => add("-DL_ENDIAN"),
1044 bn_ops => "BN_LLONG",
1045 shared_target => "bsd-shared",
1046 perlasm_scheme => "a.out",
1049 inherit_from => [ "BSD-x86" ],
1050 perlasm_scheme => "elf",
1054 inherit_from => [ "BSD-generic32", asm("sparcv8_asm") ],
1055 cflags => add("-mcpu=v8"),
1056 cppflags => add("-DB_ENDIAN"),
1059 # -DMD32_REG_T=int doesn't actually belong in sparc64 target, it
1060 # simply *happens* to work around a compiler bug in gcc 3.3.3,
1061 # triggered by RIPEMD160 code.
1062 inherit_from => [ "BSD-generic64", asm("sparcv9_asm") ],
1063 cppflags => add("-DB_ENDIAN -DMD32_REG_T=int"),
1064 bn_ops => "BN_LLONG",
1068 inherit_from => [ "BSD-generic64", asm("ia64_asm") ],
1069 cppflags => add("-DL_ENDIAN"),
1070 bn_ops => "SIXTY_FOUR_BIT_LONG",
1074 inherit_from => [ "BSD-generic64", asm("x86_64_asm") ],
1075 cppflags => add("-DL_ENDIAN"),
1076 bn_ops => "SIXTY_FOUR_BIT_LONG",
1077 perlasm_scheme => "elf",
1081 inherit_from => [ "BASE_unix", asm("x86_elf_asm") ],
1083 CFLAGS => "-fomit-frame-pointer -O3 -Wall",
1084 cppflags => "-DPERL5 -DL_ENDIAN",
1085 ex_libs => add("-ldl"),
1086 bn_ops => "BN_LLONG",
1087 thread_scheme => "(unknown)",
1088 dso_scheme => "dlfcn",
1089 shared_target => "bsd-gcc-shared",
1090 shared_cflag => "-fPIC",
1091 shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
1095 inherit_from => [ "BASE_unix" ],
1097 CFLAGS => "-O -Wall",
1098 unistd => "<libc.h>",
1099 bn_ops => "BN_LLONG",
1100 thread_scheme => "(unknown)",
1103 inherit_from => [ "BASE_unix" ],
1105 CFLAGS => "-O3 -Wall",
1106 unistd => "<libc.h>",
1107 bn_ops => "BN_LLONG",
1108 thread_scheme => "(unknown)",
1113 inherit_from => [ "BASE_unix" ],
1116 cppflags => "-DL_ENDIAN -DTERMIO",
1117 thread_scheme => "(unknown)",
1120 inherit_from => [ "BASE_unix" ],
1122 ex_libs => add("-lsocket"),
1123 dso_scheme => "dlfcn",
1124 shared_target => "bsd-gcc-shared",
1125 shared_cflag => "-fPIC",
1126 shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
1129 inherit_from => [ "BASE_unix", asm("x86_elf_asm") ],
1131 CFLAGS => "-O2 -Wall",
1132 cppflags => "-DL_ENDIAN",
1133 ex_libs => add("-lsocket"),
1134 dso_scheme => "dlfcn",
1135 shared_target => "bsd-gcc-shared",
1136 shared_cflag => "-fPIC",
1137 shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
1140 #### SCO/Caldera targets.
1142 # Originally we had like unixware-*, unixware-*-pentium, unixware-*-p6, etc.
1143 # Now we only have blended unixware-* as it's the only one used by ./config.
1144 # If you want to optimize for particular microarchitecture, bypass ./config
1145 # and './Configure unixware-7 -Kpentium_pro' or whatever appropriate.
1146 # Note that not all targets include assembler support. Mostly because of
1147 # lack of motivation to support out-of-date platforms with out-of-date
1148 # compiler drivers and assemblers.
1150 # UnixWare 2.0x fails destest with -O.
1152 inherit_from => [ "BASE_unix" ],
1154 cflags => threads("-Kthread"),
1155 cppflags => "-DFILIO_H -DNO_STRINGS_H",
1156 ex_libs => add("-lsocket -lnsl -lresolv -lx"),
1157 thread_scheme => "uithreads",
1160 inherit_from => [ "BASE_unix" ],
1163 cflags => threads("-Kthread"),
1164 cppflags => "-DFILIO_H",
1165 ex_libs => add("-lsocket -lnsl -lresolv -lx"),
1166 thread_scheme => "uithreads",
1169 inherit_from => [ "BASE_unix", asm("x86_elf_asm") ],
1172 cflags => combine("-Kalloca", threads("-Kthread")),
1173 cppflags => "-DFILIO_H",
1174 ex_libs => add("-lsocket -lnsl"),
1175 thread_scheme => "uithreads",
1176 bn_ops => "BN_LLONG",
1177 perlasm_scheme => "elf-1",
1178 dso_scheme => "dlfcn",
1179 shared_target => "svr5-shared",
1180 shared_cflag => "-Kpic",
1181 shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
1183 "unixware-7-gcc" => {
1184 inherit_from => [ "BASE_unix", asm("x86_elf_asm") ],
1186 CFLAGS => "-O3 -fomit-frame-pointer -Wall",
1187 cppflags => add("-DL_ENDIAN -DFILIO_H",
1188 threads("-D_REENTRANT")),
1189 ex_libs => add("-lsocket -lnsl"),
1190 bn_ops => "BN_LLONG",
1191 thread_scheme => "pthreads",
1192 perlasm_scheme => "elf-1",
1193 dso_scheme => "dlfcn",
1194 shared_target => "gnu-shared",
1195 shared_cflag => "-fPIC",
1196 shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
1198 # SCO 5 - Ben Laurie says the -O breaks the SCO cc.
1200 inherit_from => [ "BASE_unix", asm("x86_elf_asm") ],
1203 ex_libs => add("-lsocket -lnsl"),
1204 thread_scheme => "(unknown)",
1205 perlasm_scheme => "elf-1",
1206 dso_scheme => "dlfcn",
1207 shared_target => "svr3-shared",
1208 shared_cflag => "-Kpic",
1209 shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
1212 inherit_from => [ "BASE_unix", asm("x86_elf_asm") ],
1214 cflags => "-O3 -fomit-frame-pointer",
1215 ex_libs => add("-lsocket -lnsl"),
1216 bn_ops => "BN_LLONG",
1217 thread_scheme => "(unknown)",
1218 perlasm_scheme => "elf-1",
1219 dso_scheme => "dlfcn",
1220 shared_target => "svr3-shared",
1221 shared_cflag => "-fPIC",
1222 shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
1226 # Below targets assume AIX >=5. Caveat lector. If you are accustomed
1227 # to control compilation "bitness" by setting $OBJECT_MODE environment
1228 # variable, then you should know that in OpenSSL case it's considered
1229 # only in ./config. Once configured, build procedure remains "deaf" to
1230 # current value of $OBJECT_MODE.
1232 inherit_from => [ "BASE_unix", asm("ppc32_asm") ],
1234 CFLAGS => picker(debug => "-O0 -g",
1236 cflags => add(threads("-pthread")),
1237 cppflags => "-DB_ENDIAN",
1238 ex_libs => add(threads("-pthread")),
1240 bn_ops => "BN_LLONG RC4_CHAR",
1241 thread_scheme => "pthreads",
1242 perlasm_scheme => "aix32",
1243 dso_scheme => "dlfcn",
1244 shared_target => "aix-shared",
1245 shared_ldflag => "-shared -static-libgcc -Wl,-G",
1246 shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
1247 arflags => "-X32 r",
1250 inherit_from => [ "BASE_unix", asm("ppc64_asm") ],
1252 CFLAGS => picker(debug => "-O0 -g",
1254 cflags => combine("-maix64", threads("-pthread")),
1255 cppflags => "-DB_ENDIAN",
1256 ex_libs => add(threads("-pthread")),
1258 bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
1259 thread_scheme => "pthreads",
1260 perlasm_scheme => "aix64",
1261 dso_scheme => "dlfcn",
1262 shared_target => "aix-shared",
1263 shared_ldflag => "-shared -static-libgcc -Wl,-G",
1264 shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
1265 arflags => "-X64 r",
1268 inherit_from => [ "BASE_unix", asm("ppc32_asm") ],
1270 CFLAGS => picker(debug => "-O0 -g",
1272 cflags => combine("-q32 -qmaxmem=16384 -qro -qroconst",
1273 threads("-qthreaded")),
1274 cppflags => combine("-DB_ENDIAN", threads("-D_THREAD_SAFE")),
1276 bn_ops => "BN_LLONG RC4_CHAR",
1277 thread_scheme => "pthreads",
1278 ex_libs => threads("-lpthreads"),
1279 perlasm_scheme => "aix32",
1280 dso_scheme => "dlfcn",
1281 shared_target => "aix-shared",
1282 shared_ldflag => "-G",
1283 shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
1284 arflags => "-X32 r",
1287 inherit_from => [ "BASE_unix", asm("ppc64_asm") ],
1289 CFLAGS => picker(debug => "-O0 -g",
1291 cflags => combine("-q64 -qmaxmem=16384 -qro -qroconst",
1292 threads("-qthreaded")),
1293 cppflags => combine("-DB_ENDIAN", threads("-D_THREAD_SAFE")),
1295 bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
1296 thread_scheme => "pthreads",
1297 ex_libs => threads("-lpthreads"),
1298 perlasm_scheme => "aix64",
1299 dso_scheme => "dlfcn",
1300 shared_target => "aix-shared",
1301 shared_ldflag => "-G",
1302 shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
1303 arflags => "-X64 r",
1306 # SIEMENS BS2000/OSD: an EBCDIC-based mainframe
1308 inherit_from => [ "BASE_unix" ],
1311 cflags => "-XLLML -XLLMK -XL",
1312 cppflags => "-DB_ENDIAN -DCHARSET_EBCDIC",
1313 ex_libs => add("-lsocket -lnsl"),
1314 bn_ops => "THIRTY_TWO_BIT RC4_CHAR",
1315 thread_scheme => "(unknown)",
1318 #### Visual C targets
1320 # Win64 targets, WIN64I denotes IA-64 and WIN64A - AMD64
1322 # Note about -wd4090, disable warning C4090. This warning returns false
1323 # positives in some situations. Disabling it altogether masks both
1324 # legitimate and false cases, but as we compile on multiple platforms,
1325 # we rely on other compilers to catch legitimate cases.
1327 # Also note that we force threads no matter what. Configuring "no-threads"
1330 inherit_from => [ "BASE_Windows" ],
1333 CPP => '$(CC) /EP /C',
1334 CFLAGS => "-W3 -wd4090 -nologo",
1335 LDFLAGS => add("/debug"),
1337 cflags => '-Gs0 -GF -Gy',
1338 defines => add("OPENSSL_SYS_WIN32", "WIN32_LEAN_AND_MEAN",
1339 "L_ENDIAN", "_CRT_SECURE_NO_DEPRECATE",
1340 "_WINSOCK_DEPRECATED_NO_WARNINGS",
1341 sub { my @defs = ();
1342 unless ($disabled{"zlib-dynamic"}) {
1344 $withargs{zlib_lib} // "ZLIB1";
1347 'LIBZ="' . $zlib . '"');
1351 lib_cflags => add("/Zi /Fdossl_static"),
1352 dso_cflags => "/Zi /Fddso",
1353 bin_cflags => "/Zi /Fdapp",
1354 shared_ldflag => "/dll",
1355 shared_target => "win-shared", # meaningless except it gives Configure a hint
1356 thread_scheme => "winthreads",
1357 dso_scheme => "win32",
1358 apps_aux_src => add("win32_init.c"),
1360 "VC-noCE-common" => {
1361 inherit_from => [ "VC-common" ],
1363 CFLAGS => add(picker(debug => '/Od',
1365 cflags => add(picker(debug =>
1367 ($disabled{shared} ? "" : "/MDd");
1371 ($disabled{shared} ? "" : "/MD");
1373 defines => add(picker(default => [ "UNICODE", "_UNICODE" ],
1374 debug => [ "DEBUG", "_DEBUG" ])),
1375 lib_cflags => add(sub { $disabled{shared} ? "/MT /Zl" : () }),
1376 # Following might/should appears controversial, i.e. defining
1377 # /MDd without evaluating $disabled{shared}. It works in
1378 # non-shared build because static library is compiled with /Zl
1379 # and bares no reference to specific RTL. And it works in
1380 # shared build because multiple /MDd options are not prohibited.
1381 # But why /MDd in static build? Well, basically this is just a
1382 # reference point, which allows to catch eventual errors that
1383 # would prevent those who want to wrap OpenSSL into own .DLL.
1384 # Why not /MD in release build then? Well, some are likely to
1385 # prefer [non-debug] openssl.exe to be free from Micorosoft RTL
1387 bin_cflags => add(picker(debug => "/MDd",
1388 release => sub { $disabled{shared} ? "/MT" : () },
1390 bin_lflags => add("/subsystem:console /opt:ref"),
1391 ex_libs => add(sub {
1393 push @ex_libs, 'ws2_32.lib' unless $disabled{sock};
1394 push @ex_libs, 'gdi32.lib advapi32.lib crypt32.lib user32.lib';
1395 return join(" ", @ex_libs);
1398 "VC-WIN64-common" => {
1399 inherit_from => [ "VC-noCE-common" ],
1401 ex_libs => add(sub {
1403 push @ex_libs, 'bufferoverflowu.lib' if (`cl 2>&1` =~ /14\.00\.4[0-9]{4}\./);
1404 return join(" ", @_, @ex_libs);
1406 bn_ops => "SIXTY_FOUR_BIT EXPORT_VAR_AS_FN",
1407 build_scheme => add("VC-W64", { separator => undef }),
1410 inherit_from => [ "VC-WIN64-common", asm("ia64_asm"),
1411 sub { $disabled{shared} ? () : "ia64_uplink" } ],
1413 ASFLAGS => "-d debug",
1416 bn_asm_src => sub { return undef unless @_;
1417 my $r=join(" ",@_); $r=~s|bn-ia64.s|bn_asm.c|; $r; },
1418 perlasm_scheme => "ias",
1419 multilib => "-ia64",
1422 inherit_from => [ "VC-WIN64-common", asm("x86_64_asm"),
1423 sub { $disabled{shared} ? () : "x86_64_uplink" } ],
1424 AS => sub { vc_win64a_info()->{AS} },
1425 ASFLAGS => sub { vc_win64a_info()->{ASFLAGS} },
1426 asoutflag => sub { vc_win64a_info()->{asoutflag} },
1427 asflags => sub { vc_win64a_info()->{asflags} },
1429 bn_asm_src => sub { return undef unless @_;
1430 my $r=join(" ",@_); $r=~s|asm/x86_64-gcc|bn_asm|; $r; },
1431 perlasm_scheme => "auto",
1435 # x86 Win32 target defaults to ANSI API, if you want UNICODE,
1436 # configure with 'perl Configure VC-WIN32 -DUNICODE -D_UNICODE'
1437 inherit_from => [ "VC-noCE-common", asm("x86_asm"),
1438 sub { $disabled{shared} ? () : "uplink_common" } ],
1439 CFLAGS => add("-WX"),
1440 AS => sub { vc_win32_info()->{AS} },
1441 ASFLAGS => sub { vc_win32_info()->{ASFLAGS} },
1442 asoutflag => sub { vc_win32_info()->{asoutflag} },
1443 asflags => sub { vc_win32_info()->{asflags} },
1444 ex_libs => add(sub {
1446 # WIN32 UNICODE build gets linked with unicows.lib for
1447 # backward compatibility with Win9x.
1448 push @ex_libs, 'unicows.lib'
1449 if (grep { $_ eq "UNICODE" } @{$user{CPPDEFINES}});
1450 return join(" ", @ex_libs, @_);
1453 bn_ops => "BN_LLONG EXPORT_VAR_AS_FN",
1454 perlasm_scheme => sub { vc_win32_info()->{perlasm_scheme} },
1455 build_scheme => add("VC-W32", { separator => undef }),
1458 inherit_from => [ "VC-common" ],
1460 ASFLAGS => "/nologo",
1462 asflags => "/Cp /coff /c /Cx /Zi",
1464 CFLAGS => picker(default => '/W3 /WX /nologo',
1467 CPPDEFINES => picker(debug => [ "DEBUG", "_DEBUG" ]),
1468 LDFLAGS => add("/nologo /opt:ref"),
1471 sub { vc_wince_info()->{cflags}; },
1472 sub { `cl 2>&1` =~ /Version ([0-9]+)\./ && $1>=14
1473 ? ($disabled{shared} ? " /MT" : " /MD")
1475 cppflags => sub { vc_wince_info()->{cppflags}; },
1476 defines => [ "UNICODE", "_UNICODE", "L_ENDIAN", "DSO_WIN32",
1477 "NO_CHMOD", "OPENSSL_SMALL_FOOTPRINT",
1478 "WIN32_LEAN_AND_MEAN" ],
1480 add(combine(sub { defined(env('WCECOMPAT'))
1481 ? '$(WCECOMPAT)/include' : (); },
1482 sub { defined(env('PORTSDK_LIBPATH'))
1483 ? '$(PORTSDK_LIBPATH)/../../include'
1485 lflags => add(combine(sub { vc_wince_info()->{lflags}; },
1486 sub { defined(env('PORTSDK_LIBPATH'))
1487 ? "/entry:mainCRTstartup" : (); })),
1489 bn_ops => "BN_LLONG EXPORT_VAR_AS_FN",
1490 ex_libs => add(sub {
1492 push @ex_libs, 'ws2.lib' unless $disabled{sock};
1493 push @ex_libs, 'crypt32.lib';
1494 if (defined(env('WCECOMPAT'))) {
1495 my $x = '$(WCECOMPAT)/lib';
1496 if (-f "$x/env('TARGETCPU')/wcecompatex.lib") {
1497 $x .= '/$(TARGETCPU)/wcecompatex.lib';
1499 $x .= '/wcecompatex.lib';
1503 push @ex_libs, '$(PORTSDK_LIBPATH)/portlib.lib'
1504 if (defined(env('PORTSDK_LIBPATH')));
1505 push @ex_libs, ' /nodefaultlib coredll.lib corelibc.lib'
1506 if (env('TARGETCPU') eq "X86");
1509 build_scheme => add("VC-WCE", { separator => undef }),
1514 inherit_from => [ "BASE_unix", asm("x86_asm"),
1515 sub { $disabled{shared} ? () : "x86_uplink" } ],
1517 CFLAGS => picker(default => "-Wall",
1519 release => "-O3 -fomit-frame-pointer"),
1521 cppflags => combine("-DL_ENDIAN -DUNICODE -D_UNICODE",
1522 "-DWIN32_LEAN_AND_MEAN",
1524 sys_id => "MINGW32",
1525 ex_libs => add("-lws2_32 -lgdi32 -lcrypt32"),
1526 bn_ops => "BN_LLONG EXPORT_VAR_AS_FN",
1527 thread_scheme => "winthreads",
1528 perlasm_scheme => "coff",
1529 dso_scheme => "win32",
1530 shared_target => "mingw-shared",
1531 shared_cppflags => add("_WINDLL"),
1532 shared_ldflag => "-static-libgcc",
1533 shared_rcflag => "--target=pe-i386",
1534 shared_extension => ".dll",
1536 apps_aux_src => add("win32_init.c"),
1539 # As for OPENSSL_USE_APPLINK. Applink makes it possible to use
1540 # .dll compiled with one compiler with application compiled with
1541 # another compiler. It's possible to engage Applink support in
1542 # mingw64 build, but it's not done, because till mingw64
1543 # supports structured exception handling, one can't seriously
1544 # consider its binaries for using with non-mingw64 run-time
1545 # environment. And as mingw64 is always consistent with itself,
1546 # Applink is never engaged and can as well be omitted.
1547 inherit_from => [ "BASE_unix", asm("x86_64_asm") ],
1549 CFLAGS => picker(default => "-Wall",
1553 cppflags => combine("-DL_ENDIAN -DUNICODE -D_UNICODE",
1554 "-DWIN32_LEAN_AND_MEAN",
1556 sys_id => "MINGW64",
1557 ex_libs => add("-lws2_32 -lgdi32 -lcrypt32"),
1558 bn_ops => "SIXTY_FOUR_BIT EXPORT_VAR_AS_FN",
1559 thread_scheme => "winthreads",
1560 perlasm_scheme => "mingw64",
1561 dso_scheme => "win32",
1562 shared_target => "mingw-shared",
1563 shared_cppflags => add("_WINDLL"),
1564 shared_ldflag => "-static-libgcc",
1565 shared_rcflag => "--target=pe-x86-64",
1566 shared_extension => ".dll",
1568 apps_aux_src => add("win32_init.c"),
1573 inherit_from => [ "BASE_unix" ],
1576 cppflags => "-DL_ENDIAN",
1582 inherit_from => [ "BASE_unix" ],
1584 CFLAGS => "-O -Wall",
1585 lib_cppflags => "-DTERMIOS -DL_ENDIAN",
1587 bn_ops => "BN_LLONG",
1588 dso_scheme => "win32",
1593 inherit_from => [ "BASE_unix", asm("x86_asm") ],
1595 CFLAGS => picker(default => "-Wall",
1597 release => "-O3 -fomit-frame-pointer"),
1598 cppflags => "-DTERMIOS -DL_ENDIAN",
1600 bn_ops => "BN_LLONG",
1601 thread_scheme => "pthread",
1602 perlasm_scheme => "coff",
1603 dso_scheme => "dlfcn",
1604 shared_target => "cygwin-shared",
1605 shared_cppflags => "-D_WINDLL",
1606 shared_extension => ".dll",
1608 "Cygwin-x86_64" => {
1609 inherit_from => [ "BASE_unix", asm("x86_64_asm") ],
1611 CFLAGS => picker(default => "-Wall",
1614 cppflags => "-DTERMIOS -DL_ENDIAN",
1616 bn_ops => "SIXTY_FOUR_BIT_LONG",
1617 thread_scheme => "pthread",
1618 perlasm_scheme => "mingw64",
1619 dso_scheme => "dlfcn",
1620 shared_target => "cygwin-shared",
1621 shared_cppflags => "-D_WINDLL",
1622 shared_extension => ".dll",
1624 # Backward compatibility for those using this target
1626 inherit_from => [ "Cygwin-x86" ]
1628 # In case someone constructs the Cygwin target name themself
1630 inherit_from => [ "Cygwin-x86" ]
1633 inherit_from => [ "Cygwin-x86" ]
1636 inherit_from => [ "Cygwin-x86" ]
1639 inherit_from => [ "Cygwin-x86" ]
1642 ##### MacOS X (a.k.a. Darwin) setup
1643 "darwin-common" => {
1644 inherit_from => [ "BASE_unix" ],
1647 CFLAGS => picker(debug => "-g -O0",
1649 cppflags => threads("-D_REENTRANT"),
1650 lflags => "-Wl,-search_paths_first",
1652 bn_ops => "BN_LLONG RC4_CHAR",
1653 thread_scheme => "pthreads",
1654 perlasm_scheme => "osx32",
1655 dso_scheme => "dlfcn",
1656 ranlib => "ranlib -c",
1657 shared_target => "darwin-shared",
1658 shared_cflag => "-fPIC",
1659 shared_extension => ".\$(SHLIB_VERSION_NUMBER).dylib",
1661 # Option "freeze" such as -std=gnu9x can't negatively interfere
1662 # with future defaults for below two targets, because MacOS X
1663 # for PPC has no future, it was discontinued by vendor in 2009.
1664 "darwin-ppc-cc" => {
1665 inherit_from => [ "darwin-common", asm("ppc32_asm") ],
1666 cflags => add("-arch ppc -std=gnu9x -Wa,-force_cpusubtype_ALL"),
1667 cppflags => add("-DB_ENDIAN"),
1668 shared_cflag => add("-fno-common"),
1669 perlasm_scheme => "osx32",
1671 "darwin64-ppc-cc" => {
1672 inherit_from => [ "darwin-common", asm("ppc64_asm") ],
1673 cflags => add("-arch ppc64 -std=gnu9x"),
1674 cppflags => add("-DB_ENDIAN"),
1675 bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
1676 perlasm_scheme => "osx64",
1678 "darwin-i386-cc" => {
1679 inherit_from => [ "darwin-common", asm("x86_asm") ],
1680 CFLAGS => add(picker(release => "-fomit-frame-pointer")),
1681 cflags => add("-arch i386"),
1682 cppflags => add("-DL_ENDIAN"),
1683 bn_ops => "BN_LLONG RC4_INT",
1684 perlasm_scheme => "macosx",
1686 "darwin64-x86_64-cc" => {
1687 inherit_from => [ "darwin-common", asm("x86_64_asm") ],
1688 CFLAGS => add("-Wall"),
1689 cflags => add("-arch x86_64"),
1690 cppflags => add("-DL_ENDIAN"),
1691 bn_ops => "SIXTY_FOUR_BIT_LONG",
1692 perlasm_scheme => "macosx",
1697 # It takes three prior-set environment variables to make it work:
1699 # CROSS_COMPILE=/where/toolchain/is/usr/bin/ [note ending slash]
1700 # CROSS_TOP=/where/SDKs/are
1701 # CROSS_SDK=iPhoneOSx.y.sdk
1703 # Exact paths vary with Xcode releases, but for couple of last ones
1704 # they would look like this:
1706 # CROSS_COMPILE=`xcode-select --print-path`/Toolchains/XcodeDefault.xctoolchain/usr/bin/
1707 # CROSS_TOP=`xcode-select --print-path`/Platforms/iPhoneOS.platform/Developer
1708 # CROSS_SDK=iPhoneOS.sdk
1710 "iphoneos-cross" => {
1711 inherit_from => [ "darwin-common" ],
1712 cflags => add("-isysroot \$(CROSS_TOP)/SDKs/\$(CROSS_SDK) -fno-common"),
1716 inherit_from => [ "darwin-common", asm("armv4_asm") ],
1717 # It should be possible to go below iOS 6 and even add -arch armv6,
1718 # thus targeting iPhone pre-3GS, but it's assumed to be irrelevant
1720 cflags => add("-arch armv7 -mios-version-min=6.0.0 -isysroot \$(CROSS_TOP)/SDKs/\$(CROSS_SDK) -fno-common"),
1722 perlasm_scheme => "ios32",
1725 inherit_from => [ "darwin-common", asm("aarch64_asm") ],
1726 cflags => add("-arch arm64 -mios-version-min=7.0.0 -isysroot \$(CROSS_TOP)/SDKs/\$(CROSS_SDK) -fno-common"),
1728 bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
1729 perlasm_scheme => "ios64",
1734 inherit_from => [ "BASE_unix" ],
1735 inherit_from => [ asm("x86_elf_asm") ],
1737 CFLAGS => "-O3 -fomit-frame-pointer -Wall",
1738 cflags => threads("-pthread"),
1739 cppflags => "-DL_ENDIAN",
1740 ex_libs => add("-ldl", threads("-pthread")),
1741 bn_ops => "BN_LLONG",
1742 thread_scheme => "pthreads",
1743 dso_scheme => "dlfcn",
1744 shared_target => "linux-shared",
1745 shared_cflag => "-fPIC",
1746 shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
1749 ##### VxWorks for various targets
1750 "vxworks-ppc60x" => {
1751 inherit_from => [ "BASE_unix" ],
1753 CFLAGS => "-O2 -Wall -fstrength-reduce",
1754 cflags => "-mrtp -mhard-float -mstrict-align -fno-implicit-fp -fno-builtin -fno-strict-aliasing",
1755 cppflags => combine("-D_REENTRANT -DPPC32_fp60x -DCPU=PPC32",
1756 "_DTOOL_FAMILY=gnu -DTOOL=gnu",
1757 "-I\$(WIND_BASE)/target/usr/h",
1758 "-I\$(WIND_BASE)/target/usr/h/wrn/coreip"),
1759 sys_id => "VXWORKS",
1760 lflags => add("-L \$(WIND_BASE)/target/usr/lib/ppc/PPC32/common"),
1761 ex_libs => add("-Wl,--defsym,__wrs_rtp_base=0xe0000000"),
1763 "vxworks-ppcgen" => {
1764 inherit_from => [ "BASE_unix" ],
1766 CFLAGS => "-O1 -Wall",
1767 cflags => "-mrtp -msoft-float -mstrict-align -fno-builtin -fno-strict-aliasing",
1768 cppflags => combine("-D_REENTRANT -DPPC32 -DCPU=PPC32",
1769 "-DTOOL_FAMILY=gnu -DTOOL=gnu",
1770 "-I\$(WIND_BASE)/target/usr/h",
1771 "-I\$(WIND_BASE)/target/usr/h/wrn/coreip"),
1772 sys_id => "VXWORKS",
1773 lflags => add("-L \$(WIND_BASE)/target/usr/lib/ppc/PPC32/sfcommon"),
1774 ex_libs => add("-Wl,--defsym,__wrs_rtp_base=0xe0000000"),
1776 "vxworks-ppc405" => {
1777 inherit_from => [ "BASE_unix" ],
1780 cflags => "-msoft-float -mlongcall",
1781 cppflags => combine("-D_REENTRANT -DPPC32 -DCPU=PPC405",
1782 "-DTOOL_FAMILY=gnu -DTOOL=gnu",
1783 "-I\$(WIND_BASE)/target/h"),
1784 sys_id => "VXWORKS",
1785 lflags => add("-r"),
1787 "vxworks-ppc750" => {
1788 inherit_from => [ "BASE_unix" ],
1790 CFLAGS => "-ansi -fvolatile -Wall \$(DEBUG_FLAG)",
1791 cflags => "-nostdinc -fno-builtin -fno-for-scope -fsigned-char -msoft-float -mlongcall",
1792 cppflags => combine("-DPPC750 -D_REENTRANT -DCPU=PPC604",
1793 "-I\$(WIND_BASE)/target/h"),
1794 sys_id => "VXWORKS",
1795 lflags => add("-r"),
1797 "vxworks-ppc750-debug" => {
1798 inherit_from => [ "BASE_unix" ],
1800 CFLAGS => "-ansi -fvolatile -Wall -g",
1801 cflags => "-nostdinc -fno-builtin -fno-for-scope -fsigned-char -msoft-float -mlongcall",
1802 cppflags => combine("-DPPC750 -D_REENTRANT -DCPU=PPC604",
1803 "-DPEDANTIC -DDEBUG",
1804 "-I\$(WIND_BASE)/target/h"),
1805 sys_id => "VXWORKS",
1806 lflags => add("-r"),
1808 "vxworks-ppc860" => {
1809 inherit_from => [ "BASE_unix" ],
1811 cflags => "-nostdinc -msoft-float",
1812 cppflags => combine("-DCPU=PPC860 -DNO_STRINGS_H",
1813 "-I\$(WIND_BASE)/target/h"),
1814 sys_id => "VXWORKS",
1815 lflags => add("-r"),
1817 "vxworks-simlinux" => {
1818 inherit_from => [ "BASE_unix" ],
1820 cflags => "-B\$(WIND_BASE)/host/\$(WIND_HOST_TYPE)/lib/gcc-lib/ -fno-builtin -fno-defer-pop",
1821 cppflags => combine("-D_VSB_CONFIG_FILE=\"\$(WIND_BASE)/target/lib/h/config/vsbConfig.h\"",
1822 "-DL_ENDIAN -DCPU=SIMLINUX -DNO_STRINGS_H",
1823 "-DTOOL_FAMILY=gnu -DTOOL=gnu",
1824 "-DOPENSSL_NO_HW_PADLOCK",
1825 "-I\$(WIND_BASE)/target/h",
1826 "-I\$(WIND_BASE)/target/h/wrn/coreip"),
1827 sys_id => "VXWORKS",
1828 lflags => add("-r"),
1829 ranlib => "ranlibpentium",
1832 inherit_from => [ "BASE_unix", asm("mips32_asm") ],
1834 CFLAGS => "-O -G 0",
1835 cflags => "-mrtp -mips2 -B\$(WIND_BASE)/host/\$(WIND_HOST_TYPE)/lib/gcc-lib/ -msoft-float -mno-branch-likely -fno-builtin -fno-defer-pop",
1836 cppflags => combine("-D_VSB_CONFIG_FILE=\"\$(WIND_BASE)/target/lib/h/config/vsbConfig.h\"",
1837 "-DCPU=MIPS32 -DNO_STRINGS_H",
1838 "-DTOOL_FAMILY=gnu -DTOOL=gnu",
1839 "-DOPENSSL_NO_HW_PADLOCK",
1840 threads("-D_REENTRANT"),
1841 "-I\$(WIND_BASE)/target/h",
1842 "-I\$(WIND_BASE)/target/h/wrn/coreip"),
1843 sys_id => "VXWORKS",
1844 lflags => add("-L \$(WIND_BASE)/target/usr/lib/mips/MIPSI32/sfcommon"),
1845 ex_libs => add("-Wl,--defsym,__wrs_rtp_base=0xe0000000"),
1846 thread_scheme => "pthreads",
1847 perlasm_scheme => "o32",
1848 ranlib => "ranlibmips",
1853 inherit_from => [ "BASE_unix" ],
1854 CC => sub { env('CC') },
1855 cppflags => threads("-D_REENTRANT"),
1856 ex_libs => add("\$(LDLIBS)"),
1857 bn_ops => "BN_LLONG",
1858 thread_scheme => "pthreads",
1859 dso_scheme => sub { env('LIBSSL_dlfcn') },
1860 shared_target => "linux-shared",
1861 shared_cflag => "-fPIC",
1862 shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
1863 ranlib => sub { env('RANLIB') },
1865 "uClinux-dist64" => {
1866 inherit_from => [ "BASE_unix" ],
1867 CC => sub { env('CC') },
1868 cppflags => threads("-D_REENTRANT"),
1869 ex_libs => add("\$(LDLIBS)"),
1870 bn_ops => "SIXTY_FOUR_BIT_LONG",
1871 thread_scheme => "pthreads",
1872 dso_scheme => sub { env('LIBSSL_dlfcn') },
1873 shared_target => "linux-shared",
1874 shared_cflag => "-fPIC",
1875 shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
1876 ranlib => sub { env('RANLIB') },
1880 # Most things happen in vms-generic.
1881 # Note that vms_info extracts the pointer size from the end of
1882 # the target name, and will assume that anything matching /-p\d+$/
1883 # indicates the pointer size setting for the desired target.
1885 inherit_from => [ "BASE_VMS" ],
1888 CPP => '$(CC)/PREPROCESS_ONLY=SYS$OUTPUT:',
1890 combine(picker(default => "/STANDARD=(ISOC94,RELAXED)/NOLIST/PREFIX=ALL",
1891 debug => "/NOOPTIMIZE/DEBUG",
1892 release => "/OPTIMIZE/NODEBUG"),
1893 sub { my @warnings =
1894 @{vms_info()->{disable_warns}};
1896 ? "/WARNINGS=DISABLE=(".join(",",@warnings).")" : (); }),
1898 add("OPENSSL_USE_NODELETE",
1900 return vms_info()->{def_zlib}
1901 ? "LIBZ=\"\"\"".vms_info()->{def_zlib}."\"\"\"" : ();
1903 lflags => picker(default => "/MAP='F\$PARSE(\".MAP\",\"\$\@\")'",
1904 debug => "/DEBUG/TRACEBACK",
1905 release => "/NODEBUG/NOTRACEBACK"),
1906 lib_cflags => add("/NAMES=(AS_IS,SHORTENED)/EXTERN_MODEL=STRICT_REFDEF"),
1907 # no_inst_lib_cflags is used instead of lib_cflags by descrip.mms.tmpl
1908 # for object files belonging to selected internal libraries
1909 no_inst_lib_cflags => "",
1910 ex_libs => add(sub { return vms_info()->{zlib} || (); }),
1911 shared_target => "vms-shared",
1912 dso_scheme => "vms",
1913 thread_scheme => "pthreads",
1915 AS => sub { vms_info()->{AS} },
1916 ASFLAGS => sub { vms_info()->{ASFLAGS} },
1917 asoutflag => sub { vms_info()->{asoutflag} },
1918 asflags => sub { vms_info()->{asflags} },
1919 perlasm_scheme => sub { vms_info()->{perlasm_scheme} },
1921 apps_aux_src => "vms_term_sock.c",
1922 apps_init_src => "vms_decc_init.c",
1925 # From HELP CC/POINTER_SIZE:
1928 # LONG[=ARGV] The compiler assumes 64-bit pointers. If the ARGV option to
1929 # LONG or 64 is present, the main argument argv will be an
1930 # array of long pointers instead of an array of short pointers.
1932 # 64[=ARGV] Same as LONG.
1935 # We don't want the hassle of dealing with 32-bit pointers with argv, so
1936 # we force it to have 64-bit pointers, see the added cflags in the -p64
1937 # config targets below.
1940 inherit_from => [ "vms-generic" ],
1941 bn_ops => "SIXTY_FOUR_BIT RC4_INT",
1944 "vms-alpha-p32" => {
1945 inherit_from => [ "vms-alpha" ],
1946 cflags => add("/POINTER_SIZE=32"),
1947 pointer_size => "32",
1949 "vms-alpha-p64" => {
1950 inherit_from => [ "vms-alpha" ],
1951 cflags => add("/POINTER_SIZE=64=ARGV"),
1952 pointer_size => "64",
1955 inherit_from => [ "vms-generic",
1956 sub { vms_info()->{as}
1957 ? asm("ia64_asm")->() : () } ],
1958 bn_ops => "SIXTY_FOUR_BIT RC4_INT",
1961 modes_asm_src => "", # Because ghash-ia64.s doesn't work on VMS
1964 inherit_from => [ "vms-ia64" ],
1965 cflags => add("/POINTER_SIZE=32"),
1966 pointer_size => "32",
1969 inherit_from => [ "vms-ia64" ],
1970 cflags => add("/POINTER_SIZE=64=ARGV"),
1971 pointer_size => "64",