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 Tru64 targets. Tru64 is marketing name for OSF/1 version 4
599 #### and forward. In reality 'uname -s' still returns "OSF1". Originally
600 #### there were even osf1-* configs targeting prior versions provided,
601 #### but not anymore...
602 "tru64-alpha-gcc" => {
603 inherit_from => [ "BASE_unix", asm("alpha_asm") ],
605 cflags => combine("-std=c9x -D_XOPEN_SOURCE=500 -D_OSF_SOURCE -O3",
606 threads("-pthread")),
607 ex_libs => "-lrt", # for mlock(2)
608 bn_ops => "SIXTY_FOUR_BIT_LONG",
609 thread_scheme => "pthreads",
610 dso_scheme => "dlfcn",
611 shared_target => "alpha-osf1-shared",
612 shared_extension => ".so",
614 "tru64-alpha-cc" => {
615 inherit_from => [ "BASE_unix", asm("alpha_asm") ],
617 cflags => combine("-std1 -D_XOPEN_SOURCE=500 -D_OSF_SOURCE -tune host -fast -readonly_strings",
618 threads("-pthread")),
619 ex_libs => "-lrt", # for mlock(2)
620 bn_ops => "SIXTY_FOUR_BIT_LONG",
621 thread_scheme => "pthreads",
622 dso_scheme => "dlfcn",
623 shared_target => "alpha-osf1-shared",
624 shared_ldflag => "-msym",
625 shared_extension => ".so",
629 #### Variety of LINUX:-)
631 # *-generic* is endian-neutral target, but ./config is free to
632 # throw in -D[BL]_ENDIAN, whichever appropriate...
633 "linux-generic32" => {
634 inherit_from => [ "BASE_unix" ],
636 cflags => combine(picker(default => "-Wall",
639 threads("-pthread")),
640 ex_libs => add("-ldl"),
641 bn_ops => "BN_LLONG RC4_CHAR",
642 thread_scheme => "pthreads",
643 dso_scheme => "dlfcn",
644 shared_target => "linux-shared",
645 shared_cflag => "-fPIC",
646 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
648 "linux-generic64" => {
649 inherit_from => [ "linux-generic32" ],
650 bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
654 inherit_from => [ "linux-generic32", asm("ppc32_asm") ],
655 perlasm_scheme => "linux32",
658 inherit_from => [ "linux-generic64", asm("ppc64_asm") ],
659 cflags => add("-m64 -DB_ENDIAN"),
660 perlasm_scheme => "linux64",
661 shared_ldflag => "-m64",
665 inherit_from => [ "linux-generic64", asm("ppc64_asm") ],
666 cflags => add("-m64 -DL_ENDIAN"),
667 perlasm_scheme => "linux64le",
668 shared_ldflag => "-m64",
672 ################################################################
673 # Note that -march is not among compiler options in linux-armv4
674 # target description. Not specifying one is intentional to give
677 # a) rely on your compiler default by not specifying one;
678 # b) specify your target platform explicitly for optimal
679 # performance, e.g. -march=armv6 or -march=armv7-a;
680 # c) build "universal" binary that targets *range* of platforms
681 # by specifying minimum and maximum supported architecture;
683 # As for c) option. It actually makes no sense to specify
684 # maximum to be less than ARMv7, because it's the least
685 # requirement for run-time switch between platform-specific
686 # code paths. And without run-time switch performance would be
687 # equivalent to one for minimum. Secondly, there are some
688 # natural limitations that you'd have to accept and respect.
689 # Most notably you can *not* build "universal" binary for
690 # big-endian platform. This is because ARMv7 processor always
691 # picks instructions in little-endian order. Another similar
692 # limitation is that -mthumb can't "cross" -march=armv6t2
693 # boundary, because that's where it became Thumb-2. Well, this
694 # limitation is a bit artificial, because it's not really
695 # impossible, but it's deemed too tricky to support. And of
696 # course you have to be sure that your binutils are actually
697 # up to the task of handling maximum target platform. With all
698 # this in mind here is an example of how to configure
701 # ./Configure linux-armv4 -march=armv6 -D__ARM_MAX_ARCH__=8
703 inherit_from => [ "linux-generic32", asm("armv4_asm") ],
704 perlasm_scheme => "linux32",
707 inherit_from => [ "linux-generic64", asm("aarch64_asm") ],
708 perlasm_scheme => "linux64",
710 "linux-arm64ilp32" => { # https://wiki.linaro.org/Platform/arm64-ilp32
711 inherit_from => [ "linux-generic32", asm("aarch64_asm") ],
712 cflags => add("-mabi=ilp32"),
713 bn_ops => "SIXTY_FOUR_BIT RC4_CHAR",
714 perlasm_scheme => "linux64",
715 shared_ldflag => "-mabi=ilp32",
719 # Configure script adds minimally required -march for assembly
720 # support, if no -march was specified at command line.
721 inherit_from => [ "linux-generic32", asm("mips32_asm") ],
722 cflags => add("-mabi=32 -DBN_DIV3W"),
723 perlasm_scheme => "o32",
724 shared_ldflag => "-mabi=32",
726 # mips32 and mips64 below refer to contemporary MIPS Architecture
727 # specifications, MIPS32 and MIPS64, rather than to kernel bitness.
729 inherit_from => [ "linux-generic32", asm("mips64_asm") ],
730 cflags => add("-mabi=n32 -DBN_DIV3W"),
731 bn_ops => "SIXTY_FOUR_BIT RC4_CHAR",
732 perlasm_scheme => "n32",
733 shared_ldflag => "-mabi=n32",
736 "linux64-mips64" => {
737 inherit_from => [ "linux-generic64", asm("mips64_asm") ],
738 cflags => add("-mabi=64 -DBN_DIV3W"),
739 perlasm_scheme => "64",
740 shared_ldflag => "-mabi=64",
744 #### IA-32 targets...
746 inherit_from => [ "linux-generic32", asm("x86_elf_asm") ],
747 cflags => add(picker(default => "-DL_ENDIAN",
748 release => "-fomit-frame-pointer")),
749 ex_libs => add(picker(debug => "-lefence")),
750 bn_ops => "BN_LLONG",
753 inherit_from => [ "BASE_unix", asm("x86_asm") ],
755 cflags => add(picker(default => "-DL_ENDIAN -Wall",
757 release => "-O3 -fomit-frame-pointer")),
758 bn_ops => "BN_LLONG",
759 thread_scheme => "(unknown)",
760 perlasm_scheme => "a.out",
764 inherit_from => [ "linux-generic64", asm("x86_64_asm") ],
765 cflags => add("-m64 -DL_ENDIAN"),
766 bn_ops => "SIXTY_FOUR_BIT_LONG",
767 perlasm_scheme => "elf",
768 shared_ldflag => "-m64",
771 "linux-x86_64-clang" => {
772 inherit_from => [ "linux-x86_64" ],
774 cflags => add("-Wextra -Qunused-arguments"),
777 inherit_from => [ "linux-generic32", asm("x86_64_asm") ],
778 cflags => add("-mx32 -DL_ENDIAN"),
779 bn_ops => "SIXTY_FOUR_BIT",
780 perlasm_scheme => "elf32",
781 shared_ldflag => "-mx32",
786 inherit_from => [ "linux-generic64", asm("ia64_asm") ],
787 bn_ops => "SIXTY_FOUR_BIT_LONG",
791 inherit_from => [ "linux-generic64", asm("s390x_asm") ],
792 cflags => add("-m64 -DB_ENDIAN"),
793 perlasm_scheme => "64",
794 shared_ldflag => "-m64",
798 #### So called "highgprs" target for z/Architecture CPUs
799 # "Highgprs" is kernel feature first implemented in Linux
800 # 2.6.32, see /proc/cpuinfo. The idea is to preserve most
801 # significant bits of general purpose registers not only
802 # upon 32-bit process context switch, but even on
803 # asynchronous signal delivery to such process. This makes
804 # it possible to deploy 64-bit instructions even in legacy
805 # application context and achieve better [or should we say
806 # adequate] performance. The build is binary compatible with
807 # linux-generic32, and the idea is to be able to install the
808 # resulting libcrypto.so alongside generic one, e.g. as
809 # /lib/highgprs/libcrypto.so.x.y, for ldconfig and run-time
810 # linker to autodiscover. Unfortunately it doesn't work just
811 # yet, because of couple of bugs in glibc
812 # sysdeps/s390/dl-procinfo.c affecting ldconfig and ld.so.1...
814 inherit_from => [ "linux-generic32", asm("s390x_asm") ],
815 cflags => add("-m31 -Wa,-mzarch -DB_ENDIAN"),
816 bn_asm_src => sub { my $r=join(" ",@_); $r=~s|asm/s390x\.S|bn_asm.c|; $r; },
817 perlasm_scheme => "31",
818 shared_ldflag => "-m31",
819 multilib => "/highgprs",
822 #### SPARC Linux setups
823 # Ray Miller <ray.miller@computing-services.oxford.ac.uk> has
824 # patiently assisted with debugging of following two configs.
826 inherit_from => [ "linux-generic32", asm("sparcv8_asm") ],
827 cflags => add("-mcpu=v8 -DB_ENDIAN -DBN_DIV2W"),
830 # it's a real mess with -mcpu=ultrasparc option under Linux,
831 # but -Wa,-Av8plus should do the trick no matter what.
832 inherit_from => [ "linux-generic32", asm("sparcv9_asm") ],
833 cflags => add("-m32 -mcpu=ultrasparc -Wa,-Av8plus -DB_ENDIAN -DBN_DIV2W"),
834 shared_ldflag => "-m32",
836 "linux64-sparcv9" => {
837 # GCC 3.1 is a requirement
838 inherit_from => [ "linux-generic64", asm("sparcv9_asm") ],
839 cflags => add("-m64 -mcpu=ultrasparc -DB_ENDIAN"),
840 bn_ops => "BN_LLONG RC4_CHAR",
841 shared_ldflag => "-m64",
845 "linux-alpha-gcc" => {
846 inherit_from => [ "linux-generic64", asm("alpha_asm") ],
847 cflags => add("-DL_ENDIAN"),
848 bn_ops => "SIXTY_FOUR_BIT_LONG",
850 "linux-c64xplus" => {
851 inherit_from => [ "BASE_unix" ],
852 # TI_CGT_C6000_7.3.x is a requirement
854 cflags => combine("--linux -ea=.s -eo=.o -mv6400+ -o2 -ox -ms -pden -DOPENSSL_SMALL_FOOTPRINT",
855 threads("-D_REENTRANT")),
856 bn_ops => "BN_LLONG",
857 cpuid_asm_src => "c64xpluscpuid.s",
858 bn_asm_src => "asm/bn-c64xplus.asm c64xplus-gf2m.s",
859 aes_asm_src => "aes-c64xplus.s aes_cbc.c aes-ctr.fake",
860 sha1_asm_src => "sha1-c64xplus.s sha256-c64xplus.s sha512-c64xplus.s",
861 rc4_asm_src => "rc4-c64xplus.s",
862 modes_asm_src => "ghash-c64xplus.s",
863 chacha_asm_src => "chacha-c64xplus.s",
864 poly1305_asm_src => "poly1305-c64xplus.s",
865 thread_scheme => "pthreads",
866 perlasm_scheme => "void",
867 dso_scheme => "dlfcn",
868 shared_target => "linux-shared",
869 shared_cflag => "--pic",
870 shared_ldflag => "-z --sysv --shared",
871 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
875 #### Android: linux-* but without pointers to headers and libs.
877 # It takes pair of prior-set environment variables to make it work:
879 # CROSS_SYSROOT=/some/where/android-ndk-<ver>/platforms/android-<apiver>/arch-<
880 # CROSS_COMPILE=<prefix>
882 # As well as PATH adjusted to cover ${CROSS_COMPILE}gcc and company.
883 # For example to compile for ICS and ARM with NDK 10d, you'd:
885 # ANDROID_NDK=/some/where/android-ndk-10d
886 # CROSS_SYSROOT=$ANDROID_NDK/platforms/android-14/arch-arm
887 # CROSS_COMPILE=arm-linux-adroideabi-
888 # PATH=$ANDROID_NDK/toolchains/arm-linux-androideabi-4.8/prebuild/linux-x86_64/
891 inherit_from => [ "linux-generic32" ],
892 # Special note about unconditional -fPIC and -pie. The underlying
893 # reason is that Lollipop refuses to run non-PIE. But what about
894 # older systems and NDKs? -fPIC was never problem, so the only
895 # concern is -pie. Older toolchains, e.g. r4, appear to handle it
896 # and binaries turn mostly functional. "Mostly" means that oldest
897 # Androids, such as Froyo, fail to handle executable, but newer
898 # systems are perfectly capable of executing binaries targeting
899 # Froyo. Keep in mind that in the nutshell Android builds are
900 # about JNI, i.e. shared libraries, not applications.
901 cflags => add(picker(default => "-mandroid -fPIC --sysroot=\$(CROSS_SYSROOT) -Wa,--noexecstack")),
902 bin_cflags => "-pie",
905 inherit_from => [ "android", asm("x86_asm") ],
906 cflags => add(picker(release => "-fomit-frame-pointer")),
907 bn_ops => "BN_LLONG",
908 perlasm_scheme => "android",
910 ################################################################
911 # Contemporary Android applications can provide multiple JNI
912 # providers in .apk, targeting multiple architectures. Among
913 # them there is "place" for two ARM flavours: generic eabi and
914 # armv7-a/hard-float. However, it should be noted that OpenSSL's
915 # ability to engage NEON is not constrained by ABI choice, nor
916 # is your ability to call OpenSSL from your application code
917 # compiled with floating-point ABI other than default 'soft'.
918 # [Latter thanks to __attribute__((pcs("aapcs"))) declaration.]
919 # This means that choice of ARM libraries you provide in .apk
920 # is driven by application needs. For example if application
921 # itself benefits from NEON or is floating-point intensive, then
922 # it might be appropriate to provide both libraries. Otherwise
923 # just generic eabi would do. But in latter case it would be
926 # ./Configure android-armeabi -D__ARM_MAX_ARCH__=8
928 # in order to build "universal" binary and allow OpenSSL take
929 # advantage of NEON when it's available.
931 "android-armeabi" => {
932 inherit_from => [ "android", asm("armv4_asm") ],
935 inherit_from => [ "android", asm("mips32_asm") ],
936 perlasm_scheme => "o32",
940 inherit_from => [ "linux-generic64" ],
941 cflags => add(picker(default => "-mandroid -fPIC --sysroot=\$(CROSS_SYSROOT) -Wa,--noexecstack")),
942 bin_cflags => "-pie",
944 "android64-aarch64" => {
945 inherit_from => [ "android64", asm("aarch64_asm") ],
946 perlasm_scheme => "linux64",
951 # As for thread cflag. Idea is to maintain "collective" set of
952 # flags, which would cover all BSD flavors. -pthread applies
953 # to them all, but is treated differently. OpenBSD expands is
954 # as -D_POSIX_THREAD -lc_r, which is sufficient. FreeBSD 4.x
955 # expands it as -lc_r, which has to be accompanied by explicit
956 # -D_THREAD_SAFE and sometimes -D_REENTRANT. FreeBSD 5.x
957 # expands it as -lc_r, which seems to be sufficient?
958 inherit_from => [ "BASE_unix" ],
960 cflags => combine(picker(default => "-Wall",
963 threads("-pthread -D_THREAD_SAFE -D_REENTRANT")),
964 bn_ops => "BN_LLONG",
965 thread_scheme => "pthreads",
966 dso_scheme => "dlfcn",
967 shared_target => "bsd-gcc-shared",
968 shared_cflag => "-fPIC",
969 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
972 inherit_from => [ "BSD-generic32" ],
973 bn_ops => "SIXTY_FOUR_BIT_LONG",
977 inherit_from => [ "BSD-generic32", asm("x86_asm") ],
978 cflags => add(picker(default => "-DL_ENDIAN",
979 release => "-fomit-frame-pointer")),
980 bn_ops => "BN_LLONG",
981 shared_target => "bsd-shared",
982 perlasm_scheme => "a.out",
985 inherit_from => [ "BSD-x86" ],
986 perlasm_scheme => "elf",
990 inherit_from => [ "BSD-generic32", asm("sparcv8_asm") ],
991 cflags => add("-mcpu=v8 -DB_ENDIAN"),
994 # -DMD32_REG_T=int doesn't actually belong in sparc64 target, it
995 # simply *happens* to work around a compiler bug in gcc 3.3.3,
996 # triggered by RIPEMD160 code.
997 inherit_from => [ "BSD-generic64", asm("sparcv9_asm") ],
998 cflags => add("-DB_ENDIAN -DMD32_REG_T=int"),
999 bn_ops => "BN_LLONG",
1003 inherit_from => [ "BSD-generic64", asm("ia64_asm") ],
1004 cflags => add_before("-DL_ENDIAN"),
1005 bn_ops => "SIXTY_FOUR_BIT_LONG",
1009 inherit_from => [ "BSD-generic64", asm("x86_64_asm") ],
1010 cflags => add_before("-DL_ENDIAN"),
1011 bn_ops => "SIXTY_FOUR_BIT_LONG",
1012 perlasm_scheme => "elf",
1016 inherit_from => [ "BASE_unix", asm("x86_elf_asm") ],
1018 cflags => "-DPERL5 -DL_ENDIAN -fomit-frame-pointer -O3 -Wall",
1019 ex_libs => add("-ldl"),
1020 bn_ops => "BN_LLONG",
1021 thread_scheme => "(unknown)",
1022 dso_scheme => "dlfcn",
1023 shared_target => "bsd-gcc-shared",
1024 shared_cflag => "-fPIC",
1025 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
1029 inherit_from => [ "BASE_unix" ],
1031 cflags => "-O -Wall",
1032 unistd => "<libc.h>",
1033 bn_ops => "BN_LLONG",
1034 thread_scheme => "(unknown)",
1037 inherit_from => [ "BASE_unix" ],
1039 cflags => "-O3 -Wall",
1040 unistd => "<libc.h>",
1041 bn_ops => "BN_LLONG",
1042 thread_scheme => "(unknown)",
1047 inherit_from => [ "BASE_unix" ],
1049 cflags => "-DL_ENDIAN -DTERMIO",
1050 thread_scheme => "(unknown)",
1053 inherit_from => [ "BASE_unix" ],
1055 ex_libs => add("-lsocket"),
1056 dso_scheme => "dlfcn",
1057 shared_target => "bsd-gcc-shared",
1058 shared_cflag => "-fPIC",
1059 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
1062 inherit_from => [ "BASE_unix", asm("x86_elf_asm") ],
1064 cflags => "-DL_ENDIAN -O2 -Wall",
1065 ex_libs => add("-lsocket"),
1066 dso_scheme => "dlfcn",
1067 shared_target => "bsd-gcc-shared",
1068 shared_cflag => "-fPIC",
1069 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
1072 #### SCO/Caldera targets.
1074 # Originally we had like unixware-*, unixware-*-pentium, unixware-*-p6, etc.
1075 # Now we only have blended unixware-* as it's the only one used by ./config.
1076 # If you want to optimize for particular microarchitecture, bypass ./config
1077 # and './Configure unixware-7 -Kpentium_pro' or whatever appropriate.
1078 # Note that not all targets include assembler support. Mostly because of
1079 # lack of motivation to support out-of-date platforms with out-of-date
1080 # compiler drivers and assemblers. Tim Rice <tim@multitalents.net> has
1081 # patiently assisted to debug most of it.
1083 # UnixWare 2.0x fails destest with -O.
1085 inherit_from => [ "BASE_unix" ],
1087 cflags => combine("-DFILIO_H -DNO_STRINGS_H",
1088 threads("-Kthread")),
1089 ex_libs => add("-lsocket -lnsl -lresolv -lx"),
1090 thread_scheme => "uithreads",
1093 inherit_from => [ "BASE_unix" ],
1095 cflags => combine("-O -DFILIO_H",
1096 threads("-Kthread")),
1097 ex_libs => add("-lsocket -lnsl -lresolv -lx"),
1098 thread_scheme => "uithreads",
1101 inherit_from => [ "BASE_unix", asm("x86_elf_asm") ],
1103 cflags => combine("-O -DFILIO_H -Kalloca",
1104 threads("-Kthread")),
1105 ex_libs => add("-lsocket -lnsl"),
1106 thread_scheme => "uithreads",
1107 bn_ops => "BN_LLONG",
1108 perlasm_scheme => "elf-1",
1109 dso_scheme => "dlfcn",
1110 shared_target => "svr5-shared",
1111 shared_cflag => "-Kpic",
1112 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
1114 "unixware-7-gcc" => {
1115 inherit_from => [ "BASE_unix", asm("x86_elf_asm") ],
1117 cflags => combine("-DL_ENDIAN -DFILIO_H -O3 -fomit-frame-pointer -Wall",
1118 threads("-D_REENTRANT")),
1119 ex_libs => add("-lsocket -lnsl"),
1120 bn_ops => "BN_LLONG",
1121 thread_scheme => "pthreads",
1122 perlasm_scheme => "elf-1",
1123 dso_scheme => "dlfcn",
1124 shared_target => "gnu-shared",
1125 shared_cflag => "-fPIC",
1126 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
1128 # SCO 5 - Ben Laurie <ben@algroup.co.uk> says the -O breaks the SCO cc.
1130 inherit_from => [ "BASE_unix", asm("x86_elf_asm") ],
1133 ex_libs => add("-lsocket -lnsl"),
1134 thread_scheme => "(unknown)",
1135 perlasm_scheme => "elf-1",
1136 dso_scheme => "dlfcn",
1137 shared_target => "svr3-shared",
1138 shared_cflag => "-Kpic",
1139 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
1142 inherit_from => [ "BASE_unix", asm("x86_elf_asm") ],
1144 cflags => "-O3 -fomit-frame-pointer",
1145 ex_libs => add("-lsocket -lnsl"),
1146 bn_ops => "BN_LLONG",
1147 thread_scheme => "(unknown)",
1148 perlasm_scheme => "elf-1",
1149 dso_scheme => "dlfcn",
1150 shared_target => "svr3-shared",
1151 shared_cflag => "-fPIC",
1152 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
1157 inherit_from => [ "BASE_unix", asm("ppc32_asm") ],
1159 cflags => combine(picker(default => "-DB_ENDIAN",
1162 threads("-pthread")),
1164 bn_ops => "BN_LLONG RC4_CHAR",
1165 thread_scheme => "pthreads",
1166 perlasm_scheme => "aix32",
1167 dso_scheme => "dlfcn",
1168 shared_target => "aix-shared",
1169 shared_ldflag => "-shared -Wl,-G",
1170 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
1174 inherit_from => [ "BASE_unix", asm("ppc64_asm") ],
1176 cflags => combine(picker(default => "-maix64 -DB_ENDIAN",
1179 threads("-pthread")),
1181 bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
1182 thread_scheme => "pthreads",
1183 perlasm_scheme => "aix64",
1184 dso_scheme => "dlfcn",
1185 shared_target => "aix-shared",
1186 shared_ldflag => "-maix64 -shared -Wl,-G",
1187 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
1190 # Below targets assume AIX 5. Idea is to effectively disregard
1191 # $OBJECT_MODE at build time. $OBJECT_MODE is respected at
1194 inherit_from => [ "BASE_unix", asm("ppc32_asm") ],
1196 cflags => combine(picker(default => "-q32 -DB_ENDIAN -qmaxmem=16384 -qro -qroconst",
1199 threads("-qthreaded -D_THREAD_SAFE")),
1201 bn_ops => "BN_LLONG RC4_CHAR",
1202 thread_scheme => "pthreads",
1203 perlasm_scheme => "aix32",
1204 dso_scheme => "dlfcn",
1205 shared_target => "aix-shared",
1206 shared_ldflag => "-q32 -G",
1207 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
1211 inherit_from => [ "BASE_unix", asm("ppc64_asm") ],
1213 cflags => combine(picker(default => "-q64 -DB_ENDIAN -qmaxmem=16384 -qro -qroconst",
1216 threads("-qthreaded -D_THREAD_SAFE")),
1218 bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
1219 thread_scheme => "pthreads",
1220 perlasm_scheme => "aix64",
1221 dso_scheme => "dlfcn",
1222 shared_target => "aix-shared",
1223 shared_ldflag => "-q64 -G",
1224 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
1228 # SIEMENS BS2000/OSD: an EBCDIC-based mainframe
1230 inherit_from => [ "BASE_unix" ],
1232 cflags => "-O -XLLML -XLLMK -XL -DB_ENDIAN -DCHARSET_EBCDIC",
1233 ex_libs => add("-lsocket -lnsl"),
1234 bn_ops => "THIRTY_TWO_BIT RC4_CHAR",
1235 thread_scheme => "(unknown)",
1238 # OS/390 Unix an EBCDIC-based Unix system on IBM mainframe
1239 # You need to compile using the c89.sh wrapper in the tools directory, because the
1240 # IBM compiler does not like the -L switch after any object modules.
1243 inherit_from => [ "BASE_unix" ],
1245 cflags => "-O -DB_ENDIAN -DCHARSET_EBCDIC -DNO_SYS_PARAM_H -D_ALL_SOURCE",
1246 bn_ops => "THIRTY_TWO_BIT RC4_CHAR",
1247 thread_scheme => "(unknown)",
1250 #### Visual C targets
1252 # Win64 targets, WIN64I denotes IA-64 and WIN64A - AMD64
1254 # Note about -wd4090, disable warning C4090. This warning returns false
1255 # positives in some situations. Disabling it altogether masks both
1256 # legitimate and false cases, but as we compile on multiple platforms,
1257 # we rely on other compilers to catch legitimate cases.
1259 # Also note that we force threads no matter what. Configuring "no-threads"
1262 inherit_from => [ "BASE_Windows" ],
1265 cflags => "-W3 -wd4090 -Gs0 -GF -Gy -nologo -DOPENSSL_SYS_WIN32 -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -D_CRT_SECURE_NO_DEPRECATE",
1266 defines => add(sub { my @defs = ();
1267 unless ($disabled{"zlib-dynamic"}) {
1270 'LIBZ="' . $withargs{zlib_lib} . '"');
1277 lib_cflags => add("/Zi /Fdlib"),
1278 dso_cflags => "/Zi",
1279 bin_cflags => "/Zi /Fdapp",
1280 lflags => add("/debug"),
1281 shared_ldflag => "/dll",
1282 shared_target => "win-shared", # meaningless except it gives Configure a hint
1283 thread_scheme => "winthreads",
1284 dso_scheme => "win32",
1286 "VC-noCE-common" => {
1287 inherit_from => [ "VC-common" ],
1288 cflags => add(picker(default => "-DUNICODE -D_UNICODE",
1291 ($disabled{shared} ? "" : "/MDd")
1292 ." /Od -DDEBUG -D_DEBUG";
1296 ($disabled{shared} ? "" : "/MD")
1299 lib_cflags => add(sub { $disabled{shared} ? "/MT /Zl" : () }),
1300 # Following might/should appears controversial, i.e. defining
1301 # /MDd without evaluating $disabled{shared}. It works in
1302 # non-shared build because static library is compiled with /Zl
1303 # and bares no reference to specific RTL. And it works in
1304 # shared build because multiple /MDd options are not prohibited.
1305 # But why /MDd in static build? Well, basically this is just a
1306 # reference point, which allows to catch eventual errors that
1307 # would prevent those who want to wrap OpenSSL into own .DLL.
1308 # Why not /MD in release build then? Well, some are likely to
1309 # prefer [non-debug] openssl.exe to be free from Micorosoft RTL
1311 bin_cflags => add(picker(debug => "/MDd",
1312 release => sub { $disabled{shared} ? "/MT" : () },
1314 bin_lflags => add("/subsystem:console /opt:ref"),
1315 ex_libs => add(sub {
1317 push @ex_libs, 'ws2_32.lib' unless $disabled{sock};
1318 push @ex_libs, 'gdi32.lib advapi32.lib crypt32.lib user32.lib';
1319 return join(" ", @ex_libs);
1322 "VC-WIN64-common" => {
1323 inherit_from => [ "VC-noCE-common" ],
1324 ex_libs => add(sub {
1326 push @ex_libs, 'bufferoverflowu.lib' if (`cl 2>&1` =~ /14\.00\.4[0-9]{4}\./);
1327 return join(" ", @_, @ex_libs);
1329 bn_ops => "SIXTY_FOUR_BIT EXPORT_VAR_AS_FN",
1330 build_scheme => add("VC-W64", { separator => undef }),
1333 inherit_from => [ "VC-WIN64-common", asm("ia64_asm"),
1334 sub { $disabled{shared} ? () : "ia64_uplink" } ],
1336 asflags => "-d debug",
1339 bn_asm_src => sub { return undef unless @_;
1340 my $r=join(" ",@_); $r=~s|bn-ia64.s|bn_asm.c|; $r; },
1341 perlasm_scheme => "ias",
1342 multilib => "-ia64",
1345 inherit_from => [ "VC-WIN64-common", asm("x86_64_asm"),
1346 sub { $disabled{shared} ? () : "x86_64_uplink" } ],
1347 as => sub { vc_win64a_info()->{as} },
1348 asflags => sub { vc_win64a_info()->{asflags} },
1349 asoutflag => sub { vc_win64a_info()->{asoutflag} },
1351 bn_asm_src => sub { return undef unless @_;
1352 my $r=join(" ",@_); $r=~s|asm/x86_64-gcc|bn_asm|; $r; },
1353 perlasm_scheme => "auto",
1357 # x86 Win32 target defaults to ANSI API, if you want UNICODE,
1358 # configure with 'perl Configure VC-WIN32 -DUNICODE -D_UNICODE'
1359 inherit_from => [ "VC-noCE-common", asm("x86_asm"),
1360 sub { $disabled{shared} ? () : "uplink_common" } ],
1361 as => sub { vc_win32_info()->{as} },
1362 asflags => sub { vc_win32_info()->{asflags} },
1363 asoutflag => sub { vc_win32_info()->{asoutflag} },
1364 ex_libs => add(sub {
1366 # WIN32 UNICODE build gets linked with unicows.lib for
1367 # backward compatibility with Win9x.
1368 push @ex_libs, 'unicows.lib'
1369 if (grep { $_ eq "UNICODE" } @user_defines);
1370 return join(" ", @ex_libs, @_);
1373 bn_ops => "BN_LLONG EXPORT_VAR_AS_FN",
1374 perlasm_scheme => sub { vc_win32_info()->{perlasm_scheme} },
1375 build_scheme => add("VC-W32", { separator => undef }),
1378 inherit_from => [ "VC-common" ],
1380 asflags => "/nologo /Cp /coff /c /Cx /Zi",
1385 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',
1386 sub { vc_wince_info()->{cflags}; },
1387 sub { defined($ENV{'WCECOMPAT'})
1388 ? '-I$(WCECOMPAT)/include' : (); },
1389 sub { defined($ENV{'PORTSDK_LIBPATH'})
1390 ? '-I$(PORTSDK_LIBPATH)/../../include' : (); },
1391 sub { `cl 2>&1` =~ /Version ([0-9]+)\./ && $1>=14
1392 ? ($disabled{shared} ? " /MT" : " /MD")
1394 debug => "/Od -DDEBUG -D_DEBUG",
1396 lflags => combine("/nologo /opt:ref",
1397 sub { vc_wince_info()->{lflags}; },
1398 sub { defined($ENV{PORTSDK_LIBPATH})
1399 ? "/entry:mainCRTstartup" : (); }),
1401 bn_ops => "BN_LLONG EXPORT_VAR_AS_FN",
1402 ex_libs => add(sub {
1404 push @ex_libs, 'ws2.lib' unless $disabled{sock};
1405 push @ex_libs, 'crypt32.lib';
1406 if (defined($ENV{WCECOMPAT})) {
1407 my $x = '$(WCECOMPAT)/lib';
1408 if (-f "$x/$ENV{TARGETCPU}/wcecompatex.lib") {
1409 $x .= '/$(TARGETCPU)/wcecompatex.lib';
1411 $x .= '/wcecompatex.lib';
1415 push @ex_libs, '$(PORTSDK_LIBPATH)/portlib.lib'
1416 if (defined($ENV{'PORTSDK_LIBPATH'}));
1417 push @ex_libs, ' /nodefaultlib coredll.lib corelibc.lib'
1418 if ($ENV{'TARGETCPU'} eq "X86");
1421 build_scheme => add("VC-WCE", { separator => undef }),
1426 inherit_from => [ "BASE_unix", asm("x86_asm"),
1427 sub { $disabled{shared} ? () : "x86_uplink" } ],
1429 cflags => combine(picker(default => "-DL_ENDIAN -DWIN32_LEAN_AND_MEAN -DUNICODE -D_UNICODE -m32 -Wall",
1431 release => "-O3 -fomit-frame-pointer"),
1433 sys_id => "MINGW32",
1434 ex_libs => add("-lws2_32 -lgdi32 -lcrypt32"),
1435 bn_ops => "BN_LLONG EXPORT_VAR_AS_FN",
1436 thread_scheme => "winthreads",
1437 perlasm_scheme => "coff",
1438 dso_scheme => "win32",
1439 shared_target => "mingw-shared",
1440 shared_cflag => add("-D_WINDLL"),
1441 shared_ldflag => "-static-libgcc",
1442 shared_rcflag => "--target=pe-i386",
1443 shared_extension => ".dll",
1447 # As for OPENSSL_USE_APPLINK. Applink makes it possible to use
1448 # .dll compiled with one compiler with application compiled with
1449 # another compiler. It's possible to engage Applink support in
1450 # mingw64 build, but it's not done, because till mingw64
1451 # supports structured exception handling, one can't seriously
1452 # consider its binaries for using with non-mingw64 run-time
1453 # environment. And as mingw64 is always consistent with itself,
1454 # Applink is never engaged and can as well be omitted.
1455 inherit_from => [ "BASE_unix", asm("x86_64_asm") ],
1457 cflags => combine(picker(default => "-DL_ENDIAN -DWIN32_LEAN_AND_MEAN -DUNICODE -D_UNICODE -m64 -Wall",
1461 sys_id => "MINGW64",
1462 ex_libs => add("-lws2_32 -lgdi32 -lcrypt32"),
1463 bn_ops => "SIXTY_FOUR_BIT EXPORT_VAR_AS_FN",
1464 thread_scheme => "winthreads",
1465 perlasm_scheme => "mingw64",
1466 dso_scheme => "win32",
1467 shared_target => "mingw-shared",
1468 shared_cflag => add("-D_WINDLL"),
1469 shared_ldflag => "-static-libgcc",
1470 shared_rcflag => "--target=pe-x86-64",
1471 shared_extension => ".dll",
1477 inherit_from => [ "BASE_unix" ],
1479 cflags => "-DL_ENDIAN -O",
1485 inherit_from => [ "BASE_unix" ],
1487 cflags => "-DTERMIOS -DL_ENDIAN -O -Wall",
1489 bn_ops => "BN_LLONG",
1490 dso_scheme => "win32",
1495 inherit_from => [ "BASE_unix", asm("x86_asm") ],
1497 cflags => picker(default => "-DTERMIOS -DL_ENDIAN -Wall",
1499 release => "-O3 -fomit-frame-pointer"),
1501 bn_ops => "BN_LLONG",
1502 thread_scheme => "pthread",
1503 perlasm_scheme => "coff",
1504 dso_scheme => "dlfcn",
1505 shared_target => "cygwin-shared",
1506 shared_cflag => "-D_WINDLL",
1507 shared_ldflag => "-shared",
1508 shared_extension => ".dll",
1510 "Cygwin-x86_64" => {
1511 inherit_from => [ "BASE_unix", asm("x86_64_asm") ],
1513 cflags => picker(default => "-DTERMIOS -DL_ENDIAN -Wall",
1517 bn_ops => "SIXTY_FOUR_BIT_LONG",
1518 thread_scheme => "pthread",
1519 perlasm_scheme => "mingw64",
1520 dso_scheme => "dlfcn",
1521 shared_target => "cygwin-shared",
1522 shared_cflag => "-D_WINDLL",
1523 shared_ldflag => "-shared",
1524 shared_extension => ".dll",
1526 # Backward compatibility for those using this target
1528 inherit_from => [ "Cygwin-x86" ]
1530 # In case someone constructs the Cygwin target name themself
1532 inherit_from => [ "Cygwin-x86" ]
1535 inherit_from => [ "Cygwin-x86" ]
1538 inherit_from => [ "Cygwin-x86" ]
1541 inherit_from => [ "Cygwin-x86" ]
1546 inherit_from => [ asm("x86_asm") ],
1548 cflags => "-I/dev/env/WATT_ROOT/inc -DTERMIO -DL_ENDIAN -fomit-frame-pointer -O2 -Wall",
1550 ex_libs => add("-L/dev/env/WATT_ROOT/lib -lwatt"),
1551 bn_ops => "BN_LLONG",
1552 perlasm_scheme => "a.out",
1555 ##### MacOS X (a.k.a. Darwin) setup
1556 "darwin-common" => {
1557 inherit_from => [ "BASE_unix" ],
1560 cflags => combine(picker(default => "",
1563 threads("-D_REENTRANT")),
1565 plib_lflags => "-Wl,-search_paths_first",
1566 bn_ops => "BN_LLONG RC4_CHAR",
1567 thread_scheme => "pthreads",
1568 perlasm_scheme => "osx32",
1569 dso_scheme => "dlfcn",
1570 ranlib => "ranlib -c",
1571 shared_target => "darwin-shared",
1572 shared_cflag => "-fPIC",
1573 shared_ldflag => "-dynamiclib",
1574 shared_extension => ".\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
1576 # Option "freeze" such as -std=gnu9x can't negatively interfere
1577 # with future defaults for below two targets, because MacOS X
1578 # for PPC has no future, it was discontinued by vendor in 2009.
1579 "darwin-ppc-cc" => {
1580 inherit_from => [ "darwin-common", asm("ppc32_asm") ],
1581 cflags => add("-arch ppc -std=gnu9x -DB_ENDIAN -Wa,-force_cpusubtype_ALL"),
1582 perlasm_scheme => "osx32",
1583 shared_ldflag => "-arch ppc -dynamiclib",
1585 "darwin64-ppc-cc" => {
1586 inherit_from => [ "darwin-common", asm("ppc64_asm") ],
1587 cflags => add("-arch ppc64 -std=gnu9x -DB_ENDIAN"),
1588 bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
1589 perlasm_scheme => "osx64",
1590 shared_ldflag => "-arch ppc64 -dynamiclib",
1592 "darwin-i386-cc" => {
1593 inherit_from => [ "darwin-common", asm("x86_asm") ],
1594 cflags => add(picker(default => "-arch i386 -DL_ENDIAN",
1595 release => "-fomit-frame-pointer")),
1596 bn_ops => "BN_LLONG RC4_INT",
1597 perlasm_scheme => "macosx",
1598 shared_ldflag => "-arch i386 -dynamiclib",
1600 "darwin64-x86_64-cc" => {
1601 inherit_from => [ "darwin-common", asm("x86_64_asm") ],
1602 cflags => add("-arch x86_64 -DL_ENDIAN -Wall"),
1603 bn_ops => "SIXTY_FOUR_BIT_LONG",
1604 perlasm_scheme => "macosx",
1605 shared_ldflag => "-arch x86_64 -dynamiclib",
1610 # It takes three prior-set environment variables to make it work:
1612 # CROSS_COMPILE=/where/toolchain/is/usr/bin/ [note ending slash]
1613 # CROSS_TOP=/where/SDKs/are
1614 # CROSS_SDK=iPhoneOSx.y.sdk
1616 # Exact paths vary with Xcode releases, but for couple of last ones
1617 # they would look like this:
1619 # CROSS_COMPILE=`xcode-select --print-path`/Toolchains/XcodeDefault.xctoolchain/usr/bin/
1620 # CROSS_TOP=`xcode-select --print-path`/Platforms/iPhoneOS.platform/Developer
1621 # CROSS_SDK=iPhoneOS.sdk
1623 "iphoneos-cross" => {
1624 inherit_from => [ "darwin-common" ],
1625 cflags => add("-isysroot \$(CROSS_TOP)/SDKs/\$(CROSS_SDK) -fno-common"),
1629 inherit_from => [ "darwin-common", asm("armv4_asm") ],
1630 # It should be possible to go below iOS 6 and even add -arch armv6,
1631 # thus targeting iPhone pre-3GS, but it's assumed to be irrelevant
1633 cflags => add("-arch armv7 -mios-version-min=6.0.0 -isysroot \$(CROSS_TOP)/SDKs/\$(CROSS_SDK) -fno-common"),
1635 perlasm_scheme => "ios32",
1638 inherit_from => [ "darwin-common", asm("aarch64_asm") ],
1639 cflags => add("-arch arm64 -mios-version-min=7.0.0 -isysroot \$(CROSS_TOP)/SDKs/\$(CROSS_SDK) -fno-common"),
1641 bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
1642 perlasm_scheme => "ios64",
1647 inherit_from => [ "BASE_unix" ],
1648 inherit_from => [ asm("x86_elf_asm") ],
1650 cflags => combine("-DL_ENDIAN -O3 -fomit-frame-pointer -Wall",
1651 threads("-pthread")),
1652 ex_libs => add("-ldl"),
1653 bn_ops => "BN_LLONG",
1654 thread_scheme => "pthreads",
1655 dso_scheme => "dlfcn",
1656 shared_target => "linux-shared",
1657 shared_cflag => "-fPIC",
1660 ##### VxWorks for various targets
1661 "vxworks-ppc60x" => {
1662 inherit_from => [ "BASE_unix" ],
1664 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",
1665 sys_id => "VXWORKS",
1666 ex_libs => add("-Wl,--defsym,__wrs_rtp_base=0xe0000000 -L \$(WIND_BASE)/target/usr/lib/ppc/PPC32/common"),
1668 "vxworks-ppcgen" => {
1669 inherit_from => [ "BASE_unix" ],
1671 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",
1672 sys_id => "VXWORKS",
1673 ex_libs => add("-Wl,--defsym,__wrs_rtp_base=0xe0000000 -L \$(WIND_BASE)/target/usr/lib/ppc/PPC32/sfcommon"),
1675 "vxworks-ppc405" => {
1676 inherit_from => [ "BASE_unix" ],
1678 cflags => "-g -msoft-float -mlongcall -DCPU=PPC405 -I\$(WIND_BASE)/target/h",
1679 sys_id => "VXWORKS",
1682 "vxworks-ppc750" => {
1683 inherit_from => [ "BASE_unix" ],
1685 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)",
1686 sys_id => "VXWORKS",
1689 "vxworks-ppc750-debug" => {
1690 inherit_from => [ "BASE_unix" ],
1692 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",
1693 sys_id => "VXWORKS",
1696 "vxworks-ppc860" => {
1697 inherit_from => [ "BASE_unix" ],
1699 cflags => "-nostdinc -msoft-float -DCPU=PPC860 -DNO_STRINGS_H -I\$(WIND_BASE)/target/h",
1700 sys_id => "VXWORKS",
1703 "vxworks-simlinux" => {
1704 inherit_from => [ "BASE_unix" ],
1706 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",
1707 sys_id => "VXWORKS",
1709 ranlib => "ranlibpentium",
1712 inherit_from => [ "BASE_unix", asm("mips32_asm") ],
1714 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",
1715 threads("-D_REENTRANT")),
1716 sys_id => "VXWORKS",
1717 ex_libs => add("-Wl,--defsym,__wrs_rtp_base=0xe0000000 -L \$(WIND_BASE)/target/usr/lib/mips/MIPSI32/sfcommon"),
1718 thread_scheme => "pthreads",
1719 perlasm_scheme => "o32",
1720 ranlib => "ranlibmips",
1725 inherit_from => [ "BASE_unix" ],
1727 cflags => combine("\$(CFLAGS)",
1728 threads("-D_REENTRANT")),
1729 plib_lflags => "\$(LDFLAGS)",
1730 ex_libs => add("\$(LDLIBS)"),
1731 bn_ops => "BN_LLONG",
1732 thread_scheme => "pthreads",
1733 dso_scheme => "$ENV{'LIBSSL_dlfcn'}",
1734 shared_target => "linux-shared",
1735 shared_cflag => "-fPIC",
1736 shared_ldflag => "-shared",
1737 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
1738 ranlib => "$ENV{'RANLIB'}",
1740 "uClinux-dist64" => {
1741 inherit_from => [ "BASE_unix" ],
1743 cflags => combine("\$(CFLAGS)",
1744 threads("-D_REENTRANT")),
1745 plib_lflags => "\$(LDFLAGS)",
1746 ex_libs => add("\$(LDLIBS)"),
1747 bn_ops => "SIXTY_FOUR_BIT_LONG",
1748 thread_scheme => "pthreads",
1749 dso_scheme => "$ENV{'LIBSSL_dlfcn'}",
1750 shared_target => "linux-shared",
1751 shared_cflag => "-fPIC",
1752 shared_ldflag => "-shared",
1753 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
1754 ranlib => "$ENV{'RANLIB'}",
1759 cflags => add_before(picker(default => "-DL_ENDIAN -Wall",
1762 threads("-D_REENTRANT")),
1764 lflags => "-lnetwork",
1765 perlasm_scheme => "elf",
1766 thread_scheme => "pthreads",
1767 dso_scheme => "dlfcn",
1768 shared_target => "haiku-shared",
1769 shared_cflag => "-fPIC",
1770 shared_ldflag => "-shared",
1771 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
1774 inherit_from => [ "haiku-common", asm("x86_elf_asm") ],
1775 cflags => add(picker(default => "",
1776 release => "-fomit-frame-pointer")),
1777 bn_ops => "BN_LLONG",
1779 # Haiku builds with no-asm
1781 inherit_from => [ "haiku-common", asm("x86_64_asm") ],
1782 cflags => add("-m64"),
1783 bn_ops => "SIXTY_FOUR_BIT_LONG",
1789 inherit_from => [ "BASE_VMS" ],
1792 cflags => picker(default => "/STANDARD=RELAXED/NOLIST/PREFIX=ALL",
1793 debug => "/NOOPTIMIZE/DEBUG",
1794 release => "/OPTIMIZE/NODEBUG"),
1795 lflags => picker(default => "/MAP",
1796 debug => "/DEBUG/TRACEBACK",
1797 release => "/NODEBUG/NOTRACEBACK"),
1798 lib_cflags => add("/NAMES=(AS_IS,SHORTENED)"),
1799 dso_cflags => add("/NAMES=(AS_IS,SHORTENED)"),
1800 shared_target => "vms-shared",
1801 dso_scheme => "vms",
1802 thread_scheme => "pthreads",
1804 apps_aux_src => "vms_decc_init.c",
1807 # VMS on VAX is *unsupported*
1810 # bn_obj => "[.asm]vms.obj vms-helper.obj"
1813 # inherit_from => [ "vms-generic", asm("vms-asm") ],
1815 # debug_aflags => "/NOOPTIMIZE/DEBUG",
1816 # release_aflags => "/OPTIMIZE/NODEBUG",
1817 # bn_opts => "THIRTY_TWO_BIT RC4_CHAR RC4_CHUNK DES_PTR BF_PTR",
1820 inherit_from => [ "vms-generic" ],
1821 cflags => add(sub { my @warnings =
1822 @{vms_info(0)->{disable_warns}};
1824 ? "/WARNINGS=DISABLE=(".join(",",@warnings).")" : (); }),
1827 return vms_info(0)->{def_zlib}
1828 ? "LIBZ=\"\"\"".vms_info(0)->{def_zlib}."\"\"\"" : ();
1830 ex_libs => add(sub { return vms_info(0)->{zlib} || (); }),
1832 #debug_aflags => "/NOOPTIMIZE/DEBUG",
1833 #release_aflags => "/OPTIMIZE/NODEBUG",
1834 bn_opts => "SIXTY_FOUR_BIT RC4_INT RC4_CHUNK_LL DES_PTR BF_PTR",
1836 "vms-alpha-p32" => {
1837 inherit_from => [ "vms-generic" ],
1839 add("/POINTER_SIZE=32",
1840 sub { my @warnings =
1841 @{vms_info(32)->{disable_warns}};
1843 ? "/WARNINGS=DISABLE=(".join(",",@warnings).")" : ();
1847 return vms_info(32)->{def_zlib}
1848 ? "LIBZ=\"\"\"".vms_info(32)->{def_zlib}."\"\"\"" : ();
1850 ex_libs => add(sub { return vms_info(32)->{zlib} || (); }),
1852 "vms-alpha-p64" => {
1853 inherit_from => [ "vms-generic" ],
1855 add("/POINTER_SIZE=64=ARGV",
1856 sub { my @warnings =
1857 @{vms_info(64)->{disable_warns}};
1859 ? "/WARNINGS=DISABLE=(".join(",",@warnings).")" : ();
1863 return vms_info(64)->{def_zlib}
1864 ? "LIBZ=\"\"\"".vms_info(64)->{def_zlib}."\"\"\"" : ();
1866 ex_libs => add(sub { return vms_info(64)->{zlib} || (); }),
1869 inherit_from => [ "vms-generic" ],
1870 cflags => add(sub { my @warnings =
1871 @{vms_info(0)->{disable_warns}};
1873 ? "/WARNINGS=DISABLE=(".join(",",@warnings).")" : (); }),
1876 return vms_info(0)->{def_zlib}
1877 ? "LIBZ=\"\"\"".vms_info(0)->{def_zlib}."\"\"\"" : ();
1879 ex_libs => add(sub { return vms_info(0)->{zlib} || (); }),
1881 #debug_aflags => "/NOOPTIMIZE/DEBUG",
1882 #release_aflags => "/OPTIMIZE/NODEBUG",
1883 bn_opts => "SIXTY_FOUR_BIT RC4_INT RC4_CHUNK_LL DES_PTR BF_PTR",
1886 inherit_from => [ "vms-generic" ],
1888 add("/POINTER_SIZE=32",
1889 sub { my @warnings =
1890 @{vms_info(32)->{disable_warns}};
1892 ? "/WARNINGS=DISABLE=(".join(",",@warnings).")" : ();
1896 return vms_info(32)->{def_zlib}
1897 ? "LIBZ=\"\"\"".vms_info(32)->{def_zlib}."\"\"\"" : ();
1899 ex_libs => add(sub { return vms_info(32)->{zlib} || (); }),
1902 inherit_from => [ "vms-generic" ],
1904 add("/POINTER_SIZE=64=ARGV",
1905 sub { my @warnings =
1906 @{vms_info(64)->{disable_warns}};
1908 ? "/WARNINGS=DISABLE=(".join(",",@warnings).")" : ();
1912 return vms_info(64)->{def_zlib}
1913 ? "LIBZ=\"\"\"".vms_info(64)->{def_zlib}."\"\"\"" : ();
1915 ex_libs => add(sub { return vms_info(64)->{zlib} || (); }),