2 ## Standard openssl configuration targets.
6 return sub { add($opts{default} || (),
7 $opts{$config{build_type}} || ())->(); }
12 return sub { add($disabled{threads} ? () : @flags)->(); }
17 return sub { add(@stuff)->(); }
20 # Helper functions for the Windows configs
21 my $vc_win64a_info = {};
23 unless (%$vc_win64a_info) {
24 if (`nasm -v 2>NUL` =~ /NASM version ([0-9]+\.[0-9]+)/ && $1 >= 2.0) {
25 $vc_win64a_info = { as => "nasm",
26 asflags => "-f win64 -DNEAR -Ox -g",
29 $vc_win64a_info = { as => "ml64",
30 asflags => "/c /Cp /Cx /Zi",
34 return $vc_win64a_info;
37 my $vc_wince_info = {};
39 unless (%$vc_wince_info) {
41 die '%OSVERSION% is not defined' if (!defined($ENV{'OSVERSION'}));
42 die '%PLATFORM% is not defined' if (!defined($ENV{'PLATFORM'}));
43 die '%TARGETCPU% is not defined' if (!defined($ENV{'TARGETCPU'}));
46 # Idea behind this is to mimic flags set by eVC++ IDE...
48 my $wcevers = $ENV{'OSVERSION'}; # WCENNN
49 die '%OSVERSION% value is insane'
50 if ($wcevers !~ /^WCE([1-9])([0-9]{2})$/);
51 my $wcecdefs = "-D_WIN32_WCE=$1$2 -DUNDER_CE=$1$2"; # -D_WIN32_WCE=NNN
52 my $wcelflag = "/subsystem:windowsce,$1.$2"; # ...,N.NN
54 my $wceplatf = $ENV{'PLATFORM'};
55 my $wceplatf =~ tr/a-z0-9 /A-Z0-9_/d;
56 my $wcecdefs .= " -DWCE_PLATFORM_$wceplatf";
58 my $wcetgt = $ENV{'TARGETCPU'}; # just shorter name...
59 SWITCH: for($wcetgt) {
60 /^X86/ && do { $wcecdefs.=" -Dx86 -D_X86_ -D_i386_ -Di_386_";
61 $wcelflag.=" /machine:X86"; last; };
62 /^ARMV4[IT]/ && do { $wcecdefs.=" -DARM -D_ARM_ -D$wcetgt";
63 $wcecdefs.=" -DTHUMB -D_THUMB_" if($wcetgt=~/T$/);
64 $wcecdefs.=" -QRarch4T -QRinterwork-return";
65 $wcelflag.=" /machine:THUMB"; last; };
66 /^ARM/ && do { $wcecdefs.=" -DARM -D_ARM_ -D$wcetgt";
67 $wcelflag.=" /machine:ARM"; last; };
68 /^MIPSIV/ && do { $wcecdefs.=" -DMIPS -D_MIPS_ -DR4000 -D$wcetgt";
69 $wcecdefs.=" -D_MIPS64 -QMmips4 -QMn32";
70 $wcelflag.=" /machine:MIPSFPU"; last; };
71 /^MIPS16/ && do { $wcecdefs.=" -DMIPS -D_MIPS_ -DR4000 -D$wcetgt";
72 $wcecdefs.=" -DMIPSII -QMmips16";
73 $wcelflag.=" /machine:MIPS16"; last; };
74 /^MIPSII/ && do { $wcecdefs.=" -DMIPS -D_MIPS_ -DR4000 -D$wcetgt";
75 $wcecdefs.=" -QMmips2";
76 $wcelflag.=" /machine:MIPS"; last; };
77 /^R4[0-9]{3}/ && do { $wcecdefs.=" -DMIPS -D_MIPS_ -DR4000";
78 $wcelflag.=" /machine:MIPS"; last; };
79 /^SH[0-9]/ && do { $wcecdefs.=" -D$wcetgt -D_${wcetgt}_ -DSHx";
80 $wcecdefs.=" -Qsh4" if ($wcetgt =~ /^SH4/);
81 $wcelflag.=" /machine:$wcetgt"; last; };
82 { $wcecdefs.=" -D$wcetgt -D_${wcetgt}_";
83 $wcelflag.=" /machine:$wcetgt"; last; };
86 $vc_wince_info = { cflags => $wcecdefs,
87 lflags => $wcelflag };
89 return $vc_wince_info;
95 #### Basic configs that should work on any 32-bit box
98 cflags => picker(debug => "-O0 -g",
100 thread_scheme => "(unknown)",
101 bn_ops => "BN_LLONG",
106 thread_scheme => "(unknown)",
109 #### VOS Configurations
111 inherit_from => [ "BASE_unix" ],
113 cflags => picker(default => "-Wall -DOPENSSL_SYS_VOS -D_POSIX_C_SOURCE=200112L -D_BSD -D_VOS_EXTENDED_NAMES -DB_ENDIAN",
114 debug => "-O0 -g -DBN_DEBUG -DREF_DEBUG -DCONF_DEBUG",
116 thread_scheme => "(unknown)",
118 lflags => "-Wl,-map",
119 bn_ops => "BN_LLONG",
120 shared_extension => ".so",
123 #### Solaris configurations
124 "solaris-common" => {
125 inherit_from => [ "BASE_unix" ],
127 cflags => "-DFILIO_H",
128 ex_libs => add("-lresolv -lsocket -lnsl -ldl"),
129 dso_scheme => "dlfcn",
130 thread_scheme => "pthreads",
131 shared_target => "solaris-shared",
132 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
134 #### Solaris x86 with GNU C setups
135 "solaris-x86-gcc" => {
136 # -DOPENSSL_NO_INLINE_ASM switches off inline assembler. We have
137 # to do it here because whenever GNU C instantiates an assembler
138 # template it surrounds it with #APP #NO_APP comment pair which
139 # (at least Solaris 7_x86) /usr/ccs/bin/as fails to assemble
140 # with "Illegal mnemonic" error message.
141 inherit_from => [ "solaris-common", asm("x86_elf_asm") ],
143 cflags => add_before(picker(default => "-Wall -DL_ENDIAN -DOPENSSL_NO_INLINE_ASM",
145 release => "-O3 -fomit-frame-pointer"),
146 threads("-pthread")),
147 bn_ops => "BN_LLONG",
148 shared_cflag => "-fPIC",
149 shared_ldflag => "-shared",
151 "solaris64-x86_64-gcc" => {
152 # -shared -static-libgcc might appear controversial, but modules
153 # taken from static libgcc do not have relocations and linking
154 # them into our shared objects doesn't have any negative side
155 # effects. On the contrary, doing so makes it possible to use
156 # gcc shared build with Sun C. Given that gcc generates faster
157 # code [thanks to inline assembler], I would actually recommend
158 # to consider using gcc shared build even with vendor compiler:-)
159 # <appro@fy.chalmers.se>
160 inherit_from => [ "solaris-common", asm("x86_64_asm") ],
162 cflags => add_before(picker(default => "-m64 -Wall -DL_ENDIAN",
165 threads("-pthread")),
166 bn_ops => "SIXTY_FOUR_BIT_LONG",
167 perlasm_scheme => "elf",
168 shared_cflag => "-fPIC",
169 shared_ldflag => "-m64 -shared -static-libgcc",
173 #### Solaris x86 with Sun C setups
174 "solaris-x86-cc" => {
175 inherit_from => [ "solaris-common" ],
177 cflags => add_before(picker(default => "-xarch=generic -xstrconst -Xa -DL_ENDIAN",
179 release => "-xO5 -xregs=frameptr -xdepend -xbuiltin"),
180 threads("-D_REENTRANT")),
181 lflags => add(threads("-mt")),
182 ex_libs => add(threads("-lpthread")),
183 bn_ops => "BN_LLONG RC4_CHAR",
184 shared_cflag => "-KPIC",
185 shared_ldflag => "-G -dy -z text",
187 "solaris64-x86_64-cc" => {
188 inherit_from => [ "solaris-common", asm("x86_64_asm") ],
190 cflags => add_before(picker(default => "-xarch=generic64 -xstrconst -Xa -DL_ENDIAN",
192 release => "-xO5 -xdepend -xbuiltin"),
193 threads("-D_REENTRANT")),
194 thread_scheme => "pthreads",
195 lflags => add(threads("-mt")),
196 ex_libs => add(threads("-lpthread")),
197 bn_ops => "SIXTY_FOUR_BIT_LONG",
198 perlasm_scheme => "elf",
199 shared_cflag => "-KPIC",
200 shared_ldflag => "-xarch=generic64 -G -dy -z text",
204 #### SPARC Solaris with GNU C setups
205 "solaris-sparcv7-gcc" => {
206 inherit_from => [ "solaris-common" ],
208 cflags => add_before(picker(default => "-Wall -DB_ENDIAN -DBN_DIV2W",
211 threads("-pthread")),
212 bn_ops => "BN_LLONG RC4_CHAR",
213 shared_cflag => "-fPIC",
214 shared_ldflag => "-shared",
216 "solaris-sparcv8-gcc" => {
217 inherit_from => [ "solaris-sparcv7-gcc", asm("sparcv8_asm") ],
218 cflags => add_before("-mcpu=v8"),
220 "solaris-sparcv9-gcc" => {
221 # -m32 should be safe to add as long as driver recognizes
223 inherit_from => [ "solaris-sparcv7-gcc", asm("sparcv9_asm") ],
224 cflags => add_before(picker(default => "-m32 -mcpu=ultrasparc",
225 debug => "-DBN_DEBUG -DREF_DEBUG -DCONF_DEBUG -DBN_CTX_DEBUG -DPEDANTIC -O -g -pedantic -ansi -Wshadow -Wno-long-long -D__EXTENSIONS__")),
227 "solaris64-sparcv9-gcc" => {
228 inherit_from => [ "solaris-sparcv9-gcc" ],
229 cflags => sub { my $f=join(" ",@_); $f =~ s/\-m32/-m64/; $f; },
230 bn_ops => "BN_LLONG RC4_CHAR",
231 shared_ldflag => "-m64 -shared",
235 #### SPARC Solaris with Sun C setups
236 # SC4.0 doesn't pass 'make test', upgrade to SC5.0 or SC4.2.
237 # SC4.2 is ok, better than gcc even on bn as long as you tell it -xarch=v8
238 # SC5.0 note: Compiler common patch 107357-01 or later is required!
239 "solaris-sparcv7-cc" => {
240 inherit_from => [ "solaris-common" ],
242 cflags => add_before(picker(default => "-xstrconst -Xa -DB_ENDIAN -DBN_DIV2W",
243 debug => "-g -DBN_DEBUG -DREF_DEBUG -DCONF_DEBUG -DBN_CTX_DEBUG",
244 release => "-xO5 -xdepend"),
245 threads("-D_REENTRANT")),
246 lflags => add(threads("-mt")),
247 ex_libs => add(threads("-lpthread")),
248 bn_ops => "BN_LLONG RC4_CHAR",
249 shared_cflag => "-KPIC",
250 shared_ldflag => "-G -dy -z text",
253 "solaris-sparcv8-cc" => {
254 inherit_from => [ "solaris-sparcv7-cc", asm("sparcv8_asm") ],
255 cflags => add_before("-xarch=v8"),
257 "solaris-sparcv9-cc" => {
258 inherit_from => [ "solaris-sparcv7-cc", asm("sparcv9_asm") ],
259 cflags => add_before("-xarch=v8plus -xtarget=ultra"),
261 "solaris64-sparcv9-cc" => {
262 inherit_from => [ "solaris-sparcv7-cc", asm("sparcv9_asm") ],
263 cflags => add_before("-xarch=v9 -xtarget=ultra"),
264 bn_ops => "BN_LLONG RC4_CHAR",
265 shared_ldflag => "-xarch=v9 -G -dy -z text",
269 #### IRIX 5.x configs
270 # -mips2 flag is added by ./config when appropriate.
272 inherit_from => [ "BASE_unix", asm("mips32_asm") ],
274 cflags => picker(default => "-DB_ENDIAN",
277 bn_ops => "BN_LLONG RC4_CHAR",
278 thread_scheme => "(unknown)",
279 perlasm_scheme => "o32",
280 dso_scheme => "dlfcn",
281 shared_target => "irix-shared",
282 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
285 inherit_from => [ "BASE_unix", asm("mips32_asm") ],
287 cflags => picker(default => "-use_readonly_const -DB_ENDIAN",
290 bn_ops => "BN_LLONG RC4_CHAR",
291 thread_scheme => "(unknown)",
292 perlasm_scheme => "o32",
293 dso_scheme => "dlfcn",
294 shared_target => "irix-shared",
295 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
297 #### IRIX 6.x configs
298 # Only N32 and N64 ABIs are supported. If you need O32 ABI build, invoke
299 # './Configure irix-cc -o32' manually.
300 "irix-mips3-gcc" => {
301 inherit_from => [ "BASE_unix", asm("mips64_asm") ],
303 cflags => combine(picker(default => "-mabi=n32 -DB_ENDIAN -DBN_DIV3W",
306 threads("-D_SGI_MP_SOURCE -pthread")),
307 bn_ops => "RC4_CHAR SIXTY_FOUR_BIT",
308 thread_scheme => "pthreads",
309 perlasm_scheme => "n32",
310 dso_scheme => "dlfcn",
311 shared_target => "irix-shared",
312 shared_ldflag => "-mabi=n32",
313 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
317 inherit_from => [ "BASE_unix", asm("mips64_asm") ],
319 cflags => combine(picker(default => "-n32 -mips3 -use_readonly_const -G0 -rdata_shared -DB_ENDIAN -DBN_DIV3W",
322 threads("-D_SGI_MP_SOURCE")),
323 ex_libs => add(threads("-lpthread")),
324 bn_ops => "RC4_CHAR SIXTY_FOUR_BIT",
325 thread_scheme => "pthreads",
326 perlasm_scheme => "n32",
327 dso_scheme => "dlfcn",
328 shared_target => "irix-shared",
329 shared_ldflag => "-n32",
330 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
334 "irix64-mips4-gcc" => {
335 inherit_from => [ "BASE_unix", asm("mips64_asm") ],
337 cflags => combine(picker(default => "-mabi=64 -mips4 -DB_ENDIAN -DBN_DIV3W",
340 threads("-D_SGI_MP_SOURCE")),
341 bn_ops => "RC4_CHAR SIXTY_FOUR_BIT_LONG",
342 thread_scheme => "pthreads",
343 perlasm_scheme => "64",
344 dso_scheme => "dlfcn",
345 shared_target => "irix-shared",
346 shared_ldflag => "-mabi=64",
347 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
350 "irix64-mips4-cc" => {
351 inherit_from => [ "BASE_unix", asm("mips64_asm") ],
353 cflags => combine(picker(default => "-64 -mips4 -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_LONG",
359 thread_scheme => "pthreads",
360 perlasm_scheme => "64",
361 dso_scheme => "dlfcn",
362 shared_target => "irix-shared",
363 shared_ldflag => "-64",
364 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
368 #### Unified HP-UX ANSI C configs.
370 # - Originally we were optimizing at +O4 level. It should be noted
371 # that the only difference between +O3 and +O4 is global inter-
372 # procedural analysis. As it has to be performed during the link
373 # stage the compiler leaves behind certain pseudo-code in lib*.a
374 # which might be release or even patch level specific. Generating
375 # the machine code for and analyzing the *whole* program appears
376 # to be *extremely* memory demanding while the performance gain is
377 # actually questionable. The situation is intensified by the default
378 # HP-UX data set size limit (infamous 'maxdsiz' tunable) of 64MB
379 # which is way too low for +O4. In other words, doesn't +O3 make
381 # - Keep in mind that the HP compiler by default generates code
382 # suitable for execution on the host you're currently compiling at.
383 # If the toolkit is meant to be used on various PA-RISC processors
384 # consider './Configure hpux-parisc-[g]cc +DAportable'.
385 # - -DMD32_XARRAY triggers workaround for compiler bug we ran into in
386 # 32-bit message digests. (For the moment of this writing) HP C
387 # doesn't seem to "digest" too many local variables (they make "him"
388 # chew forever:-). For more details look-up MD32_XARRAY comment in
389 # crypto/sha/sha_lcl.h.
390 # - originally there were 32-bit hpux-parisc2-* targets. They were
391 # scrapped, because a) they were not interchangeable with other 32-bit
392 # targets; a) when critical 32-bit assembly modules detect if they
393 # are executed on PA-RISC 2.0 and thus adequate performance is
395 # <appro@fy.chalmers.se>
396 "hpux-parisc-gcc" => {
397 inherit_from => [ "BASE_unix" ],
399 cflags => combine(picker(default => "-DB_ENDIAN -DBN_DIV2W",
402 threads("-pthread")),
403 ex_libs => add("-Wl,+s -ldld"),
404 bn_ops => "BN_LLONG",
405 thread_scheme => "pthreads",
407 shared_target => "hpux-shared",
408 shared_cflag => "-fPIC",
409 shared_ldflag => "-shared",
410 shared_extension => ".sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
412 "hpux-parisc1_1-gcc" => {
413 inherit_from => [ "hpux-parisc-gcc", asm("parisc11_asm") ],
414 multilib => "/pa1.1",
416 "hpux64-parisc2-gcc" => {
417 inherit_from => [ "BASE_unix", asm("parisc20_64_asm") ],
419 cflags => combine(picker(default => "-DB_ENDIAN",
422 threads("-D_REENTRANT")),
423 ex_libs => add("-ldl"),
424 bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
425 thread_scheme => "pthreads",
426 dso_scheme => "dlfcn",
427 shared_target => "hpux-shared",
428 shared_cflag => "-fpic",
429 shared_ldflag => "-shared",
430 shared_extension => ".sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
431 multilib => "/pa20_64",
434 # More attempts at unified 10.X and 11.X targets for HP C compiler.
436 # Chris Ruemmler <ruemmler@cup.hp.com>
437 # Kevin Steves <ks@hp.se>
438 "hpux-parisc-cc" => {
439 inherit_from => [ "BASE_unix" ],
441 cflags => combine(picker(default => "+Optrs_strongly_typed -Ae +ESlit -DB_ENDIAN -DBN_DIV2W -DMD32_XARRAY",
442 debug => "+O0 +d -g",
444 threads("-D_REENTRANT")),
445 ex_libs => add("-Wl,+s -ldld",threads("-lpthread")),
446 bn_ops => "RC4_CHAR",
447 thread_scheme => "pthreads",
449 shared_target => "hpux-shared",
450 shared_cflag => "+Z",
451 shared_ldflag => "-b",
452 shared_extension => ".sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
454 "hpux-parisc1_1-cc" => {
455 inherit_from => [ "hpux-parisc-cc", asm("parisc11_asm") ],
456 cflags => add_before("+DA1.1"),
457 multilib => "/pa1.1",
459 "hpux64-parisc2-cc" => {
460 inherit_from => [ "BASE_unix", asm("parisc20_64_asm") ],
462 cflags => combine(picker(default => "+DD64 +Optrs_strongly_typed -Ae +ESlit -DB_ENDIAN -DMD32_XARRAY",
463 debug => "+O0 +d -g",
465 threads("-D_REENTRANT")),
466 ex_libs => add("-ldl",threads("-lpthread")),
467 bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
468 thread_scheme => "pthreads",
469 dso_scheme => "dlfcn",
470 shared_target => "hpux-shared",
471 shared_cflag => "+Z",
472 shared_ldflag => "+DD64 -b",
473 shared_extension => ".sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
474 multilib => "/pa20_64",
477 # HP/UX IA-64 targets
479 inherit_from => [ "BASE_unix", asm("ia64_asm") ],
481 cflags => combine(picker(default => "-Ae +DD32 +Olit=all -z -DB_ENDIAN",
482 debug => "+O0 +d -g",
484 threads("-D_REENTRANT")),
485 ex_libs => add("-ldl",threads("-lpthread")),
486 bn_ops => "SIXTY_FOUR_BIT",
487 thread_scheme => "pthreads",
488 dso_scheme => "dlfcn",
489 shared_target => "hpux-shared",
490 shared_cflag => "+Z",
491 shared_ldflag => "+DD32 -b",
492 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
493 multilib => "/hpux32",
495 # Frank Geurts <frank.geurts@nl.abnamro.com> has patiently assisted
496 # with debugging of the following config.
497 "hpux64-ia64-cc" => {
498 inherit_from => [ "BASE_unix", asm("ia64_asm") ],
500 cflags => combine(picker(default => "-Ae +DD64 +Olit=all -z -DB_ENDIAN",
501 debug => "+O0 +d -g",
503 threads("-D_REENTRANT")),
504 ex_libs => add("-ldl", threads("-lpthread")),
505 bn_ops => "SIXTY_FOUR_BIT_LONG",
506 thread_scheme => "pthreads",
507 dso_scheme => "dlfcn",
508 shared_target => "hpux-shared",
509 shared_cflag => "+Z",
510 shared_ldflag => "+DD64 -b",
511 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
512 multilib => "/hpux64",
516 inherit_from => [ "BASE_unix", asm("ia64_asm") ],
518 cflags => combine(picker(default => "-DB_ENDIAN",
521 threads("-pthread")),
522 ex_libs => add("-ldl"),
523 bn_ops => "SIXTY_FOUR_BIT",
524 thread_scheme => "pthreads",
525 dso_scheme => "dlfcn",
526 shared_target => "hpux-shared",
527 shared_cflag => "-fpic",
528 shared_ldflag => "-shared",
529 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
530 multilib => "/hpux32",
532 "hpux64-ia64-gcc" => {
533 inherit_from => [ "BASE_unix", asm("ia64_asm") ],
535 cflags => picker(default => "-mlp64 -DB_ENDIAN",
538 threads("-pthread")),
539 ex_libs => add("-ldl"),
540 bn_ops => "SIXTY_FOUR_BIT_LONG",
541 thread_scheme => "pthreads",
542 dso_scheme => "dlfcn",
543 shared_target => "hpux-shared",
544 shared_cflag => "-fpic",
545 shared_ldflag => "-mlp64 -shared",
546 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
547 multilib => "/hpux64",
550 #### HP MPE/iX http://jazz.external.hp.com/src/openssl/
552 inherit_from => [ "BASE_unix" ],
554 cflags => "-D_ENDIAN -DBN_DIV2W -O3 -D_POSIX_SOURCE -D_SOCKET_SOURCE -I/SYSLOG/PUB",
556 ex_libs => add("-L/SYSLOG/PUB -lsyslog -lsocket -lcurses"),
557 thread_scheme => "(unknown)",
558 bn_ops => "BN_LLONG",
561 #### DEC Alpha OSF/1/Tru64 targets.
562 "osf1-alpha-gcc" => {
563 inherit_from => [ "BASE_unix", asm("alpha_asm") ],
566 bn_ops => "SIXTY_FOUR_BIT_LONG",
567 thread_scheme => "(unknown)",
568 dso_scheme => "dlfcn",
569 shared_target => "alpha-osf1-shared",
570 shared_extension => ".so",
573 inherit_from => [ "BASE_unix", asm("alpha_asm") ],
575 cflags => "-std1 -tune host -O4 -readonly_strings",
576 bn_ops => "SIXTY_FOUR_BIT_LONG",
577 thread_scheme => "(unknown)",
578 dso_scheme => "dlfcn",
579 shared_target => "alpha-osf1-shared",
580 shared_extension => ".so",
582 "tru64-alpha-cc" => {
583 inherit_from => [ "BASE_unix", asm("alpha_asm") ],
585 cflags => combine("-std1 -tune host -fast -readonly_strings",
586 threads("-pthread")),
587 bn_ops => "SIXTY_FOUR_BIT_LONG",
588 thread_scheme => "pthreads",
589 dso_scheme => "dlfcn",
590 shared_target => "alpha-osf1-shared",
591 shared_ldflag => "-msym",
592 shared_extension => ".so",
596 #### Variety of LINUX:-)
598 # *-generic* is endian-neutral target, but ./config is free to
599 # throw in -D[BL]_ENDIAN, whichever appropriate...
600 "linux-generic32" => {
601 inherit_from => [ "BASE_unix" ],
603 cflags => combine(picker(default => "-Wall",
604 debug => "-O0 -g -DBN_DEBUG -DREF_DEBUG -DCONF_DEBUG",
606 threads("-pthread")),
607 ex_libs => add("-ldl"),
608 bn_ops => "BN_LLONG RC4_CHAR",
609 thread_scheme => "pthreads",
610 dso_scheme => "dlfcn",
611 shared_target => "linux-shared",
612 shared_cflag => "-fPIC",
613 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
615 "linux-generic64" => {
616 inherit_from => [ "linux-generic32" ],
617 bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
621 inherit_from => [ "linux-generic32", asm("ppc32_asm") ],
622 perlasm_scheme => "linux32",
625 inherit_from => [ "linux-generic64", asm("ppc64_asm") ],
626 cflags => add("-m64 -DB_ENDIAN"),
627 perlasm_scheme => "linux64",
628 shared_ldflag => "-m64",
632 inherit_from => [ "linux-generic64", asm("ppc64_asm") ],
633 cflags => add("-m64 -DL_ENDIAN"),
634 perlasm_scheme => "linux64le",
635 shared_ldflag => "-m64",
639 ################################################################
640 # Note that -march is not among compiler options in linux-armv4
641 # target description. Not specifying one is intentional to give
644 # a) rely on your compiler default by not specifying one;
645 # b) specify your target platform explicitly for optimal
646 # performance, e.g. -march=armv6 or -march=armv7-a;
647 # c) build "universal" binary that targets *range* of platforms
648 # by specifying minimum and maximum supported architecture;
650 # As for c) option. It actually makes no sense to specify
651 # maximum to be less than ARMv7, because it's the least
652 # requirement for run-time switch between platform-specific
653 # code paths. And without run-time switch performance would be
654 # equivalent to one for minimum. Secondly, there are some
655 # natural limitations that you'd have to accept and respect.
656 # Most notably you can *not* build "universal" binary for
657 # big-endian platform. This is because ARMv7 processor always
658 # picks instructions in little-endian order. Another similar
659 # limitation is that -mthumb can't "cross" -march=armv6t2
660 # boundary, because that's where it became Thumb-2. Well, this
661 # limitation is a bit artificial, because it's not really
662 # impossible, but it's deemed too tricky to support. And of
663 # course you have to be sure that your binutils are actually
664 # up to the task of handling maximum target platform. With all
665 # this in mind here is an example of how to configure
668 # ./Configure linux-armv4 -march=armv6 -D__ARM_MAX_ARCH__=8
670 inherit_from => [ "linux-generic32", asm("armv4_asm") ],
671 perlasm_scheme => "linux32",
674 inherit_from => [ "linux-generic64", asm("aarch64_asm") ],
675 perlasm_scheme => "linux64",
677 "linux-arm64ilp32" => { # https://wiki.linaro.org/Platform/arm64-ilp32
678 inherit_from => [ "linux-generic32", asm("aarch64_asm") ],
679 cflags => add("-mabi=ilp32"),
680 bn_ops => "SIXTY_FOUR_BIT RC4_CHAR",
681 perlasm_scheme => "linux64",
682 shared_ldflag => "-mabi=ilp32",
686 # Configure script adds minimally required -march for assembly
687 # support, if no -march was specified at command line.
688 inherit_from => [ "linux-generic32", asm("mips32_asm") ],
689 cflags => add("-mabi=32 -DBN_DIV3W"),
690 perlasm_scheme => "o32",
691 shared_ldflag => "-mabi=32",
693 # mips32 and mips64 below refer to contemporary MIPS Architecture
694 # specifications, MIPS32 and MIPS64, rather than to kernel bitness.
696 inherit_from => [ "linux-generic32", asm("mips64_asm") ],
697 cflags => add("-mabi=n32 -DBN_DIV3W"),
698 bn_ops => "SIXTY_FOUR_BIT RC4_CHAR",
699 perlasm_scheme => "n32",
700 shared_ldflag => "-mabi=n32",
703 "linux64-mips64" => {
704 inherit_from => [ "linux-generic64", asm("mips64_asm") ],
705 cflags => add("-mabi=64 -DBN_DIV3W"),
706 perlasm_scheme => "64",
707 shared_ldflag => "-mabi=64",
711 #### IA-32 targets...
713 inherit_from => [ "linux-generic32", asm("x86_elf_asm") ],
714 cflags => add(picker(default => "-DL_ENDIAN",
715 release => "-fomit-frame-pointer")),
716 ex_libs => add(picker(debug => "-lefence")),
717 bn_ops => "BN_LLONG",
720 inherit_from => [ "BASE_unix", asm("x86_asm") ],
722 cflags => add(picker(default => "-DL_ENDIAN -Wall",
724 release => "-O3 -fomit-frame-pointer")),
725 bn_ops => "BN_LLONG",
726 thread_scheme => "(unknown)",
727 perlasm_scheme => "a.out",
731 inherit_from => [ "linux-generic64", asm("x86_64_asm") ],
732 cflags => add("-m64 -DL_ENDIAN"),
733 bn_ops => "SIXTY_FOUR_BIT_LONG",
734 perlasm_scheme => "elf",
735 shared_ldflag => "-m64",
738 "linux-x86_64-clang" => {
739 inherit_from => [ "linux-x86_64" ],
741 cflags => add("-Wextra -Qunused-arguments"),
744 inherit_from => [ "linux-generic32", asm("x86_64_asm") ],
745 cflags => add("-mx32 -DL_ENDIAN"),
746 bn_ops => "SIXTY_FOUR_BIT",
747 perlasm_scheme => "elf",
748 shared_ldflag => "-mx32",
753 inherit_from => [ "linux-generic64", asm("ia64_asm") ],
754 bn_ops => "SIXTY_FOUR_BIT_LONG",
758 inherit_from => [ "linux-generic64", asm("s390x_asm") ],
759 cflags => add("-m64 -DB_ENDIAN"),
760 perlasm_scheme => "64",
761 shared_ldflag => "-m64",
765 #### So called "highgprs" target for z/Architecture CPUs
766 # "Highgprs" is kernel feature first implemented in Linux
767 # 2.6.32, see /proc/cpuinfo. The idea is to preserve most
768 # significant bits of general purpose registers not only
769 # upon 32-bit process context switch, but even on
770 # asynchronous signal delivery to such process. This makes
771 # it possible to deploy 64-bit instructions even in legacy
772 # application context and achieve better [or should we say
773 # adequate] performance. The build is binary compatible with
774 # linux-generic32, and the idea is to be able to install the
775 # resulting libcrypto.so alongside generic one, e.g. as
776 # /lib/highgprs/libcrypto.so.x.y, for ldconfig and run-time
777 # linker to autodiscover. Unfortunately it doesn't work just
778 # yet, because of couple of bugs in glibc
779 # sysdeps/s390/dl-procinfo.c affecting ldconfig and ld.so.1...
781 inherit_from => [ "linux-generic32", asm("s390x_asm") ],
782 cflags => add("-m31 -Wa,-mzarch -DB_ENDIAN"),
783 bn_obj => sub { my $r=join(" ",@_); $r=~s/bn\-s390x/bn_asm/; $r; },
784 perlasm_scheme => "31",
785 shared_ldflag => "-m31",
786 multilib => "/highgprs",
789 #### SPARC Linux setups
790 # Ray Miller <ray.miller@computing-services.oxford.ac.uk> has
791 # patiently assisted with debugging of following two configs.
793 inherit_from => [ "linux-generic32", asm("sparcv8_asm") ],
794 cflags => add("-mcpu=v8 -DB_ENDIAN -DBN_DIV2W"),
797 # it's a real mess with -mcpu=ultrasparc option under Linux,
798 # but -Wa,-Av8plus should do the trick no matter what.
799 inherit_from => [ "linux-generic32", asm("sparcv9_asm") ],
800 cflags => add("-m32 -mcpu=ultrasparc -Wa,-Av8plus -DB_ENDIAN -DBN_DIV2W"),
801 shared_ldflag => "-m32",
803 "linux64-sparcv9" => {
804 # GCC 3.1 is a requirement
805 inherit_from => [ "linux-generic64", asm("sparcv9_asm") ],
806 cflags => add("-m64 -mcpu=ultrasparc -DB_ENDIAN"),
807 bn_ops => "BN_LLONG RC4_CHAR",
808 shared_ldflag => "-m64",
812 "linux-alpha-gcc" => {
813 inherit_from => [ "linux-generic64", asm("alpha_asm") ],
814 cflags => add("-DL_ENDIAN"),
815 bn_ops => "SIXTY_FOUR_BIT_LONG",
817 "linux-c64xplus" => {
818 inherit_from => [ "BASE_unix" ],
819 # TI_CGT_C6000_7.3.x is a requirement
821 cflags => combine("--linux -ea=.s -eo=.o -mv6400+ -o2 -ox -ms -pden -DOPENSSL_SMALL_FOOTPRINT",
822 threads("-D_REENTRANT")),
823 bn_ops => "BN_LLONG",
824 cpuid_asm_src => "c64xpluscpuid.s",
825 bn_asm_src => "asm/bn-c64xplus.asm c64xplus-gf2m.s",
826 aes_asm_src => "aes-c64xplus.s aes_cbc.c aes-ctr.fake",
827 sha1_asm_src => "sha1-c64xplus.s sha256-c64xplus.s sha512-c64xplus.s",
828 rc4_asm_src => "rc4-c64xplus.s",
829 modes_asm_src => "ghash-c64xplus.s",
830 chacha_asm_src => "chacha-c64xplus.s",
831 poly1305_asm_src => "poly1305-c64xplus.s",
832 thread_scheme => "pthreads",
833 perlasm_scheme => "void",
834 dso_scheme => "dlfcn",
835 shared_target => "linux-shared",
836 shared_cflag => "--pic",
837 shared_ldflag => "-z --sysv --shared",
838 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
842 #### Android: linux-* but without pointers to headers and libs.
844 # It takes pair of prior-set environment variables to make it work:
846 # CROSS_SYSROOT=/some/where/android-ndk-<ver>/platforms/android-<apiver>/arch-<
847 # CROSS_COMPILE=<prefix>
849 # As well as PATH adjusted to cover ${CROSS_COMPILE}gcc and company.
850 # For example to compile for ICS and ARM with NDK 10d, you'd:
852 # ANDROID_NDK=/some/where/android-ndk-10d
853 # CROSS_SYSROOT=$ANDROID_NDK/platforms/android-14/arch-arm
854 # CROSS_COMPILE=arm-linux-adroideabi-
855 # PATH=$ANDROID_NDK/toolchains/arm-linux-androideabi-4.8/prebuild/linux-x86_64/
858 inherit_from => [ "linux-generic32" ],
859 # Special note about unconditional -fPIC and -pie. The underlying
860 # reason is that Lollipop refuses to run non-PIE. But what about
861 # older systems and NDKs? -fPIC was never problem, so the only
862 # concern if -pie. Older toolchains, e.g. r4, appear to handle it
863 # and binaries turn mostly functional. "Mostly" means that oldest
864 # Androids, such as Froyo, fail to handle executable, but newer
865 # systems are perfectly capable of executing binaries targeting
866 # Froyo. Keep in mind that in the nutshell Android builds are
867 # about JNI, i.e. shared libraries, not applications.
868 cflags => picker(default => "-mandroid -fPIC --sysroot=\$(CROSS_SYSROOT) -Wa,--noexecstack -Wall",
875 inherit_from => [ "android", asm("x86_asm") ],
876 cflags => add(picker(release => "-fomit-frame-pointer")),
877 bn_ops => "BN_LLONG",
878 perlasm_scheme => "android",
880 ################################################################
881 # Contemporary Android applications can provide multiple JNI
882 # providers in .apk, targeting multiple architectures. Among
883 # them there is "place" for two ARM flavours: generic eabi and
884 # armv7-a/hard-float. However, it should be noted that OpenSSL's
885 # ability to engage NEON is not constrained by ABI choice, nor
886 # is your ability to call OpenSSL from your application code
887 # compiled with floating-point ABI other than default 'soft'.
888 # [Latter thanks to __attribute__((pcs("aapcs"))) declaration.]
889 # This means that choice of ARM libraries you provide in .apk
890 # is driven by application needs. For example if application
891 # itself benefits from NEON or is floating-point intensive, then
892 # it might be appropriate to provide both libraries. Otherwise
893 # just generic eabi would do. But in latter case it would be
896 # ./Configure android-armeabi -D__ARM_MAX_ARCH__=8
898 # in order to build "universal" binary and allow OpenSSL take
899 # advantage of NEON when it's available.
901 "android-armeabi" => {
902 inherit_from => [ "android", asm("armv4_asm") ],
905 inherit_from => [ "android", asm("mips32_asm") ],
906 perlasm_scheme => "o32",
910 inherit_from => [ "linux-generic64" ],
911 cflags => picker(default => "-mandroid -fPIC --sysroot=\$(CROSS_SYSROOT) -Wa,--noexecstack -Wall",
917 "android64-aarch64" => {
918 inherit_from => [ "android64", asm("aarch64_asm") ],
919 perlasm_scheme => "linux64",
924 # As for thread cflag. Idea is to maintain "collective" set of
925 # flags, which would cover all BSD flavors. -pthread applies
926 # to them all, but is treated differently. OpenBSD expands is
927 # as -D_POSIX_THREAD -lc_r, which is sufficient. FreeBSD 4.x
928 # expands it as -lc_r, which has to be accompanied by explicit
929 # -D_THREAD_SAFE and sometimes -D_REENTRANT. FreeBSD 5.x
930 # expands it as -lc_r, which seems to be sufficient?
931 inherit_from => [ "BASE_unix" ],
933 cflags => combine(picker(default => "-Wall",
936 threads("-pthread -D_THREAD_SAFE -D_REENTRANT")),
937 bn_ops => "BN_LLONG",
938 thread_scheme => "pthreads",
939 dso_scheme => "dlfcn",
940 shared_target => "bsd-gcc-shared",
941 shared_cflag => "-fPIC",
942 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
945 inherit_from => [ "BSD-generic32" ],
946 bn_ops => "SIXTY_FOUR_BIT_LONG",
950 inherit_from => [ "BSD-generic32", asm("x86_asm") ],
951 cflags => add(picker(default => "-DL_ENDIAN",
952 release => "-fomit-frame-pointer")),
953 bn_ops => "BN_LLONG",
954 shared_target => "bsd-shared",
955 perlasm_scheme => "a.out",
958 inherit_from => [ "BSD-x86" ],
959 perlasm_scheme => "elf",
963 inherit_from => [ "BSD-generic32", asm("sparcv8_asm") ],
964 cflags => add("-mcpu=v8 -DB_ENDIAN"),
967 # -DMD32_REG_T=int doesn't actually belong in sparc64 target, it
968 # simply *happens* to work around a compiler bug in gcc 3.3.3,
969 # triggered by RIPEMD160 code.
970 inherit_from => [ "BSD-generic64", asm("sparcv9_asm") ],
971 cflags => add("-DB_ENDIAN -DMD32_REG_T=int"),
972 bn_ops => "BN_LLONG",
976 inherit_from => [ "BSD-generic64", asm("ia64_asm") ],
977 cflags => add_before("-DL_ENDIAN"),
978 bn_ops => "SIXTY_FOUR_BIT_LONG",
982 inherit_from => [ "BSD-generic64", asm("x86_64_asm") ],
983 cflags => add_before("-DL_ENDIAN"),
984 bn_ops => "SIXTY_FOUR_BIT_LONG",
985 perlasm_scheme => "elf",
989 inherit_from => [ "BASE_unix", asm("x86_elf_asm") ],
991 cflags => "-DPERL5 -DL_ENDIAN -fomit-frame-pointer -O3 -Wall",
992 ex_libs => add("-ldl"),
993 bn_ops => "BN_LLONG",
994 thread_scheme => "(unknown)",
995 dso_scheme => "dlfcn",
996 shared_target => "bsd-gcc-shared",
997 shared_cflag => "-fPIC",
998 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
1002 inherit_from => [ "BASE_unix" ],
1004 cflags => "-O -Wall",
1005 unistd => "<libc.h>",
1006 bn_ops => "BN_LLONG",
1007 thread_scheme => "(unknown)",
1010 inherit_from => [ "BASE_unix" ],
1012 cflags => "-O3 -Wall",
1013 unistd => "<libc.h>",
1014 bn_ops => "BN_LLONG",
1015 thread_scheme => "(unknown)",
1020 inherit_from => [ "BASE_unix" ],
1022 cflags => "-DL_ENDIAN -DTERMIO",
1023 thread_scheme => "(unknown)",
1026 inherit_from => [ "BASE_unix" ],
1028 ex_libs => add("-lsocket"),
1029 dso_scheme => "dlfcn",
1030 shared_target => "bsd-gcc-shared",
1031 shared_cflag => "-fPIC",
1032 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
1035 inherit_from => [ "BASE_unix", asm("x86_elf_asm") ],
1037 cflags => "-DL_ENDIAN -O2 -Wall",
1038 ex_libs => add("-lsocket"),
1039 dso_scheme => "dlfcn",
1040 shared_target => "bsd-gcc-shared",
1041 shared_cflag => "-fPIC",
1042 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
1045 #### SCO/Caldera targets.
1047 # Originally we had like unixware-*, unixware-*-pentium, unixware-*-p6, etc.
1048 # Now we only have blended unixware-* as it's the only one used by ./config.
1049 # If you want to optimize for particular microarchitecture, bypass ./config
1050 # and './Configure unixware-7 -Kpentium_pro' or whatever appropriate.
1051 # Note that not all targets include assembler support. Mostly because of
1052 # lack of motivation to support out-of-date platforms with out-of-date
1053 # compiler drivers and assemblers. Tim Rice <tim@multitalents.net> has
1054 # patiently assisted to debug most of it.
1056 # UnixWare 2.0x fails destest with -O.
1058 inherit_from => [ "BASE_unix" ],
1060 cflags => combine("-DFILIO_H -DNO_STRINGS_H",
1061 threads("-Kthread")),
1062 ex_libs => add("-lsocket -lnsl -lresolv -lx"),
1063 thread_scheme => "uithreads",
1066 inherit_from => [ "BASE_unix" ],
1068 cflags => combine("-O -DFILIO_H",
1069 threads("-Kthread")),
1070 ex_libs => add("-lsocket -lnsl -lresolv -lx"),
1071 thread_scheme => "uithreads",
1074 inherit_from => [ "BASE_unix", asm("x86_elf_asm") ],
1076 cflags => combine("-O -DFILIO_H -Kalloca",
1077 threads("-Kthread")),
1078 ex_libs => add("-lsocket -lnsl"),
1079 thread_scheme => "uithreads",
1080 bn_ops => "BN_LLONG",
1081 perlasm_scheme => "elf-1",
1082 dso_scheme => "dlfcn",
1083 shared_target => "svr5-shared",
1084 shared_cflag => "-Kpic",
1085 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
1087 "unixware-7-gcc" => {
1088 inherit_from => [ "BASE_unix", asm("x86_elf_asm") ],
1090 cflags => combine("-DL_ENDIAN -DFILIO_H -O3 -fomit-frame-pointer -Wall",
1091 threads("-D_REENTRANT")),
1092 ex_libs => add("-lsocket -lnsl"),
1093 bn_ops => "BN_LLONG",
1094 thread_scheme => "pthreads",
1095 perlasm_scheme => "elf-1",
1096 dso_scheme => "dlfcn",
1097 shared_target => "gnu-shared",
1098 shared_cflag => "-fPIC",
1099 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
1101 # SCO 5 - Ben Laurie <ben@algroup.co.uk> says the -O breaks the SCO cc.
1103 inherit_from => [ "BASE_unix", asm("x86_elf_asm") ],
1106 ex_libs => add("-lsocket -lnsl"),
1107 thread_scheme => "(unknown)",
1108 perlasm_scheme => "elf-1",
1109 dso_scheme => "dlfcn",
1110 shared_target => "svr3-shared",
1111 shared_cflag => "-Kpic",
1112 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
1115 inherit_from => [ "BASE_unix", asm("x86_elf_asm") ],
1117 cflags => "-O3 -fomit-frame-pointer",
1118 ex_libs => add("-lsocket -lnsl"),
1119 bn_ops => "BN_LLONG",
1120 thread_scheme => "(unknown)",
1121 perlasm_scheme => "elf-1",
1122 dso_scheme => "dlfcn",
1123 shared_target => "svr3-shared",
1124 shared_cflag => "-fPIC",
1125 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
1130 inherit_from => [ "BASE_unix", asm("ppc32_asm") ],
1132 cflags => combine(picker(default => "-DB_ENDIAN",
1135 threads("-pthread")),
1137 bn_ops => "BN_LLONG RC4_CHAR",
1138 thread_scheme => "pthreads",
1139 perlasm_scheme => "aix32",
1140 dso_scheme => "dlfcn",
1141 shared_target => "aix-shared",
1142 shared_ldflag => "-shared -Wl,-G",
1143 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
1147 inherit_from => [ "BASE_unix", asm("ppc64_asm") ],
1149 cflags => combine(picker(default => "-maix64 -DB_ENDIAN",
1152 threads("-pthread")),
1154 bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
1155 thread_scheme => "pthreads",
1156 perlasm_scheme => "aix64",
1157 dso_scheme => "dlfcn",
1158 shared_target => "aix-shared",
1159 shared_ldflag => "-maix64 -shared -Wl,-G",
1160 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
1163 # Below targets assume AIX 5. Idea is to effectively disregard
1164 # $OBJECT_MODE at build time. $OBJECT_MODE is respected at
1167 inherit_from => [ "BASE_unix", asm("ppc32_asm") ],
1169 cflags => combine(picker(default => "-q32 -DB_ENDIAN -qmaxmem=16384 -qro -qroconst",
1172 threads("-qthreaded -D_THREAD_SAFE")),
1174 bn_ops => "BN_LLONG RC4_CHAR",
1175 thread_scheme => "pthreads",
1176 perlasm_scheme => "aix32",
1177 dso_scheme => "dlfcn",
1178 shared_target => "aix-shared",
1179 shared_ldflag => "-q32 -G",
1180 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
1184 inherit_from => [ "BASE_unix", asm("ppc64_asm") ],
1186 cflags => combine(picker(default => "-q64 -DB_ENDIAN -qmaxmem=16384 -qro -qroconst",
1189 threads("-qthreaded -D_THREAD_SAFE")),
1191 bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
1192 thread_scheme => "pthreads",
1193 perlasm_scheme => "aix64",
1194 dso_scheme => "dlfcn",
1195 shared_target => "aix-shared",
1196 shared_ldflag => "-q64 -G",
1197 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
1201 # SIEMENS BS2000/OSD: an EBCDIC-based mainframe
1203 inherit_from => [ "BASE_unix" ],
1205 cflags => "-O -XLLML -XLLMK -XL -DB_ENDIAN -DCHARSET_EBCDIC",
1206 ex_libs => add("-lsocket -lnsl"),
1207 bn_ops => "THIRTY_TWO_BIT RC4_CHAR",
1208 thread_scheme => "(unknown)",
1211 # OS/390 Unix an EBCDIC-based Unix system on IBM mainframe
1212 # You need to compile using the c89.sh wrapper in the tools directory, because the
1213 # IBM compiler does not like the -L switch after any object modules.
1216 inherit_from => [ "BASE_unix" ],
1218 cflags => "-O -DB_ENDIAN -DCHARSET_EBCDIC -DNO_SYS_PARAM_H -D_ALL_SOURCE",
1219 bn_ops => "THIRTY_TWO_BIT RC4_CHAR",
1220 thread_scheme => "(unknown)",
1223 #### Visual C targets
1225 # Win64 targets, WIN64I denotes IA-64 and WIN64A - AMD64
1227 # Note about -wd4090, disable warning C4090. This warning returns false
1228 # positives in some situations. Disabling it altogether masks both
1229 # legitimate and false cases, but as we compile on multiple platforms,
1230 # we rely on other compilers to catch legitimate cases.
1232 # Also note that we force threads no matter what. Configuring "no-threads"
1235 inherit_from => [ "BASE_Windows" ],
1238 cflags => "-W3 -wd4090 -Gs0 -GF -Gy -nologo -DOPENSSL_SYS_WIN32 -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -D_CRT_SECURE_NO_DEPRECATE",
1240 lib_cflags => "/Zl /Zi /Fdlib",
1241 dso_cflags => "/Zi",
1242 bin_cflags => "/Zi /Fdapp",
1243 lflags => add("/debug"),
1244 shared_cflag => "-D_WINDLL",
1245 shared_ldflag => "/dll",
1246 shared_target => "win-shared", # meaningless except it gives Configure a hint
1247 thread_scheme => "winthreads",
1248 dso_scheme => "win32",
1250 "VC-noCE-common" => {
1251 inherit_from => [ "VC-common", "uplink_common" ],
1252 cflags => add(picker(default => "-DUNICODE -D_UNICODE",
1255 ($disabled{shared} ? "/MT" : "/MD")
1256 ."d /Od -DDEBUG -D_DEBUG";
1260 ($disabled{shared} ? "/MT" : "/MD")
1263 bin_lflags => add("/subsystem:console /opt:ref"),
1266 push @ex_libs, 'ws2_32.lib' unless $disabled{sock};
1267 push @ex_libs, 'gdi32.lib advapi32.lib crypt32.lib user32.lib';
1268 return join(" ", @ex_libs);
1271 "VC-WIN64-common" => {
1272 inherit_from => [ "VC-noCE-common" ],
1275 push @ex_libs, 'bufferoverflowu.lib' if (`cl 2>&1` =~ /14\.00\.4[0-9]{4}\./);
1276 return join(" ", @_, @ex_libs);
1278 bn_ops => "SIXTY_FOUR_BIT EXPORT_VAR_AS_FN",
1279 build_scheme => add("VC-W64", { separator => undef }),
1282 inherit_from => [ "VC-WIN64-common", asm("ia64_asm") ],
1284 asflags => "-d debug",
1288 perlasm_scheme => "ias",
1291 inherit_from => [ "VC-WIN64-common", asm("x86_64_asm") ],
1292 as => sub { vc_win64a_info()->{as} },
1293 asflags => sub { vc_win64a_info()->{asflags} },
1294 asoutflag => sub { vc_win64a_info()->{asoutflag} },
1296 bn_asm_src => sub { return undef unless @_;
1297 my $r=join(" ",@_); $r=~s|asm/x86_64-gcc|bn_asm|; $r; },
1298 perlasm_scheme => "auto",
1301 # x86 Win32 target defaults to ANSI API, if you want UNICODE,
1302 # configure with 'perl Configure VC-WIN32 -DUNICODE -D_UNICODE'
1303 inherit_from => [ "VC-noCE-common", asm("x86_asm") ],
1304 as => sub { my $ver=`nasm -v 2>NUL`;
1305 my $vew=`nasmw -v 2>NUL`;
1306 return $ver ge $vew ? "nasm" : "nasmw" },
1307 asflags => "-f win32",
1311 # WIN32 UNICODE build gets linked with unicows.lib for
1312 # backward compatibility with Win9x.
1313 push @ex_libs, 'unicows.lib'
1314 if (grep { $_ eq "UNICODE" } @user_defines);
1315 return join(" ", @ex_libs, @_);
1318 bn_ops => "BN_LLONG EXPORT_VAR_AS_FN",
1319 perlasm_scheme => "win32n",
1320 build_scheme => add("VC-W32", { separator => undef }),
1323 inherit_from => [ "VC-common" ],
1325 asflags => "/nologo /Cp /coff /c /Cx /Zi",
1330 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',
1331 sub { vc_wince_info()->{cflags}; },
1332 sub { defined($ENV{'WCECOMPAT'})
1333 ? '-I$(WCECOMPAT)/include' : (); },
1334 sub { defined($ENV{'PORTSDK_LIBPATH'})
1335 ? '-I$(PORTSDK_LIBPATH)/../../include' : (); },
1336 sub { `cl 2>&1` =~ /Version ([0-9]+)\./ && $1>=14
1337 ? ($disabled{shared} ? " /MT" : " /MD")
1339 debug => "/Od -DDEBUG -D_DEBUG",
1341 lflags => combine("/nologo /opt:ref",
1342 sub { vc_wince_info()->{lflags}; },
1343 sub { defined($ENV{PORTSDK_LIBPATH})
1344 ? "/entry:mainCRTstartup" : (); }),
1346 bn_ops => "BN_LLONG EXPORT_VAR_AS_FN",
1349 push @ex_libs, 'ws2.lib' unless $disabled{sock};
1350 push @ex_libs, 'crypt32.lib';
1351 if (defined($ENV{WCECOMPAT})) {
1352 my $x = '$(WCECOMPAT)/lib';
1353 if (-f "$x/$ENV{TARGETCPU}/wcecompatex.lib") {
1354 $x .= '/$(TARGETCPU)/wcecompatex.lib';
1356 $x .= '/wcecompatex.lib';
1360 push @ex_libs, '$(PORTSDK_LIBPATH)/portlib.lib'
1361 if (defined($ENV{'PORTSDK_LIBPATH'}));
1362 push @ex_libs, ' /nodefaultlib coredll.lib corelibc.lib'
1363 if ($ENV{'TARGETCPU'} eq "X86");
1366 build_scheme => add("VC-WCE", { separator => undef }),
1369 ###### Borland C++ 4.5
1371 ## inherit_from => [ "BASE_Windows" ],
1373 ## sys_id => "WIN32",
1374 ## bn_ops => "BN_LLONG EXPORT_VAR_AS_FN",
1375 ## dso_scheme => "win32",
1376 ## build_scheme => add("BC", { separator => undef }),
1381 inherit_from => [ "BASE_unix", asm("x86_asm"),
1382 sub { $disabled{shared} ? () : "x86_uplink" } ],
1384 cflags => combine(picker(default => "-DL_ENDIAN -DWIN32_LEAN_AND_MEAN -DUNICODE -D_UNICODE -m32 -Wall",
1386 release => "-O3 -fomit-frame-pointer"),
1388 sys_id => "MINGW32",
1389 ex_libs => add("-lws2_32 -lgdi32 -lcrypt32"),
1390 bn_ops => "BN_LLONG EXPORT_VAR_AS_FN",
1391 thread_scheme => "winthreads",
1392 perlasm_scheme => "coff",
1393 dso_scheme => "win32",
1394 shared_target => "mingw-shared",
1395 shared_cflag => add("-D_WINDLL"),
1396 shared_ldflag => "-static-libgcc",
1397 shared_rcflag => "--target=pe-i386",
1398 shared_extension => ".dll",
1402 # As for OPENSSL_USE_APPLINK. Applink makes it possible to use
1403 # .dll compiled with one compiler with application compiled with
1404 # another compiler. It's possible to engage Applink support in
1405 # mingw64 build, but it's not done, because till mingw64
1406 # supports structured exception handling, one can't seriously
1407 # consider its binaries for using with non-mingw64 run-time
1408 # environment. And as mingw64 is always consistent with itself,
1409 # Applink is never engaged and can as well be omitted.
1410 inherit_from => [ "BASE_unix", asm("x86_64_asm") ],
1412 cflags => combine(picker(default => "-DL_ENDIAN -DWIN32_LEAN_AND_MEAN -DUNICODE -D_UNICODE -m64 -Wall",
1416 sys_id => "MINGW64",
1417 ex_libs => add("-lws2_32 -lgdi32 -lcrypt32"),
1418 bn_ops => "SIXTY_FOUR_BIT EXPORT_VAR_AS_FN",
1419 thread_scheme => "winthreads",
1420 perlasm_scheme => "mingw64",
1421 dso_scheme => "win32",
1422 shared_target => "mingw-shared",
1423 shared_cflag => add("-D_WINDLL"),
1424 shared_ldflag => "-static-libgcc",
1425 shared_rcflag => "--target=pe-x86-64",
1426 shared_extension => ".dll",
1432 inherit_from => [ "BASE_unix" ],
1434 cflags => "-DL_ENDIAN -O",
1440 inherit_from => [ "BASE_unix" ],
1442 cflags => "-DTERMIOS -DL_ENDIAN -O -Wall",
1444 bn_ops => "BN_LLONG",
1445 dso_scheme => "win32",
1450 inherit_from => [ "BASE_unix", asm("x86_asm") ],
1452 cflags => picker(default => "-DTERMIOS -DL_ENDIAN -Wall",
1454 release => "-O3 -fomit-frame-pointer"),
1456 bn_ops => "BN_LLONG",
1457 perlasm_scheme => "coff",
1458 dso_scheme => "dlfcn",
1459 shared_target => "cygwin-shared",
1460 shared_cflag => "-D_WINDLL",
1461 shared_ldflag => "-shared",
1462 shared_extension => ".dll",
1464 "Cygwin-x86_64" => {
1465 inherit_from => [ "BASE_unix", asm("x86_64_asm") ],
1467 cflags => picker(default => "-DTERMIOS -DL_ENDIAN -Wall",
1471 bn_ops => "SIXTY_FOUR_BIT_LONG",
1472 perlasm_scheme => "mingw64",
1473 dso_scheme => "dlfcn",
1474 shared_target => "cygwin-shared",
1475 shared_cflag => "-D_WINDLL",
1476 shared_ldflag => "-shared",
1477 shared_extension => ".dll",
1479 # Backward compatibility for those using this target
1481 inherit_from => [ "Cygwin-x86" ]
1483 # In case someone constructs the Cygwin target name themself
1485 inherit_from => [ "Cygwin-x86" ]
1488 inherit_from => [ "Cygwin-x86" ]
1491 inherit_from => [ "Cygwin-x86" ]
1494 inherit_from => [ "Cygwin-x86" ]
1497 #### NetWare from David Ward (dsward@novell.com)
1498 # requires either MetroWerks NLM development tools, or gcc / nlmconv
1499 # NetWare defaults socket bio to WinSock sockets. However,
1500 # the builds can be configured to use BSD sockets instead.
1501 # netware-clib => legacy CLib c-runtime support
1503 inherit_from => [ "BASE_Windows" ],
1505 build_scheme => add("netware", { separator => undef }),
1507 "netware-clib-bsdsock" => {
1508 inherit_from => [ "BASE_Windows" ],
1510 build_scheme => add("netware", { separator => undef }),
1512 "netware-clib-gcc" => {
1513 inherit_from => [ "BASE_unix" ],
1514 cc => "i586-netware-gcc",
1515 cflags => "-nostdinc -I/ndk/nwsdk/include/nlm -I/ndk/ws295sdk/include -DL_ENDIAN -DNETWARE_CLIB -DOPENSSL_SYS_NETWARE -O2 -Wall",
1517 "netware-clib-bsdsock-gcc" => {
1518 inherit_from => [ "BASE_unix" ],
1519 cc => "i586-netware-gcc",
1520 cflags => "-nostdinc -I/ndk/nwsdk/include/nlm -DNETWARE_BSDSOCK -DNETDB_USE_INTERNET -DL_ENDIAN -DNETWARE_CLIB -DOPENSSL_SYS_NETWARE -O2 -Wall",
1522 # netware-libc => LibC/NKS support
1524 inherit_from => [ "BASE_Windows" ],
1526 bn_ops => "BN_LLONG",
1527 build_scheme => add("netware", { separator => undef }),
1529 "netware-libc-bsdsock" => {
1530 inherit_from => [ "BASE_Windows" ],
1532 bn_ops => "BN_LLONG",
1533 build_scheme => add("netware", { separator => undef }),
1535 "netware-libc-gcc" => {
1536 inherit_from => [ "BASE_unix" ],
1537 cc => "i586-netware-gcc",
1538 cflags => "-nostdinc -I/ndk/libc/include -I/ndk/libc/include/winsock -DL_ENDIAN -DNETWARE_LIBC -DOPENSSL_SYS_NETWARE -DTERMIO -O2 -Wall",
1539 bn_ops => "BN_LLONG",
1541 "netware-libc-bsdsock-gcc" => {
1542 inherit_from => [ "BASE_unix" ],
1543 cc => "i586-netware-gcc",
1544 cflags => "-nostdinc -I/ndk/libc/include -DNETWARE_BSDSOCK -DL_ENDIAN -DNETWARE_LIBC -DOPENSSL_SYS_NETWARE -DTERMIO -O2 -Wall",
1545 bn_ops => "BN_LLONG",
1550 inherit_from => [ asm("x86_asm") ],
1552 cflags => "-I/dev/env/WATT_ROOT/inc -DTERMIO -DL_ENDIAN -fomit-frame-pointer -O2 -Wall",
1554 ex_libs => add("-L/dev/env/WATT_ROOT/lib -lwatt"),
1555 bn_ops => "BN_LLONG",
1556 perlasm_scheme => "a.out",
1559 #### Ultrix from Bernhard Simon <simon@zid.tuwien.ac.at>
1561 inherit_from => [ "BASE_unix" ],
1563 cflags => "-std1 -O -Olimit 2500 -DL_ENDIAN",
1564 thread_scheme => "(unknown)",
1567 inherit_from => [ "BASE_unix" ],
1569 cflags => "-O3 -DL_ENDIAN",
1570 bn_ops => "BN_LLONG",
1571 thread_scheme => "(unknown)",
1573 # K&R C is no longer supported; you need gcc on old Ultrix installations
1574 ##"ultrix","cc:-O2 -DNOPROTO -DNOCONST -DL_ENDIAN::(unknown):::::::",
1576 ##### MacOS X (a.k.a. Darwin) setup
1577 "darwin-common" => {
1578 inherit_from => [ "BASE_unix" ],
1581 cflags => combine(picker(default => "",
1584 threads("-D_REENTRANT")),
1586 plib_lflags => "-Wl,-search_paths_first",
1587 bn_ops => "BN_LLONG RC4_CHAR",
1588 thread_scheme => "pthreads",
1589 perlasm_scheme => "osx32",
1590 dso_scheme => "dlfcn",
1591 ranlib => "ranlib -c",
1592 shared_target => "darwin-shared",
1593 shared_cflag => "-fPIC",
1594 shared_ldflag => "-dynamiclib",
1595 shared_extension => ".\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
1597 "darwin-ppc-cc" => {
1598 inherit_from => [ "darwin-common", asm("ppc32_asm") ],
1599 cflags => add("-arch ppc -DB_ENDIAN -Wa,-force_cpusubtype_ALL"),
1600 perlasm_scheme => "osx32",
1601 shared_ldflag => "-arch ppc -dynamiclib",
1603 "darwin64-ppc-cc" => {
1604 inherit_from => [ "darwin-common", asm("ppc64_asm") ],
1605 cflags => add("-arch ppc64 -DB_ENDIAN"),
1606 bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
1607 perlasm_scheme => "osx64",
1608 shared_ldflag => "-arch ppc64 -dynamiclib",
1610 "darwin-i386-cc" => {
1611 inherit_from => [ "darwin-common", asm("x86_asm") ],
1612 cflags => add(picker(default => "-arch i386 -DL_ENDIAN",
1613 release => "-fomit-frame-pointer")),
1614 bn_ops => "BN_LLONG RC4_INT",
1615 perlasm_scheme => "macosx",
1616 shared_ldflag => "-arch i386 -dynamiclib",
1618 "darwin64-x86_64-cc" => {
1619 inherit_from => [ "darwin-common", asm("x86_64_asm") ],
1620 cflags => add("-arch x86_64 -DL_ENDIAN -Wall"),
1621 bn_ops => "SIXTY_FOUR_BIT_LONG",
1622 perlasm_scheme => "macosx",
1623 shared_ldflag => "-arch x86_64 -dynamiclib",
1628 # It takes three prior-set environment variables to make it work:
1630 # CROSS_COMPILE=/where/toolchain/is/usr/bin/ [note ending slash]
1631 # CROSS_TOP=/where/SDKs/are
1632 # CROSS_SDK=iPhoneOSx.y.sdk
1634 # Exact paths vary with Xcode releases, but for couple of last ones
1635 # they would look like this:
1637 # CROSS_COMPILE=`xcode-select --print-path`/Toolchains/XcodeDefault.xctoolchain/usr/bin/
1638 # CROSS_TOP=`xcode-select --print-path`/Platforms/iPhoneOS.platform/Developer
1639 # CROSS_SDK=iPhoneOS.sdk
1641 "iphoneos-cross" => {
1642 inherit_from => [ "darwin-common" ],
1643 cflags => add("-isysroot \$(CROSS_TOP)/SDKs/\$(CROSS_SDK) -fno-common"),
1647 inherit_from => [ "darwin-common", asm("armv4_asm") ],
1648 # It should be possible to go below iOS 6 and even add -arch armv6,
1649 # thus targeting iPhone pre-3GS, but it's assumed to be irrelevant
1651 cflags => add("-arch armv7 -mios-version-min=6.0.0 -isysroot \$(CROSS_TOP)/SDKs/\$(CROSS_SDK) -fno-common"),
1653 perlasm_scheme => "ios32",
1656 inherit_from => [ "darwin-common", asm("aarch64_asm") ],
1657 cflags => add("-arch arm64 -mios-version-min=7.0.0 -isysroot \$(CROSS_TOP)/SDKs/\$(CROSS_SDK) -fno-common"),
1659 bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
1660 perlasm_scheme => "ios64",
1665 inherit_from => [ "BASE_unix" ],
1666 inherit_from => [ asm("x86_elf_asm") ],
1668 cflags => combine("-DL_ENDIAN -O3 -fomit-frame-pointer -Wall",
1669 threads("-pthread")),
1670 ex_libs => add("-ldl"),
1671 bn_ops => "BN_LLONG",
1672 thread_scheme => "pthreads",
1673 dso_scheme => "dlfcn",
1674 shared_target => "linux-shared",
1675 shared_cflag => "-fPIC",
1680 inherit_from => [ "BASE_unix" ],
1684 ##### VxWorks for various targets
1685 "vxworks-ppc60x" => {
1686 inherit_from => [ "BASE_unix" ],
1688 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",
1689 sys_id => "VXWORKS",
1690 ex_libs => add("-Wl,--defsym,__wrs_rtp_base=0xe0000000 -L \$(WIND_BASE)/target/usr/lib/ppc/PPC32/common"),
1692 "vxworks-ppcgen" => {
1693 inherit_from => [ "BASE_unix" ],
1695 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",
1696 sys_id => "VXWORKS",
1697 ex_libs => add("-Wl,--defsym,__wrs_rtp_base=0xe0000000 -L \$(WIND_BASE)/target/usr/lib/ppc/PPC32/sfcommon"),
1699 "vxworks-ppc405" => {
1700 inherit_from => [ "BASE_unix" ],
1702 cflags => "-g -msoft-float -mlongcall -DCPU=PPC405 -I\$(WIND_BASE)/target/h",
1703 sys_id => "VXWORKS",
1706 "vxworks-ppc750" => {
1707 inherit_from => [ "BASE_unix" ],
1709 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)",
1710 sys_id => "VXWORKS",
1713 "vxworks-ppc750-debug" => {
1714 inherit_from => [ "BASE_unix" ],
1716 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 -DBN_DEBUG -DREF_DEBUG -DCONF_DEBUG -DBN_CTX_DEBUG -DPEDANTIC -DDEBUG_SAFESTACK -DDEBUG -g",
1717 sys_id => "VXWORKS",
1720 "vxworks-ppc860" => {
1721 inherit_from => [ "BASE_unix" ],
1723 cflags => "-nostdinc -msoft-float -DCPU=PPC860 -DNO_STRINGS_H -I\$(WIND_BASE)/target/h",
1724 sys_id => "VXWORKS",
1727 "vxworks-simlinux" => {
1728 inherit_from => [ "BASE_unix" ],
1730 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",
1731 sys_id => "VXWORKS",
1733 ranlib => "ranlibpentium",
1736 inherit_from => [ "BASE_unix", asm("mips32_asm") ],
1738 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",
1739 threads("-D_REENTRANT")),
1740 sys_id => "VXWORKS",
1741 ex_libs => add("-Wl,--defsym,__wrs_rtp_base=0xe0000000 -L \$(WIND_BASE)/target/usr/lib/mips/MIPSI32/sfcommon"),
1742 thread_scheme => "pthreads",
1743 perlasm_scheme => "o32",
1744 ranlib => "ranlibmips",
1749 inherit_from => [ "BASE_unix" ],
1751 cflags => combine("\$(CFLAGS)",
1752 threads("-D_REENTRANT")),
1753 plib_lflags => "\$(LDFLAGS)",
1754 ex_libs => add("\$(LDLIBS)"),
1755 bn_ops => "BN_LLONG",
1756 thread_scheme => "pthreads",
1757 dso_scheme => "$ENV{'LIBSSL_dlfcn'}",
1758 shared_target => "linux-shared",
1759 shared_cflag => "-fPIC",
1760 shared_ldflag => "-shared",
1761 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
1762 ranlib => "$ENV{'RANLIB'}",
1764 "uClinux-dist64" => {
1765 inherit_from => [ "BASE_unix" ],
1767 cflags => combine("\$(CFLAGS)",
1768 threads("-D_REENTRANT")),
1769 plib_lflags => "\$(LDFLAGS)",
1770 ex_libs => add("\$(LDLIBS)"),
1771 bn_ops => "SIXTY_FOUR_BIT_LONG",
1772 thread_scheme => "pthreads",
1773 dso_scheme => "$ENV{'LIBSSL_dlfcn'}",
1774 shared_target => "linux-shared",
1775 shared_cflag => "-fPIC",
1776 shared_ldflag => "-shared",
1777 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
1778 ranlib => "$ENV{'RANLIB'}",
1783 inherit_from => [ "BASE_VMS" ],
1786 cflags => picker(default => "/STANDARD=RELAXED/NOLIST/PREFIX=ALL/NAMES=(AS_IS,SHORTENED)",
1787 debug => "/NOOPTIMIZE/DEBUG",
1788 release => "/OPTIMIZE/NODEBUG"),
1789 lflags => picker(default => "/MAP",
1790 debug => "/DEBUG/TRACEBACK",
1791 release => "/NODEBUG/NOTRACEBACK"),
1792 shared_target => "vms-shared",
1793 thread_scheme => "pthreads",
1795 apps_aux_src => "vms_decc_init.c",
1798 # VMS on VAX is *unsupported*
1801 # bn_obj => "[.asm]vms.obj vms-helper.obj"
1804 # inherit_from => [ "vms-generic", asm("vms-asm") ],
1806 # debug_aflags => "/NOOPTIMIZE/DEBUG",
1807 # release_aflags => "/OPTIMIZE/NODEBUG",
1808 # bn_opts => "THIRTY_TWO_BIT RC4_CHAR RC4_CHUNK DES_PTR BF_PTR",
1811 inherit_from => [ "vms-generic" ],
1813 #debug_aflags => "/NOOPTIMIZE/DEBUG",
1814 #release_aflags => "/OPTIMIZE/NODEBUG",
1815 bn_opts => "SIXTY_FOUR_BIT RC4_INT RC4_CHUNK_LL DES_PTR BF_PTR",
1817 "vms-alpha-P32" => {
1818 inherit_from => [ "vms-alpha" ],
1819 cflags => add("/POINTER_SIZE=32"),
1820 ex_libs => sub { join(",", map { s|SHR([\./])|SHR32$1|g; $_ } @_) },
1822 "vms-alpha-P64" => {
1823 inherit_from => [ "vms-alpha" ],
1824 cflags => add("/POINTER_SIZE=64"),
1825 ex_libs => sub { join(",", map { s|SHR([\./])|SHR64$1|g; $_ } @_) },
1828 inherit_from => [ "vms-generic" ],
1830 #debug_aflags => "/NOOPTIMIZE/DEBUG",
1831 #release_aflags => "/OPTIMIZE/NODEBUG",
1832 bn_opts => "SIXTY_FOUR_BIT RC4_INT RC4_CHUNK_LL DES_PTR BF_PTR",
1835 inherit_from => [ "vms-ia64" ],
1836 cflags => add("/POINTER_SIZE=32"),
1837 ex_libs => sub { join(",", map { s|SHR([\./])|SHR32$1|g; $_ } @_) },
1840 inherit_from => [ "vms-ia64" ],
1841 cflags => add("/POINTER_SIZE=64"),
1842 ex_libs => sub { join(",", map { s|SHR([\./])|SHR64$1|g; $_ } @_) },