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 - make sure it's installed and available on %PATH%\n");
18 $vc_win64a_info = { as => "{unknown}",
23 return $vc_win64a_info;
26 my $vc_win32_info = {};
28 unless (%$vc_win32_info) {
29 my $ver=`nasm -v 2>NUL`;
30 my $vew=`nasmw -v 2>NUL`;
31 if ($ver ne "" || $vew ne "") {
32 $vc_win32_info = { as => $ver ge $vew ? "nasm" : "nasmw",
33 asflags => "-f win32",
35 perlasm_scheme => "win32n" };
36 } elsif ($disabled{asm}) {
37 $vc_win32_info = { as => "ml",
38 asflags => "/nologo /Cp /coff /c /Cx /Zi",
40 perlasm_scheme => "win32" };
42 $die->("NASM not found - make sure it's installed and available on %PATH%\n");
43 $vc_win32_info = { as => "{unknown}",
46 perlasm_scheme => "win32" };
49 return $vc_win32_info;
52 my $vc_wince_info = {};
54 unless (%$vc_wince_info) {
56 $die->('%OSVERSION% is not defined') if (!defined($ENV{'OSVERSION'}));
57 $die->('%PLATFORM% is not defined') if (!defined($ENV{'PLATFORM'}));
58 $die->('%TARGETCPU% is not defined') if (!defined($ENV{'TARGETCPU'}));
61 # Idea behind this is to mimic flags set by eVC++ IDE...
63 my $wcevers = $ENV{'OSVERSION'}; # WCENNN
66 if ($wcevers =~ /^WCE([1-9])([0-9]{2})$/) {
68 $wceverdotnum = "$1.$2";
70 $die->('%OSVERSION% value is insane');
71 $wcevernum = "{unknown}";
72 $wceverdotnum = "{unknown}";
74 my $wcecdefs = "-D_WIN32_WCE=$wcevernum -DUNDER_CE=$wcevernum"; # -D_WIN32_WCE=NNN
75 my $wcelflag = "/subsystem:windowsce,$wceverdotnum"; # ...,N.NN
77 my $wceplatf = $ENV{'PLATFORM'};
79 $wceplatf =~ tr/a-z0-9 /A-Z0-9_/;
80 $wcecdefs .= " -DWCE_PLATFORM_$wceplatf";
82 my $wcetgt = $ENV{'TARGETCPU'}; # just shorter name...
83 SWITCH: for($wcetgt) {
84 /^X86/ && do { $wcecdefs.=" -Dx86 -D_X86_ -D_i386_ -Di_386_";
85 $wcelflag.=" /machine:X86"; last; };
86 /^ARMV4[IT]/ && do { $wcecdefs.=" -DARM -D_ARM_ -D$wcetgt";
87 $wcecdefs.=" -DTHUMB -D_THUMB_" if($wcetgt=~/T$/);
88 $wcecdefs.=" -QRarch4T -QRinterwork-return";
89 $wcelflag.=" /machine:THUMB"; last; };
90 /^ARM/ && do { $wcecdefs.=" -DARM -D_ARM_ -D$wcetgt";
91 $wcelflag.=" /machine:ARM"; last; };
92 /^MIPSIV/ && do { $wcecdefs.=" -DMIPS -D_MIPS_ -DR4000 -D$wcetgt";
93 $wcecdefs.=" -D_MIPS64 -QMmips4 -QMn32";
94 $wcelflag.=" /machine:MIPSFPU"; last; };
95 /^MIPS16/ && do { $wcecdefs.=" -DMIPS -D_MIPS_ -DR4000 -D$wcetgt";
96 $wcecdefs.=" -DMIPSII -QMmips16";
97 $wcelflag.=" /machine:MIPS16"; last; };
98 /^MIPSII/ && do { $wcecdefs.=" -DMIPS -D_MIPS_ -DR4000 -D$wcetgt";
99 $wcecdefs.=" -QMmips2";
100 $wcelflag.=" /machine:MIPS"; last; };
101 /^R4[0-9]{3}/ && do { $wcecdefs.=" -DMIPS -D_MIPS_ -DR4000";
102 $wcelflag.=" /machine:MIPS"; last; };
103 /^SH[0-9]/ && do { $wcecdefs.=" -D$wcetgt -D_${wcetgt}_ -DSHx";
104 $wcecdefs.=" -Qsh4" if ($wcetgt =~ /^SH4/);
105 $wcelflag.=" /machine:$wcetgt"; last; };
106 { $wcecdefs.=" -D$wcetgt -D_${wcetgt}_";
107 $wcelflag.=" /machine:$wcetgt"; last; };
110 $vc_wince_info = { cflags => $wcecdefs,
111 lflags => $wcelflag };
113 return $vc_wince_info;
116 # Helper functions for the VMS configs
119 unless (%$vms_info) {
120 my $pointer_size = shift;
121 my $pointer_size_str = $pointer_size == 0 ? "" : "$pointer_size";
123 $vms_info->{disable_warns} = [ ];
124 $vms_info->{pointer_size} = $pointer_size_str;
125 if ($pointer_size == 64) {
126 `PIPE CC /NOCROSS_REFERENCE /NOLIST /NOOBJECT /WARNINGS = DISABLE = ( MAYLOSEDATA3, EMPTYFILE ) NL: 2> NL:`;
128 push @{$vms_info->{disable_warns}}, "MAYLOSEDATA3";
132 unless ($disabled{zlib}) {
133 my $default_zlib = 'GNV$LIBZSHR' . $pointer_size_str;
134 if (defined($disabled{"zlib-dynamic"})) {
135 $vms_info->{zlib} = $withargs{zlib_lib} || "$default_zlib/SHARE";
137 $vms_info->{def_zlib} = $withargs{zlib_lib} || $default_zlib;
138 # In case the --with-zlib-lib value contains something like
139 # /SHARE or /LIB or so at the end, remove it.
140 $vms_info->{def_zlib} =~ s|/.*$||g;
149 #### Basic configs that should work on any 32-bit box
152 cflags => picker(debug => "-O0 -g",
154 thread_scheme => "(unknown)",
155 bn_ops => "BN_LLONG",
160 thread_scheme => "(unknown)",
163 #### VOS Configurations
165 inherit_from => [ "BASE_unix" ],
167 cflags => picker(default => "-Wall -DOPENSSL_SYS_VOS -D_POSIX_C_SOURCE=200112L -D_BSD -D_VOS_EXTENDED_NAMES -DB_ENDIAN",
170 thread_scheme => "(unknown)",
172 lflags => "-Wl,-map",
173 bn_ops => "BN_LLONG",
174 shared_extension => ".so",
177 #### Solaris configurations
178 "solaris-common" => {
179 inherit_from => [ "BASE_unix" ],
181 cflags => "-DFILIO_H",
182 ex_libs => add("-lsocket -lnsl -ldl"),
183 dso_scheme => "dlfcn",
184 thread_scheme => "pthreads",
185 shared_target => "solaris-shared",
186 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
188 #### Solaris x86 with GNU C setups
189 "solaris-x86-gcc" => {
190 # NB. GNU C has to be configured to use GNU assembler, and not
191 # /usr/ccs/bin/as. Failure to comply will result in compile
192 # failures [at least] in 32-bit build.
193 # [Above statement is in direct contradition with one below.
194 # Latter is kept, because it's formally inappropriate to
195 # modify compile flags in letter release.]
196 # -DOPENSSL_NO_INLINE_ASM switches off inline assembler. We have
197 # to do it here because whenever GNU C instantiates an assembler
198 # template it surrounds it with #APP #NO_APP comment pair which
199 # (at least Solaris 7_x86) /usr/ccs/bin/as fails to assemble
200 # with "Illegal mnemonic" error message.
201 inherit_from => [ "solaris-common", asm("x86_elf_asm") ],
203 cflags => add_before(picker(default => "-Wall -DL_ENDIAN -DOPENSSL_NO_INLINE_ASM",
205 release => "-O3 -fomit-frame-pointer"),
206 threads("-pthread")),
207 ex_libs => add(threads("-pthread")),
208 bn_ops => "BN_LLONG",
209 shared_cflag => "-fPIC",
210 shared_ldflag => "-shared -static-libgcc",
212 "solaris64-x86_64-gcc" => {
213 # -shared -static-libgcc might appear controversial, but modules
214 # taken from static libgcc do not have relocations and linking
215 # them into our shared objects doesn't have any negative side
216 # effects. On the contrary, doing so makes it possible to use
217 # gcc shared build with Sun C. Given that gcc generates faster
218 # code [thanks to inline assembler], I would actually recommend
219 # to consider using gcc shared build even with vendor compiler:-)
220 # <appro@fy.chalmers.se>
221 inherit_from => [ "solaris-common", asm("x86_64_asm") ],
223 cflags => add_before(picker(default => "-m64 -Wall -DL_ENDIAN",
226 threads("-pthread")),
227 ex_libs => add(threads("-pthread")),
228 bn_ops => "SIXTY_FOUR_BIT_LONG",
229 perlasm_scheme => "elf",
230 shared_cflag => "-fPIC",
231 shared_ldflag => "-m64 -shared -static-libgcc",
235 #### Solaris x86 with Sun C setups
236 # There used to be solaris-x86-cc target, but it was removed,
237 # primarily because vendor assembler can't assemble our modules
238 # with -KPIC flag. As result it, assembly support, was not even
239 # available as option. But its lack means lack of side-channel
240 # resistant code, which is incompatible with security by todays
241 # standards. Fortunately gcc is readily available prepackaged
242 # option, which we can firmly point at...
244 # On related note, solaris64-x86_64-cc target won't compile code
245 # paths utilizing AVX and post-Haswell instruction extensions.
246 # Consider switching to solaris64-x86_64-gcc even here...
248 "solaris64-x86_64-cc" => {
249 inherit_from => [ "solaris-common", asm("x86_64_asm") ],
251 cflags => add_before(picker(default => "-xarch=generic64 -xstrconst -Xa -DL_ENDIAN",
253 release => "-xO5 -xdepend -xbuiltin"),
254 threads("-D_REENTRANT")),
255 thread_scheme => "pthreads",
256 lflags => add("-xarch=generic64",threads("-mt")),
257 ex_libs => add(threads("-lpthread")),
258 bn_ops => "SIXTY_FOUR_BIT_LONG",
259 perlasm_scheme => "elf",
260 shared_cflag => "-KPIC",
261 shared_ldflag => "-xarch=generic64 -G -dy -z text",
265 #### SPARC Solaris with GNU C setups
266 "solaris-sparcv7-gcc" => {
267 inherit_from => [ "solaris-common" ],
269 cflags => add_before(picker(default => "-Wall -DB_ENDIAN -DBN_DIV2W",
272 threads("-pthread")),
273 ex_libs => add(threads("-pthread")),
274 bn_ops => "BN_LLONG RC4_CHAR",
275 shared_cflag => "-fPIC",
276 shared_ldflag => "-shared",
278 "solaris-sparcv8-gcc" => {
279 inherit_from => [ "solaris-sparcv7-gcc", asm("sparcv8_asm") ],
280 cflags => add_before("-mcpu=v8"),
282 "solaris-sparcv9-gcc" => {
283 # -m32 should be safe to add as long as driver recognizes
285 inherit_from => [ "solaris-sparcv7-gcc", asm("sparcv9_asm") ],
286 cflags => add_before("-m32 -mcpu=ultrasparc"),
288 "solaris64-sparcv9-gcc" => {
289 inherit_from => [ "solaris-sparcv9-gcc" ],
290 cflags => sub { my $f=join(" ",@_); $f =~ s/\-m32/-m64/; $f; },
291 bn_ops => "BN_LLONG RC4_CHAR",
292 shared_ldflag => "-m64 -shared",
296 #### SPARC Solaris with Sun C setups
297 # SC4.0 doesn't pass 'make test', upgrade to SC5.0 or SC4.2.
298 # SC4.2 is ok, better than gcc even on bn as long as you tell it -xarch=v8
299 # SC5.0 note: Compiler common patch 107357-01 or later is required!
300 "solaris-sparcv7-cc" => {
301 inherit_from => [ "solaris-common" ],
303 cflags => add_before(picker(default => "-xstrconst -Xa -DB_ENDIAN -DBN_DIV2W",
305 release => "-xO5 -xdepend"),
306 threads("-D_REENTRANT")),
307 lflags => add(threads("-mt")),
308 ex_libs => add(threads("-lpthread")),
309 bn_ops => "BN_LLONG RC4_CHAR",
310 shared_cflag => "-KPIC",
311 shared_ldflag => "-G -dy -z text",
314 "solaris-sparcv8-cc" => {
315 inherit_from => [ "solaris-sparcv7-cc", asm("sparcv8_asm") ],
316 cflags => add_before("-xarch=v8"),
318 "solaris-sparcv9-cc" => {
319 inherit_from => [ "solaris-sparcv7-cc", asm("sparcv9_asm") ],
320 cflags => add_before("-xarch=v8plus"),
322 "solaris64-sparcv9-cc" => {
323 inherit_from => [ "solaris-sparcv7-cc", asm("sparcv9_asm") ],
324 cflags => add_before("-xarch=v9"),
325 lflags => add_before("-xarch=v9"),
326 bn_ops => "BN_LLONG RC4_CHAR",
327 shared_ldflag => "-xarch=v9 -G -dy -z text",
331 #### IRIX 6.x configs
332 # Only N32 and N64 ABIs are supported.
333 "irix-mips3-gcc" => {
334 inherit_from => [ "BASE_unix", asm("mips64_asm") ],
336 cflags => combine(picker(default => "-mabi=n32 -DB_ENDIAN -DBN_DIV3W",
339 threads("-D_SGI_MP_SOURCE")),
340 ex_libs => add(threads("-lpthread")),
341 bn_ops => "RC4_CHAR SIXTY_FOUR_BIT",
342 thread_scheme => "pthreads",
343 perlasm_scheme => "n32",
344 dso_scheme => "dlfcn",
345 shared_target => "irix-shared",
346 shared_ldflag => "-mabi=n32",
347 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
351 inherit_from => [ "BASE_unix", asm("mips64_asm") ],
353 cflags => combine(picker(default => "-n32 -mips3 -use_readonly_const -G0 -rdata_shared -DB_ENDIAN -DBN_DIV3W",
356 threads("-D_SGI_MP_SOURCE")),
357 ex_libs => add(threads("-lpthread")),
358 bn_ops => "RC4_CHAR SIXTY_FOUR_BIT",
359 thread_scheme => "pthreads",
360 perlasm_scheme => "n32",
361 dso_scheme => "dlfcn",
362 shared_target => "irix-shared",
363 shared_ldflag => "-n32",
364 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
368 "irix64-mips4-gcc" => {
369 inherit_from => [ "BASE_unix", asm("mips64_asm") ],
371 cflags => combine(picker(default => "-mabi=64 -mips4 -DB_ENDIAN -DBN_DIV3W",
374 threads("-D_SGI_MP_SOURCE")),
375 ex_libs => add(threads("-lpthread")),
376 bn_ops => "RC4_CHAR SIXTY_FOUR_BIT_LONG",
377 thread_scheme => "pthreads",
378 perlasm_scheme => "64",
379 dso_scheme => "dlfcn",
380 shared_target => "irix-shared",
381 shared_ldflag => "-mabi=64",
382 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
385 "irix64-mips4-cc" => {
386 inherit_from => [ "BASE_unix", asm("mips64_asm") ],
388 cflags => combine(picker(default => "-64 -mips4 -use_readonly_const -G0 -rdata_shared -DB_ENDIAN -DBN_DIV3W",
391 threads("-D_SGI_MP_SOURCE")),
392 ex_libs => add(threads("-lpthread")),
393 bn_ops => "RC4_CHAR SIXTY_FOUR_BIT_LONG",
394 thread_scheme => "pthreads",
395 perlasm_scheme => "64",
396 dso_scheme => "dlfcn",
397 shared_target => "irix-shared",
398 shared_ldflag => "-64",
399 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
403 #### Unified HP-UX ANSI C configs.
405 # - Originally we were optimizing at +O4 level. It should be noted
406 # that the only difference between +O3 and +O4 is global inter-
407 # procedural analysis. As it has to be performed during the link
408 # stage the compiler leaves behind certain pseudo-code in lib*.a
409 # which might be release or even patch level specific. Generating
410 # the machine code for and analyzing the *whole* program appears
411 # to be *extremely* memory demanding while the performance gain is
412 # actually questionable. The situation is intensified by the default
413 # HP-UX data set size limit (infamous 'maxdsiz' tunable) of 64MB
414 # which is way too low for +O4. In other words, doesn't +O3 make
416 # - Keep in mind that the HP compiler by default generates code
417 # suitable for execution on the host you're currently compiling at.
418 # If the toolkit is meant to be used on various PA-RISC processors
419 # consider './Configure hpux-parisc-[g]cc +DAportable'.
420 # - -DMD32_XARRAY triggers workaround for compiler bug we ran into in
421 # 32-bit message digests. (For the moment of this writing) HP C
422 # doesn't seem to "digest" too many local variables (they make "him"
423 # chew forever:-). For more details look-up MD32_XARRAY comment in
424 # crypto/sha/sha_lcl.h.
425 # - originally there were 32-bit hpux-parisc2-* targets. They were
426 # scrapped, because a) they were not interchangeable with other 32-bit
427 # targets; b) performance-critical 32-bit assembly modules implement
428 # even PA-RISC 2.0-specific code paths, which are chosen at run-time,
429 # thus adequate performance is provided even with PA-RISC 1.1 build.
430 # <appro@fy.chalmers.se>
432 inherit_from => [ "BASE_unix" ],
434 defines => add("_XOPEN_SOURCE", "_XOPEN_SOURCE_EXTENDED",
435 "_HPUX_ALT_XOPEN_SOCKET_API"),
436 thread_scheme => "pthreads",
437 dso_scheme => "dlfcn", # overridden in 32-bit PA-RISC builds
438 shared_target => "hpux-shared",
440 "hpux-parisc-gcc" => {
441 inherit_from => [ "hpux-common" ],
443 cflags => combine(picker(default => "-DB_ENDIAN -DBN_DIV2W",
446 threads("-pthread")),
447 ex_libs => add("-Wl,+s -ldld", threads("-pthread")),
448 bn_ops => "BN_LLONG",
450 shared_cflag => "-fPIC",
451 shared_ldflag => "-shared",
452 shared_extension => ".sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
454 "hpux-parisc1_1-gcc" => {
455 inherit_from => [ "hpux-parisc-gcc", asm("parisc11_asm") ],
456 multilib => "/pa1.1",
458 "hpux64-parisc2-gcc" => {
459 inherit_from => [ "hpux-common", asm("parisc20_64_asm") ],
461 cflags => combine(picker(default => "-DB_ENDIAN",
464 threads("-D_REENTRANT")),
465 ex_libs => add("-ldl"),
466 bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
467 shared_cflag => "-fpic",
468 shared_ldflag => "-shared",
469 shared_extension => ".sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
470 multilib => "/pa20_64",
473 # More attempts at unified 10.X and 11.X targets for HP C compiler.
475 # Chris Ruemmler <ruemmler@cup.hp.com>
476 # Kevin Steves <ks@hp.se>
477 "hpux-parisc-cc" => {
478 inherit_from => [ "hpux-common" ],
480 cflags => combine(picker(default => "+Optrs_strongly_typed -Ae +ESlit -DB_ENDIAN -DBN_DIV2W -DMD32_XARRAY",
481 debug => "+O0 +d -g",
483 threads("-D_REENTRANT")),
484 ex_libs => add("-Wl,+s -ldld",threads("-lpthread")),
485 bn_ops => "RC4_CHAR",
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 => [ "hpux-common", 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 shared_cflag => "+Z",
506 shared_ldflag => "+DD64 -b",
507 shared_extension => ".sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
508 multilib => "/pa20_64",
511 # HP/UX IA-64 targets
513 inherit_from => [ "hpux-common", asm("ia64_asm") ],
515 cflags => combine(picker(default => "-Ae +DD32 +Olit=all -z -DB_ENDIAN",
516 debug => "+O0 +d -g",
518 threads("-D_REENTRANT")),
519 ex_libs => add("-ldl",threads("-lpthread")),
520 bn_ops => "SIXTY_FOUR_BIT",
521 shared_cflag => "+Z",
522 shared_ldflag => "+DD32 -b",
523 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
524 multilib => "/hpux32",
526 # Frank Geurts <frank.geurts@nl.abnamro.com> has patiently assisted
527 # with debugging of the following config.
528 "hpux64-ia64-cc" => {
529 inherit_from => [ "hpux-common", asm("ia64_asm") ],
531 cflags => combine(picker(default => "-Ae +DD64 +Olit=all -z -DB_ENDIAN",
532 debug => "+O0 +d -g",
534 threads("-D_REENTRANT")),
535 ex_libs => add("-ldl", threads("-lpthread")),
536 bn_ops => "SIXTY_FOUR_BIT_LONG",
537 shared_cflag => "+Z",
538 shared_ldflag => "+DD64 -b",
539 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
540 multilib => "/hpux64",
544 inherit_from => [ "hpux-common", asm("ia64_asm") ],
546 cflags => combine(picker(default => "-DB_ENDIAN",
549 threads("-pthread")),
550 ex_libs => add("-ldl", threads("-pthread")),
551 bn_ops => "SIXTY_FOUR_BIT",
552 shared_cflag => "-fpic",
553 shared_ldflag => "-shared",
554 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
555 multilib => "/hpux32",
557 "hpux64-ia64-gcc" => {
558 inherit_from => [ "hpux-common", asm("ia64_asm") ],
560 cflags => combine(picker(default => "-mlp64 -DB_ENDIAN",
563 threads("-pthread")),
564 ex_libs => add("-ldl", threads("-pthread")),
565 bn_ops => "SIXTY_FOUR_BIT_LONG",
566 shared_cflag => "-fpic",
567 shared_ldflag => "-mlp64 -shared",
568 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
569 multilib => "/hpux64",
572 #### HP MPE/iX http://jazz.external.hp.com/src/openssl/
574 inherit_from => [ "BASE_unix" ],
576 cflags => "-DBN_DIV2W -O3 -D_POSIX_SOURCE -D_SOCKET_SOURCE -I/SYSLOG/PUB",
578 ex_libs => add("-L/SYSLOG/PUB -lsyslog -lsocket -lcurses"),
579 thread_scheme => "(unknown)",
580 bn_ops => "BN_LLONG",
583 #### DEC Alpha Tru64 targets. Tru64 is marketing name for OSF/1 version 4
584 #### and forward. In reality 'uname -s' still returns "OSF1". Originally
585 #### there were even osf1-* configs targeting prior versions provided,
586 #### but not anymore...
587 "tru64-alpha-gcc" => {
588 inherit_from => [ "BASE_unix", asm("alpha_asm") ],
590 cflags => combine("-std=c9x -D_XOPEN_SOURCE=500 -D_OSF_SOURCE -O3",
591 threads("-pthread")),
592 ex_libs => add("-lrt", threads("-pthread")), # for mlock(2)
593 bn_ops => "SIXTY_FOUR_BIT_LONG",
594 thread_scheme => "pthreads",
595 dso_scheme => "dlfcn",
596 shared_target => "alpha-osf1-shared",
597 shared_extension => ".so",
599 "tru64-alpha-cc" => {
600 inherit_from => [ "BASE_unix", asm("alpha_asm") ],
602 cflags => combine("-std1 -D_XOPEN_SOURCE=500 -D_OSF_SOURCE -tune host -fast -readonly_strings",
603 threads("-pthread")),
604 ex_libs => add("-lrt", threads("-pthread")), # for mlock(2)
605 bn_ops => "SIXTY_FOUR_BIT_LONG",
606 thread_scheme => "pthreads",
607 dso_scheme => "dlfcn",
608 shared_target => "alpha-osf1-shared",
609 shared_ldflag => "-msym",
610 shared_extension => ".so",
614 #### Variety of LINUX:-)
616 # *-generic* is endian-neutral target, but ./config is free to
617 # throw in -D[BL]_ENDIAN, whichever appropriate...
618 "linux-generic32" => {
619 inherit_from => [ "BASE_unix" ],
621 cflags => combine(picker(default => "-Wall",
624 threads("-pthread")),
625 ex_libs => add("-ldl", threads("-pthread")),
626 bn_ops => "BN_LLONG RC4_CHAR",
627 thread_scheme => "pthreads",
628 dso_scheme => "dlfcn",
629 shared_target => "linux-shared",
630 shared_cflag => "-fPIC -DOPENSSL_USE_NODELETE",
631 shared_ldflag => "-Wl,-znodelete",
632 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
634 "linux-generic64" => {
635 inherit_from => [ "linux-generic32" ],
636 bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
640 inherit_from => [ "linux-generic32", asm("ppc32_asm") ],
641 perlasm_scheme => "linux32",
644 inherit_from => [ "linux-generic64", asm("ppc64_asm") ],
645 cflags => add("-m64 -DB_ENDIAN"),
646 perlasm_scheme => "linux64",
647 shared_ldflag => add("-m64"),
651 inherit_from => [ "linux-generic64", asm("ppc64_asm") ],
652 cflags => add("-m64 -DL_ENDIAN"),
653 perlasm_scheme => "linux64le",
654 shared_ldflag => add("-m64"),
658 ################################################################
659 # Note that -march is not among compiler options in linux-armv4
660 # target description. Not specifying one is intentional to give
663 # a) rely on your compiler default by not specifying one;
664 # b) specify your target platform explicitly for optimal
665 # performance, e.g. -march=armv6 or -march=armv7-a;
666 # c) build "universal" binary that targets *range* of platforms
667 # by specifying minimum and maximum supported architecture;
669 # As for c) option. It actually makes no sense to specify
670 # maximum to be less than ARMv7, because it's the least
671 # requirement for run-time switch between platform-specific
672 # code paths. And without run-time switch performance would be
673 # equivalent to one for minimum. Secondly, there are some
674 # natural limitations that you'd have to accept and respect.
675 # Most notably you can *not* build "universal" binary for
676 # big-endian platform. This is because ARMv7 processor always
677 # picks instructions in little-endian order. Another similar
678 # limitation is that -mthumb can't "cross" -march=armv6t2
679 # boundary, because that's where it became Thumb-2. Well, this
680 # limitation is a bit artificial, because it's not really
681 # impossible, but it's deemed too tricky to support. And of
682 # course you have to be sure that your binutils are actually
683 # up to the task of handling maximum target platform. With all
684 # this in mind here is an example of how to configure
687 # ./Configure linux-armv4 -march=armv6 -D__ARM_MAX_ARCH__=8
689 inherit_from => [ "linux-generic32", asm("armv4_asm") ],
690 perlasm_scheme => "linux32",
693 inherit_from => [ "linux-generic64", asm("aarch64_asm") ],
694 perlasm_scheme => "linux64",
696 "linux-arm64ilp32" => { # https://wiki.linaro.org/Platform/arm64-ilp32
697 inherit_from => [ "linux-generic32", asm("aarch64_asm") ],
698 cflags => add("-mabi=ilp32"),
699 bn_ops => "SIXTY_FOUR_BIT RC4_CHAR",
700 perlasm_scheme => "linux64",
701 shared_ldflag => add("-mabi=ilp32"),
705 # Configure script adds minimally required -march for assembly
706 # support, if no -march was specified at command line.
707 inherit_from => [ "linux-generic32", asm("mips32_asm") ],
708 cflags => add("-mabi=32 -DBN_DIV3W"),
709 perlasm_scheme => "o32",
710 shared_ldflag => add("-mabi=32"),
712 # mips32 and mips64 below refer to contemporary MIPS Architecture
713 # specifications, MIPS32 and MIPS64, rather than to kernel bitness.
715 inherit_from => [ "linux-generic32", asm("mips64_asm") ],
716 cflags => add("-mabi=n32 -DBN_DIV3W"),
717 bn_ops => "SIXTY_FOUR_BIT RC4_CHAR",
718 perlasm_scheme => "n32",
719 shared_ldflag => add("-mabi=n32"),
722 "linux64-mips64" => {
723 inherit_from => [ "linux-generic64", asm("mips64_asm") ],
724 cflags => add("-mabi=64 -DBN_DIV3W"),
725 perlasm_scheme => "64",
726 shared_ldflag => add("-mabi=64"),
730 #### IA-32 targets...
731 #### These two targets are a bit aged and are to be used on older Linux
732 #### machines where gcc doesn't understand -m32 and -m64
734 inherit_from => [ "linux-generic32", asm("x86_elf_asm") ],
735 cflags => add(picker(default => "-DL_ENDIAN",
736 release => "-fomit-frame-pointer")),
737 bn_ops => "BN_LLONG",
740 inherit_from => [ "BASE_unix", asm("x86_asm") ],
742 cflags => add(picker(default => "-DL_ENDIAN -Wall",
744 release => "-O3 -fomit-frame-pointer")),
745 bn_ops => "BN_LLONG",
746 thread_scheme => "(unknown)",
747 perlasm_scheme => "a.out",
750 #### X86 / X86_64 targets
752 inherit_from => [ "linux-generic32", asm("x86_asm") ],
753 cflags => add(picker(default => "-m32 -DL_ENDIAN",
754 release => "-fomit-frame-pointer")),
755 bn_ops => "BN_LLONG",
756 perlasm_scheme => "elf",
757 shared_ldflag => add("-m32"),
759 "linux-x86-clang" => {
760 inherit_from => [ "linux-x86" ],
763 cflags => add("-Wextra -Qunused-arguments"),
766 inherit_from => [ "linux-generic64", asm("x86_64_asm") ],
767 cflags => add("-m64 -DL_ENDIAN"),
768 bn_ops => "SIXTY_FOUR_BIT_LONG",
769 perlasm_scheme => "elf",
770 shared_ldflag => add("-m64"),
773 "linux-x86_64-clang" => {
774 inherit_from => [ "linux-x86_64" ],
776 cflags => add("-Wextra -Qunused-arguments"),
779 inherit_from => [ "linux-generic32", asm("x86_64_asm") ],
780 cflags => add("-mx32 -DL_ENDIAN"),
781 bn_ops => "SIXTY_FOUR_BIT",
782 perlasm_scheme => "elf32",
783 shared_ldflag => add("-mx32"),
788 inherit_from => [ "linux-generic64", asm("ia64_asm") ],
789 bn_ops => "SIXTY_FOUR_BIT_LONG",
793 inherit_from => [ "linux-generic64", asm("s390x_asm") ],
794 cflags => add("-m64 -DB_ENDIAN"),
795 perlasm_scheme => "64",
796 shared_ldflag => add("-m64"),
800 #### So called "highgprs" target for z/Architecture CPUs
801 # "Highgprs" is kernel feature first implemented in Linux
802 # 2.6.32, see /proc/cpuinfo. The idea is to preserve most
803 # significant bits of general purpose registers not only
804 # upon 32-bit process context switch, but even on
805 # asynchronous signal delivery to such process. This makes
806 # it possible to deploy 64-bit instructions even in legacy
807 # application context and achieve better [or should we say
808 # adequate] performance. The build is binary compatible with
809 # linux-generic32, and the idea is to be able to install the
810 # resulting libcrypto.so alongside generic one, e.g. as
811 # /lib/highgprs/libcrypto.so.x.y, for ldconfig and run-time
812 # linker to autodiscover. Unfortunately it doesn't work just
813 # yet, because of couple of bugs in glibc
814 # sysdeps/s390/dl-procinfo.c affecting ldconfig and ld.so.1...
816 inherit_from => [ "linux-generic32", asm("s390x_asm") ],
817 cflags => add("-m31 -Wa,-mzarch -DB_ENDIAN"),
818 bn_asm_src => sub { my $r=join(" ",@_); $r=~s|asm/s390x\.S|bn_asm.c|; $r; },
819 perlasm_scheme => "31",
820 shared_ldflag => add("-m31"),
821 multilib => "/highgprs",
824 #### SPARC Linux setups
825 # Ray Miller <ray.miller@computing-services.oxford.ac.uk> has
826 # patiently assisted with debugging of following two configs.
828 inherit_from => [ "linux-generic32", asm("sparcv8_asm") ],
829 cflags => add("-mcpu=v8 -DB_ENDIAN -DBN_DIV2W"),
832 # it's a real mess with -mcpu=ultrasparc option under Linux,
833 # but -Wa,-Av8plus should do the trick no matter what.
834 inherit_from => [ "linux-generic32", asm("sparcv9_asm") ],
835 cflags => add("-m32 -mcpu=ultrasparc -Wa,-Av8plus -DB_ENDIAN -DBN_DIV2W"),
836 shared_ldflag => add("-m32"),
838 "linux64-sparcv9" => {
839 # GCC 3.1 is a requirement
840 inherit_from => [ "linux-generic64", asm("sparcv9_asm") ],
841 cflags => add("-m64 -mcpu=ultrasparc -DB_ENDIAN"),
842 bn_ops => "BN_LLONG RC4_CHAR",
843 shared_ldflag => add("-m64"),
847 "linux-alpha-gcc" => {
848 inherit_from => [ "linux-generic64", asm("alpha_asm") ],
849 cflags => add("-DL_ENDIAN"),
850 bn_ops => "SIXTY_FOUR_BIT_LONG",
852 "linux-c64xplus" => {
853 inherit_from => [ "BASE_unix" ],
854 # TI_CGT_C6000_7.3.x is a requirement
856 cflags => combine("--linux -ea=.s -eo=.o -mv6400+ -o2 -ox -ms -pden -DOPENSSL_SMALL_FOOTPRINT",
857 threads("-D_REENTRANT")),
858 bn_ops => "BN_LLONG",
859 cpuid_asm_src => "c64xpluscpuid.s",
860 bn_asm_src => "asm/bn-c64xplus.asm c64xplus-gf2m.s",
861 aes_asm_src => "aes-c64xplus.s aes_cbc.c aes-ctr.fake",
862 sha1_asm_src => "sha1-c64xplus.s sha256-c64xplus.s sha512-c64xplus.s",
863 rc4_asm_src => "rc4-c64xplus.s",
864 modes_asm_src => "ghash-c64xplus.s",
865 chacha_asm_src => "chacha-c64xplus.s",
866 poly1305_asm_src => "poly1305-c64xplus.s",
867 thread_scheme => "pthreads",
868 perlasm_scheme => "void",
869 dso_scheme => "dlfcn",
870 shared_target => "linux-shared",
871 shared_cflag => "--pic",
872 shared_ldflag => add("-z --sysv --shared"),
873 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
877 #### Android: linux-* but without pointers to headers and libs.
879 # It takes pair of prior-set environment variables to make it work:
881 # CROSS_SYSROOT=/some/where/android-ndk-<ver>/platforms/android-<apiver>/arch-<arch>
882 # CROSS_COMPILE=<prefix>
884 # As well as PATH adjusted to cover ${CROSS_COMPILE}gcc and company.
885 # For example to compile for ICS and ARM with NDK 10d, you'd:
887 # ANDROID_NDK=/some/where/android-ndk-10d
888 # CROSS_SYSROOT=$ANDROID_NDK/platforms/android-14/arch-arm
889 # CROSS_COMPILE=arm-linux-androideabi-
890 # PATH=$ANDROID_NDK/toolchains/arm-linux-androideabi-4.8/prebuild/linux-x86_64/bin
893 inherit_from => [ "linux-generic32" ],
894 # Special note about unconditional -fPIC and -pie. The underlying
895 # reason is that Lollipop refuses to run non-PIE. But what about
896 # older systems and NDKs? -fPIC was never problem, so the only
897 # concern is -pie. Older toolchains, e.g. r4, appear to handle it
898 # and binaries turn mostly functional. "Mostly" means that oldest
899 # Androids, such as Froyo, fail to handle executable, but newer
900 # systems are perfectly capable of executing binaries targeting
901 # Froyo. Keep in mind that in the nutshell Android builds are
902 # about JNI, i.e. shared libraries, not applications.
903 cflags => add(picker(default => "-mandroid -fPIC --sysroot=\$(CROSS_SYSROOT) -Wa,--noexecstack")),
904 bin_cflags => "-pie",
907 inherit_from => [ "android", asm("x86_asm") ],
908 cflags => add(picker(release => "-fomit-frame-pointer")),
909 bn_ops => "BN_LLONG",
910 perlasm_scheme => "android",
912 ################################################################
913 # Contemporary Android applications can provide multiple JNI
914 # providers in .apk, targeting multiple architectures. Among
915 # them there is "place" for two ARM flavours: generic eabi and
916 # armv7-a/hard-float. However, it should be noted that OpenSSL's
917 # ability to engage NEON is not constrained by ABI choice, nor
918 # is your ability to call OpenSSL from your application code
919 # compiled with floating-point ABI other than default 'soft'.
920 # [Latter thanks to __attribute__((pcs("aapcs"))) declaration.]
921 # This means that choice of ARM libraries you provide in .apk
922 # is driven by application needs. For example if application
923 # itself benefits from NEON or is floating-point intensive, then
924 # it might be appropriate to provide both libraries. Otherwise
925 # just generic eabi would do. But in latter case it would be
928 # ./Configure android-armeabi -D__ARM_MAX_ARCH__=8
930 # in order to build "universal" binary and allow OpenSSL take
931 # advantage of NEON when it's available.
933 "android-armeabi" => {
934 inherit_from => [ "android", asm("armv4_asm") ],
937 inherit_from => [ "android", asm("mips32_asm") ],
938 perlasm_scheme => "o32",
942 inherit_from => [ "linux-generic64" ],
943 cflags => add(picker(default => "-mandroid -fPIC --sysroot=\$(CROSS_SYSROOT) -Wa,--noexecstack")),
944 bin_cflags => "-pie",
946 "android64-aarch64" => {
947 inherit_from => [ "android64", asm("aarch64_asm") ],
948 perlasm_scheme => "linux64",
953 # As for thread cflag. Idea is to maintain "collective" set of
954 # flags, which would cover all BSD flavors. -pthread applies
955 # to them all, but is treated differently. OpenBSD expands is
956 # as -D_POSIX_THREAD -lc_r, which is sufficient. FreeBSD 4.x
957 # expands it as -lc_r, which has to be accompanied by explicit
958 # -D_THREAD_SAFE and sometimes -D_REENTRANT. FreeBSD 5.x
959 # expands it as -lc_r, which seems to be sufficient?
960 inherit_from => [ "BASE_unix" ],
962 cflags => combine(picker(default => "-Wall",
965 threads("-pthread -D_THREAD_SAFE -D_REENTRANT")),
966 bn_ops => "BN_LLONG",
967 thread_scheme => "pthreads",
968 dso_scheme => "dlfcn",
969 shared_target => "bsd-gcc-shared",
970 shared_cflag => "-fPIC",
971 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
974 inherit_from => [ "BSD-generic32" ],
975 bn_ops => "SIXTY_FOUR_BIT_LONG",
979 inherit_from => [ "BSD-generic32", asm("x86_asm") ],
980 cflags => add(picker(default => "-DL_ENDIAN",
981 release => "-fomit-frame-pointer")),
982 bn_ops => "BN_LLONG",
983 shared_target => "bsd-shared",
984 perlasm_scheme => "a.out",
987 inherit_from => [ "BSD-x86" ],
988 perlasm_scheme => "elf",
992 inherit_from => [ "BSD-generic32", asm("sparcv8_asm") ],
993 cflags => add("-mcpu=v8 -DB_ENDIAN"),
996 # -DMD32_REG_T=int doesn't actually belong in sparc64 target, it
997 # simply *happens* to work around a compiler bug in gcc 3.3.3,
998 # triggered by RIPEMD160 code.
999 inherit_from => [ "BSD-generic64", asm("sparcv9_asm") ],
1000 cflags => add("-DB_ENDIAN -DMD32_REG_T=int"),
1001 bn_ops => "BN_LLONG",
1005 inherit_from => [ "BSD-generic64", asm("ia64_asm") ],
1006 cflags => add_before("-DL_ENDIAN"),
1007 bn_ops => "SIXTY_FOUR_BIT_LONG",
1011 inherit_from => [ "BSD-generic64", asm("x86_64_asm") ],
1012 cflags => add_before("-DL_ENDIAN"),
1013 bn_ops => "SIXTY_FOUR_BIT_LONG",
1014 perlasm_scheme => "elf",
1018 inherit_from => [ "BASE_unix", asm("x86_elf_asm") ],
1020 cflags => "-DPERL5 -DL_ENDIAN -fomit-frame-pointer -O3 -Wall",
1021 ex_libs => add("-ldl"),
1022 bn_ops => "BN_LLONG",
1023 thread_scheme => "(unknown)",
1024 dso_scheme => "dlfcn",
1025 shared_target => "bsd-gcc-shared",
1026 shared_cflag => "-fPIC",
1027 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
1031 inherit_from => [ "BASE_unix" ],
1033 cflags => "-O -Wall",
1034 unistd => "<libc.h>",
1035 bn_ops => "BN_LLONG",
1036 thread_scheme => "(unknown)",
1039 inherit_from => [ "BASE_unix" ],
1041 cflags => "-O3 -Wall",
1042 unistd => "<libc.h>",
1043 bn_ops => "BN_LLONG",
1044 thread_scheme => "(unknown)",
1049 inherit_from => [ "BASE_unix" ],
1051 cflags => "-DL_ENDIAN -DTERMIO",
1052 thread_scheme => "(unknown)",
1055 inherit_from => [ "BASE_unix" ],
1057 ex_libs => add("-lsocket"),
1058 dso_scheme => "dlfcn",
1059 shared_target => "bsd-gcc-shared",
1060 shared_cflag => "-fPIC",
1061 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
1064 inherit_from => [ "BASE_unix", asm("x86_elf_asm") ],
1066 cflags => "-DL_ENDIAN -O2 -Wall",
1067 ex_libs => add("-lsocket"),
1068 dso_scheme => "dlfcn",
1069 shared_target => "bsd-gcc-shared",
1070 shared_cflag => "-fPIC",
1071 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
1074 #### SCO/Caldera targets.
1076 # Originally we had like unixware-*, unixware-*-pentium, unixware-*-p6, etc.
1077 # Now we only have blended unixware-* as it's the only one used by ./config.
1078 # If you want to optimize for particular microarchitecture, bypass ./config
1079 # and './Configure unixware-7 -Kpentium_pro' or whatever appropriate.
1080 # Note that not all targets include assembler support. Mostly because of
1081 # lack of motivation to support out-of-date platforms with out-of-date
1082 # compiler drivers and assemblers. Tim Rice <tim@multitalents.net> has
1083 # patiently assisted to debug most of it.
1085 # UnixWare 2.0x fails destest with -O.
1087 inherit_from => [ "BASE_unix" ],
1089 cflags => combine("-DFILIO_H -DNO_STRINGS_H",
1090 threads("-Kthread")),
1091 ex_libs => add("-lsocket -lnsl -lresolv -lx"),
1092 thread_scheme => "uithreads",
1095 inherit_from => [ "BASE_unix" ],
1097 cflags => combine("-O -DFILIO_H",
1098 threads("-Kthread")),
1099 ex_libs => add("-lsocket -lnsl -lresolv -lx"),
1100 thread_scheme => "uithreads",
1103 inherit_from => [ "BASE_unix", asm("x86_elf_asm") ],
1105 cflags => combine("-O -DFILIO_H -Kalloca",
1106 threads("-Kthread")),
1107 ex_libs => add("-lsocket -lnsl"),
1108 thread_scheme => "uithreads",
1109 bn_ops => "BN_LLONG",
1110 perlasm_scheme => "elf-1",
1111 dso_scheme => "dlfcn",
1112 shared_target => "svr5-shared",
1113 shared_cflag => "-Kpic",
1114 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
1116 "unixware-7-gcc" => {
1117 inherit_from => [ "BASE_unix", asm("x86_elf_asm") ],
1119 cflags => combine("-DL_ENDIAN -DFILIO_H -O3 -fomit-frame-pointer -Wall",
1120 threads("-D_REENTRANT")),
1121 ex_libs => add("-lsocket -lnsl"),
1122 bn_ops => "BN_LLONG",
1123 thread_scheme => "pthreads",
1124 perlasm_scheme => "elf-1",
1125 dso_scheme => "dlfcn",
1126 shared_target => "gnu-shared",
1127 shared_cflag => "-fPIC",
1128 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
1130 # SCO 5 - Ben Laurie <ben@algroup.co.uk> says the -O breaks the SCO cc.
1132 inherit_from => [ "BASE_unix", asm("x86_elf_asm") ],
1135 ex_libs => add("-lsocket -lnsl"),
1136 thread_scheme => "(unknown)",
1137 perlasm_scheme => "elf-1",
1138 dso_scheme => "dlfcn",
1139 shared_target => "svr3-shared",
1140 shared_cflag => "-Kpic",
1141 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
1144 inherit_from => [ "BASE_unix", asm("x86_elf_asm") ],
1146 cflags => "-O3 -fomit-frame-pointer",
1147 ex_libs => add("-lsocket -lnsl"),
1148 bn_ops => "BN_LLONG",
1149 thread_scheme => "(unknown)",
1150 perlasm_scheme => "elf-1",
1151 dso_scheme => "dlfcn",
1152 shared_target => "svr3-shared",
1153 shared_cflag => "-fPIC",
1154 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
1158 # Below targets assume AIX >=5. Caveat lector. If you are accustomed
1159 # to control compilation "bitness" by setting $OBJECT_MODE environment
1160 # variable, then you should know that in OpenSSL case it's considered
1161 # only in ./config. Once configured, build procedure remains "deaf" to
1162 # current value of $OBJECT_MODE.
1164 inherit_from => [ "BASE_unix", asm("ppc32_asm") ],
1166 cflags => combine(picker(default => "-DB_ENDIAN",
1169 threads("-pthread")),
1170 ex_libs => add(threads("-pthread")),
1172 bn_ops => "BN_LLONG RC4_CHAR",
1173 thread_scheme => "pthreads",
1174 perlasm_scheme => "aix32",
1175 dso_scheme => "dlfcn",
1176 shared_target => "aix-shared",
1177 shared_ldflag => "-shared -static-libgcc -Wl,-G",
1178 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
1182 inherit_from => [ "BASE_unix", asm("ppc64_asm") ],
1184 cflags => combine(picker(default => "-maix64 -DB_ENDIAN",
1187 threads("-pthread")),
1188 ex_libs => add(threads("-pthread")),
1190 bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
1191 thread_scheme => "pthreads",
1192 perlasm_scheme => "aix64",
1193 dso_scheme => "dlfcn",
1194 shared_target => "aix-shared",
1195 shared_ldflag => "-maix64 -shared -static-libgcc -Wl,-G",
1196 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
1200 inherit_from => [ "BASE_unix", asm("ppc32_asm") ],
1202 cflags => combine(picker(default => "-q32 -DB_ENDIAN -qmaxmem=16384 -qro -qroconst",
1205 threads("-qthreaded -D_THREAD_SAFE")),
1207 bn_ops => "BN_LLONG RC4_CHAR",
1208 thread_scheme => "pthreads",
1209 ex_libs => threads("-lpthreads"),
1210 perlasm_scheme => "aix32",
1211 dso_scheme => "dlfcn",
1212 shared_target => "aix-shared",
1213 shared_cflag => "-qpic",
1214 shared_ldflag => "-q32 -G",
1215 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
1219 inherit_from => [ "BASE_unix", asm("ppc64_asm") ],
1221 cflags => combine(picker(default => "-q64 -DB_ENDIAN -qmaxmem=16384 -qro -qroconst",
1224 threads("-qthreaded -D_THREAD_SAFE")),
1226 bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
1227 thread_scheme => "pthreads",
1228 ex_libs => threads("-lpthreads"),
1229 perlasm_scheme => "aix64",
1230 dso_scheme => "dlfcn",
1231 shared_target => "aix-shared",
1232 shared_cflag => "-qpic",
1233 shared_ldflag => "-q64 -G",
1234 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
1238 # SIEMENS BS2000/OSD: an EBCDIC-based mainframe
1240 inherit_from => [ "BASE_unix" ],
1242 cflags => "-O -XLLML -XLLMK -XL -DB_ENDIAN -DCHARSET_EBCDIC",
1243 ex_libs => add("-lsocket -lnsl"),
1244 bn_ops => "THIRTY_TWO_BIT RC4_CHAR",
1245 thread_scheme => "(unknown)",
1248 #### Visual C targets
1250 # Win64 targets, WIN64I denotes IA-64 and WIN64A - AMD64
1252 # Note about -wd4090, disable warning C4090. This warning returns false
1253 # positives in some situations. Disabling it altogether masks both
1254 # legitimate and false cases, but as we compile on multiple platforms,
1255 # we rely on other compilers to catch legitimate cases.
1257 # Also note that we force threads no matter what. Configuring "no-threads"
1260 inherit_from => [ "BASE_Windows" ],
1263 cflags => "-W3 -wd4090 -Gs0 -GF -Gy -nologo -DOPENSSL_SYS_WIN32 -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -D_CRT_SECURE_NO_DEPRECATE",
1264 defines => add(sub { my @defs = ();
1265 unless ($disabled{"zlib-dynamic"}) {
1267 $withargs{zlib_lib} // "ZLIB1";
1270 'LIBZ="' . $zlib . '"');
1275 lib_cflags => add("/Zi /Fdossl_static"),
1276 dso_cflags => "/Zi /Fddso",
1277 bin_cflags => "/Zi /Fdapp",
1278 lflags => add("/debug"),
1279 shared_ldflag => "/dll",
1280 shared_target => "win-shared", # meaningless except it gives Configure a hint
1281 thread_scheme => "winthreads",
1282 dso_scheme => "win32",
1283 apps_aux_src => add("win32_init.c"),
1285 "VC-noCE-common" => {
1286 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" ],
1325 ex_libs => add(sub {
1327 push @ex_libs, 'bufferoverflowu.lib' if (`cl 2>&1` =~ /14\.00\.4[0-9]{4}\./);
1328 return join(" ", @_, @ex_libs);
1330 bn_ops => "SIXTY_FOUR_BIT EXPORT_VAR_AS_FN",
1331 build_scheme => add("VC-W64", { separator => undef }),
1334 inherit_from => [ "VC-WIN64-common", asm("ia64_asm"),
1335 sub { $disabled{shared} ? () : "ia64_uplink" } ],
1337 asflags => "-d debug",
1340 bn_asm_src => sub { return undef unless @_;
1341 my $r=join(" ",@_); $r=~s|bn-ia64.s|bn_asm.c|; $r; },
1342 perlasm_scheme => "ias",
1343 multilib => "-ia64",
1346 inherit_from => [ "VC-WIN64-common", asm("x86_64_asm"),
1347 sub { $disabled{shared} ? () : "x86_64_uplink" } ],
1348 as => sub { vc_win64a_info()->{as} },
1349 asflags => sub { vc_win64a_info()->{asflags} },
1350 asoutflag => sub { vc_win64a_info()->{asoutflag} },
1352 bn_asm_src => sub { return undef unless @_;
1353 my $r=join(" ",@_); $r=~s|asm/x86_64-gcc|bn_asm|; $r; },
1354 perlasm_scheme => "auto",
1358 # x86 Win32 target defaults to ANSI API, if you want UNICODE,
1359 # configure with 'perl Configure VC-WIN32 -DUNICODE -D_UNICODE'
1360 inherit_from => [ "VC-noCE-common", asm("x86_asm"),
1361 sub { $disabled{shared} ? () : "uplink_common" } ],
1362 as => sub { vc_win32_info()->{as} },
1363 asflags => sub { vc_win32_info()->{asflags} },
1364 asoutflag => sub { vc_win32_info()->{asoutflag} },
1365 ex_libs => add(sub {
1367 # WIN32 UNICODE build gets linked with unicows.lib for
1368 # backward compatibility with Win9x.
1369 push @ex_libs, 'unicows.lib'
1370 if (grep { $_ eq "UNICODE" } @user_defines);
1371 return join(" ", @ex_libs, @_);
1374 bn_ops => "BN_LLONG EXPORT_VAR_AS_FN",
1375 perlasm_scheme => sub { vc_win32_info()->{perlasm_scheme} },
1376 build_scheme => add("VC-W32", { separator => undef }),
1379 inherit_from => [ "VC-common" ],
1381 asflags => "/nologo /Cp /coff /c /Cx /Zi",
1386 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',
1387 sub { vc_wince_info()->{cflags}; },
1388 sub { defined($ENV{'WCECOMPAT'})
1389 ? '-I$(WCECOMPAT)/include' : (); },
1390 sub { defined($ENV{'PORTSDK_LIBPATH'})
1391 ? '-I$(PORTSDK_LIBPATH)/../../include' : (); },
1392 sub { `cl 2>&1` =~ /Version ([0-9]+)\./ && $1>=14
1393 ? ($disabled{shared} ? " /MT" : " /MD")
1395 debug => "/Od -DDEBUG -D_DEBUG",
1397 lflags => combine("/nologo /opt:ref",
1398 sub { vc_wince_info()->{lflags}; },
1399 sub { defined($ENV{PORTSDK_LIBPATH})
1400 ? "/entry:mainCRTstartup" : (); }),
1402 bn_ops => "BN_LLONG EXPORT_VAR_AS_FN",
1403 ex_libs => add(sub {
1405 push @ex_libs, 'ws2.lib' unless $disabled{sock};
1406 push @ex_libs, 'crypt32.lib';
1407 if (defined($ENV{WCECOMPAT})) {
1408 my $x = '$(WCECOMPAT)/lib';
1409 if (-f "$x/$ENV{TARGETCPU}/wcecompatex.lib") {
1410 $x .= '/$(TARGETCPU)/wcecompatex.lib';
1412 $x .= '/wcecompatex.lib';
1416 push @ex_libs, '$(PORTSDK_LIBPATH)/portlib.lib'
1417 if (defined($ENV{'PORTSDK_LIBPATH'}));
1418 push @ex_libs, ' /nodefaultlib coredll.lib corelibc.lib'
1419 if ($ENV{'TARGETCPU'} eq "X86");
1422 build_scheme => add("VC-WCE", { separator => undef }),
1427 inherit_from => [ "BASE_unix", asm("x86_asm"),
1428 sub { $disabled{shared} ? () : "x86_uplink" } ],
1430 cflags => combine(picker(default => "-DL_ENDIAN -DWIN32_LEAN_AND_MEAN -DUNICODE -D_UNICODE -m32 -Wall",
1432 release => "-O3 -fomit-frame-pointer"),
1434 sys_id => "MINGW32",
1435 ex_libs => add("-lws2_32 -lgdi32 -lcrypt32"),
1436 bn_ops => "BN_LLONG EXPORT_VAR_AS_FN",
1437 thread_scheme => "winthreads",
1438 perlasm_scheme => "coff",
1439 dso_scheme => "win32",
1440 shared_target => "mingw-shared",
1441 shared_cflag => add("-D_WINDLL"),
1442 shared_ldflag => "-static-libgcc",
1443 shared_rcflag => "--target=pe-i386",
1444 shared_extension => ".dll",
1446 apps_aux_src => add("win32_init.c"),
1447 build_scheme => add("mingw", { separator => undef }),
1450 # As for OPENSSL_USE_APPLINK. Applink makes it possible to use
1451 # .dll compiled with one compiler with application compiled with
1452 # another compiler. It's possible to engage Applink support in
1453 # mingw64 build, but it's not done, because till mingw64
1454 # supports structured exception handling, one can't seriously
1455 # consider its binaries for using with non-mingw64 run-time
1456 # environment. And as mingw64 is always consistent with itself,
1457 # Applink is never engaged and can as well be omitted.
1458 inherit_from => [ "BASE_unix", asm("x86_64_asm") ],
1460 cflags => combine(picker(default => "-DL_ENDIAN -DWIN32_LEAN_AND_MEAN -DUNICODE -D_UNICODE -m64 -Wall",
1464 sys_id => "MINGW64",
1465 ex_libs => add("-lws2_32 -lgdi32 -lcrypt32"),
1466 bn_ops => "SIXTY_FOUR_BIT EXPORT_VAR_AS_FN",
1467 thread_scheme => "winthreads",
1468 perlasm_scheme => "mingw64",
1469 dso_scheme => "win32",
1470 shared_target => "mingw-shared",
1471 shared_cflag => add("-D_WINDLL"),
1472 shared_ldflag => "-static-libgcc",
1473 shared_rcflag => "--target=pe-x86-64",
1474 shared_extension => ".dll",
1476 apps_aux_src => add("win32_init.c"),
1477 build_scheme => add("mingw64", { separator => undef }),
1482 inherit_from => [ "BASE_unix" ],
1484 cflags => "-DL_ENDIAN -O",
1490 inherit_from => [ "BASE_unix" ],
1492 cflags => "-DTERMIOS -DL_ENDIAN -O -Wall",
1494 bn_ops => "BN_LLONG",
1495 dso_scheme => "win32",
1500 inherit_from => [ "BASE_unix", asm("x86_asm") ],
1502 cflags => picker(default => "-DTERMIOS -DL_ENDIAN -Wall",
1504 release => "-O3 -fomit-frame-pointer"),
1506 bn_ops => "BN_LLONG",
1507 thread_scheme => "pthread",
1508 perlasm_scheme => "coff",
1509 dso_scheme => "dlfcn",
1510 shared_target => "cygwin-shared",
1511 shared_cflag => "-D_WINDLL",
1512 shared_ldflag => "-shared",
1513 shared_extension => ".dll",
1515 "Cygwin-x86_64" => {
1516 inherit_from => [ "BASE_unix", asm("x86_64_asm") ],
1518 cflags => picker(default => "-DTERMIOS -DL_ENDIAN -Wall",
1522 bn_ops => "SIXTY_FOUR_BIT_LONG",
1523 thread_scheme => "pthread",
1524 perlasm_scheme => "mingw64",
1525 dso_scheme => "dlfcn",
1526 shared_target => "cygwin-shared",
1527 shared_cflag => "-D_WINDLL",
1528 shared_ldflag => "-shared",
1529 shared_extension => ".dll",
1531 # Backward compatibility for those using this target
1533 inherit_from => [ "Cygwin-x86" ]
1535 # In case someone constructs the Cygwin target name themself
1537 inherit_from => [ "Cygwin-x86" ]
1540 inherit_from => [ "Cygwin-x86" ]
1543 inherit_from => [ "Cygwin-x86" ]
1546 inherit_from => [ "Cygwin-x86" ]
1549 ##### MacOS X (a.k.a. Darwin) setup
1550 "darwin-common" => {
1551 inherit_from => [ "BASE_unix" ],
1554 cflags => combine(picker(default => "",
1557 threads("-D_REENTRANT")),
1559 plib_lflags => "-Wl,-search_paths_first",
1560 bn_ops => "BN_LLONG RC4_CHAR",
1561 thread_scheme => "pthreads",
1562 perlasm_scheme => "osx32",
1563 dso_scheme => "dlfcn",
1564 ranlib => "ranlib -c",
1565 shared_target => "darwin-shared",
1566 shared_cflag => "-fPIC",
1567 shared_ldflag => "-dynamiclib",
1568 shared_extension => ".\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
1570 # Option "freeze" such as -std=gnu9x can't negatively interfere
1571 # with future defaults for below two targets, because MacOS X
1572 # for PPC has no future, it was discontinued by vendor in 2009.
1573 "darwin-ppc-cc" => {
1574 inherit_from => [ "darwin-common", asm("ppc32_asm") ],
1575 cflags => add("-arch ppc -std=gnu9x -DB_ENDIAN -Wa,-force_cpusubtype_ALL"),
1576 perlasm_scheme => "osx32",
1577 shared_cflag => add("-fno-common"),
1578 shared_ldflag => "-arch ppc -dynamiclib",
1580 "darwin64-ppc-cc" => {
1581 inherit_from => [ "darwin-common", asm("ppc64_asm") ],
1582 cflags => add("-arch ppc64 -std=gnu9x -DB_ENDIAN"),
1583 bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
1584 perlasm_scheme => "osx64",
1585 shared_ldflag => "-arch ppc64 -dynamiclib",
1587 "darwin-i386-cc" => {
1588 inherit_from => [ "darwin-common", asm("x86_asm") ],
1589 cflags => add(picker(default => "-arch i386 -DL_ENDIAN",
1590 release => "-fomit-frame-pointer")),
1591 bn_ops => "BN_LLONG RC4_INT",
1592 perlasm_scheme => "macosx",
1593 shared_ldflag => "-arch i386 -dynamiclib",
1595 "darwin64-x86_64-cc" => {
1596 inherit_from => [ "darwin-common", asm("x86_64_asm") ],
1597 cflags => add("-arch x86_64 -DL_ENDIAN -Wall"),
1598 bn_ops => "SIXTY_FOUR_BIT_LONG",
1599 perlasm_scheme => "macosx",
1600 shared_ldflag => "-arch x86_64 -dynamiclib",
1605 # It takes three prior-set environment variables to make it work:
1607 # CROSS_COMPILE=/where/toolchain/is/usr/bin/ [note ending slash]
1608 # CROSS_TOP=/where/SDKs/are
1609 # CROSS_SDK=iPhoneOSx.y.sdk
1611 # Exact paths vary with Xcode releases, but for couple of last ones
1612 # they would look like this:
1614 # CROSS_COMPILE=`xcode-select --print-path`/Toolchains/XcodeDefault.xctoolchain/usr/bin/
1615 # CROSS_TOP=`xcode-select --print-path`/Platforms/iPhoneOS.platform/Developer
1616 # CROSS_SDK=iPhoneOS.sdk
1618 "iphoneos-cross" => {
1619 inherit_from => [ "darwin-common" ],
1620 cflags => add("-isysroot \$(CROSS_TOP)/SDKs/\$(CROSS_SDK) -fno-common"),
1624 inherit_from => [ "darwin-common", asm("armv4_asm") ],
1625 # It should be possible to go below iOS 6 and even add -arch armv6,
1626 # thus targeting iPhone pre-3GS, but it's assumed to be irrelevant
1628 cflags => add("-arch armv7 -mios-version-min=6.0.0 -isysroot \$(CROSS_TOP)/SDKs/\$(CROSS_SDK) -fno-common"),
1630 perlasm_scheme => "ios32",
1633 inherit_from => [ "darwin-common", asm("aarch64_asm") ],
1634 cflags => add("-arch arm64 -mios-version-min=7.0.0 -isysroot \$(CROSS_TOP)/SDKs/\$(CROSS_SDK) -fno-common"),
1636 bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
1637 perlasm_scheme => "ios64",
1642 inherit_from => [ "BASE_unix" ],
1643 inherit_from => [ asm("x86_elf_asm") ],
1645 cflags => combine("-DL_ENDIAN -O3 -fomit-frame-pointer -Wall",
1646 threads("-pthread")),
1647 ex_libs => add("-ldl", threads("-pthread")),
1648 bn_ops => "BN_LLONG",
1649 thread_scheme => "pthreads",
1650 dso_scheme => "dlfcn",
1651 shared_target => "linux-shared",
1652 shared_cflag => "-fPIC",
1653 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
1656 ##### VxWorks for various targets
1657 "vxworks-ppc60x" => {
1658 inherit_from => [ "BASE_unix" ],
1660 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",
1661 sys_id => "VXWORKS",
1662 ex_libs => add("-Wl,--defsym,__wrs_rtp_base=0xe0000000 -L \$(WIND_BASE)/target/usr/lib/ppc/PPC32/common"),
1664 "vxworks-ppcgen" => {
1665 inherit_from => [ "BASE_unix" ],
1667 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",
1668 sys_id => "VXWORKS",
1669 ex_libs => add("-Wl,--defsym,__wrs_rtp_base=0xe0000000 -L \$(WIND_BASE)/target/usr/lib/ppc/PPC32/sfcommon"),
1671 "vxworks-ppc405" => {
1672 inherit_from => [ "BASE_unix" ],
1674 cflags => "-g -msoft-float -mlongcall -DCPU=PPC405 -I\$(WIND_BASE)/target/h",
1675 sys_id => "VXWORKS",
1678 "vxworks-ppc750" => {
1679 inherit_from => [ "BASE_unix" ],
1681 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)",
1682 sys_id => "VXWORKS",
1685 "vxworks-ppc750-debug" => {
1686 inherit_from => [ "BASE_unix" ],
1688 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",
1689 sys_id => "VXWORKS",
1692 "vxworks-ppc860" => {
1693 inherit_from => [ "BASE_unix" ],
1695 cflags => "-nostdinc -msoft-float -DCPU=PPC860 -DNO_STRINGS_H -I\$(WIND_BASE)/target/h",
1696 sys_id => "VXWORKS",
1699 "vxworks-simlinux" => {
1700 inherit_from => [ "BASE_unix" ],
1702 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",
1703 sys_id => "VXWORKS",
1705 ranlib => "ranlibpentium",
1708 inherit_from => [ "BASE_unix", asm("mips32_asm") ],
1710 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",
1711 threads("-D_REENTRANT")),
1712 sys_id => "VXWORKS",
1713 ex_libs => add("-Wl,--defsym,__wrs_rtp_base=0xe0000000 -L \$(WIND_BASE)/target/usr/lib/mips/MIPSI32/sfcommon"),
1714 thread_scheme => "pthreads",
1715 perlasm_scheme => "o32",
1716 ranlib => "ranlibmips",
1721 inherit_from => [ "BASE_unix" ],
1723 cflags => combine(threads("-D_REENTRANT")),
1724 ex_libs => add("\$(LDLIBS)"),
1725 bn_ops => "BN_LLONG",
1726 thread_scheme => "pthreads",
1727 dso_scheme => "$ENV{'LIBSSL_dlfcn'}",
1728 shared_target => "linux-shared",
1729 shared_cflag => "-fPIC",
1730 shared_ldflag => "-shared",
1731 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
1732 ranlib => "$ENV{'RANLIB'}",
1734 "uClinux-dist64" => {
1735 inherit_from => [ "BASE_unix" ],
1737 cflags => combine(threads("-D_REENTRANT")),
1738 ex_libs => add("\$(LDLIBS)"),
1739 bn_ops => "SIXTY_FOUR_BIT_LONG",
1740 thread_scheme => "pthreads",
1741 dso_scheme => "$ENV{'LIBSSL_dlfcn'}",
1742 shared_target => "linux-shared",
1743 shared_cflag => "-fPIC",
1744 shared_ldflag => "-shared",
1745 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
1746 ranlib => "$ENV{'RANLIB'}",
1751 inherit_from => [ "BASE_VMS" ],
1754 cflags => picker(default => "/STANDARD=(ISOC94,RELAXED)/NOLIST/PREFIX=ALL",
1755 debug => "/NOOPTIMIZE/DEBUG",
1756 release => "/OPTIMIZE/NODEBUG"),
1757 defines => add("OPENSSL_USE_NODELETE"),
1758 lflags => picker(default => "/MAP",
1759 debug => "/DEBUG/TRACEBACK",
1760 release => "/NODEBUG/NOTRACEBACK"),
1761 lib_cflags => add("/NAMES=(AS_IS,SHORTENED)/EXTERN_MODEL=STRICT_REFDEF"),
1762 dso_cflags => add("/NAMES=(AS_IS,SHORTENED)"),
1763 shared_target => "vms-shared",
1764 dso_scheme => "vms",
1765 thread_scheme => "pthreads",
1767 apps_aux_src => "vms_decc_init.c vms_term_sock.c",
1771 inherit_from => [ "vms-generic" ],
1772 cflags => add(sub { my @warnings =
1773 @{vms_info(0)->{disable_warns}};
1775 ? "/WARNINGS=DISABLE=(".join(",",@warnings).")" : (); }),
1778 return vms_info(0)->{def_zlib}
1779 ? "LIBZ=\"\"\"".vms_info(0)->{def_zlib}."\"\"\"" : ();
1781 ex_libs => add(sub { return vms_info(0)->{zlib} || (); }),
1782 pointer_size => sub { return vms_info(0)->{pointer_size} },
1784 #debug_aflags => "/NOOPTIMIZE/DEBUG",
1785 #release_aflags => "/OPTIMIZE/NODEBUG",
1786 bn_opts => "SIXTY_FOUR_BIT RC4_INT",
1788 "vms-alpha-p32" => {
1789 inherit_from => [ "vms-generic" ],
1791 add("/POINTER_SIZE=32",
1792 sub { my @warnings =
1793 @{vms_info(32)->{disable_warns}};
1795 ? "/WARNINGS=DISABLE=(".join(",",@warnings).")" : ();
1799 return vms_info(32)->{def_zlib}
1800 ? "LIBZ=\"\"\"".vms_info(32)->{def_zlib}."\"\"\"" : ();
1802 ex_libs => add(sub { return vms_info(32)->{zlib} || (); }),
1803 pointer_size => sub { return vms_info(32)->{pointer_size} },
1805 "vms-alpha-p64" => {
1806 inherit_from => [ "vms-generic" ],
1808 add("/POINTER_SIZE=64=ARGV",
1809 sub { my @warnings =
1810 @{vms_info(64)->{disable_warns}};
1812 ? "/WARNINGS=DISABLE=(".join(",",@warnings).")" : ();
1816 return vms_info(64)->{def_zlib}
1817 ? "LIBZ=\"\"\"".vms_info(64)->{def_zlib}."\"\"\"" : ();
1819 ex_libs => add(sub { return vms_info(64)->{zlib} || (); }),
1820 pointer_size => sub { return vms_info(64)->{pointer_size} },
1823 inherit_from => [ "vms-generic" ],
1824 cflags => add(sub { my @warnings =
1825 @{vms_info(0)->{disable_warns}};
1827 ? "/WARNINGS=DISABLE=(".join(",",@warnings).")" : (); }),
1830 return vms_info(0)->{def_zlib}
1831 ? "LIBZ=\"\"\"".vms_info(0)->{def_zlib}."\"\"\"" : ();
1833 ex_libs => add(sub { return vms_info(0)->{zlib} || (); }),
1834 pointer_size => sub { return vms_info(0)->{pointer_size} },
1836 #debug_aflags => "/NOOPTIMIZE/DEBUG",
1837 #release_aflags => "/OPTIMIZE/NODEBUG",
1838 bn_opts => "SIXTY_FOUR_BIT RC4_INT",
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} || (); }),
1855 pointer_size => sub { return vms_info(32)->{pointer_size} },
1858 inherit_from => [ "vms-generic" ],
1860 add("/POINTER_SIZE=64=ARGV",
1861 sub { my @warnings =
1862 @{vms_info(64)->{disable_warns}};
1864 ? "/WARNINGS=DISABLE=(".join(",",@warnings).")" : ();
1868 return vms_info(64)->{def_zlib}
1869 ? "LIBZ=\"\"\"".vms_info(64)->{def_zlib}."\"\"\"" : ();
1871 ex_libs => add(sub { return vms_info(64)->{zlib} || (); }),
1872 pointer_size => sub { return vms_info(64)->{pointer_size} },