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";
20 return $vc_win64a_info;
23 my $vc_win32_info = {};
25 unless (%$vc_win32_info) {
26 my $ver=`nasm -v 2>NUL`;
27 my $vew=`nasmw -v 2>NUL`;
28 if ($ver ne "" || $vew ne "") {
29 $vc_win32_info = { as => $ver ge $vew ? "nasm" : "nasmw",
30 asflags => "-f win32",
32 perlasm_scheme => "win32n" };
33 } elsif ($disabled{asm}) {
34 $vc_win32_info = { as => "ml",
35 asflags => "/nologo /Cp /coff /c /Cx /Zi",
37 perlasm_scheme => "win32" };
39 die "NASM not found - please read INSTALL and NOTES.WIN for further details\n";
42 return $vc_win32_info;
45 my $vc_wince_info = {};
47 unless (%$vc_wince_info) {
49 die '%OSVERSION% is not defined' if (!defined($ENV{'OSVERSION'}));
50 die '%PLATFORM% is not defined' if (!defined($ENV{'PLATFORM'}));
51 die '%TARGETCPU% is not defined' if (!defined($ENV{'TARGETCPU'}));
54 # Idea behind this is to mimic flags set by eVC++ IDE...
56 my $wcevers = $ENV{'OSVERSION'}; # WCENNN
57 die '%OSVERSION% value is insane'
58 if ($wcevers !~ /^WCE([1-9])([0-9]{2})$/);
59 my $wcecdefs = "-D_WIN32_WCE=$1$2 -DUNDER_CE=$1$2"; # -D_WIN32_WCE=NNN
60 my $wcelflag = "/subsystem:windowsce,$1.$2"; # ...,N.NN
62 my $wceplatf = $ENV{'PLATFORM'};
64 $wceplatf =~ tr/a-z0-9 /A-Z0-9_/;
65 $wcecdefs .= " -DWCE_PLATFORM_$wceplatf";
67 my $wcetgt = $ENV{'TARGETCPU'}; # just shorter name...
68 SWITCH: for($wcetgt) {
69 /^X86/ && do { $wcecdefs.=" -Dx86 -D_X86_ -D_i386_ -Di_386_";
70 $wcelflag.=" /machine:X86"; last; };
71 /^ARMV4[IT]/ && do { $wcecdefs.=" -DARM -D_ARM_ -D$wcetgt";
72 $wcecdefs.=" -DTHUMB -D_THUMB_" if($wcetgt=~/T$/);
73 $wcecdefs.=" -QRarch4T -QRinterwork-return";
74 $wcelflag.=" /machine:THUMB"; last; };
75 /^ARM/ && do { $wcecdefs.=" -DARM -D_ARM_ -D$wcetgt";
76 $wcelflag.=" /machine:ARM"; last; };
77 /^MIPSIV/ && do { $wcecdefs.=" -DMIPS -D_MIPS_ -DR4000 -D$wcetgt";
78 $wcecdefs.=" -D_MIPS64 -QMmips4 -QMn32";
79 $wcelflag.=" /machine:MIPSFPU"; last; };
80 /^MIPS16/ && do { $wcecdefs.=" -DMIPS -D_MIPS_ -DR4000 -D$wcetgt";
81 $wcecdefs.=" -DMIPSII -QMmips16";
82 $wcelflag.=" /machine:MIPS16"; last; };
83 /^MIPSII/ && do { $wcecdefs.=" -DMIPS -D_MIPS_ -DR4000 -D$wcetgt";
84 $wcecdefs.=" -QMmips2";
85 $wcelflag.=" /machine:MIPS"; last; };
86 /^R4[0-9]{3}/ && do { $wcecdefs.=" -DMIPS -D_MIPS_ -DR4000";
87 $wcelflag.=" /machine:MIPS"; last; };
88 /^SH[0-9]/ && do { $wcecdefs.=" -D$wcetgt -D_${wcetgt}_ -DSHx";
89 $wcecdefs.=" -Qsh4" if ($wcetgt =~ /^SH4/);
90 $wcelflag.=" /machine:$wcetgt"; last; };
91 { $wcecdefs.=" -D$wcetgt -D_${wcetgt}_";
92 $wcelflag.=" /machine:$wcetgt"; last; };
95 $vc_wince_info = { cflags => $wcecdefs,
96 lflags => $wcelflag };
98 return $vc_wince_info;
101 # Helper functions for the VMS configs
104 unless (%$vms_info) {
105 my $pointer_size = shift;
106 my $pointer_size_str = $pointer_size == 0 ? "" : "$pointer_size";
108 $vms_info->{disable_warns} = [ ];
109 if ($pointer_size == 64) {
110 `PIPE CC /NOCROSS_REFERENCE /NOLIST /NOOBJECT /WARNINGS = DISABLE = ( MAYLOSEDATA3, EMPTYFILE ) NL: 2> NL:`;
112 push @{$vms_info->{disable_warns}}, "MAYLOSEDATA3";
116 unless ($disabled{zlib}) {
117 my $default_zlib = 'GNV$LIBZSHR' . $pointer_size_str;
118 if (defined($disabled{"zlib-dynamic"})) {
119 $vms_info->{zlib} = $withargs{zlib_lib} || "$default_zlib/SHARE";
121 $vms_info->{def_zlib} = $withargs{zlib_lib} || $default_zlib;
122 # In case the --with-zlib-lib value contains something like
123 # /SHARE or /LIB or so at the end, remove it.
124 $vms_info->{def_zlib} =~ s|/.*$||g;
133 #### Basic configs that should work on any 32-bit box
136 cflags => picker(debug => "-O0 -g",
138 thread_scheme => "(unknown)",
139 bn_ops => "BN_LLONG",
144 thread_scheme => "(unknown)",
147 #### VOS Configurations
149 inherit_from => [ "BASE_unix" ],
151 cflags => picker(default => "-Wall -DOPENSSL_SYS_VOS -D_POSIX_C_SOURCE=200112L -D_BSD -D_VOS_EXTENDED_NAMES -DB_ENDIAN",
154 thread_scheme => "(unknown)",
156 lflags => "-Wl,-map",
157 bn_ops => "BN_LLONG",
158 shared_extension => ".so",
161 #### Solaris configurations
162 "solaris-common" => {
163 inherit_from => [ "BASE_unix" ],
165 cflags => "-DFILIO_H",
166 ex_libs => add("-lresolv -lsocket -lnsl -ldl"),
167 dso_scheme => "dlfcn",
168 thread_scheme => "pthreads",
169 shared_target => "solaris-shared",
170 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
172 #### Solaris x86 with GNU C setups
173 "solaris-x86-gcc" => {
174 # -DOPENSSL_NO_INLINE_ASM switches off inline assembler. We have
175 # to do it here because whenever GNU C instantiates an assembler
176 # template it surrounds it with #APP #NO_APP comment pair which
177 # (at least Solaris 7_x86) /usr/ccs/bin/as fails to assemble
178 # with "Illegal mnemonic" error message.
179 inherit_from => [ "solaris-common", asm("x86_elf_asm") ],
181 cflags => add_before(picker(default => "-Wall -DL_ENDIAN -DOPENSSL_NO_INLINE_ASM",
183 release => "-O3 -fomit-frame-pointer"),
184 threads("-pthread")),
185 bn_ops => "BN_LLONG",
186 shared_cflag => "-fPIC",
187 shared_ldflag => "-shared",
189 "solaris64-x86_64-gcc" => {
190 # -shared -static-libgcc might appear controversial, but modules
191 # taken from static libgcc do not have relocations and linking
192 # them into our shared objects doesn't have any negative side
193 # effects. On the contrary, doing so makes it possible to use
194 # gcc shared build with Sun C. Given that gcc generates faster
195 # code [thanks to inline assembler], I would actually recommend
196 # to consider using gcc shared build even with vendor compiler:-)
197 # <appro@fy.chalmers.se>
198 inherit_from => [ "solaris-common", asm("x86_64_asm") ],
200 cflags => add_before(picker(default => "-m64 -Wall -DL_ENDIAN",
203 threads("-pthread")),
204 bn_ops => "SIXTY_FOUR_BIT_LONG",
205 perlasm_scheme => "elf",
206 shared_cflag => "-fPIC",
207 shared_ldflag => "-m64 -shared -static-libgcc",
211 #### Solaris x86 with Sun C setups
212 "solaris-x86-cc" => {
213 inherit_from => [ "solaris-common" ],
215 cflags => add_before(picker(default => "-xarch=generic -xstrconst -Xa -DL_ENDIAN",
217 release => "-xO5 -xregs=frameptr -xdepend -xbuiltin"),
218 threads("-D_REENTRANT")),
219 lflags => add(threads("-mt")),
220 ex_libs => add(threads("-lpthread")),
221 bn_ops => "BN_LLONG RC4_CHAR",
222 shared_cflag => "-KPIC",
223 shared_ldflag => "-G -dy -z text",
225 "solaris64-x86_64-cc" => {
226 inherit_from => [ "solaris-common", asm("x86_64_asm") ],
228 cflags => add_before(picker(default => "-xarch=generic64 -xstrconst -Xa -DL_ENDIAN",
230 release => "-xO5 -xdepend -xbuiltin"),
231 threads("-D_REENTRANT")),
232 thread_scheme => "pthreads",
233 lflags => add(threads("-mt")),
234 ex_libs => add(threads("-lpthread")),
235 bn_ops => "SIXTY_FOUR_BIT_LONG",
236 perlasm_scheme => "elf",
237 shared_cflag => "-KPIC",
238 shared_ldflag => "-xarch=generic64 -G -dy -z text",
242 #### SPARC Solaris with GNU C setups
243 "solaris-sparcv7-gcc" => {
244 inherit_from => [ "solaris-common" ],
246 cflags => add_before(picker(default => "-Wall -DB_ENDIAN -DBN_DIV2W",
249 threads("-pthread")),
250 bn_ops => "BN_LLONG RC4_CHAR",
251 shared_cflag => "-fPIC",
252 shared_ldflag => "-shared",
254 "solaris-sparcv8-gcc" => {
255 inherit_from => [ "solaris-sparcv7-gcc", asm("sparcv8_asm") ],
256 cflags => add_before("-mcpu=v8"),
258 "solaris-sparcv9-gcc" => {
259 # -m32 should be safe to add as long as driver recognizes
261 inherit_from => [ "solaris-sparcv7-gcc", asm("sparcv9_asm") ],
262 cflags => add_before("-m32 -mcpu=ultrasparc"),
264 "solaris64-sparcv9-gcc" => {
265 inherit_from => [ "solaris-sparcv9-gcc" ],
266 cflags => sub { my $f=join(" ",@_); $f =~ s/\-m32/-m64/; $f; },
267 bn_ops => "BN_LLONG RC4_CHAR",
268 shared_ldflag => "-m64 -shared",
272 #### SPARC Solaris with Sun C setups
273 # SC4.0 doesn't pass 'make test', upgrade to SC5.0 or SC4.2.
274 # SC4.2 is ok, better than gcc even on bn as long as you tell it -xarch=v8
275 # SC5.0 note: Compiler common patch 107357-01 or later is required!
276 "solaris-sparcv7-cc" => {
277 inherit_from => [ "solaris-common" ],
279 cflags => add_before(picker(default => "-xstrconst -Xa -DB_ENDIAN -DBN_DIV2W",
281 release => "-xO5 -xdepend"),
282 threads("-D_REENTRANT")),
283 lflags => add(threads("-mt")),
284 ex_libs => add(threads("-lpthread")),
285 bn_ops => "BN_LLONG RC4_CHAR",
286 shared_cflag => "-KPIC",
287 shared_ldflag => "-G -dy -z text",
290 "solaris-sparcv8-cc" => {
291 inherit_from => [ "solaris-sparcv7-cc", asm("sparcv8_asm") ],
292 cflags => add_before("-xarch=v8"),
294 "solaris-sparcv9-cc" => {
295 inherit_from => [ "solaris-sparcv7-cc", asm("sparcv9_asm") ],
296 cflags => add_before("-xarch=v8plus -xtarget=ultra"),
298 "solaris64-sparcv9-cc" => {
299 inherit_from => [ "solaris-sparcv7-cc", asm("sparcv9_asm") ],
300 cflags => add_before("-xarch=v9 -xtarget=ultra"),
301 bn_ops => "BN_LLONG RC4_CHAR",
302 shared_ldflag => "-xarch=v9 -G -dy -z text",
306 #### IRIX 5.x configs
307 # -mips2 flag is added by ./config when appropriate.
309 inherit_from => [ "BASE_unix", asm("mips32_asm") ],
311 cflags => picker(default => "-DB_ENDIAN",
314 bn_ops => "BN_LLONG RC4_CHAR",
315 thread_scheme => "(unknown)",
316 perlasm_scheme => "o32",
317 dso_scheme => "dlfcn",
318 shared_target => "irix-shared",
319 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
322 inherit_from => [ "BASE_unix", asm("mips32_asm") ],
324 cflags => picker(default => "-use_readonly_const -DB_ENDIAN",
327 bn_ops => "BN_LLONG RC4_CHAR",
328 thread_scheme => "(unknown)",
329 perlasm_scheme => "o32",
330 dso_scheme => "dlfcn",
331 shared_target => "irix-shared",
332 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
334 #### IRIX 6.x configs
335 # Only N32 and N64 ABIs are supported. If you need O32 ABI build, invoke
336 # './Configure irix-cc -o32' manually.
337 "irix-mips3-gcc" => {
338 inherit_from => [ "BASE_unix", asm("mips64_asm") ],
340 cflags => combine(picker(default => "-mabi=n32 -DB_ENDIAN -DBN_DIV3W",
343 threads("-D_SGI_MP_SOURCE -pthread")),
344 bn_ops => "RC4_CHAR SIXTY_FOUR_BIT",
345 thread_scheme => "pthreads",
346 perlasm_scheme => "n32",
347 dso_scheme => "dlfcn",
348 shared_target => "irix-shared",
349 shared_ldflag => "-mabi=n32",
350 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
354 inherit_from => [ "BASE_unix", asm("mips64_asm") ],
356 cflags => combine(picker(default => "-n32 -mips3 -use_readonly_const -G0 -rdata_shared -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_ldflag => "-n32",
367 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
371 "irix64-mips4-gcc" => {
372 inherit_from => [ "BASE_unix", asm("mips64_asm") ],
374 cflags => combine(picker(default => "-mabi=64 -mips4 -DB_ENDIAN -DBN_DIV3W",
377 threads("-D_SGI_MP_SOURCE")),
378 bn_ops => "RC4_CHAR SIXTY_FOUR_BIT_LONG",
379 thread_scheme => "pthreads",
380 perlasm_scheme => "64",
381 dso_scheme => "dlfcn",
382 shared_target => "irix-shared",
383 shared_ldflag => "-mabi=64",
384 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
387 "irix64-mips4-cc" => {
388 inherit_from => [ "BASE_unix", asm("mips64_asm") ],
390 cflags => combine(picker(default => "-64 -mips4 -use_readonly_const -G0 -rdata_shared -DB_ENDIAN -DBN_DIV3W",
393 threads("-D_SGI_MP_SOURCE")),
394 ex_libs => add(threads("-lpthread")),
395 bn_ops => "RC4_CHAR SIXTY_FOUR_BIT_LONG",
396 thread_scheme => "pthreads",
397 perlasm_scheme => "64",
398 dso_scheme => "dlfcn",
399 shared_target => "irix-shared",
400 shared_ldflag => "-64",
401 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
405 #### Unified HP-UX ANSI C configs.
407 # - Originally we were optimizing at +O4 level. It should be noted
408 # that the only difference between +O3 and +O4 is global inter-
409 # procedural analysis. As it has to be performed during the link
410 # stage the compiler leaves behind certain pseudo-code in lib*.a
411 # which might be release or even patch level specific. Generating
412 # the machine code for and analyzing the *whole* program appears
413 # to be *extremely* memory demanding while the performance gain is
414 # actually questionable. The situation is intensified by the default
415 # HP-UX data set size limit (infamous 'maxdsiz' tunable) of 64MB
416 # which is way too low for +O4. In other words, doesn't +O3 make
418 # - Keep in mind that the HP compiler by default generates code
419 # suitable for execution on the host you're currently compiling at.
420 # If the toolkit is meant to be used on various PA-RISC processors
421 # consider './Configure hpux-parisc-[g]cc +DAportable'.
422 # - -DMD32_XARRAY triggers workaround for compiler bug we ran into in
423 # 32-bit message digests. (For the moment of this writing) HP C
424 # doesn't seem to "digest" too many local variables (they make "him"
425 # chew forever:-). For more details look-up MD32_XARRAY comment in
426 # crypto/sha/sha_lcl.h.
427 # - originally there were 32-bit hpux-parisc2-* targets. They were
428 # scrapped, because a) they were not interchangeable with other 32-bit
429 # targets; a) when critical 32-bit assembly modules detect if they
430 # are executed on PA-RISC 2.0 and thus adequate performance is
432 # <appro@fy.chalmers.se>
433 "hpux-parisc-gcc" => {
434 inherit_from => [ "BASE_unix" ],
436 cflags => combine(picker(default => "-DB_ENDIAN -DBN_DIV2W",
439 threads("-pthread")),
440 ex_libs => add("-Wl,+s -ldld"),
441 bn_ops => "BN_LLONG",
442 thread_scheme => "pthreads",
444 shared_target => "hpux-shared",
445 shared_cflag => "-fPIC",
446 shared_ldflag => "-shared",
447 shared_extension => ".sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
449 "hpux-parisc1_1-gcc" => {
450 inherit_from => [ "hpux-parisc-gcc", asm("parisc11_asm") ],
451 multilib => "/pa1.1",
453 "hpux64-parisc2-gcc" => {
454 inherit_from => [ "BASE_unix", asm("parisc20_64_asm") ],
456 cflags => combine(picker(default => "-DB_ENDIAN",
459 threads("-D_REENTRANT")),
460 ex_libs => add("-ldl"),
461 bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
462 thread_scheme => "pthreads",
463 dso_scheme => "dlfcn",
464 shared_target => "hpux-shared",
465 shared_cflag => "-fpic",
466 shared_ldflag => "-shared",
467 shared_extension => ".sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
468 multilib => "/pa20_64",
471 # More attempts at unified 10.X and 11.X targets for HP C compiler.
473 # Chris Ruemmler <ruemmler@cup.hp.com>
474 # Kevin Steves <ks@hp.se>
475 "hpux-parisc-cc" => {
476 inherit_from => [ "BASE_unix" ],
478 cflags => combine(picker(default => "+Optrs_strongly_typed -Ae +ESlit -DB_ENDIAN -DBN_DIV2W -DMD32_XARRAY",
479 debug => "+O0 +d -g",
481 threads("-D_REENTRANT")),
482 ex_libs => add("-Wl,+s -ldld",threads("-lpthread")),
483 bn_ops => "RC4_CHAR",
484 thread_scheme => "pthreads",
486 shared_target => "hpux-shared",
487 shared_cflag => "+Z",
488 shared_ldflag => "-b",
489 shared_extension => ".sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
491 "hpux-parisc1_1-cc" => {
492 inherit_from => [ "hpux-parisc-cc", asm("parisc11_asm") ],
493 cflags => add_before("+DA1.1"),
494 multilib => "/pa1.1",
496 "hpux64-parisc2-cc" => {
497 inherit_from => [ "BASE_unix", asm("parisc20_64_asm") ],
499 cflags => combine(picker(default => "+DD64 +Optrs_strongly_typed -Ae +ESlit -DB_ENDIAN -DMD32_XARRAY",
500 debug => "+O0 +d -g",
502 threads("-D_REENTRANT")),
503 ex_libs => add("-ldl",threads("-lpthread")),
504 bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
505 thread_scheme => "pthreads",
506 dso_scheme => "dlfcn",
507 shared_target => "hpux-shared",
508 shared_cflag => "+Z",
509 shared_ldflag => "+DD64 -b",
510 shared_extension => ".sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
511 multilib => "/pa20_64",
514 # HP/UX IA-64 targets
516 inherit_from => [ "BASE_unix", asm("ia64_asm") ],
518 cflags => combine(picker(default => "-Ae +DD32 +Olit=all -z -DB_ENDIAN",
519 debug => "+O0 +d -g",
521 threads("-D_REENTRANT")),
522 ex_libs => add("-ldl",threads("-lpthread")),
523 bn_ops => "SIXTY_FOUR_BIT",
524 thread_scheme => "pthreads",
525 dso_scheme => "dlfcn",
526 shared_target => "hpux-shared",
527 shared_cflag => "+Z",
528 shared_ldflag => "+DD32 -b",
529 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
530 multilib => "/hpux32",
532 # Frank Geurts <frank.geurts@nl.abnamro.com> has patiently assisted
533 # with debugging of the following config.
534 "hpux64-ia64-cc" => {
535 inherit_from => [ "BASE_unix", asm("ia64_asm") ],
537 cflags => combine(picker(default => "-Ae +DD64 +Olit=all -z -DB_ENDIAN",
538 debug => "+O0 +d -g",
540 threads("-D_REENTRANT")),
541 ex_libs => add("-ldl", threads("-lpthread")),
542 bn_ops => "SIXTY_FOUR_BIT_LONG",
543 thread_scheme => "pthreads",
544 dso_scheme => "dlfcn",
545 shared_target => "hpux-shared",
546 shared_cflag => "+Z",
547 shared_ldflag => "+DD64 -b",
548 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
549 multilib => "/hpux64",
553 inherit_from => [ "BASE_unix", asm("ia64_asm") ],
555 cflags => combine(picker(default => "-DB_ENDIAN",
558 threads("-pthread")),
559 ex_libs => add("-ldl"),
560 bn_ops => "SIXTY_FOUR_BIT",
561 thread_scheme => "pthreads",
562 dso_scheme => "dlfcn",
563 shared_target => "hpux-shared",
564 shared_cflag => "-fpic",
565 shared_ldflag => "-shared",
566 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
567 multilib => "/hpux32",
569 "hpux64-ia64-gcc" => {
570 inherit_from => [ "BASE_unix", asm("ia64_asm") ],
572 cflags => combine(picker(default => "-mlp64 -DB_ENDIAN",
575 threads("-pthread")),
576 ex_libs => add("-ldl"),
577 bn_ops => "SIXTY_FOUR_BIT_LONG",
578 thread_scheme => "pthreads",
579 dso_scheme => "dlfcn",
580 shared_target => "hpux-shared",
581 shared_cflag => "-fpic",
582 shared_ldflag => "-mlp64 -shared",
583 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
584 multilib => "/hpux64",
587 #### HP MPE/iX http://jazz.external.hp.com/src/openssl/
589 inherit_from => [ "BASE_unix" ],
591 cflags => "-D_ENDIAN -DBN_DIV2W -O3 -D_POSIX_SOURCE -D_SOCKET_SOURCE -I/SYSLOG/PUB",
593 ex_libs => add("-L/SYSLOG/PUB -lsyslog -lsocket -lcurses"),
594 thread_scheme => "(unknown)",
595 bn_ops => "BN_LLONG",
598 #### DEC Alpha OSF/1/Tru64 targets.
599 "osf1-alpha-gcc" => {
600 inherit_from => [ "BASE_unix", asm("alpha_asm") ],
603 bn_ops => "SIXTY_FOUR_BIT_LONG",
604 thread_scheme => "(unknown)",
605 dso_scheme => "dlfcn",
606 shared_target => "alpha-osf1-shared",
607 shared_extension => ".so",
610 inherit_from => [ "BASE_unix", asm("alpha_asm") ],
612 cflags => "-std1 -tune host -O4 -readonly_strings",
613 bn_ops => "SIXTY_FOUR_BIT_LONG",
614 thread_scheme => "(unknown)",
615 dso_scheme => "dlfcn",
616 shared_target => "alpha-osf1-shared",
617 shared_extension => ".so",
619 "tru64-alpha-cc" => {
620 inherit_from => [ "BASE_unix", asm("alpha_asm") ],
622 cflags => combine("-std1 -tune host -fast -readonly_strings",
623 threads("-pthread")),
624 bn_ops => "SIXTY_FOUR_BIT_LONG",
625 thread_scheme => "pthreads",
626 dso_scheme => "dlfcn",
627 shared_target => "alpha-osf1-shared",
628 shared_ldflag => "-msym",
629 shared_extension => ".so",
633 #### Variety of LINUX:-)
635 # *-generic* is endian-neutral target, but ./config is free to
636 # throw in -D[BL]_ENDIAN, whichever appropriate...
637 "linux-generic32" => {
638 inherit_from => [ "BASE_unix" ],
640 cflags => combine(picker(default => "-Wall",
643 threads("-pthread")),
644 ex_libs => add("-ldl"),
645 bn_ops => "BN_LLONG RC4_CHAR",
646 thread_scheme => "pthreads",
647 dso_scheme => "dlfcn",
648 shared_target => "linux-shared",
649 shared_cflag => "-fPIC",
650 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
652 "linux-generic64" => {
653 inherit_from => [ "linux-generic32" ],
654 bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
658 inherit_from => [ "linux-generic32", asm("ppc32_asm") ],
659 perlasm_scheme => "linux32",
662 inherit_from => [ "linux-generic64", asm("ppc64_asm") ],
663 cflags => add("-m64 -DB_ENDIAN"),
664 perlasm_scheme => "linux64",
665 shared_ldflag => "-m64",
669 inherit_from => [ "linux-generic64", asm("ppc64_asm") ],
670 cflags => add("-m64 -DL_ENDIAN"),
671 perlasm_scheme => "linux64le",
672 shared_ldflag => "-m64",
676 ################################################################
677 # Note that -march is not among compiler options in linux-armv4
678 # target description. Not specifying one is intentional to give
681 # a) rely on your compiler default by not specifying one;
682 # b) specify your target platform explicitly for optimal
683 # performance, e.g. -march=armv6 or -march=armv7-a;
684 # c) build "universal" binary that targets *range* of platforms
685 # by specifying minimum and maximum supported architecture;
687 # As for c) option. It actually makes no sense to specify
688 # maximum to be less than ARMv7, because it's the least
689 # requirement for run-time switch between platform-specific
690 # code paths. And without run-time switch performance would be
691 # equivalent to one for minimum. Secondly, there are some
692 # natural limitations that you'd have to accept and respect.
693 # Most notably you can *not* build "universal" binary for
694 # big-endian platform. This is because ARMv7 processor always
695 # picks instructions in little-endian order. Another similar
696 # limitation is that -mthumb can't "cross" -march=armv6t2
697 # boundary, because that's where it became Thumb-2. Well, this
698 # limitation is a bit artificial, because it's not really
699 # impossible, but it's deemed too tricky to support. And of
700 # course you have to be sure that your binutils are actually
701 # up to the task of handling maximum target platform. With all
702 # this in mind here is an example of how to configure
705 # ./Configure linux-armv4 -march=armv6 -D__ARM_MAX_ARCH__=8
707 inherit_from => [ "linux-generic32", asm("armv4_asm") ],
708 perlasm_scheme => "linux32",
711 inherit_from => [ "linux-generic64", asm("aarch64_asm") ],
712 perlasm_scheme => "linux64",
714 "linux-arm64ilp32" => { # https://wiki.linaro.org/Platform/arm64-ilp32
715 inherit_from => [ "linux-generic32", asm("aarch64_asm") ],
716 cflags => add("-mabi=ilp32"),
717 bn_ops => "SIXTY_FOUR_BIT RC4_CHAR",
718 perlasm_scheme => "linux64",
719 shared_ldflag => "-mabi=ilp32",
723 # Configure script adds minimally required -march for assembly
724 # support, if no -march was specified at command line.
725 inherit_from => [ "linux-generic32", asm("mips32_asm") ],
726 cflags => add("-mabi=32 -DBN_DIV3W"),
727 perlasm_scheme => "o32",
728 shared_ldflag => "-mabi=32",
730 # mips32 and mips64 below refer to contemporary MIPS Architecture
731 # specifications, MIPS32 and MIPS64, rather than to kernel bitness.
733 inherit_from => [ "linux-generic32", asm("mips64_asm") ],
734 cflags => add("-mabi=n32 -DBN_DIV3W"),
735 bn_ops => "SIXTY_FOUR_BIT RC4_CHAR",
736 perlasm_scheme => "n32",
737 shared_ldflag => "-mabi=n32",
740 "linux64-mips64" => {
741 inherit_from => [ "linux-generic64", asm("mips64_asm") ],
742 cflags => add("-mabi=64 -DBN_DIV3W"),
743 perlasm_scheme => "64",
744 shared_ldflag => "-mabi=64",
748 #### IA-32 targets...
750 inherit_from => [ "linux-generic32", asm("x86_elf_asm") ],
751 cflags => add(picker(default => "-DL_ENDIAN",
752 release => "-fomit-frame-pointer")),
753 ex_libs => add(picker(debug => "-lefence")),
754 bn_ops => "BN_LLONG",
757 inherit_from => [ "BASE_unix", asm("x86_asm") ],
759 cflags => add(picker(default => "-DL_ENDIAN -Wall",
761 release => "-O3 -fomit-frame-pointer")),
762 bn_ops => "BN_LLONG",
763 thread_scheme => "(unknown)",
764 perlasm_scheme => "a.out",
768 inherit_from => [ "linux-generic64", asm("x86_64_asm") ],
769 cflags => add("-m64 -DL_ENDIAN"),
770 bn_ops => "SIXTY_FOUR_BIT_LONG",
771 perlasm_scheme => "elf",
772 shared_ldflag => "-m64",
775 "linux-x86_64-clang" => {
776 inherit_from => [ "linux-x86_64" ],
778 cflags => add("-Wextra -Qunused-arguments"),
781 inherit_from => [ "linux-generic32", asm("x86_64_asm") ],
782 cflags => add("-mx32 -DL_ENDIAN"),
783 bn_ops => "SIXTY_FOUR_BIT",
784 perlasm_scheme => "elf32",
785 shared_ldflag => "-mx32",
790 inherit_from => [ "linux-generic64", asm("ia64_asm") ],
791 bn_ops => "SIXTY_FOUR_BIT_LONG",
795 inherit_from => [ "linux-generic64", asm("s390x_asm") ],
796 cflags => add("-m64 -DB_ENDIAN"),
797 perlasm_scheme => "64",
798 shared_ldflag => "-m64",
802 #### So called "highgprs" target for z/Architecture CPUs
803 # "Highgprs" is kernel feature first implemented in Linux
804 # 2.6.32, see /proc/cpuinfo. The idea is to preserve most
805 # significant bits of general purpose registers not only
806 # upon 32-bit process context switch, but even on
807 # asynchronous signal delivery to such process. This makes
808 # it possible to deploy 64-bit instructions even in legacy
809 # application context and achieve better [or should we say
810 # adequate] performance. The build is binary compatible with
811 # linux-generic32, and the idea is to be able to install the
812 # resulting libcrypto.so alongside generic one, e.g. as
813 # /lib/highgprs/libcrypto.so.x.y, for ldconfig and run-time
814 # linker to autodiscover. Unfortunately it doesn't work just
815 # yet, because of couple of bugs in glibc
816 # sysdeps/s390/dl-procinfo.c affecting ldconfig and ld.so.1...
818 inherit_from => [ "linux-generic32", asm("s390x_asm") ],
819 cflags => add("-m31 -Wa,-mzarch -DB_ENDIAN"),
820 bn_asm_src => sub { my $r=join(" ",@_); $r=~s|asm/s390x\.S|bn_asm.c|; $r; },
821 perlasm_scheme => "31",
822 shared_ldflag => "-m31",
823 multilib => "/highgprs",
826 #### SPARC Linux setups
827 # Ray Miller <ray.miller@computing-services.oxford.ac.uk> has
828 # patiently assisted with debugging of following two configs.
830 inherit_from => [ "linux-generic32", asm("sparcv8_asm") ],
831 cflags => add("-mcpu=v8 -DB_ENDIAN -DBN_DIV2W"),
834 # it's a real mess with -mcpu=ultrasparc option under Linux,
835 # but -Wa,-Av8plus should do the trick no matter what.
836 inherit_from => [ "linux-generic32", asm("sparcv9_asm") ],
837 cflags => add("-m32 -mcpu=ultrasparc -Wa,-Av8plus -DB_ENDIAN -DBN_DIV2W"),
838 shared_ldflag => "-m32",
840 "linux64-sparcv9" => {
841 # GCC 3.1 is a requirement
842 inherit_from => [ "linux-generic64", asm("sparcv9_asm") ],
843 cflags => add("-m64 -mcpu=ultrasparc -DB_ENDIAN"),
844 bn_ops => "BN_LLONG RC4_CHAR",
845 shared_ldflag => "-m64",
849 "linux-alpha-gcc" => {
850 inherit_from => [ "linux-generic64", asm("alpha_asm") ],
851 cflags => add("-DL_ENDIAN"),
852 bn_ops => "SIXTY_FOUR_BIT_LONG",
854 "linux-c64xplus" => {
855 inherit_from => [ "BASE_unix" ],
856 # TI_CGT_C6000_7.3.x is a requirement
858 cflags => combine("--linux -ea=.s -eo=.o -mv6400+ -o2 -ox -ms -pden -DOPENSSL_SMALL_FOOTPRINT",
859 threads("-D_REENTRANT")),
860 bn_ops => "BN_LLONG",
861 cpuid_asm_src => "c64xpluscpuid.s",
862 bn_asm_src => "asm/bn-c64xplus.asm c64xplus-gf2m.s",
863 aes_asm_src => "aes-c64xplus.s aes_cbc.c aes-ctr.fake",
864 sha1_asm_src => "sha1-c64xplus.s sha256-c64xplus.s sha512-c64xplus.s",
865 rc4_asm_src => "rc4-c64xplus.s",
866 modes_asm_src => "ghash-c64xplus.s",
867 chacha_asm_src => "chacha-c64xplus.s",
868 poly1305_asm_src => "poly1305-c64xplus.s",
869 thread_scheme => "pthreads",
870 perlasm_scheme => "void",
871 dso_scheme => "dlfcn",
872 shared_target => "linux-shared",
873 shared_cflag => "--pic",
874 shared_ldflag => "-z --sysv --shared",
875 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
879 #### Android: linux-* but without pointers to headers and libs.
881 # It takes pair of prior-set environment variables to make it work:
883 # CROSS_SYSROOT=/some/where/android-ndk-<ver>/platforms/android-<apiver>/arch-<
884 # CROSS_COMPILE=<prefix>
886 # As well as PATH adjusted to cover ${CROSS_COMPILE}gcc and company.
887 # For example to compile for ICS and ARM with NDK 10d, you'd:
889 # ANDROID_NDK=/some/where/android-ndk-10d
890 # CROSS_SYSROOT=$ANDROID_NDK/platforms/android-14/arch-arm
891 # CROSS_COMPILE=arm-linux-adroideabi-
892 # PATH=$ANDROID_NDK/toolchains/arm-linux-androideabi-4.8/prebuild/linux-x86_64/
895 inherit_from => [ "linux-generic32" ],
896 # Special note about unconditional -fPIC and -pie. The underlying
897 # reason is that Lollipop refuses to run non-PIE. But what about
898 # older systems and NDKs? -fPIC was never problem, so the only
899 # concern is -pie. Older toolchains, e.g. r4, appear to handle it
900 # and binaries turn mostly functional. "Mostly" means that oldest
901 # Androids, such as Froyo, fail to handle executable, but newer
902 # systems are perfectly capable of executing binaries targeting
903 # Froyo. Keep in mind that in the nutshell Android builds are
904 # about JNI, i.e. shared libraries, not applications.
905 cflags => add(picker(default => "-mandroid -fPIC --sysroot=\$(CROSS_SYSROOT) -Wa,--noexecstack")),
906 bin_cflags => "-pie",
909 inherit_from => [ "android", asm("x86_asm") ],
910 cflags => add(picker(release => "-fomit-frame-pointer")),
911 bn_ops => "BN_LLONG",
912 perlasm_scheme => "android",
914 ################################################################
915 # Contemporary Android applications can provide multiple JNI
916 # providers in .apk, targeting multiple architectures. Among
917 # them there is "place" for two ARM flavours: generic eabi and
918 # armv7-a/hard-float. However, it should be noted that OpenSSL's
919 # ability to engage NEON is not constrained by ABI choice, nor
920 # is your ability to call OpenSSL from your application code
921 # compiled with floating-point ABI other than default 'soft'.
922 # [Latter thanks to __attribute__((pcs("aapcs"))) declaration.]
923 # This means that choice of ARM libraries you provide in .apk
924 # is driven by application needs. For example if application
925 # itself benefits from NEON or is floating-point intensive, then
926 # it might be appropriate to provide both libraries. Otherwise
927 # just generic eabi would do. But in latter case it would be
930 # ./Configure android-armeabi -D__ARM_MAX_ARCH__=8
932 # in order to build "universal" binary and allow OpenSSL take
933 # advantage of NEON when it's available.
935 "android-armeabi" => {
936 inherit_from => [ "android", asm("armv4_asm") ],
939 inherit_from => [ "android", asm("mips32_asm") ],
940 perlasm_scheme => "o32",
944 inherit_from => [ "linux-generic64" ],
945 cflags => add(picker(default => "-mandroid -fPIC --sysroot=\$(CROSS_SYSROOT) -Wa,--noexecstack")),
946 bin_cflags => "-pie",
948 "android64-aarch64" => {
949 inherit_from => [ "android64", asm("aarch64_asm") ],
950 perlasm_scheme => "linux64",
955 # As for thread cflag. Idea is to maintain "collective" set of
956 # flags, which would cover all BSD flavors. -pthread applies
957 # to them all, but is treated differently. OpenBSD expands is
958 # as -D_POSIX_THREAD -lc_r, which is sufficient. FreeBSD 4.x
959 # expands it as -lc_r, which has to be accompanied by explicit
960 # -D_THREAD_SAFE and sometimes -D_REENTRANT. FreeBSD 5.x
961 # expands it as -lc_r, which seems to be sufficient?
962 inherit_from => [ "BASE_unix" ],
964 cflags => combine(picker(default => "-Wall",
967 threads("-pthread -D_THREAD_SAFE -D_REENTRANT")),
968 bn_ops => "BN_LLONG",
969 thread_scheme => "pthreads",
970 dso_scheme => "dlfcn",
971 shared_target => "bsd-gcc-shared",
972 shared_cflag => "-fPIC",
973 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
976 inherit_from => [ "BSD-generic32" ],
977 bn_ops => "SIXTY_FOUR_BIT_LONG",
981 inherit_from => [ "BSD-generic32", asm("x86_asm") ],
982 cflags => add(picker(default => "-DL_ENDIAN",
983 release => "-fomit-frame-pointer")),
984 bn_ops => "BN_LLONG",
985 shared_target => "bsd-shared",
986 perlasm_scheme => "a.out",
989 inherit_from => [ "BSD-x86" ],
990 perlasm_scheme => "elf",
994 inherit_from => [ "BSD-generic32", asm("sparcv8_asm") ],
995 cflags => add("-mcpu=v8 -DB_ENDIAN"),
998 # -DMD32_REG_T=int doesn't actually belong in sparc64 target, it
999 # simply *happens* to work around a compiler bug in gcc 3.3.3,
1000 # triggered by RIPEMD160 code.
1001 inherit_from => [ "BSD-generic64", asm("sparcv9_asm") ],
1002 cflags => add("-DB_ENDIAN -DMD32_REG_T=int"),
1003 bn_ops => "BN_LLONG",
1007 inherit_from => [ "BSD-generic64", asm("ia64_asm") ],
1008 cflags => add_before("-DL_ENDIAN"),
1009 bn_ops => "SIXTY_FOUR_BIT_LONG",
1013 inherit_from => [ "BSD-generic64", asm("x86_64_asm") ],
1014 cflags => add_before("-DL_ENDIAN"),
1015 bn_ops => "SIXTY_FOUR_BIT_LONG",
1016 perlasm_scheme => "elf",
1020 inherit_from => [ "BASE_unix", asm("x86_elf_asm") ],
1022 cflags => "-DPERL5 -DL_ENDIAN -fomit-frame-pointer -O3 -Wall",
1023 ex_libs => add("-ldl"),
1024 bn_ops => "BN_LLONG",
1025 thread_scheme => "(unknown)",
1026 dso_scheme => "dlfcn",
1027 shared_target => "bsd-gcc-shared",
1028 shared_cflag => "-fPIC",
1029 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
1033 inherit_from => [ "BASE_unix" ],
1035 cflags => "-O -Wall",
1036 unistd => "<libc.h>",
1037 bn_ops => "BN_LLONG",
1038 thread_scheme => "(unknown)",
1041 inherit_from => [ "BASE_unix" ],
1043 cflags => "-O3 -Wall",
1044 unistd => "<libc.h>",
1045 bn_ops => "BN_LLONG",
1046 thread_scheme => "(unknown)",
1051 inherit_from => [ "BASE_unix" ],
1053 cflags => "-DL_ENDIAN -DTERMIO",
1054 thread_scheme => "(unknown)",
1057 inherit_from => [ "BASE_unix" ],
1059 ex_libs => add("-lsocket"),
1060 dso_scheme => "dlfcn",
1061 shared_target => "bsd-gcc-shared",
1062 shared_cflag => "-fPIC",
1063 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
1066 inherit_from => [ "BASE_unix", asm("x86_elf_asm") ],
1068 cflags => "-DL_ENDIAN -O2 -Wall",
1069 ex_libs => add("-lsocket"),
1070 dso_scheme => "dlfcn",
1071 shared_target => "bsd-gcc-shared",
1072 shared_cflag => "-fPIC",
1073 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
1076 #### SCO/Caldera targets.
1078 # Originally we had like unixware-*, unixware-*-pentium, unixware-*-p6, etc.
1079 # Now we only have blended unixware-* as it's the only one used by ./config.
1080 # If you want to optimize for particular microarchitecture, bypass ./config
1081 # and './Configure unixware-7 -Kpentium_pro' or whatever appropriate.
1082 # Note that not all targets include assembler support. Mostly because of
1083 # lack of motivation to support out-of-date platforms with out-of-date
1084 # compiler drivers and assemblers. Tim Rice <tim@multitalents.net> has
1085 # patiently assisted to debug most of it.
1087 # UnixWare 2.0x fails destest with -O.
1089 inherit_from => [ "BASE_unix" ],
1091 cflags => combine("-DFILIO_H -DNO_STRINGS_H",
1092 threads("-Kthread")),
1093 ex_libs => add("-lsocket -lnsl -lresolv -lx"),
1094 thread_scheme => "uithreads",
1097 inherit_from => [ "BASE_unix" ],
1099 cflags => combine("-O -DFILIO_H",
1100 threads("-Kthread")),
1101 ex_libs => add("-lsocket -lnsl -lresolv -lx"),
1102 thread_scheme => "uithreads",
1105 inherit_from => [ "BASE_unix", asm("x86_elf_asm") ],
1107 cflags => combine("-O -DFILIO_H -Kalloca",
1108 threads("-Kthread")),
1109 ex_libs => add("-lsocket -lnsl"),
1110 thread_scheme => "uithreads",
1111 bn_ops => "BN_LLONG",
1112 perlasm_scheme => "elf-1",
1113 dso_scheme => "dlfcn",
1114 shared_target => "svr5-shared",
1115 shared_cflag => "-Kpic",
1116 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
1118 "unixware-7-gcc" => {
1119 inherit_from => [ "BASE_unix", asm("x86_elf_asm") ],
1121 cflags => combine("-DL_ENDIAN -DFILIO_H -O3 -fomit-frame-pointer -Wall",
1122 threads("-D_REENTRANT")),
1123 ex_libs => add("-lsocket -lnsl"),
1124 bn_ops => "BN_LLONG",
1125 thread_scheme => "pthreads",
1126 perlasm_scheme => "elf-1",
1127 dso_scheme => "dlfcn",
1128 shared_target => "gnu-shared",
1129 shared_cflag => "-fPIC",
1130 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
1132 # SCO 5 - Ben Laurie <ben@algroup.co.uk> says the -O breaks the SCO cc.
1134 inherit_from => [ "BASE_unix", asm("x86_elf_asm") ],
1137 ex_libs => add("-lsocket -lnsl"),
1138 thread_scheme => "(unknown)",
1139 perlasm_scheme => "elf-1",
1140 dso_scheme => "dlfcn",
1141 shared_target => "svr3-shared",
1142 shared_cflag => "-Kpic",
1143 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
1146 inherit_from => [ "BASE_unix", asm("x86_elf_asm") ],
1148 cflags => "-O3 -fomit-frame-pointer",
1149 ex_libs => add("-lsocket -lnsl"),
1150 bn_ops => "BN_LLONG",
1151 thread_scheme => "(unknown)",
1152 perlasm_scheme => "elf-1",
1153 dso_scheme => "dlfcn",
1154 shared_target => "svr3-shared",
1155 shared_cflag => "-fPIC",
1156 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
1161 inherit_from => [ "BASE_unix", asm("ppc32_asm") ],
1163 cflags => combine(picker(default => "-DB_ENDIAN",
1166 threads("-pthread")),
1168 bn_ops => "BN_LLONG RC4_CHAR",
1169 thread_scheme => "pthreads",
1170 perlasm_scheme => "aix32",
1171 dso_scheme => "dlfcn",
1172 shared_target => "aix-shared",
1173 shared_ldflag => "-shared -Wl,-G",
1174 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
1178 inherit_from => [ "BASE_unix", asm("ppc64_asm") ],
1180 cflags => combine(picker(default => "-maix64 -DB_ENDIAN",
1183 threads("-pthread")),
1185 bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
1186 thread_scheme => "pthreads",
1187 perlasm_scheme => "aix64",
1188 dso_scheme => "dlfcn",
1189 shared_target => "aix-shared",
1190 shared_ldflag => "-maix64 -shared -Wl,-G",
1191 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
1194 # Below targets assume AIX 5. Idea is to effectively disregard
1195 # $OBJECT_MODE at build time. $OBJECT_MODE is respected at
1198 inherit_from => [ "BASE_unix", asm("ppc32_asm") ],
1200 cflags => combine(picker(default => "-q32 -DB_ENDIAN -qmaxmem=16384 -qro -qroconst",
1203 threads("-qthreaded -D_THREAD_SAFE")),
1205 bn_ops => "BN_LLONG RC4_CHAR",
1206 thread_scheme => "pthreads",
1207 perlasm_scheme => "aix32",
1208 dso_scheme => "dlfcn",
1209 shared_target => "aix-shared",
1210 shared_ldflag => "-q32 -G",
1211 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
1215 inherit_from => [ "BASE_unix", asm("ppc64_asm") ],
1217 cflags => combine(picker(default => "-q64 -DB_ENDIAN -qmaxmem=16384 -qro -qroconst",
1220 threads("-qthreaded -D_THREAD_SAFE")),
1222 bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
1223 thread_scheme => "pthreads",
1224 perlasm_scheme => "aix64",
1225 dso_scheme => "dlfcn",
1226 shared_target => "aix-shared",
1227 shared_ldflag => "-q64 -G",
1228 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
1232 # SIEMENS BS2000/OSD: an EBCDIC-based mainframe
1234 inherit_from => [ "BASE_unix" ],
1236 cflags => "-O -XLLML -XLLMK -XL -DB_ENDIAN -DCHARSET_EBCDIC",
1237 ex_libs => add("-lsocket -lnsl"),
1238 bn_ops => "THIRTY_TWO_BIT RC4_CHAR",
1239 thread_scheme => "(unknown)",
1242 # OS/390 Unix an EBCDIC-based Unix system on IBM mainframe
1243 # You need to compile using the c89.sh wrapper in the tools directory, because the
1244 # IBM compiler does not like the -L switch after any object modules.
1247 inherit_from => [ "BASE_unix" ],
1249 cflags => "-O -DB_ENDIAN -DCHARSET_EBCDIC -DNO_SYS_PARAM_H -D_ALL_SOURCE",
1250 bn_ops => "THIRTY_TWO_BIT RC4_CHAR",
1251 thread_scheme => "(unknown)",
1254 #### Visual C targets
1256 # Win64 targets, WIN64I denotes IA-64 and WIN64A - AMD64
1258 # Note about -wd4090, disable warning C4090. This warning returns false
1259 # positives in some situations. Disabling it altogether masks both
1260 # legitimate and false cases, but as we compile on multiple platforms,
1261 # we rely on other compilers to catch legitimate cases.
1263 # Also note that we force threads no matter what. Configuring "no-threads"
1266 inherit_from => [ "BASE_Windows" ],
1269 cflags => "-W3 -wd4090 -Gs0 -GF -Gy -nologo -DOPENSSL_SYS_WIN32 -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -D_CRT_SECURE_NO_DEPRECATE",
1270 defines => add(sub { my @defs = ();
1271 unless ($disabled{"zlib-dynamic"}) {
1274 'LIBZ="' . $withargs{zlib_lib} . '"');
1281 lib_cflags => add("/Zi /Fdlib"),
1282 dso_cflags => "/Zi",
1283 bin_cflags => "/Zi /Fdapp",
1284 lflags => add("/debug"),
1285 shared_ldflag => "/dll",
1286 shared_target => "win-shared", # meaningless except it gives Configure a hint
1287 thread_scheme => "winthreads",
1288 dso_scheme => "win32",
1290 "VC-noCE-common" => {
1291 inherit_from => [ "VC-common" ],
1292 cflags => add(picker(default => "-DUNICODE -D_UNICODE",
1295 ($disabled{shared} ? "" : "/MDd")
1296 ." /Od -DDEBUG -D_DEBUG";
1300 ($disabled{shared} ? "" : "/MD")
1303 lib_cflags => add(sub { $disabled{shared} ? "/MT /Zl" : () }),
1304 # Following might/should appears controversial, i.e. defining
1305 # /MDd without evaluating $disabled{shared}. It works in
1306 # non-shared build because static library is compiled with /Zl
1307 # and bares no reference to specific RTL. And it works in
1308 # shared build because multiple /MDd options are not prohibited.
1309 # But why /MDd in static build? Well, basically this is just a
1310 # reference point, which allows to catch eventual errors that
1311 # would prevent those who want to wrap OpenSSL into own .DLL.
1312 # Why not /MD in release build then? Well, some are likely to
1313 # prefer [non-debug] openssl.exe to be free from Micorosoft RTL
1315 bin_cflags => add(picker(debug => "/MDd",
1316 release => sub { $disabled{shared} ? "/MT" : () },
1318 bin_lflags => add("/subsystem:console /opt:ref"),
1319 ex_libs => add(sub {
1321 push @ex_libs, 'ws2_32.lib' unless $disabled{sock};
1322 push @ex_libs, 'gdi32.lib advapi32.lib crypt32.lib user32.lib';
1323 return join(" ", @ex_libs);
1326 "VC-WIN64-common" => {
1327 inherit_from => [ "VC-noCE-common" ],
1328 ex_libs => add(sub {
1330 push @ex_libs, 'bufferoverflowu.lib' if (`cl 2>&1` =~ /14\.00\.4[0-9]{4}\./);
1331 return join(" ", @_, @ex_libs);
1333 bn_ops => "SIXTY_FOUR_BIT EXPORT_VAR_AS_FN",
1334 build_scheme => add("VC-W64", { separator => undef }),
1337 inherit_from => [ "VC-WIN64-common", asm("ia64_asm"),
1338 sub { $disabled{shared} ? () : "ia64_uplink" } ],
1340 asflags => "-d debug",
1343 bn_asm_src => sub { return undef unless @_;
1344 my $r=join(" ",@_); $r=~s|bn-ia64.s|bn_asm.c|; $r; },
1345 perlasm_scheme => "ias",
1346 multilib => "-ia64",
1349 inherit_from => [ "VC-WIN64-common", asm("x86_64_asm"),
1350 sub { $disabled{shared} ? () : "x86_64_uplink" } ],
1351 as => sub { vc_win64a_info()->{as} },
1352 asflags => sub { vc_win64a_info()->{asflags} },
1353 asoutflag => sub { vc_win64a_info()->{asoutflag} },
1355 bn_asm_src => sub { return undef unless @_;
1356 my $r=join(" ",@_); $r=~s|asm/x86_64-gcc|bn_asm|; $r; },
1357 perlasm_scheme => "auto",
1361 # x86 Win32 target defaults to ANSI API, if you want UNICODE,
1362 # configure with 'perl Configure VC-WIN32 -DUNICODE -D_UNICODE'
1363 inherit_from => [ "VC-noCE-common", asm("x86_asm"),
1364 sub { $disabled{shared} ? () : "uplink_common" } ],
1365 as => sub { vc_win32_info()->{as} },
1366 asflags => sub { vc_win32_info()->{asflags} },
1367 asoutflag => sub { vc_win32_info()->{asoutflag} },
1368 ex_libs => add(sub {
1370 # WIN32 UNICODE build gets linked with unicows.lib for
1371 # backward compatibility with Win9x.
1372 push @ex_libs, 'unicows.lib'
1373 if (grep { $_ eq "UNICODE" } @user_defines);
1374 return join(" ", @ex_libs, @_);
1377 bn_ops => "BN_LLONG EXPORT_VAR_AS_FN",
1378 perlasm_scheme => sub { vc_win32_info()->{perlasm_scheme} },
1379 build_scheme => add("VC-W32", { separator => undef }),
1382 inherit_from => [ "VC-common" ],
1384 asflags => "/nologo /Cp /coff /c /Cx /Zi",
1389 combine('/W3 /WX /GF /Gy /nologo -DUNICODE -D_UNICODE -DOPENSSL_SYS_WINCE -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -DDSO_WIN32 -DNO_CHMOD -DOPENSSL_SMALL_FOOTPRINT',
1390 sub { vc_wince_info()->{cflags}; },
1391 sub { defined($ENV{'WCECOMPAT'})
1392 ? '-I$(WCECOMPAT)/include' : (); },
1393 sub { defined($ENV{'PORTSDK_LIBPATH'})
1394 ? '-I$(PORTSDK_LIBPATH)/../../include' : (); },
1395 sub { `cl 2>&1` =~ /Version ([0-9]+)\./ && $1>=14
1396 ? ($disabled{shared} ? " /MT" : " /MD")
1398 debug => "/Od -DDEBUG -D_DEBUG",
1400 lflags => combine("/nologo /opt:ref",
1401 sub { vc_wince_info()->{lflags}; },
1402 sub { defined($ENV{PORTSDK_LIBPATH})
1403 ? "/entry:mainCRTstartup" : (); }),
1405 bn_ops => "BN_LLONG EXPORT_VAR_AS_FN",
1406 ex_libs => add(sub {
1408 push @ex_libs, 'ws2.lib' unless $disabled{sock};
1409 push @ex_libs, 'crypt32.lib';
1410 if (defined($ENV{WCECOMPAT})) {
1411 my $x = '$(WCECOMPAT)/lib';
1412 if (-f "$x/$ENV{TARGETCPU}/wcecompatex.lib") {
1413 $x .= '/$(TARGETCPU)/wcecompatex.lib';
1415 $x .= '/wcecompatex.lib';
1419 push @ex_libs, '$(PORTSDK_LIBPATH)/portlib.lib'
1420 if (defined($ENV{'PORTSDK_LIBPATH'}));
1421 push @ex_libs, ' /nodefaultlib coredll.lib corelibc.lib'
1422 if ($ENV{'TARGETCPU'} eq "X86");
1425 build_scheme => add("VC-WCE", { separator => undef }),
1430 inherit_from => [ "BASE_unix", asm("x86_asm"),
1431 sub { $disabled{shared} ? () : "x86_uplink" } ],
1433 cflags => combine(picker(default => "-DL_ENDIAN -DWIN32_LEAN_AND_MEAN -DUNICODE -D_UNICODE -m32 -Wall",
1435 release => "-O3 -fomit-frame-pointer"),
1437 sys_id => "MINGW32",
1438 ex_libs => add("-lws2_32 -lgdi32 -lcrypt32"),
1439 bn_ops => "BN_LLONG EXPORT_VAR_AS_FN",
1440 thread_scheme => "winthreads",
1441 perlasm_scheme => "coff",
1442 dso_scheme => "win32",
1443 shared_target => "mingw-shared",
1444 shared_cflag => add("-D_WINDLL"),
1445 shared_ldflag => "-static-libgcc",
1446 shared_rcflag => "--target=pe-i386",
1447 shared_extension => ".dll",
1451 # As for OPENSSL_USE_APPLINK. Applink makes it possible to use
1452 # .dll compiled with one compiler with application compiled with
1453 # another compiler. It's possible to engage Applink support in
1454 # mingw64 build, but it's not done, because till mingw64
1455 # supports structured exception handling, one can't seriously
1456 # consider its binaries for using with non-mingw64 run-time
1457 # environment. And as mingw64 is always consistent with itself,
1458 # Applink is never engaged and can as well be omitted.
1459 inherit_from => [ "BASE_unix", asm("x86_64_asm") ],
1461 cflags => combine(picker(default => "-DL_ENDIAN -DWIN32_LEAN_AND_MEAN -DUNICODE -D_UNICODE -m64 -Wall",
1465 sys_id => "MINGW64",
1466 ex_libs => add("-lws2_32 -lgdi32 -lcrypt32"),
1467 bn_ops => "SIXTY_FOUR_BIT EXPORT_VAR_AS_FN",
1468 thread_scheme => "winthreads",
1469 perlasm_scheme => "mingw64",
1470 dso_scheme => "win32",
1471 shared_target => "mingw-shared",
1472 shared_cflag => add("-D_WINDLL"),
1473 shared_ldflag => "-static-libgcc",
1474 shared_rcflag => "--target=pe-x86-64",
1475 shared_extension => ".dll",
1481 inherit_from => [ "BASE_unix" ],
1483 cflags => "-DL_ENDIAN -O",
1489 inherit_from => [ "BASE_unix" ],
1491 cflags => "-DTERMIOS -DL_ENDIAN -O -Wall",
1493 bn_ops => "BN_LLONG",
1494 dso_scheme => "win32",
1499 inherit_from => [ "BASE_unix", asm("x86_asm") ],
1501 cflags => picker(default => "-DTERMIOS -DL_ENDIAN -Wall",
1503 release => "-O3 -fomit-frame-pointer"),
1505 bn_ops => "BN_LLONG",
1506 thread_scheme => "pthread",
1507 perlasm_scheme => "coff",
1508 dso_scheme => "dlfcn",
1509 shared_target => "cygwin-shared",
1510 shared_cflag => "-D_WINDLL",
1511 shared_ldflag => "-shared",
1512 shared_extension => ".dll",
1514 "Cygwin-x86_64" => {
1515 inherit_from => [ "BASE_unix", asm("x86_64_asm") ],
1517 cflags => picker(default => "-DTERMIOS -DL_ENDIAN -Wall",
1521 bn_ops => "SIXTY_FOUR_BIT_LONG",
1522 thread_scheme => "pthread",
1523 perlasm_scheme => "mingw64",
1524 dso_scheme => "dlfcn",
1525 shared_target => "cygwin-shared",
1526 shared_cflag => "-D_WINDLL",
1527 shared_ldflag => "-shared",
1528 shared_extension => ".dll",
1530 # Backward compatibility for those using this target
1532 inherit_from => [ "Cygwin-x86" ]
1534 # In case someone constructs the Cygwin target name themself
1536 inherit_from => [ "Cygwin-x86" ]
1539 inherit_from => [ "Cygwin-x86" ]
1542 inherit_from => [ "Cygwin-x86" ]
1545 inherit_from => [ "Cygwin-x86" ]
1550 inherit_from => [ asm("x86_asm") ],
1552 cflags => "-I/dev/env/WATT_ROOT/inc -DTERMIO -DL_ENDIAN -fomit-frame-pointer -O2 -Wall",
1554 ex_libs => add("-L/dev/env/WATT_ROOT/lib -lwatt"),
1555 bn_ops => "BN_LLONG",
1556 perlasm_scheme => "a.out",
1559 ##### MacOS X (a.k.a. Darwin) setup
1560 "darwin-common" => {
1561 inherit_from => [ "BASE_unix" ],
1564 cflags => combine(picker(default => "",
1567 threads("-D_REENTRANT")),
1569 plib_lflags => "-Wl,-search_paths_first",
1570 bn_ops => "BN_LLONG RC4_CHAR",
1571 thread_scheme => "pthreads",
1572 perlasm_scheme => "osx32",
1573 dso_scheme => "dlfcn",
1574 ranlib => "ranlib -c",
1575 shared_target => "darwin-shared",
1576 shared_cflag => "-fPIC",
1577 shared_ldflag => "-dynamiclib",
1578 shared_extension => ".\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
1580 # Option "freeze" such as -std=gnu9x can't negatively interfere
1581 # with future defaults for below two targets, because MacOS X
1582 # for PPC has no future, it was discontinued by vendor in 2009.
1583 "darwin-ppc-cc" => {
1584 inherit_from => [ "darwin-common", asm("ppc32_asm") ],
1585 cflags => add("-arch ppc -std=gnu9x -DB_ENDIAN -Wa,-force_cpusubtype_ALL"),
1586 perlasm_scheme => "osx32",
1587 shared_ldflag => "-arch ppc -dynamiclib",
1589 "darwin64-ppc-cc" => {
1590 inherit_from => [ "darwin-common", asm("ppc64_asm") ],
1591 cflags => add("-arch ppc64 -std=gnu9x -DB_ENDIAN"),
1592 bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
1593 perlasm_scheme => "osx64",
1594 shared_ldflag => "-arch ppc64 -dynamiclib",
1596 "darwin-i386-cc" => {
1597 inherit_from => [ "darwin-common", asm("x86_asm") ],
1598 cflags => add(picker(default => "-arch i386 -DL_ENDIAN",
1599 release => "-fomit-frame-pointer")),
1600 bn_ops => "BN_LLONG RC4_INT",
1601 perlasm_scheme => "macosx",
1602 shared_ldflag => "-arch i386 -dynamiclib",
1604 "darwin64-x86_64-cc" => {
1605 inherit_from => [ "darwin-common", asm("x86_64_asm") ],
1606 cflags => add("-arch x86_64 -DL_ENDIAN -Wall"),
1607 bn_ops => "SIXTY_FOUR_BIT_LONG",
1608 perlasm_scheme => "macosx",
1609 shared_ldflag => "-arch x86_64 -dynamiclib",
1614 # It takes three prior-set environment variables to make it work:
1616 # CROSS_COMPILE=/where/toolchain/is/usr/bin/ [note ending slash]
1617 # CROSS_TOP=/where/SDKs/are
1618 # CROSS_SDK=iPhoneOSx.y.sdk
1620 # Exact paths vary with Xcode releases, but for couple of last ones
1621 # they would look like this:
1623 # CROSS_COMPILE=`xcode-select --print-path`/Toolchains/XcodeDefault.xctoolchain/usr/bin/
1624 # CROSS_TOP=`xcode-select --print-path`/Platforms/iPhoneOS.platform/Developer
1625 # CROSS_SDK=iPhoneOS.sdk
1627 "iphoneos-cross" => {
1628 inherit_from => [ "darwin-common" ],
1629 cflags => add("-isysroot \$(CROSS_TOP)/SDKs/\$(CROSS_SDK) -fno-common"),
1633 inherit_from => [ "darwin-common", asm("armv4_asm") ],
1634 # It should be possible to go below iOS 6 and even add -arch armv6,
1635 # thus targeting iPhone pre-3GS, but it's assumed to be irrelevant
1637 cflags => add("-arch armv7 -mios-version-min=6.0.0 -isysroot \$(CROSS_TOP)/SDKs/\$(CROSS_SDK) -fno-common"),
1639 perlasm_scheme => "ios32",
1642 inherit_from => [ "darwin-common", asm("aarch64_asm") ],
1643 cflags => add("-arch arm64 -mios-version-min=7.0.0 -isysroot \$(CROSS_TOP)/SDKs/\$(CROSS_SDK) -fno-common"),
1645 bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
1646 perlasm_scheme => "ios64",
1651 inherit_from => [ "BASE_unix" ],
1652 inherit_from => [ asm("x86_elf_asm") ],
1654 cflags => combine("-DL_ENDIAN -O3 -fomit-frame-pointer -Wall",
1655 threads("-pthread")),
1656 ex_libs => add("-ldl"),
1657 bn_ops => "BN_LLONG",
1658 thread_scheme => "pthreads",
1659 dso_scheme => "dlfcn",
1660 shared_target => "linux-shared",
1661 shared_cflag => "-fPIC",
1664 ##### VxWorks for various targets
1665 "vxworks-ppc60x" => {
1666 inherit_from => [ "BASE_unix" ],
1668 cflags => "-D_REENTRANT -mrtp -mhard-float -mstrict-align -fno-implicit-fp -DPPC32_fp60x -O2 -fstrength-reduce -fno-builtin -fno-strict-aliasing -Wall -DCPU=PPC32 -DTOOL_FAMILY=gnu -DTOOL=gnu -I\$(WIND_BASE)/target/usr/h -I\$(WIND_BASE)/target/usr/h/wrn/coreip",
1669 sys_id => "VXWORKS",
1670 ex_libs => add("-Wl,--defsym,__wrs_rtp_base=0xe0000000 -L \$(WIND_BASE)/target/usr/lib/ppc/PPC32/common"),
1672 "vxworks-ppcgen" => {
1673 inherit_from => [ "BASE_unix" ],
1675 cflags => "-D_REENTRANT -mrtp -msoft-float -mstrict-align -O1 -fno-builtin -fno-strict-aliasing -Wall -DCPU=PPC32 -DTOOL_FAMILY=gnu -DTOOL=gnu -I\$(WIND_BASE)/target/usr/h -I\$(WIND_BASE)/target/usr/h/wrn/coreip",
1676 sys_id => "VXWORKS",
1677 ex_libs => add("-Wl,--defsym,__wrs_rtp_base=0xe0000000 -L \$(WIND_BASE)/target/usr/lib/ppc/PPC32/sfcommon"),
1679 "vxworks-ppc405" => {
1680 inherit_from => [ "BASE_unix" ],
1682 cflags => "-g -msoft-float -mlongcall -DCPU=PPC405 -I\$(WIND_BASE)/target/h",
1683 sys_id => "VXWORKS",
1686 "vxworks-ppc750" => {
1687 inherit_from => [ "BASE_unix" ],
1689 cflags => "-ansi -nostdinc -DPPC750 -D_REENTRANT -fvolatile -fno-builtin -fno-for-scope -fsigned-char -Wall -msoft-float -mlongcall -DCPU=PPC604 -I\$(WIND_BASE)/target/h \$(DEBUG_FLAG)",
1690 sys_id => "VXWORKS",
1693 "vxworks-ppc750-debug" => {
1694 inherit_from => [ "BASE_unix" ],
1696 cflags => "-ansi -nostdinc -DPPC750 -D_REENTRANT -fvolatile -fno-builtin -fno-for-scope -fsigned-char -Wall -msoft-float -mlongcall -DCPU=PPC604 -I\$(WIND_BASE)/target/h -DPEDANTIC -DDEBUG -g",
1697 sys_id => "VXWORKS",
1700 "vxworks-ppc860" => {
1701 inherit_from => [ "BASE_unix" ],
1703 cflags => "-nostdinc -msoft-float -DCPU=PPC860 -DNO_STRINGS_H -I\$(WIND_BASE)/target/h",
1704 sys_id => "VXWORKS",
1707 "vxworks-simlinux" => {
1708 inherit_from => [ "BASE_unix" ],
1710 cflags => "-B\$(WIND_BASE)/host/\$(WIND_HOST_TYPE)/lib/gcc-lib/ -D_VSB_CONFIG_FILE=\"\$(WIND_BASE)/target/lib/h/config/vsbConfig.h\" -DL_ENDIAN -DCPU=SIMLINUX -DTOOL_FAMILY=gnu -DTOOL=gnu -fno-builtin -fno-defer-pop -DNO_STRINGS_H -I\$(WIND_BASE)/target/h -I\$(WIND_BASE)/target/h/wrn/coreip -DOPENSSL_NO_HW_PADLOCK",
1711 sys_id => "VXWORKS",
1713 ranlib => "ranlibpentium",
1716 inherit_from => [ "BASE_unix", asm("mips32_asm") ],
1718 cflags => combine("-mrtp -mips2 -O -G 0 -B\$(WIND_BASE)/host/\$(WIND_HOST_TYPE)/lib/gcc-lib/ -D_VSB_CONFIG_FILE=\"\$(WIND_BASE)/target/lib/h/config/vsbConfig.h\" -DCPU=MIPS32 -msoft-float -mno-branch-likely -DTOOL_FAMILY=gnu -DTOOL=gnu -fno-builtin -fno-defer-pop -DNO_STRINGS_H -I\$(WIND_BASE)/target/usr/h -I\$(WIND_BASE)/target/h/wrn/coreip",
1719 threads("-D_REENTRANT")),
1720 sys_id => "VXWORKS",
1721 ex_libs => add("-Wl,--defsym,__wrs_rtp_base=0xe0000000 -L \$(WIND_BASE)/target/usr/lib/mips/MIPSI32/sfcommon"),
1722 thread_scheme => "pthreads",
1723 perlasm_scheme => "o32",
1724 ranlib => "ranlibmips",
1729 inherit_from => [ "BASE_unix" ],
1731 cflags => combine("\$(CFLAGS)",
1732 threads("-D_REENTRANT")),
1733 plib_lflags => "\$(LDFLAGS)",
1734 ex_libs => add("\$(LDLIBS)"),
1735 bn_ops => "BN_LLONG",
1736 thread_scheme => "pthreads",
1737 dso_scheme => "$ENV{'LIBSSL_dlfcn'}",
1738 shared_target => "linux-shared",
1739 shared_cflag => "-fPIC",
1740 shared_ldflag => "-shared",
1741 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
1742 ranlib => "$ENV{'RANLIB'}",
1744 "uClinux-dist64" => {
1745 inherit_from => [ "BASE_unix" ],
1747 cflags => combine("\$(CFLAGS)",
1748 threads("-D_REENTRANT")),
1749 plib_lflags => "\$(LDFLAGS)",
1750 ex_libs => add("\$(LDLIBS)"),
1751 bn_ops => "SIXTY_FOUR_BIT_LONG",
1752 thread_scheme => "pthreads",
1753 dso_scheme => "$ENV{'LIBSSL_dlfcn'}",
1754 shared_target => "linux-shared",
1755 shared_cflag => "-fPIC",
1756 shared_ldflag => "-shared",
1757 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
1758 ranlib => "$ENV{'RANLIB'}",
1763 cflags => add_before(picker(default => "-DL_ENDIAN -Wall",
1766 threads("-D_REENTRANT")),
1768 lflags => "-lnetwork",
1769 perlasm_scheme => "elf",
1770 thread_scheme => "pthreads",
1771 dso_scheme => "dlfcn",
1772 shared_target => "haiku-shared",
1773 shared_cflag => "-fPIC",
1774 shared_ldflag => "-shared",
1775 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
1778 inherit_from => [ "haiku-common", asm("x86_elf_asm") ],
1779 cflags => add(picker(default => "",
1780 release => "-fomit-frame-pointer")),
1781 bn_ops => "BN_LLONG",
1783 # Haiku builds with no-asm
1785 inherit_from => [ "haiku-common", asm("x86_64_asm") ],
1786 cflags => add("-m64"),
1787 bn_ops => "SIXTY_FOUR_BIT_LONG",
1793 inherit_from => [ "BASE_VMS" ],
1796 cflags => picker(default => "/STANDARD=RELAXED/NOLIST/PREFIX=ALL",
1797 debug => "/NOOPTIMIZE/DEBUG",
1798 release => "/OPTIMIZE/NODEBUG"),
1799 lflags => picker(default => "/MAP",
1800 debug => "/DEBUG/TRACEBACK",
1801 release => "/NODEBUG/NOTRACEBACK"),
1802 lib_cflags => add("/NAMES=(AS_IS,SHORTENED)"),
1803 dso_cflags => add("/NAMES=(AS_IS,SHORTENED)"),
1804 shared_target => "vms-shared",
1805 dso_scheme => "vms",
1806 thread_scheme => "pthreads",
1808 apps_aux_src => "vms_decc_init.c",
1811 # VMS on VAX is *unsupported*
1814 # bn_obj => "[.asm]vms.obj vms-helper.obj"
1817 # inherit_from => [ "vms-generic", asm("vms-asm") ],
1819 # debug_aflags => "/NOOPTIMIZE/DEBUG",
1820 # release_aflags => "/OPTIMIZE/NODEBUG",
1821 # bn_opts => "THIRTY_TWO_BIT RC4_CHAR RC4_CHUNK DES_PTR BF_PTR",
1824 inherit_from => [ "vms-generic" ],
1825 cflags => add(sub { my @warnings =
1826 @{vms_info(0)->{disable_warns}};
1828 ? "/WARNINGS=DISABLE=(".join(",",@warnings).")" : (); }),
1831 return vms_info(0)->{def_zlib}
1832 ? "LIBZ=\"\"\"".vms_info(0)->{def_zlib}."\"\"\"" : ();
1834 ex_libs => add(sub { return vms_info(0)->{zlib} || (); }),
1836 #debug_aflags => "/NOOPTIMIZE/DEBUG",
1837 #release_aflags => "/OPTIMIZE/NODEBUG",
1838 bn_opts => "SIXTY_FOUR_BIT RC4_INT RC4_CHUNK_LL DES_PTR BF_PTR",
1840 "vms-alpha-p32" => {
1841 inherit_from => [ "vms-generic" ],
1843 add("/POINTER_SIZE=32",
1844 sub { my @warnings =
1845 @{vms_info(32)->{disable_warns}};
1847 ? "/WARNINGS=DISABLE=(".join(",",@warnings).")" : ();
1851 return vms_info(32)->{def_zlib}
1852 ? "LIBZ=\"\"\"".vms_info(32)->{def_zlib}."\"\"\"" : ();
1854 ex_libs => add(sub { return vms_info(32)->{zlib} || (); }),
1856 "vms-alpha-p64" => {
1857 inherit_from => [ "vms-generic" ],
1859 add("/POINTER_SIZE=64=ARGV",
1860 sub { my @warnings =
1861 @{vms_info(64)->{disable_warns}};
1863 ? "/WARNINGS=DISABLE=(".join(",",@warnings).")" : ();
1867 return vms_info(64)->{def_zlib}
1868 ? "LIBZ=\"\"\"".vms_info(64)->{def_zlib}."\"\"\"" : ();
1870 ex_libs => add(sub { return vms_info(64)->{zlib} || (); }),
1873 inherit_from => [ "vms-generic" ],
1874 cflags => add(sub { my @warnings =
1875 @{vms_info(0)->{disable_warns}};
1877 ? "/WARNINGS=DISABLE=(".join(",",@warnings).")" : (); }),
1880 return vms_info(0)->{def_zlib}
1881 ? "LIBZ=\"\"\"".vms_info(0)->{def_zlib}."\"\"\"" : ();
1883 ex_libs => add(sub { return vms_info(0)->{zlib} || (); }),
1885 #debug_aflags => "/NOOPTIMIZE/DEBUG",
1886 #release_aflags => "/OPTIMIZE/NODEBUG",
1887 bn_opts => "SIXTY_FOUR_BIT RC4_INT RC4_CHUNK_LL DES_PTR BF_PTR",
1890 inherit_from => [ "vms-generic" ],
1892 add("/POINTER_SIZE=32",
1893 sub { my @warnings =
1894 @{vms_info(32)->{disable_warns}};
1896 ? "/WARNINGS=DISABLE=(".join(",",@warnings).")" : ();
1900 return vms_info(32)->{def_zlib}
1901 ? "LIBZ=\"\"\"".vms_info(32)->{def_zlib}."\"\"\"" : ();
1903 ex_libs => add(sub { return vms_info(32)->{zlib} || (); }),
1906 inherit_from => [ "vms-generic" ],
1908 add("/POINTER_SIZE=64=ARGV",
1909 sub { my @warnings =
1910 @{vms_info(64)->{disable_warns}};
1912 ? "/WARNINGS=DISABLE=(".join(",",@warnings).")" : ();
1916 return vms_info(64)->{def_zlib}
1917 ? "LIBZ=\"\"\"".vms_info(64)->{def_zlib}."\"\"\"" : ();
1919 ex_libs => add(sub { return vms_info(64)->{zlib} || (); }),