2 ## Standard openssl configuration targets.
4 # Helper functions for the Windows configs
5 my $vc_win64a_info = {};
7 unless (%$vc_win64a_info) {
8 if (`nasm -v 2>NUL` =~ /NASM version ([0-9]+\.[0-9]+)/ && $1 >= 2.0) {
9 $vc_win64a_info = { as => "nasm",
10 asflags => "-f win64 -DNEAR -Ox -g",
12 } elsif ($disabled{asm}) {
13 $vc_win64a_info = { as => "ml64",
14 asflags => "/c /Cp /Cx /Zi",
17 $die->("NASM not found - please read INSTALL and NOTES.WIN for further details\n");
18 $vc_win64a_info = { as => "{unknown}",
23 return $vc_win64a_info;
26 my $vc_win32_info = {};
28 unless (%$vc_win32_info) {
29 my $ver=`nasm -v 2>NUL`;
30 my $vew=`nasmw -v 2>NUL`;
31 if ($ver ne "" || $vew ne "") {
32 $vc_win32_info = { as => $ver ge $vew ? "nasm" : "nasmw",
33 asflags => "-f win32",
35 perlasm_scheme => "win32n" };
36 } elsif ($disabled{asm}) {
37 $vc_win32_info = { as => "ml",
38 asflags => "/nologo /Cp /coff /c /Cx /Zi",
40 perlasm_scheme => "win32" };
42 $die->("NASM not found - please read INSTALL and NOTES.WIN for further details\n");
43 $vc_win32_info = { as => "{unknown}",
46 perlasm_scheme => "win32" };
49 return $vc_win32_info;
52 my $vc_wince_info = {};
54 unless (%$vc_wince_info) {
56 $die->('%OSVERSION% is not defined') if (!defined($ENV{'OSVERSION'}));
57 $die->('%PLATFORM% is not defined') if (!defined($ENV{'PLATFORM'}));
58 $die->('%TARGETCPU% is not defined') if (!defined($ENV{'TARGETCPU'}));
61 # Idea behind this is to mimic flags set by eVC++ IDE...
63 my $wcevers = $ENV{'OSVERSION'}; # WCENNN
66 if ($wcevers =~ /^WCE([1-9])([0-9]{2})$/) {
68 $wceverdotnum = "$1.$2";
70 $die->('%OSVERSION% value is insane');
71 $wcevernum = "{unknown}";
72 $wceverdotnum = "{unknown}";
74 my $wcecdefs = "-D_WIN32_WCE=$wcevernum -DUNDER_CE=$wcevernum"; # -D_WIN32_WCE=NNN
75 my $wcelflag = "/subsystem:windowsce,$wceverdotnum"; # ...,N.NN
77 my $wceplatf = $ENV{'PLATFORM'};
79 $wceplatf =~ tr/a-z0-9 /A-Z0-9_/;
80 $wcecdefs .= " -DWCE_PLATFORM_$wceplatf";
82 my $wcetgt = $ENV{'TARGETCPU'}; # just shorter name...
83 SWITCH: for($wcetgt) {
84 /^X86/ && do { $wcecdefs.=" -Dx86 -D_X86_ -D_i386_ -Di_386_";
85 $wcelflag.=" /machine:X86"; last; };
86 /^ARMV4[IT]/ && do { $wcecdefs.=" -DARM -D_ARM_ -D$wcetgt";
87 $wcecdefs.=" -DTHUMB -D_THUMB_" if($wcetgt=~/T$/);
88 $wcecdefs.=" -QRarch4T -QRinterwork-return";
89 $wcelflag.=" /machine:THUMB"; last; };
90 /^ARM/ && do { $wcecdefs.=" -DARM -D_ARM_ -D$wcetgt";
91 $wcelflag.=" /machine:ARM"; last; };
92 /^MIPSIV/ && do { $wcecdefs.=" -DMIPS -D_MIPS_ -DR4000 -D$wcetgt";
93 $wcecdefs.=" -D_MIPS64 -QMmips4 -QMn32";
94 $wcelflag.=" /machine:MIPSFPU"; last; };
95 /^MIPS16/ && do { $wcecdefs.=" -DMIPS -D_MIPS_ -DR4000 -D$wcetgt";
96 $wcecdefs.=" -DMIPSII -QMmips16";
97 $wcelflag.=" /machine:MIPS16"; last; };
98 /^MIPSII/ && do { $wcecdefs.=" -DMIPS -D_MIPS_ -DR4000 -D$wcetgt";
99 $wcecdefs.=" -QMmips2";
100 $wcelflag.=" /machine:MIPS"; last; };
101 /^R4[0-9]{3}/ && do { $wcecdefs.=" -DMIPS -D_MIPS_ -DR4000";
102 $wcelflag.=" /machine:MIPS"; last; };
103 /^SH[0-9]/ && do { $wcecdefs.=" -D$wcetgt -D_${wcetgt}_ -DSHx";
104 $wcecdefs.=" -Qsh4" if ($wcetgt =~ /^SH4/);
105 $wcelflag.=" /machine:$wcetgt"; last; };
106 { $wcecdefs.=" -D$wcetgt -D_${wcetgt}_";
107 $wcelflag.=" /machine:$wcetgt"; last; };
110 $vc_wince_info = { 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 bn_ops => "BN_LLONG",
208 shared_cflag => "-fPIC",
209 shared_ldflag => "-shared -static-libgcc",
211 "solaris64-x86_64-gcc" => {
212 # -shared -static-libgcc might appear controversial, but modules
213 # taken from static libgcc do not have relocations and linking
214 # them into our shared objects doesn't have any negative side
215 # effects. On the contrary, doing so makes it possible to use
216 # gcc shared build with Sun C. Given that gcc generates faster
217 # code [thanks to inline assembler], I would actually recommend
218 # to consider using gcc shared build even with vendor compiler:-)
219 # <appro@fy.chalmers.se>
220 inherit_from => [ "solaris-common", asm("x86_64_asm") ],
222 cflags => add_before(picker(default => "-m64 -Wall -DL_ENDIAN",
225 threads("-pthread")),
226 bn_ops => "SIXTY_FOUR_BIT_LONG",
227 perlasm_scheme => "elf",
228 shared_cflag => "-fPIC",
229 shared_ldflag => "-m64 -shared -static-libgcc",
233 #### Solaris x86 with Sun C setups
234 # There used to be solaris-x86-cc target, but it was removed,
235 # primarily because vendor assembler can't assemble our modules
236 # with -KPIC flag. As result it, assembly support, was not even
237 # available as option. But its lack means lack of side-channel
238 # resistant code, which is incompatible with security by todays
239 # standards. Fortunately gcc is readily available prepackaged
240 # option, which we can firmly point at...
242 # On related note, solaris64-x86_64-cc target won't compile code
243 # paths utilizing AVX and post-Haswell instruction extensions.
244 # Consider switching to solaris64-x86_64-gcc even here...
246 "solaris64-x86_64-cc" => {
247 inherit_from => [ "solaris-common", asm("x86_64_asm") ],
249 cflags => add_before(picker(default => "-xarch=generic64 -xstrconst -Xa -DL_ENDIAN",
251 release => "-xO5 -xdepend -xbuiltin"),
252 threads("-D_REENTRANT")),
253 thread_scheme => "pthreads",
254 lflags => add("-xarch=generic64",threads("-mt")),
255 ex_libs => add(threads("-lpthread")),
256 bn_ops => "SIXTY_FOUR_BIT_LONG",
257 perlasm_scheme => "elf",
258 shared_cflag => "-KPIC",
259 shared_ldflag => "-xarch=generic64 -G -dy -z text",
263 #### SPARC Solaris with GNU C setups
264 "solaris-sparcv7-gcc" => {
265 inherit_from => [ "solaris-common" ],
267 cflags => add_before(picker(default => "-Wall -DB_ENDIAN -DBN_DIV2W",
270 threads("-pthread")),
271 bn_ops => "BN_LLONG RC4_CHAR",
272 shared_cflag => "-fPIC",
273 shared_ldflag => "-shared",
275 "solaris-sparcv8-gcc" => {
276 inherit_from => [ "solaris-sparcv7-gcc", asm("sparcv8_asm") ],
277 cflags => add_before("-mcpu=v8"),
279 "solaris-sparcv9-gcc" => {
280 # -m32 should be safe to add as long as driver recognizes
282 inherit_from => [ "solaris-sparcv7-gcc", asm("sparcv9_asm") ],
283 cflags => add_before("-m32 -mcpu=ultrasparc"),
285 "solaris64-sparcv9-gcc" => {
286 inherit_from => [ "solaris-sparcv9-gcc" ],
287 cflags => sub { my $f=join(" ",@_); $f =~ s/\-m32/-m64/; $f; },
288 bn_ops => "BN_LLONG RC4_CHAR",
289 shared_ldflag => "-m64 -shared",
293 #### SPARC Solaris with Sun C setups
294 # SC4.0 doesn't pass 'make test', upgrade to SC5.0 or SC4.2.
295 # SC4.2 is ok, better than gcc even on bn as long as you tell it -xarch=v8
296 # SC5.0 note: Compiler common patch 107357-01 or later is required!
297 "solaris-sparcv7-cc" => {
298 inherit_from => [ "solaris-common" ],
300 cflags => add_before(picker(default => "-xstrconst -Xa -DB_ENDIAN -DBN_DIV2W",
302 release => "-xO5 -xdepend"),
303 threads("-D_REENTRANT")),
304 lflags => add(threads("-mt")),
305 ex_libs => add(threads("-lpthread")),
306 bn_ops => "BN_LLONG RC4_CHAR",
307 shared_cflag => "-KPIC",
308 shared_ldflag => "-G -dy -z text",
311 "solaris-sparcv8-cc" => {
312 inherit_from => [ "solaris-sparcv7-cc", asm("sparcv8_asm") ],
313 cflags => add_before("-xarch=v8"),
315 "solaris-sparcv9-cc" => {
316 inherit_from => [ "solaris-sparcv7-cc", asm("sparcv9_asm") ],
317 cflags => add_before("-xarch=v8plus"),
319 "solaris64-sparcv9-cc" => {
320 inherit_from => [ "solaris-sparcv7-cc", asm("sparcv9_asm") ],
321 cflags => add_before("-xarch=v9"),
322 lflags => add_before("-xarch=v9"),
323 bn_ops => "BN_LLONG RC4_CHAR",
324 shared_ldflag => "-xarch=v9 -G -dy -z text",
328 #### IRIX 6.x configs
329 # Only N32 and N64 ABIs are supported.
330 "irix-mips3-gcc" => {
331 inherit_from => [ "BASE_unix", asm("mips64_asm") ],
333 cflags => combine(picker(default => "-mabi=n32 -DB_ENDIAN -DBN_DIV3W",
336 threads("-D_SGI_MP_SOURCE")),
337 ex_libs => add(threads("-lpthread")),
338 bn_ops => "RC4_CHAR SIXTY_FOUR_BIT",
339 thread_scheme => "pthreads",
340 perlasm_scheme => "n32",
341 dso_scheme => "dlfcn",
342 shared_target => "irix-shared",
343 shared_ldflag => "-mabi=n32",
344 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
348 inherit_from => [ "BASE_unix", asm("mips64_asm") ],
350 cflags => combine(picker(default => "-n32 -mips3 -use_readonly_const -G0 -rdata_shared -DB_ENDIAN -DBN_DIV3W",
353 threads("-D_SGI_MP_SOURCE")),
354 ex_libs => add(threads("-lpthread")),
355 bn_ops => "RC4_CHAR SIXTY_FOUR_BIT",
356 thread_scheme => "pthreads",
357 perlasm_scheme => "n32",
358 dso_scheme => "dlfcn",
359 shared_target => "irix-shared",
360 shared_ldflag => "-n32",
361 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
365 "irix64-mips4-gcc" => {
366 inherit_from => [ "BASE_unix", asm("mips64_asm") ],
368 cflags => combine(picker(default => "-mabi=64 -mips4 -DB_ENDIAN -DBN_DIV3W",
371 threads("-D_SGI_MP_SOURCE")),
372 ex_libs => add(threads("-lpthread")),
373 bn_ops => "RC4_CHAR SIXTY_FOUR_BIT_LONG",
374 thread_scheme => "pthreads",
375 perlasm_scheme => "64",
376 dso_scheme => "dlfcn",
377 shared_target => "irix-shared",
378 shared_ldflag => "-mabi=64",
379 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
382 "irix64-mips4-cc" => {
383 inherit_from => [ "BASE_unix", asm("mips64_asm") ],
385 cflags => combine(picker(default => "-64 -mips4 -use_readonly_const -G0 -rdata_shared -DB_ENDIAN -DBN_DIV3W",
388 threads("-D_SGI_MP_SOURCE")),
389 ex_libs => add(threads("-lpthread")),
390 bn_ops => "RC4_CHAR SIXTY_FOUR_BIT_LONG",
391 thread_scheme => "pthreads",
392 perlasm_scheme => "64",
393 dso_scheme => "dlfcn",
394 shared_target => "irix-shared",
395 shared_ldflag => "-64",
396 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
400 #### Unified HP-UX ANSI C configs.
402 # - Originally we were optimizing at +O4 level. It should be noted
403 # that the only difference between +O3 and +O4 is global inter-
404 # procedural analysis. As it has to be performed during the link
405 # stage the compiler leaves behind certain pseudo-code in lib*.a
406 # which might be release or even patch level specific. Generating
407 # the machine code for and analyzing the *whole* program appears
408 # to be *extremely* memory demanding while the performance gain is
409 # actually questionable. The situation is intensified by the default
410 # HP-UX data set size limit (infamous 'maxdsiz' tunable) of 64MB
411 # which is way too low for +O4. In other words, doesn't +O3 make
413 # - Keep in mind that the HP compiler by default generates code
414 # suitable for execution on the host you're currently compiling at.
415 # If the toolkit is meant to be used on various PA-RISC processors
416 # consider './Configure hpux-parisc-[g]cc +DAportable'.
417 # - -DMD32_XARRAY triggers workaround for compiler bug we ran into in
418 # 32-bit message digests. (For the moment of this writing) HP C
419 # doesn't seem to "digest" too many local variables (they make "him"
420 # chew forever:-). For more details look-up MD32_XARRAY comment in
421 # crypto/sha/sha_lcl.h.
422 # - originally there were 32-bit hpux-parisc2-* targets. They were
423 # scrapped, because a) they were not interchangeable with other 32-bit
424 # targets; b) performance-critical 32-bit assembly modules implement
425 # even PA-RISC 2.0-specific code paths, which are chosen at run-time,
426 # thus adequate performance is provided even with PA-RISC 1.1 build.
427 # <appro@fy.chalmers.se>
428 "hpux-parisc-gcc" => {
429 inherit_from => [ "BASE_unix" ],
431 cflags => combine(picker(default => "-DB_ENDIAN -DBN_DIV2W",
434 threads("-pthread")),
435 ex_libs => add("-Wl,+s -ldld"),
436 bn_ops => "BN_LLONG",
437 thread_scheme => "pthreads",
439 shared_target => "hpux-shared",
440 shared_cflag => "-fPIC",
441 shared_ldflag => "-shared",
442 shared_extension => ".sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
444 "hpux-parisc1_1-gcc" => {
445 inherit_from => [ "hpux-parisc-gcc", asm("parisc11_asm") ],
446 multilib => "/pa1.1",
448 "hpux64-parisc2-gcc" => {
449 inherit_from => [ "BASE_unix", asm("parisc20_64_asm") ],
451 cflags => combine(picker(default => "-DB_ENDIAN",
454 threads("-D_REENTRANT")),
455 ex_libs => add("-ldl"),
456 bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
457 thread_scheme => "pthreads",
458 dso_scheme => "dlfcn",
459 shared_target => "hpux-shared",
460 shared_cflag => "-fpic",
461 shared_ldflag => "-shared",
462 shared_extension => ".sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
463 multilib => "/pa20_64",
466 # More attempts at unified 10.X and 11.X targets for HP C compiler.
468 # Chris Ruemmler <ruemmler@cup.hp.com>
469 # Kevin Steves <ks@hp.se>
470 "hpux-parisc-cc" => {
471 inherit_from => [ "BASE_unix" ],
473 cflags => combine(picker(default => "+Optrs_strongly_typed -Ae +ESlit -DB_ENDIAN -DBN_DIV2W -DMD32_XARRAY",
474 debug => "+O0 +d -g",
476 threads("-D_REENTRANT")),
477 ex_libs => add("-Wl,+s -ldld",threads("-lpthread")),
478 bn_ops => "RC4_CHAR",
479 thread_scheme => "pthreads",
481 shared_target => "hpux-shared",
482 shared_cflag => "+Z",
483 shared_ldflag => "-b",
484 shared_extension => ".sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
486 "hpux-parisc1_1-cc" => {
487 inherit_from => [ "hpux-parisc-cc", asm("parisc11_asm") ],
488 cflags => add_before("+DA1.1"),
489 multilib => "/pa1.1",
491 "hpux64-parisc2-cc" => {
492 inherit_from => [ "BASE_unix", asm("parisc20_64_asm") ],
494 cflags => combine(picker(default => "+DD64 +Optrs_strongly_typed -Ae +ESlit -DB_ENDIAN -DMD32_XARRAY",
495 debug => "+O0 +d -g",
497 threads("-D_REENTRANT")),
498 ex_libs => add("-ldl",threads("-lpthread")),
499 bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
500 thread_scheme => "pthreads",
501 dso_scheme => "dlfcn",
502 shared_target => "hpux-shared",
503 shared_cflag => "+Z",
504 shared_ldflag => "+DD64 -b",
505 shared_extension => ".sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
506 multilib => "/pa20_64",
509 # HP/UX IA-64 targets
511 inherit_from => [ "BASE_unix", asm("ia64_asm") ],
513 cflags => combine(picker(default => "-Ae +DD32 +Olit=all -z -DB_ENDIAN",
514 debug => "+O0 +d -g",
516 threads("-D_REENTRANT")),
517 ex_libs => add("-ldl",threads("-lpthread")),
518 bn_ops => "SIXTY_FOUR_BIT",
519 thread_scheme => "pthreads",
520 dso_scheme => "dlfcn",
521 shared_target => "hpux-shared",
522 shared_cflag => "+Z",
523 shared_ldflag => "+DD32 -b",
524 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
525 multilib => "/hpux32",
527 # Frank Geurts <frank.geurts@nl.abnamro.com> has patiently assisted
528 # with debugging of the following config.
529 "hpux64-ia64-cc" => {
530 inherit_from => [ "BASE_unix", asm("ia64_asm") ],
532 cflags => combine(picker(default => "-Ae +DD64 +Olit=all -z -DB_ENDIAN",
533 debug => "+O0 +d -g",
535 threads("-D_REENTRANT")),
536 ex_libs => add("-ldl", threads("-lpthread")),
537 bn_ops => "SIXTY_FOUR_BIT_LONG",
538 thread_scheme => "pthreads",
539 dso_scheme => "dlfcn",
540 shared_target => "hpux-shared",
541 shared_cflag => "+Z",
542 shared_ldflag => "+DD64 -b",
543 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
544 multilib => "/hpux64",
548 inherit_from => [ "BASE_unix", asm("ia64_asm") ],
550 cflags => combine(picker(default => "-DB_ENDIAN",
553 threads("-pthread")),
554 ex_libs => add("-ldl"),
555 bn_ops => "SIXTY_FOUR_BIT",
556 thread_scheme => "pthreads",
557 dso_scheme => "dlfcn",
558 shared_target => "hpux-shared",
559 shared_cflag => "-fpic",
560 shared_ldflag => "-shared",
561 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
562 multilib => "/hpux32",
564 "hpux64-ia64-gcc" => {
565 inherit_from => [ "BASE_unix", asm("ia64_asm") ],
567 cflags => combine(picker(default => "-mlp64 -DB_ENDIAN",
570 threads("-pthread")),
571 ex_libs => add("-ldl"),
572 bn_ops => "SIXTY_FOUR_BIT_LONG",
573 thread_scheme => "pthreads",
574 dso_scheme => "dlfcn",
575 shared_target => "hpux-shared",
576 shared_cflag => "-fpic",
577 shared_ldflag => "-mlp64 -shared",
578 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
579 multilib => "/hpux64",
582 #### HP MPE/iX http://jazz.external.hp.com/src/openssl/
584 inherit_from => [ "BASE_unix" ],
586 cflags => "-D_ENDIAN -DBN_DIV2W -O3 -D_POSIX_SOURCE -D_SOCKET_SOURCE -I/SYSLOG/PUB",
588 ex_libs => add("-L/SYSLOG/PUB -lsyslog -lsocket -lcurses"),
589 thread_scheme => "(unknown)",
590 bn_ops => "BN_LLONG",
593 #### DEC Alpha Tru64 targets. Tru64 is marketing name for OSF/1 version 4
594 #### and forward. In reality 'uname -s' still returns "OSF1". Originally
595 #### there were even osf1-* configs targeting prior versions provided,
596 #### but not anymore...
597 "tru64-alpha-gcc" => {
598 inherit_from => [ "BASE_unix", asm("alpha_asm") ],
600 cflags => combine("-std=c9x -D_XOPEN_SOURCE=500 -D_OSF_SOURCE -O3",
601 threads("-pthread")),
602 ex_libs => "-lrt", # for mlock(2)
603 bn_ops => "SIXTY_FOUR_BIT_LONG",
604 thread_scheme => "pthreads",
605 dso_scheme => "dlfcn",
606 shared_target => "alpha-osf1-shared",
607 shared_extension => ".so",
609 "tru64-alpha-cc" => {
610 inherit_from => [ "BASE_unix", asm("alpha_asm") ],
612 cflags => combine("-std1 -D_XOPEN_SOURCE=500 -D_OSF_SOURCE -tune host -fast -readonly_strings",
613 threads("-pthread")),
614 ex_libs => "-lrt", # for mlock(2)
615 bn_ops => "SIXTY_FOUR_BIT_LONG",
616 thread_scheme => "pthreads",
617 dso_scheme => "dlfcn",
618 shared_target => "alpha-osf1-shared",
619 shared_ldflag => "-msym",
620 shared_extension => ".so",
624 #### Variety of LINUX:-)
626 # *-generic* is endian-neutral target, but ./config is free to
627 # throw in -D[BL]_ENDIAN, whichever appropriate...
628 "linux-generic32" => {
629 inherit_from => [ "BASE_unix" ],
631 cflags => combine(picker(default => "-Wall",
634 threads("-pthread")),
635 ex_libs => add("-ldl"),
636 bn_ops => "BN_LLONG RC4_CHAR",
637 thread_scheme => "pthreads",
638 dso_scheme => "dlfcn",
639 shared_target => "linux-shared",
640 shared_cflag => "-fPIC -DOPENSSL_USE_NODELETE",
641 shared_ldflag => "-Wl,-znodelete",
642 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
644 "linux-generic64" => {
645 inherit_from => [ "linux-generic32" ],
646 bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
650 inherit_from => [ "linux-generic32", asm("ppc32_asm") ],
651 perlasm_scheme => "linux32",
654 inherit_from => [ "linux-generic64", asm("ppc64_asm") ],
655 cflags => add("-m64 -DB_ENDIAN"),
656 perlasm_scheme => "linux64",
657 shared_ldflag => add("-m64"),
661 inherit_from => [ "linux-generic64", asm("ppc64_asm") ],
662 cflags => add("-m64 -DL_ENDIAN"),
663 perlasm_scheme => "linux64le",
664 shared_ldflag => add("-m64"),
668 ################################################################
669 # Note that -march is not among compiler options in linux-armv4
670 # target description. Not specifying one is intentional to give
673 # a) rely on your compiler default by not specifying one;
674 # b) specify your target platform explicitly for optimal
675 # performance, e.g. -march=armv6 or -march=armv7-a;
676 # c) build "universal" binary that targets *range* of platforms
677 # by specifying minimum and maximum supported architecture;
679 # As for c) option. It actually makes no sense to specify
680 # maximum to be less than ARMv7, because it's the least
681 # requirement for run-time switch between platform-specific
682 # code paths. And without run-time switch performance would be
683 # equivalent to one for minimum. Secondly, there are some
684 # natural limitations that you'd have to accept and respect.
685 # Most notably you can *not* build "universal" binary for
686 # big-endian platform. This is because ARMv7 processor always
687 # picks instructions in little-endian order. Another similar
688 # limitation is that -mthumb can't "cross" -march=armv6t2
689 # boundary, because that's where it became Thumb-2. Well, this
690 # limitation is a bit artificial, because it's not really
691 # impossible, but it's deemed too tricky to support. And of
692 # course you have to be sure that your binutils are actually
693 # up to the task of handling maximum target platform. With all
694 # this in mind here is an example of how to configure
697 # ./Configure linux-armv4 -march=armv6 -D__ARM_MAX_ARCH__=8
699 inherit_from => [ "linux-generic32", asm("armv4_asm") ],
700 perlasm_scheme => "linux32",
703 inherit_from => [ "linux-generic64", asm("aarch64_asm") ],
704 perlasm_scheme => "linux64",
706 "linux-arm64ilp32" => { # https://wiki.linaro.org/Platform/arm64-ilp32
707 inherit_from => [ "linux-generic32", asm("aarch64_asm") ],
708 cflags => add("-mabi=ilp32"),
709 bn_ops => "SIXTY_FOUR_BIT RC4_CHAR",
710 perlasm_scheme => "linux64",
711 shared_ldflag => add("-mabi=ilp32"),
715 # Configure script adds minimally required -march for assembly
716 # support, if no -march was specified at command line.
717 inherit_from => [ "linux-generic32", asm("mips32_asm") ],
718 cflags => add("-mabi=32 -DBN_DIV3W"),
719 perlasm_scheme => "o32",
720 shared_ldflag => add("-mabi=32"),
722 # mips32 and mips64 below refer to contemporary MIPS Architecture
723 # specifications, MIPS32 and MIPS64, rather than to kernel bitness.
725 inherit_from => [ "linux-generic32", asm("mips64_asm") ],
726 cflags => add("-mabi=n32 -DBN_DIV3W"),
727 bn_ops => "SIXTY_FOUR_BIT RC4_CHAR",
728 perlasm_scheme => "n32",
729 shared_ldflag => add("-mabi=n32"),
732 "linux64-mips64" => {
733 inherit_from => [ "linux-generic64", asm("mips64_asm") ],
734 cflags => add("-mabi=64 -DBN_DIV3W"),
735 perlasm_scheme => "64",
736 shared_ldflag => add("-mabi=64"),
740 #### IA-32 targets...
741 #### These two targets are a bit aged and are to be used on older Linux
742 #### machines where gcc doesn't understand -m32 and -m64
744 inherit_from => [ "linux-generic32", asm("x86_elf_asm") ],
745 cflags => add(picker(default => "-DL_ENDIAN",
746 release => "-fomit-frame-pointer")),
747 bn_ops => "BN_LLONG",
750 inherit_from => [ "BASE_unix", asm("x86_asm") ],
752 cflags => add(picker(default => "-DL_ENDIAN -Wall",
754 release => "-O3 -fomit-frame-pointer")),
755 bn_ops => "BN_LLONG",
756 thread_scheme => "(unknown)",
757 perlasm_scheme => "a.out",
760 #### X86 / X86_64 targets
762 inherit_from => [ "linux-generic32", asm("x86_asm") ],
763 cflags => add(picker(default => "-m32 -DL_ENDIAN",
764 release => "-fomit-frame-pointer")),
765 bn_ops => "BN_LLONG",
766 perlasm_scheme => "elf",
767 shared_ldflag => add("-m32"),
769 "linux-x86-clang" => {
770 inherit_from => [ "linux-x86" ],
773 cflags => add("-Wextra -Qunused-arguments"),
776 inherit_from => [ "linux-generic64", asm("x86_64_asm") ],
777 cflags => add("-m64 -DL_ENDIAN"),
778 bn_ops => "SIXTY_FOUR_BIT_LONG",
779 perlasm_scheme => "elf",
780 shared_ldflag => add("-m64"),
783 "linux-x86_64-clang" => {
784 inherit_from => [ "linux-x86_64" ],
786 cflags => add("-Wextra -Qunused-arguments"),
789 inherit_from => [ "linux-generic32", asm("x86_64_asm") ],
790 cflags => add("-mx32 -DL_ENDIAN"),
791 bn_ops => "SIXTY_FOUR_BIT",
792 perlasm_scheme => "elf32",
793 shared_ldflag => add("-mx32"),
798 inherit_from => [ "linux-generic64", asm("ia64_asm") ],
799 bn_ops => "SIXTY_FOUR_BIT_LONG",
803 inherit_from => [ "linux-generic64", asm("s390x_asm") ],
804 cflags => add("-m64 -DB_ENDIAN"),
805 perlasm_scheme => "64",
806 shared_ldflag => add("-m64"),
810 #### So called "highgprs" target for z/Architecture CPUs
811 # "Highgprs" is kernel feature first implemented in Linux
812 # 2.6.32, see /proc/cpuinfo. The idea is to preserve most
813 # significant bits of general purpose registers not only
814 # upon 32-bit process context switch, but even on
815 # asynchronous signal delivery to such process. This makes
816 # it possible to deploy 64-bit instructions even in legacy
817 # application context and achieve better [or should we say
818 # adequate] performance. The build is binary compatible with
819 # linux-generic32, and the idea is to be able to install the
820 # resulting libcrypto.so alongside generic one, e.g. as
821 # /lib/highgprs/libcrypto.so.x.y, for ldconfig and run-time
822 # linker to autodiscover. Unfortunately it doesn't work just
823 # yet, because of couple of bugs in glibc
824 # sysdeps/s390/dl-procinfo.c affecting ldconfig and ld.so.1...
826 inherit_from => [ "linux-generic32", asm("s390x_asm") ],
827 cflags => add("-m31 -Wa,-mzarch -DB_ENDIAN"),
828 bn_asm_src => sub { my $r=join(" ",@_); $r=~s|asm/s390x\.S|bn_asm.c|; $r; },
829 perlasm_scheme => "31",
830 shared_ldflag => add("-m31"),
831 multilib => "/highgprs",
834 #### SPARC Linux setups
835 # Ray Miller <ray.miller@computing-services.oxford.ac.uk> has
836 # patiently assisted with debugging of following two configs.
838 inherit_from => [ "linux-generic32", asm("sparcv8_asm") ],
839 cflags => add("-mcpu=v8 -DB_ENDIAN -DBN_DIV2W"),
842 # it's a real mess with -mcpu=ultrasparc option under Linux,
843 # but -Wa,-Av8plus should do the trick no matter what.
844 inherit_from => [ "linux-generic32", asm("sparcv9_asm") ],
845 cflags => add("-m32 -mcpu=ultrasparc -Wa,-Av8plus -DB_ENDIAN -DBN_DIV2W"),
846 shared_ldflag => add("-m32"),
848 "linux64-sparcv9" => {
849 # GCC 3.1 is a requirement
850 inherit_from => [ "linux-generic64", asm("sparcv9_asm") ],
851 cflags => add("-m64 -mcpu=ultrasparc -DB_ENDIAN"),
852 bn_ops => "BN_LLONG RC4_CHAR",
853 shared_ldflag => add("-m64"),
857 "linux-alpha-gcc" => {
858 inherit_from => [ "linux-generic64", asm("alpha_asm") ],
859 cflags => add("-DL_ENDIAN"),
860 bn_ops => "SIXTY_FOUR_BIT_LONG",
862 "linux-c64xplus" => {
863 inherit_from => [ "BASE_unix" ],
864 # TI_CGT_C6000_7.3.x is a requirement
866 cflags => combine("--linux -ea=.s -eo=.o -mv6400+ -o2 -ox -ms -pden -DOPENSSL_SMALL_FOOTPRINT",
867 threads("-D_REENTRANT")),
868 bn_ops => "BN_LLONG",
869 cpuid_asm_src => "c64xpluscpuid.s",
870 bn_asm_src => "asm/bn-c64xplus.asm c64xplus-gf2m.s",
871 aes_asm_src => "aes-c64xplus.s aes_cbc.c aes-ctr.fake",
872 sha1_asm_src => "sha1-c64xplus.s sha256-c64xplus.s sha512-c64xplus.s",
873 rc4_asm_src => "rc4-c64xplus.s",
874 modes_asm_src => "ghash-c64xplus.s",
875 chacha_asm_src => "chacha-c64xplus.s",
876 poly1305_asm_src => "poly1305-c64xplus.s",
877 thread_scheme => "pthreads",
878 perlasm_scheme => "void",
879 dso_scheme => "dlfcn",
880 shared_target => "linux-shared",
881 shared_cflag => "--pic",
882 shared_ldflag => add("-z --sysv --shared"),
883 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
887 #### Android: linux-* but without pointers to headers and libs.
889 # It takes pair of prior-set environment variables to make it work:
891 # CROSS_SYSROOT=/some/where/android-ndk-<ver>/platforms/android-<apiver>/arch-<arch>
892 # CROSS_COMPILE=<prefix>
894 # As well as PATH adjusted to cover ${CROSS_COMPILE}gcc and company.
895 # For example to compile for ICS and ARM with NDK 10d, you'd:
897 # ANDROID_NDK=/some/where/android-ndk-10d
898 # CROSS_SYSROOT=$ANDROID_NDK/platforms/android-14/arch-arm
899 # CROSS_COMPILE=arm-linux-adroideabi-
900 # PATH=$ANDROID_NDK/toolchains/arm-linux-androideabi-4.8/prebuild/linux-x86_64/bin
903 inherit_from => [ "linux-generic32" ],
904 # Special note about unconditional -fPIC and -pie. The underlying
905 # reason is that Lollipop refuses to run non-PIE. But what about
906 # older systems and NDKs? -fPIC was never problem, so the only
907 # concern is -pie. Older toolchains, e.g. r4, appear to handle it
908 # and binaries turn mostly functional. "Mostly" means that oldest
909 # Androids, such as Froyo, fail to handle executable, but newer
910 # systems are perfectly capable of executing binaries targeting
911 # Froyo. Keep in mind that in the nutshell Android builds are
912 # about JNI, i.e. shared libraries, not applications.
913 cflags => add(picker(default => "-mandroid -fPIC --sysroot=\$(CROSS_SYSROOT) -Wa,--noexecstack")),
914 bin_cflags => "-pie",
917 inherit_from => [ "android", asm("x86_asm") ],
918 cflags => add(picker(release => "-fomit-frame-pointer")),
919 bn_ops => "BN_LLONG",
920 perlasm_scheme => "android",
922 ################################################################
923 # Contemporary Android applications can provide multiple JNI
924 # providers in .apk, targeting multiple architectures. Among
925 # them there is "place" for two ARM flavours: generic eabi and
926 # armv7-a/hard-float. However, it should be noted that OpenSSL's
927 # ability to engage NEON is not constrained by ABI choice, nor
928 # is your ability to call OpenSSL from your application code
929 # compiled with floating-point ABI other than default 'soft'.
930 # [Latter thanks to __attribute__((pcs("aapcs"))) declaration.]
931 # This means that choice of ARM libraries you provide in .apk
932 # is driven by application needs. For example if application
933 # itself benefits from NEON or is floating-point intensive, then
934 # it might be appropriate to provide both libraries. Otherwise
935 # just generic eabi would do. But in latter case it would be
938 # ./Configure android-armeabi -D__ARM_MAX_ARCH__=8
940 # in order to build "universal" binary and allow OpenSSL take
941 # advantage of NEON when it's available.
943 "android-armeabi" => {
944 inherit_from => [ "android", asm("armv4_asm") ],
947 inherit_from => [ "android", asm("mips32_asm") ],
948 perlasm_scheme => "o32",
952 inherit_from => [ "linux-generic64" ],
953 cflags => add(picker(default => "-mandroid -fPIC --sysroot=\$(CROSS_SYSROOT) -Wa,--noexecstack")),
954 bin_cflags => "-pie",
956 "android64-aarch64" => {
957 inherit_from => [ "android64", asm("aarch64_asm") ],
958 perlasm_scheme => "linux64",
963 # As for thread cflag. Idea is to maintain "collective" set of
964 # flags, which would cover all BSD flavors. -pthread applies
965 # to them all, but is treated differently. OpenBSD expands is
966 # as -D_POSIX_THREAD -lc_r, which is sufficient. FreeBSD 4.x
967 # expands it as -lc_r, which has to be accompanied by explicit
968 # -D_THREAD_SAFE and sometimes -D_REENTRANT. FreeBSD 5.x
969 # expands it as -lc_r, which seems to be sufficient?
970 inherit_from => [ "BASE_unix" ],
972 cflags => combine(picker(default => "-Wall",
975 threads("-pthread -D_THREAD_SAFE -D_REENTRANT")),
976 bn_ops => "BN_LLONG",
977 thread_scheme => "pthreads",
978 dso_scheme => "dlfcn",
979 shared_target => "bsd-gcc-shared",
980 shared_cflag => "-fPIC",
981 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
984 inherit_from => [ "BSD-generic32" ],
985 bn_ops => "SIXTY_FOUR_BIT_LONG",
989 inherit_from => [ "BSD-generic32", asm("x86_asm") ],
990 cflags => add(picker(default => "-DL_ENDIAN",
991 release => "-fomit-frame-pointer")),
992 bn_ops => "BN_LLONG",
993 shared_target => "bsd-shared",
994 perlasm_scheme => "a.out",
997 inherit_from => [ "BSD-x86" ],
998 perlasm_scheme => "elf",
1002 inherit_from => [ "BSD-generic32", asm("sparcv8_asm") ],
1003 cflags => add("-mcpu=v8 -DB_ENDIAN"),
1006 # -DMD32_REG_T=int doesn't actually belong in sparc64 target, it
1007 # simply *happens* to work around a compiler bug in gcc 3.3.3,
1008 # triggered by RIPEMD160 code.
1009 inherit_from => [ "BSD-generic64", asm("sparcv9_asm") ],
1010 cflags => add("-DB_ENDIAN -DMD32_REG_T=int"),
1011 bn_ops => "BN_LLONG",
1015 inherit_from => [ "BSD-generic64", asm("ia64_asm") ],
1016 cflags => add_before("-DL_ENDIAN"),
1017 bn_ops => "SIXTY_FOUR_BIT_LONG",
1021 inherit_from => [ "BSD-generic64", asm("x86_64_asm") ],
1022 cflags => add_before("-DL_ENDIAN"),
1023 bn_ops => "SIXTY_FOUR_BIT_LONG",
1024 perlasm_scheme => "elf",
1028 inherit_from => [ "BASE_unix", asm("x86_elf_asm") ],
1030 cflags => "-DPERL5 -DL_ENDIAN -fomit-frame-pointer -O3 -Wall",
1031 ex_libs => add("-ldl"),
1032 bn_ops => "BN_LLONG",
1033 thread_scheme => "(unknown)",
1034 dso_scheme => "dlfcn",
1035 shared_target => "bsd-gcc-shared",
1036 shared_cflag => "-fPIC",
1037 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
1041 inherit_from => [ "BASE_unix" ],
1043 cflags => "-O -Wall",
1044 unistd => "<libc.h>",
1045 bn_ops => "BN_LLONG",
1046 thread_scheme => "(unknown)",
1049 inherit_from => [ "BASE_unix" ],
1051 cflags => "-O3 -Wall",
1052 unistd => "<libc.h>",
1053 bn_ops => "BN_LLONG",
1054 thread_scheme => "(unknown)",
1059 inherit_from => [ "BASE_unix" ],
1061 cflags => "-DL_ENDIAN -DTERMIO",
1062 thread_scheme => "(unknown)",
1065 inherit_from => [ "BASE_unix" ],
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 inherit_from => [ "BASE_unix", asm("x86_elf_asm") ],
1076 cflags => "-DL_ENDIAN -O2 -Wall",
1077 ex_libs => add("-lsocket"),
1078 dso_scheme => "dlfcn",
1079 shared_target => "bsd-gcc-shared",
1080 shared_cflag => "-fPIC",
1081 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
1084 #### SCO/Caldera targets.
1086 # Originally we had like unixware-*, unixware-*-pentium, unixware-*-p6, etc.
1087 # Now we only have blended unixware-* as it's the only one used by ./config.
1088 # If you want to optimize for particular microarchitecture, bypass ./config
1089 # and './Configure unixware-7 -Kpentium_pro' or whatever appropriate.
1090 # Note that not all targets include assembler support. Mostly because of
1091 # lack of motivation to support out-of-date platforms with out-of-date
1092 # compiler drivers and assemblers. Tim Rice <tim@multitalents.net> has
1093 # patiently assisted to debug most of it.
1095 # UnixWare 2.0x fails destest with -O.
1097 inherit_from => [ "BASE_unix" ],
1099 cflags => combine("-DFILIO_H -DNO_STRINGS_H",
1100 threads("-Kthread")),
1101 ex_libs => add("-lsocket -lnsl -lresolv -lx"),
1102 thread_scheme => "uithreads",
1105 inherit_from => [ "BASE_unix" ],
1107 cflags => combine("-O -DFILIO_H",
1108 threads("-Kthread")),
1109 ex_libs => add("-lsocket -lnsl -lresolv -lx"),
1110 thread_scheme => "uithreads",
1113 inherit_from => [ "BASE_unix", asm("x86_elf_asm") ],
1115 cflags => combine("-O -DFILIO_H -Kalloca",
1116 threads("-Kthread")),
1117 ex_libs => add("-lsocket -lnsl"),
1118 thread_scheme => "uithreads",
1119 bn_ops => "BN_LLONG",
1120 perlasm_scheme => "elf-1",
1121 dso_scheme => "dlfcn",
1122 shared_target => "svr5-shared",
1123 shared_cflag => "-Kpic",
1124 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
1126 "unixware-7-gcc" => {
1127 inherit_from => [ "BASE_unix", asm("x86_elf_asm") ],
1129 cflags => combine("-DL_ENDIAN -DFILIO_H -O3 -fomit-frame-pointer -Wall",
1130 threads("-D_REENTRANT")),
1131 ex_libs => add("-lsocket -lnsl"),
1132 bn_ops => "BN_LLONG",
1133 thread_scheme => "pthreads",
1134 perlasm_scheme => "elf-1",
1135 dso_scheme => "dlfcn",
1136 shared_target => "gnu-shared",
1137 shared_cflag => "-fPIC",
1138 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
1140 # SCO 5 - Ben Laurie <ben@algroup.co.uk> says the -O breaks the SCO cc.
1142 inherit_from => [ "BASE_unix", asm("x86_elf_asm") ],
1145 ex_libs => add("-lsocket -lnsl"),
1146 thread_scheme => "(unknown)",
1147 perlasm_scheme => "elf-1",
1148 dso_scheme => "dlfcn",
1149 shared_target => "svr3-shared",
1150 shared_cflag => "-Kpic",
1151 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
1154 inherit_from => [ "BASE_unix", asm("x86_elf_asm") ],
1156 cflags => "-O3 -fomit-frame-pointer",
1157 ex_libs => add("-lsocket -lnsl"),
1158 bn_ops => "BN_LLONG",
1159 thread_scheme => "(unknown)",
1160 perlasm_scheme => "elf-1",
1161 dso_scheme => "dlfcn",
1162 shared_target => "svr3-shared",
1163 shared_cflag => "-fPIC",
1164 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
1168 # Below targets assume AIX >=5. Caveat lector. If you are accustomed
1169 # to control compilation "bitness" by setting $OBJECT_MODE environment
1170 # variable, then you should know that in OpenSSL case it's considered
1171 # only in ./config. Once configured, build procedure remains "deaf" to
1172 # current value of $OBJECT_MODE.
1174 inherit_from => [ "BASE_unix", asm("ppc32_asm") ],
1176 cflags => combine(picker(default => "-DB_ENDIAN",
1179 threads("-pthread")),
1181 bn_ops => "BN_LLONG RC4_CHAR",
1182 thread_scheme => "pthreads",
1183 perlasm_scheme => "aix32",
1184 dso_scheme => "dlfcn",
1185 shared_target => "aix-shared",
1186 shared_ldflag => "-shared -static-libgcc -Wl,-G",
1187 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
1191 inherit_from => [ "BASE_unix", asm("ppc64_asm") ],
1193 cflags => combine(picker(default => "-maix64 -DB_ENDIAN",
1196 threads("-pthread")),
1198 bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
1199 thread_scheme => "pthreads",
1200 perlasm_scheme => "aix64",
1201 dso_scheme => "dlfcn",
1202 shared_target => "aix-shared",
1203 shared_ldflag => "-maix64 -shared -static-libgcc -Wl,-G",
1204 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
1208 inherit_from => [ "BASE_unix", asm("ppc32_asm") ],
1210 cflags => combine(picker(default => "-q32 -DB_ENDIAN -qmaxmem=16384 -qro -qroconst",
1213 threads("-qthreaded -D_THREAD_SAFE")),
1215 bn_ops => "BN_LLONG RC4_CHAR",
1216 thread_scheme => "pthreads",
1217 ex_libs => threads("-lpthreads"),
1218 perlasm_scheme => "aix32",
1219 dso_scheme => "dlfcn",
1220 shared_target => "aix-shared",
1221 shared_ldflag => "-q32 -G",
1222 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
1226 inherit_from => [ "BASE_unix", asm("ppc64_asm") ],
1228 cflags => combine(picker(default => "-q64 -DB_ENDIAN -qmaxmem=16384 -qro -qroconst",
1231 threads("-qthreaded -D_THREAD_SAFE")),
1233 bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
1234 thread_scheme => "pthreads",
1235 ex_libs => threads("-lpthreads"),
1236 perlasm_scheme => "aix64",
1237 dso_scheme => "dlfcn",
1238 shared_target => "aix-shared",
1239 shared_ldflag => "-q64 -G",
1240 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
1244 # SIEMENS BS2000/OSD: an EBCDIC-based mainframe
1246 inherit_from => [ "BASE_unix" ],
1248 cflags => "-O -XLLML -XLLMK -XL -DB_ENDIAN -DCHARSET_EBCDIC",
1249 ex_libs => add("-lsocket -lnsl"),
1250 bn_ops => "THIRTY_TWO_BIT RC4_CHAR",
1251 thread_scheme => "(unknown)",
1254 # OS/390 Unix an EBCDIC-based Unix system on IBM mainframe
1255 # You need to compile using the c89.sh wrapper in the tools directory, because the
1256 # IBM compiler does not like the -L switch after any object modules.
1259 inherit_from => [ "BASE_unix" ],
1261 cflags => "-O -DB_ENDIAN -DCHARSET_EBCDIC -DNO_SYS_PARAM_H -D_ALL_SOURCE",
1262 bn_ops => "THIRTY_TWO_BIT RC4_CHAR",
1263 thread_scheme => "(unknown)",
1266 #### Visual C targets
1268 # Win64 targets, WIN64I denotes IA-64 and WIN64A - AMD64
1270 # Note about -wd4090, disable warning C4090. This warning returns false
1271 # positives in some situations. Disabling it altogether masks both
1272 # legitimate and false cases, but as we compile on multiple platforms,
1273 # we rely on other compilers to catch legitimate cases.
1275 # Also note that we force threads no matter what. Configuring "no-threads"
1278 inherit_from => [ "BASE_Windows" ],
1281 cflags => "-W3 -wd4090 -Gs0 -GF -Gy -nologo -DOPENSSL_SYS_WIN32 -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -D_CRT_SECURE_NO_DEPRECATE",
1282 defines => add(sub { my @defs = ();
1283 unless ($disabled{"zlib-dynamic"}) {
1285 $withargs{zlib_lib} // "ZLIB1";
1288 'LIBZ="' . $zlib . '"');
1293 lib_cflags => add("/Zi /Fdossl_static"),
1294 dso_cflags => "/Zi /Fddso",
1295 bin_cflags => "/Zi /Fdapp",
1296 lflags => add("/debug"),
1297 shared_ldflag => "/dll",
1298 shared_target => "win-shared", # meaningless except it gives Configure a hint
1299 thread_scheme => "winthreads",
1300 dso_scheme => "win32",
1301 apps_aux_src => add("win32_init.c"),
1303 "VC-noCE-common" => {
1304 inherit_from => [ "VC-common" ],
1306 cflags => add(picker(default => "-DUNICODE -D_UNICODE",
1309 ($disabled{shared} ? "" : "/MDd")
1310 ." /Od -DDEBUG -D_DEBUG";
1314 ($disabled{shared} ? "" : "/MD")
1317 lib_cflags => add(sub { $disabled{shared} ? "/MT /Zl" : () }),
1318 # Following might/should appears controversial, i.e. defining
1319 # /MDd without evaluating $disabled{shared}. It works in
1320 # non-shared build because static library is compiled with /Zl
1321 # and bares no reference to specific RTL. And it works in
1322 # shared build because multiple /MDd options are not prohibited.
1323 # But why /MDd in static build? Well, basically this is just a
1324 # reference point, which allows to catch eventual errors that
1325 # would prevent those who want to wrap OpenSSL into own .DLL.
1326 # Why not /MD in release build then? Well, some are likely to
1327 # prefer [non-debug] openssl.exe to be free from Micorosoft RTL
1329 bin_cflags => add(picker(debug => "/MDd",
1330 release => sub { $disabled{shared} ? "/MT" : () },
1332 bin_lflags => add("/subsystem:console /opt:ref"),
1333 ex_libs => add(sub {
1335 push @ex_libs, 'ws2_32.lib' unless $disabled{sock};
1336 push @ex_libs, 'gdi32.lib advapi32.lib crypt32.lib user32.lib';
1337 return join(" ", @ex_libs);
1340 "VC-WIN64-common" => {
1341 inherit_from => [ "VC-noCE-common" ],
1343 ex_libs => add(sub {
1345 push @ex_libs, 'bufferoverflowu.lib' if (`cl 2>&1` =~ /14\.00\.4[0-9]{4}\./);
1346 return join(" ", @_, @ex_libs);
1348 bn_ops => "SIXTY_FOUR_BIT EXPORT_VAR_AS_FN",
1349 build_scheme => add("VC-W64", { separator => undef }),
1352 inherit_from => [ "VC-WIN64-common", asm("ia64_asm"),
1353 sub { $disabled{shared} ? () : "ia64_uplink" } ],
1355 asflags => "-d debug",
1358 bn_asm_src => sub { return undef unless @_;
1359 my $r=join(" ",@_); $r=~s|bn-ia64.s|bn_asm.c|; $r; },
1360 perlasm_scheme => "ias",
1361 multilib => "-ia64",
1364 inherit_from => [ "VC-WIN64-common", asm("x86_64_asm"),
1365 sub { $disabled{shared} ? () : "x86_64_uplink" } ],
1366 as => sub { vc_win64a_info()->{as} },
1367 asflags => sub { vc_win64a_info()->{asflags} },
1368 asoutflag => sub { vc_win64a_info()->{asoutflag} },
1370 bn_asm_src => sub { return undef unless @_;
1371 my $r=join(" ",@_); $r=~s|asm/x86_64-gcc|bn_asm|; $r; },
1372 perlasm_scheme => "auto",
1376 # x86 Win32 target defaults to ANSI API, if you want UNICODE,
1377 # configure with 'perl Configure VC-WIN32 -DUNICODE -D_UNICODE'
1378 inherit_from => [ "VC-noCE-common", asm("x86_asm"),
1379 sub { $disabled{shared} ? () : "uplink_common" } ],
1380 as => sub { vc_win32_info()->{as} },
1381 asflags => sub { vc_win32_info()->{asflags} },
1382 asoutflag => sub { vc_win32_info()->{asoutflag} },
1383 ex_libs => add(sub {
1385 # WIN32 UNICODE build gets linked with unicows.lib for
1386 # backward compatibility with Win9x.
1387 push @ex_libs, 'unicows.lib'
1388 if (grep { $_ eq "UNICODE" } @user_defines);
1389 return join(" ", @ex_libs, @_);
1392 bn_ops => "BN_LLONG EXPORT_VAR_AS_FN",
1393 perlasm_scheme => sub { vc_win32_info()->{perlasm_scheme} },
1394 build_scheme => add("VC-W32", { separator => undef }),
1397 inherit_from => [ "VC-common" ],
1399 asflags => "/nologo /Cp /coff /c /Cx /Zi",
1404 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',
1405 sub { vc_wince_info()->{cflags}; },
1406 sub { defined($ENV{'WCECOMPAT'})
1407 ? '-I$(WCECOMPAT)/include' : (); },
1408 sub { defined($ENV{'PORTSDK_LIBPATH'})
1409 ? '-I$(PORTSDK_LIBPATH)/../../include' : (); },
1410 sub { `cl 2>&1` =~ /Version ([0-9]+)\./ && $1>=14
1411 ? ($disabled{shared} ? " /MT" : " /MD")
1413 debug => "/Od -DDEBUG -D_DEBUG",
1415 lflags => combine("/nologo /opt:ref",
1416 sub { vc_wince_info()->{lflags}; },
1417 sub { defined($ENV{PORTSDK_LIBPATH})
1418 ? "/entry:mainCRTstartup" : (); }),
1420 bn_ops => "BN_LLONG EXPORT_VAR_AS_FN",
1421 ex_libs => add(sub {
1423 push @ex_libs, 'ws2.lib' unless $disabled{sock};
1424 push @ex_libs, 'crypt32.lib';
1425 if (defined($ENV{WCECOMPAT})) {
1426 my $x = '$(WCECOMPAT)/lib';
1427 if (-f "$x/$ENV{TARGETCPU}/wcecompatex.lib") {
1428 $x .= '/$(TARGETCPU)/wcecompatex.lib';
1430 $x .= '/wcecompatex.lib';
1434 push @ex_libs, '$(PORTSDK_LIBPATH)/portlib.lib'
1435 if (defined($ENV{'PORTSDK_LIBPATH'}));
1436 push @ex_libs, ' /nodefaultlib coredll.lib corelibc.lib'
1437 if ($ENV{'TARGETCPU'} eq "X86");
1440 build_scheme => add("VC-WCE", { separator => undef }),
1445 inherit_from => [ "BASE_unix", asm("x86_asm"),
1446 sub { $disabled{shared} ? () : "x86_uplink" } ],
1448 cflags => combine(picker(default => "-DL_ENDIAN -DWIN32_LEAN_AND_MEAN -DUNICODE -D_UNICODE -m32 -Wall",
1450 release => "-O3 -fomit-frame-pointer"),
1452 sys_id => "MINGW32",
1453 ex_libs => add("-lws2_32 -lgdi32 -lcrypt32"),
1454 bn_ops => "BN_LLONG EXPORT_VAR_AS_FN",
1455 thread_scheme => "winthreads",
1456 perlasm_scheme => "coff",
1457 dso_scheme => "win32",
1458 shared_target => "mingw-shared",
1459 shared_cflag => add("-D_WINDLL"),
1460 shared_ldflag => "-static-libgcc",
1461 shared_rcflag => "--target=pe-i386",
1462 shared_extension => ".dll",
1464 apps_aux_src => add("win32_init.c"),
1467 # As for OPENSSL_USE_APPLINK. Applink makes it possible to use
1468 # .dll compiled with one compiler with application compiled with
1469 # another compiler. It's possible to engage Applink support in
1470 # mingw64 build, but it's not done, because till mingw64
1471 # supports structured exception handling, one can't seriously
1472 # consider its binaries for using with non-mingw64 run-time
1473 # environment. And as mingw64 is always consistent with itself,
1474 # Applink is never engaged and can as well be omitted.
1475 inherit_from => [ "BASE_unix", asm("x86_64_asm") ],
1477 cflags => combine(picker(default => "-DL_ENDIAN -DWIN32_LEAN_AND_MEAN -DUNICODE -D_UNICODE -m64 -Wall",
1481 sys_id => "MINGW64",
1482 ex_libs => add("-lws2_32 -lgdi32 -lcrypt32"),
1483 bn_ops => "SIXTY_FOUR_BIT EXPORT_VAR_AS_FN",
1484 thread_scheme => "winthreads",
1485 perlasm_scheme => "mingw64",
1486 dso_scheme => "win32",
1487 shared_target => "mingw-shared",
1488 shared_cflag => add("-D_WINDLL"),
1489 shared_ldflag => "-static-libgcc",
1490 shared_rcflag => "--target=pe-x86-64",
1491 shared_extension => ".dll",
1493 apps_aux_src => add("win32_init.c"),
1498 inherit_from => [ "BASE_unix" ],
1500 cflags => "-DL_ENDIAN -O",
1506 inherit_from => [ "BASE_unix" ],
1508 cflags => "-DTERMIOS -DL_ENDIAN -O -Wall",
1510 bn_ops => "BN_LLONG",
1511 dso_scheme => "win32",
1516 inherit_from => [ "BASE_unix", asm("x86_asm") ],
1518 cflags => picker(default => "-DTERMIOS -DL_ENDIAN -Wall",
1520 release => "-O3 -fomit-frame-pointer"),
1522 bn_ops => "BN_LLONG",
1523 thread_scheme => "pthread",
1524 perlasm_scheme => "coff",
1525 dso_scheme => "dlfcn",
1526 shared_target => "cygwin-shared",
1527 shared_cflag => "-D_WINDLL",
1528 shared_ldflag => "-shared",
1529 shared_extension => ".dll",
1531 "Cygwin-x86_64" => {
1532 inherit_from => [ "BASE_unix", asm("x86_64_asm") ],
1534 cflags => picker(default => "-DTERMIOS -DL_ENDIAN -Wall",
1538 bn_ops => "SIXTY_FOUR_BIT_LONG",
1539 thread_scheme => "pthread",
1540 perlasm_scheme => "mingw64",
1541 dso_scheme => "dlfcn",
1542 shared_target => "cygwin-shared",
1543 shared_cflag => "-D_WINDLL",
1544 shared_ldflag => "-shared",
1545 shared_extension => ".dll",
1547 # Backward compatibility for those using this target
1549 inherit_from => [ "Cygwin-x86" ]
1551 # In case someone constructs the Cygwin target name themself
1553 inherit_from => [ "Cygwin-x86" ]
1556 inherit_from => [ "Cygwin-x86" ]
1559 inherit_from => [ "Cygwin-x86" ]
1562 inherit_from => [ "Cygwin-x86" ]
1565 ##### MacOS X (a.k.a. Darwin) setup
1566 "darwin-common" => {
1567 inherit_from => [ "BASE_unix" ],
1570 cflags => combine(picker(default => "",
1573 threads("-D_REENTRANT")),
1575 plib_lflags => "-Wl,-search_paths_first",
1576 bn_ops => "BN_LLONG RC4_CHAR",
1577 thread_scheme => "pthreads",
1578 perlasm_scheme => "osx32",
1579 dso_scheme => "dlfcn",
1580 ranlib => "ranlib -c",
1581 shared_target => "darwin-shared",
1582 shared_cflag => "-fPIC",
1583 shared_ldflag => "-dynamiclib",
1584 shared_extension => ".\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
1586 # Option "freeze" such as -std=gnu9x can't negatively interfere
1587 # with future defaults for below two targets, because MacOS X
1588 # for PPC has no future, it was discontinued by vendor in 2009.
1589 "darwin-ppc-cc" => {
1590 inherit_from => [ "darwin-common", asm("ppc32_asm") ],
1591 cflags => add("-arch ppc -std=gnu9x -DB_ENDIAN -Wa,-force_cpusubtype_ALL"),
1592 perlasm_scheme => "osx32",
1593 shared_ldflag => "-arch ppc -dynamiclib",
1595 "darwin64-ppc-cc" => {
1596 inherit_from => [ "darwin-common", asm("ppc64_asm") ],
1597 cflags => add("-arch ppc64 -std=gnu9x -DB_ENDIAN"),
1598 bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
1599 perlasm_scheme => "osx64",
1600 shared_ldflag => "-arch ppc64 -dynamiclib",
1602 "darwin-i386-cc" => {
1603 inherit_from => [ "darwin-common", asm("x86_asm") ],
1604 cflags => add(picker(default => "-arch i386 -DL_ENDIAN",
1605 release => "-fomit-frame-pointer")),
1606 bn_ops => "BN_LLONG RC4_INT",
1607 perlasm_scheme => "macosx",
1608 shared_ldflag => "-arch i386 -dynamiclib",
1610 "darwin64-x86_64-cc" => {
1611 inherit_from => [ "darwin-common", asm("x86_64_asm") ],
1612 cflags => add("-arch x86_64 -DL_ENDIAN -Wall"),
1613 bn_ops => "SIXTY_FOUR_BIT_LONG",
1614 perlasm_scheme => "macosx",
1615 shared_ldflag => "-arch x86_64 -dynamiclib",
1620 # It takes three prior-set environment variables to make it work:
1622 # CROSS_COMPILE=/where/toolchain/is/usr/bin/ [note ending slash]
1623 # CROSS_TOP=/where/SDKs/are
1624 # CROSS_SDK=iPhoneOSx.y.sdk
1626 # Exact paths vary with Xcode releases, but for couple of last ones
1627 # they would look like this:
1629 # CROSS_COMPILE=`xcode-select --print-path`/Toolchains/XcodeDefault.xctoolchain/usr/bin/
1630 # CROSS_TOP=`xcode-select --print-path`/Platforms/iPhoneOS.platform/Developer
1631 # CROSS_SDK=iPhoneOS.sdk
1633 "iphoneos-cross" => {
1634 inherit_from => [ "darwin-common" ],
1635 cflags => add("-isysroot \$(CROSS_TOP)/SDKs/\$(CROSS_SDK) -fno-common"),
1639 inherit_from => [ "darwin-common", asm("armv4_asm") ],
1640 # It should be possible to go below iOS 6 and even add -arch armv6,
1641 # thus targeting iPhone pre-3GS, but it's assumed to be irrelevant
1643 cflags => add("-arch armv7 -mios-version-min=6.0.0 -isysroot \$(CROSS_TOP)/SDKs/\$(CROSS_SDK) -fno-common"),
1645 perlasm_scheme => "ios32",
1648 inherit_from => [ "darwin-common", asm("aarch64_asm") ],
1649 cflags => add("-arch arm64 -mios-version-min=7.0.0 -isysroot \$(CROSS_TOP)/SDKs/\$(CROSS_SDK) -fno-common"),
1651 bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
1652 perlasm_scheme => "ios64",
1657 inherit_from => [ "BASE_unix" ],
1658 inherit_from => [ asm("x86_elf_asm") ],
1660 cflags => combine("-DL_ENDIAN -O3 -fomit-frame-pointer -Wall",
1661 threads("-pthread")),
1662 ex_libs => add("-ldl"),
1663 bn_ops => "BN_LLONG",
1664 thread_scheme => "pthreads",
1665 dso_scheme => "dlfcn",
1666 shared_target => "linux-shared",
1667 shared_cflag => "-fPIC",
1668 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
1671 ##### VxWorks for various targets
1672 "vxworks-ppc60x" => {
1673 inherit_from => [ "BASE_unix" ],
1675 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",
1676 sys_id => "VXWORKS",
1677 ex_libs => add("-Wl,--defsym,__wrs_rtp_base=0xe0000000 -L \$(WIND_BASE)/target/usr/lib/ppc/PPC32/common"),
1679 "vxworks-ppcgen" => {
1680 inherit_from => [ "BASE_unix" ],
1682 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",
1683 sys_id => "VXWORKS",
1684 ex_libs => add("-Wl,--defsym,__wrs_rtp_base=0xe0000000 -L \$(WIND_BASE)/target/usr/lib/ppc/PPC32/sfcommon"),
1686 "vxworks-ppc405" => {
1687 inherit_from => [ "BASE_unix" ],
1689 cflags => "-g -msoft-float -mlongcall -DCPU=PPC405 -I\$(WIND_BASE)/target/h",
1690 sys_id => "VXWORKS",
1693 "vxworks-ppc750" => {
1694 inherit_from => [ "BASE_unix" ],
1696 cflags => "-ansi -nostdinc -DPPC750 -D_REENTRANT -fvolatile -fno-builtin -fno-for-scope -fsigned-char -Wall -msoft-float -mlongcall -DCPU=PPC604 -I\$(WIND_BASE)/target/h \$(DEBUG_FLAG)",
1697 sys_id => "VXWORKS",
1700 "vxworks-ppc750-debug" => {
1701 inherit_from => [ "BASE_unix" ],
1703 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",
1704 sys_id => "VXWORKS",
1707 "vxworks-ppc860" => {
1708 inherit_from => [ "BASE_unix" ],
1710 cflags => "-nostdinc -msoft-float -DCPU=PPC860 -DNO_STRINGS_H -I\$(WIND_BASE)/target/h",
1711 sys_id => "VXWORKS",
1714 "vxworks-simlinux" => {
1715 inherit_from => [ "BASE_unix" ],
1717 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",
1718 sys_id => "VXWORKS",
1720 ranlib => "ranlibpentium",
1723 inherit_from => [ "BASE_unix", asm("mips32_asm") ],
1725 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",
1726 threads("-D_REENTRANT")),
1727 sys_id => "VXWORKS",
1728 ex_libs => add("-Wl,--defsym,__wrs_rtp_base=0xe0000000 -L \$(WIND_BASE)/target/usr/lib/mips/MIPSI32/sfcommon"),
1729 thread_scheme => "pthreads",
1730 perlasm_scheme => "o32",
1731 ranlib => "ranlibmips",
1736 inherit_from => [ "BASE_unix" ],
1738 cflags => combine("\$(CFLAGS)",
1739 threads("-D_REENTRANT")),
1740 plib_lflags => "\$(LDFLAGS)",
1741 ex_libs => add("\$(LDLIBS)"),
1742 bn_ops => "BN_LLONG",
1743 thread_scheme => "pthreads",
1744 dso_scheme => "$ENV{'LIBSSL_dlfcn'}",
1745 shared_target => "linux-shared",
1746 shared_cflag => "-fPIC",
1747 shared_ldflag => "-shared",
1748 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
1749 ranlib => "$ENV{'RANLIB'}",
1751 "uClinux-dist64" => {
1752 inherit_from => [ "BASE_unix" ],
1754 cflags => combine("\$(CFLAGS)",
1755 threads("-D_REENTRANT")),
1756 plib_lflags => "\$(LDFLAGS)",
1757 ex_libs => add("\$(LDLIBS)"),
1758 bn_ops => "SIXTY_FOUR_BIT_LONG",
1759 thread_scheme => "pthreads",
1760 dso_scheme => "$ENV{'LIBSSL_dlfcn'}",
1761 shared_target => "linux-shared",
1762 shared_cflag => "-fPIC",
1763 shared_ldflag => "-shared",
1764 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
1765 ranlib => "$ENV{'RANLIB'}",
1770 inherit_from => [ "BASE_VMS" ],
1773 cflags => picker(default => "/STANDARD=(ISOC94,RELAXED)/NOLIST/PREFIX=ALL",
1774 debug => "/NOOPTIMIZE/DEBUG",
1775 release => "/OPTIMIZE/NODEBUG"),
1776 defines => add("OPENSSL_USE_NODELETE"),
1777 lflags => picker(default => "/MAP",
1778 debug => "/DEBUG/TRACEBACK",
1779 release => "/NODEBUG/NOTRACEBACK"),
1780 lib_cflags => add("/NAMES=(AS_IS,SHORTENED)/EXTERN_MODEL=STRICT_REFDEF"),
1781 dso_cflags => add("/NAMES=(AS_IS,SHORTENED)"),
1782 shared_target => "vms-shared",
1783 dso_scheme => "vms",
1784 thread_scheme => "pthreads",
1786 apps_aux_src => "vms_decc_init.c vms_term_sock.c",
1790 inherit_from => [ "vms-generic" ],
1791 cflags => add(sub { my @warnings =
1792 @{vms_info(0)->{disable_warns}};
1794 ? "/WARNINGS=DISABLE=(".join(",",@warnings).")" : (); }),
1797 return vms_info(0)->{def_zlib}
1798 ? "LIBZ=\"\"\"".vms_info(0)->{def_zlib}."\"\"\"" : ();
1800 ex_libs => add(sub { return vms_info(0)->{zlib} || (); }),
1801 pointer_size => sub { return vms_info(0)->{pointer_size} },
1803 #debug_aflags => "/NOOPTIMIZE/DEBUG",
1804 #release_aflags => "/OPTIMIZE/NODEBUG",
1805 bn_opts => "SIXTY_FOUR_BIT RC4_INT",
1807 "vms-alpha-p32" => {
1808 inherit_from => [ "vms-generic" ],
1810 add("/POINTER_SIZE=32",
1811 sub { my @warnings =
1812 @{vms_info(32)->{disable_warns}};
1814 ? "/WARNINGS=DISABLE=(".join(",",@warnings).")" : ();
1818 return vms_info(32)->{def_zlib}
1819 ? "LIBZ=\"\"\"".vms_info(32)->{def_zlib}."\"\"\"" : ();
1821 ex_libs => add(sub { return vms_info(32)->{zlib} || (); }),
1822 pointer_size => sub { return vms_info(32)->{pointer_size} },
1824 "vms-alpha-p64" => {
1825 inherit_from => [ "vms-generic" ],
1827 add("/POINTER_SIZE=64=ARGV",
1828 sub { my @warnings =
1829 @{vms_info(64)->{disable_warns}};
1831 ? "/WARNINGS=DISABLE=(".join(",",@warnings).")" : ();
1835 return vms_info(64)->{def_zlib}
1836 ? "LIBZ=\"\"\"".vms_info(64)->{def_zlib}."\"\"\"" : ();
1838 ex_libs => add(sub { return vms_info(64)->{zlib} || (); }),
1839 pointer_size => sub { return vms_info(64)->{pointer_size} },
1842 inherit_from => [ "vms-generic" ],
1843 cflags => add(sub { my @warnings =
1844 @{vms_info(0)->{disable_warns}};
1846 ? "/WARNINGS=DISABLE=(".join(",",@warnings).")" : (); }),
1849 return vms_info(0)->{def_zlib}
1850 ? "LIBZ=\"\"\"".vms_info(0)->{def_zlib}."\"\"\"" : ();
1852 ex_libs => add(sub { return vms_info(0)->{zlib} || (); }),
1853 pointer_size => sub { return vms_info(0)->{pointer_size} },
1855 #debug_aflags => "/NOOPTIMIZE/DEBUG",
1856 #release_aflags => "/OPTIMIZE/NODEBUG",
1857 bn_opts => "SIXTY_FOUR_BIT RC4_INT",
1860 inherit_from => [ "vms-generic" ],
1862 add("/POINTER_SIZE=32",
1863 sub { my @warnings =
1864 @{vms_info(32)->{disable_warns}};
1866 ? "/WARNINGS=DISABLE=(".join(",",@warnings).")" : ();
1870 return vms_info(32)->{def_zlib}
1871 ? "LIBZ=\"\"\"".vms_info(32)->{def_zlib}."\"\"\"" : ();
1873 ex_libs => add(sub { return vms_info(32)->{zlib} || (); }),
1874 pointer_size => sub { return vms_info(32)->{pointer_size} },
1877 inherit_from => [ "vms-generic" ],
1879 add("/POINTER_SIZE=64=ARGV",
1880 sub { my @warnings =
1881 @{vms_info(64)->{disable_warns}};
1883 ? "/WARNINGS=DISABLE=(".join(",",@warnings).")" : ();
1887 return vms_info(64)->{def_zlib}
1888 ? "LIBZ=\"\"\"".vms_info(64)->{def_zlib}."\"\"\"" : ();
1890 ex_libs => add(sub { return vms_info(64)->{zlib} || (); }),
1891 pointer_size => sub { return vms_info(64)->{pointer_size} },