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",
11 asflags => "-Ox -f win64 -DNEAR",
13 } elsif ($disabled{asm}) {
14 # assembler is still used to compile uplink shim
15 $vc_win64a_info = { AS => "ml64",
16 ASFLAGS => "/nologo /Zi",
17 asflags => "/c /Cp /Cx",
20 $die->("NASM not found - please read INSTALL and NOTES.WIN for further details\n");
21 $vc_win64a_info = { AS => "{unknown}",
27 return $vc_win64a_info;
30 my $vc_win32_info = {};
32 unless (%$vc_win32_info) {
33 my $ver=`nasm -v 2>NUL`;
34 my $vew=`nasmw -v 2>NUL`;
35 if ($ver ne "" || $vew ne "") {
36 $vc_win32_info = { AS => $ver ge $vew ? "nasm" : "nasmw",
38 asflags => "-f win32",
40 perlasm_scheme => "win32n" };
41 } elsif ($disabled{asm}) {
42 # not actually used, uplink shim is inlined into C code
43 $vc_win32_info = { AS => "ml",
44 ASFLAGS => "/nologo /Zi",
45 asflags => "/Cp /coff /c /Cx",
47 perlasm_scheme => "win32" };
49 $die->("NASM not found - please read INSTALL and NOTES.WIN for further details\n");
50 $vc_win32_info = { AS => "{unknown}",
54 perlasm_scheme => "win32" };
57 return $vc_win32_info;
60 my $vc_wince_info = {};
62 unless (%$vc_wince_info) {
64 $die->('%OSVERSION% is not defined') if (!defined(env('OSVERSION')));
65 $die->('%PLATFORM% is not defined') if (!defined(env('PLATFORM')));
66 $die->('%TARGETCPU% is not defined') if (!defined(env('TARGETCPU')));
69 # Idea behind this is to mimic flags set by eVC++ IDE...
71 my $wcevers = env('OSVERSION'); # WCENNN
74 if ($wcevers =~ /^WCE([1-9])([0-9]{2})$/) {
76 $wceverdotnum = "$1.$2";
78 $die->('%OSVERSION% value is insane');
79 $wcevernum = "{unknown}";
80 $wceverdotnum = "{unknown}";
82 my $wcecdefs = "-D_WIN32_WCE=$wcevernum -DUNDER_CE=$wcevernum"; # -D_WIN32_WCE=NNN
83 my $wcelflag = "/subsystem:windowsce,$wceverdotnum"; # ...,N.NN
85 my $wceplatf = env('PLATFORM');
87 $wceplatf =~ tr/a-z0-9 /A-Z0-9_/;
88 $wcecdefs .= " -DWCE_PLATFORM_$wceplatf";
90 my $wcetgt = env('TARGETCPU'); # just shorter name...
91 SWITCH: for($wcetgt) {
92 /^X86/ && do { $wcecdefs.=" -Dx86 -D_X86_ -D_i386_ -Di_386_";
93 $wcelflag.=" /machine:X86"; last; };
94 /^ARMV4[IT]/ && do { $wcecdefs.=" -DARM -D_ARM_ -D$wcetgt";
95 $wcecdefs.=" -DTHUMB -D_THUMB_" if($wcetgt=~/T$/);
96 $wcecdefs.=" -QRarch4T -QRinterwork-return";
97 $wcelflag.=" /machine:THUMB"; last; };
98 /^ARM/ && do { $wcecdefs.=" -DARM -D_ARM_ -D$wcetgt";
99 $wcelflag.=" /machine:ARM"; last; };
100 /^MIPSIV/ && do { $wcecdefs.=" -DMIPS -D_MIPS_ -DR4000 -D$wcetgt";
101 $wcecdefs.=" -D_MIPS64 -QMmips4 -QMn32";
102 $wcelflag.=" /machine:MIPSFPU"; last; };
103 /^MIPS16/ && do { $wcecdefs.=" -DMIPS -D_MIPS_ -DR4000 -D$wcetgt";
104 $wcecdefs.=" -DMIPSII -QMmips16";
105 $wcelflag.=" /machine:MIPS16"; last; };
106 /^MIPSII/ && do { $wcecdefs.=" -DMIPS -D_MIPS_ -DR4000 -D$wcetgt";
107 $wcecdefs.=" -QMmips2";
108 $wcelflag.=" /machine:MIPS"; last; };
109 /^R4[0-9]{3}/ && do { $wcecdefs.=" -DMIPS -D_MIPS_ -DR4000";
110 $wcelflag.=" /machine:MIPS"; last; };
111 /^SH[0-9]/ && do { $wcecdefs.=" -D$wcetgt -D_${wcetgt}_ -DSHx";
112 $wcecdefs.=" -Qsh4" if ($wcetgt =~ /^SH4/);
113 $wcelflag.=" /machine:$wcetgt"; last; };
114 { $wcecdefs.=" -D$wcetgt -D_${wcetgt}_";
115 $wcelflag.=" /machine:$wcetgt"; last; };
118 $vc_wince_info = { cppflags => $wcecdefs,
119 lflags => $wcelflag };
121 return $vc_wince_info;
124 # Helper functions for the VMS configs
127 my $pointer_size_str = $config{target} =~ m|-p(\d+)$| ? $1 : "";
129 # For the case where Configure iterate through all config targets, such
130 # as when listing them and their details, we reset info if the pointer
132 if (%$vms_info && $vms_info->{pointer_size} ne $pointer_size_str) {
136 unless (%$vms_info) {
137 $vms_info->{disable_warns} = [ ];
138 $vms_info->{pointer_size} = $pointer_size_str;
139 if ($pointer_size_str eq "64") {
140 `PIPE CC /NOCROSS_REFERENCE /NOLIST /NOOBJECT /WARNINGS = DISABLE = ( MAYLOSEDATA3, EMPTYFILE ) NL: 2> NL:`;
142 push @{$vms_info->{disable_warns}}, "MAYLOSEDATA3";
146 unless ($disabled{zlib}) {
147 my $default_zlib = 'GNV$LIBZSHR' . $pointer_size_str;
148 if (defined($disabled{"zlib-dynamic"})) {
149 $vms_info->{zlib} = $withargs{zlib_lib} || "$default_zlib/SHARE";
151 $vms_info->{def_zlib} = $withargs{zlib_lib} || $default_zlib;
152 # In case the --with-zlib-lib value contains something like
153 # /SHARE or /LIB or so at the end, remove it.
154 $vms_info->{def_zlib} =~ s|/.*$||g;
158 if ($config{target} =~ /-ia64/) {
159 `PIPE ias -H 2> NL:`;
161 $vms_info->{AS} = "ias";
162 $vms_info->{ASFLAGS} = '-d debug';
163 $vms_info->{asflags} = '"-N" vms_upcase';
164 $vms_info->{asoutflag} = "-o ";
165 $vms_info->{perlasm_scheme} = "ias";
174 #### Basic configs that should work on any 32-bit box
176 inherit_from => [ "BASE_unix" ],
178 CFLAGS => picker(debug => "-O0 -g",
180 thread_scheme => "(unknown)",
181 bn_ops => "BN_LLONG",
184 inherit_from => [ "BASE_unix" ],
187 thread_scheme => "(unknown)",
190 #### VOS Configurations
192 inherit_from => [ "BASE_unix" ],
194 CFLAGS => picker(default => "-Wall",
197 cppflags => "-D_POSIX_C_SOURCE=200112L -D_BSD -D_VOS_EXTENDED_NAMES",
198 lib_cppflags => "-DB_ENDIAN",
199 thread_scheme => "(unknown)",
201 lflags => add("-Wl,-map"),
202 bn_ops => "BN_LLONG",
203 shared_extension => ".so",
206 #### Solaris configurations
207 "solaris-common" => {
208 inherit_from => [ "BASE_unix" ],
210 lib_cppflags => "-DFILIO_H",
211 ex_libs => add("-lsocket -lnsl -ldl"),
212 dso_scheme => "dlfcn",
213 thread_scheme => "pthreads",
214 shared_target => "solaris-shared",
215 shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
217 #### Solaris x86 with GNU C setups
218 "solaris-x86-gcc" => {
219 # NB. GNU C has to be configured to use GNU assembler, and not
220 # /usr/ccs/bin/as. Failure to comply will result in compile
221 # failures [at least] in 32-bit build.
222 inherit_from => [ "solaris-common", asm("x86_elf_asm") ],
224 CFLAGS => add_before(picker(default => "-Wall",
226 release => "-O3 -fomit-frame-pointer")),
227 cflags => add(threads("-pthread")),
228 lib_cppflags => add("-DL_ENDIAN"),
229 ex_libs => add(threads("-pthread")),
230 bn_ops => "BN_LLONG",
231 shared_cflag => "-fPIC",
232 shared_ldflag => "-shared -static-libgcc",
234 "solaris64-x86_64-gcc" => {
235 # -shared -static-libgcc might appear controversial, but modules
236 # taken from static libgcc do not have relocations and linking
237 # them into our shared objects doesn't have any negative side
238 # effects. On the contrary, doing so makes it possible to use
239 # gcc shared build with Sun C. Given that gcc generates faster
240 # code [thanks to inline assembler], I would actually recommend
241 # to consider using gcc shared build even with vendor compiler:-)
242 # -- <appro@openssl.org>
243 inherit_from => [ "solaris-common", asm("x86_64_asm") ],
245 CFLAGS => add_before(picker(default => "-Wall",
248 cflags => add_before("-m64", threads("-pthread")),
249 lib_cppflags => add("-DL_ENDIAN"),
250 ex_libs => add(threads("-pthread")),
251 bn_ops => "SIXTY_FOUR_BIT_LONG",
252 perlasm_scheme => "elf",
253 shared_cflag => "-fPIC",
254 shared_ldflag => "-shared -static-libgcc",
258 #### Solaris x86 with Sun C setups
259 # There used to be solaris-x86-cc target, but it was removed,
260 # primarily because vendor assembler can't assemble our modules
261 # with -KPIC flag. As result it, assembly support, was not even
262 # available as option. But its lack means lack of side-channel
263 # resistant code, which is incompatible with security by todays
264 # standards. Fortunately gcc is readily available prepackaged
265 # option, which we can firmly point at...
267 # On related note, solaris64-x86_64-cc target won't compile code
268 # paths utilizing AVX and post-Haswell instruction extensions.
269 # Consider switching to solaris64-x86_64-gcc even here...
271 "solaris64-x86_64-cc" => {
272 inherit_from => [ "solaris-common", asm("x86_64_asm") ],
274 CFLAGS => add_before(picker(debug => "-g",
275 release => "-xO5 -xdepend -xbuiltin")),
276 cflags => add_before("-xarch=generic64 -xstrconst -Xa"),
277 cppflags => add(threads("-D_REENTRANT")),
278 lib_cppflags => add("-DL_ENDIAN"),
279 thread_scheme => "pthreads",
280 lflags => add(threads("-mt")),
281 ex_libs => add(threads("-lpthread")),
282 bn_ops => "SIXTY_FOUR_BIT_LONG",
283 perlasm_scheme => "elf",
284 shared_cflag => "-KPIC",
285 shared_ldflag => "-G -dy -z text",
289 #### SPARC Solaris with GNU C setups
290 "solaris-sparcv7-gcc" => {
291 inherit_from => [ "solaris-common" ],
293 CFLAGS => add_before(picker(default => "-Wall",
296 cflags => add(threads("-pthread")),
297 lib_cppflags => add("-DB_ENDIAN -DBN_DIV2W"),
298 ex_libs => add(threads("-pthread")),
299 bn_ops => "BN_LLONG RC4_CHAR",
300 shared_cflag => "-fPIC",
301 shared_ldflag => "-shared",
303 "solaris-sparcv8-gcc" => {
304 inherit_from => [ "solaris-sparcv7-gcc", asm("sparcv8_asm") ],
305 cflags => add_before("-mcpu=v8"),
307 "solaris-sparcv9-gcc" => {
308 # -m32 should be safe to add as long as driver recognizes
310 inherit_from => [ "solaris-sparcv7-gcc", asm("sparcv9_asm") ],
311 cflags => add_before("-m32 -mcpu=ultrasparc"),
313 "solaris64-sparcv9-gcc" => {
314 inherit_from => [ "solaris-sparcv9-gcc" ],
315 cflags => sub { my $f=join(" ",@_); $f =~ s/\-m32/-m64/; $f; },
316 bn_ops => "BN_LLONG RC4_CHAR",
320 #### SPARC Solaris with Sun C setups
321 # SC4.0 doesn't pass 'make test', upgrade to SC5.0 or SC4.2.
322 # SC4.2 is ok, better than gcc even on bn as long as you tell it -xarch=v8
323 # SC5.0 note: Compiler common patch 107357-01 or later is required!
324 "solaris-sparcv7-cc" => {
325 inherit_from => [ "solaris-common" ],
327 CFLAGS => add_before(picker(debug => "-g",
328 release => "-xO5 -xdepend")),
329 cflags => add_before("-xstrconst -Xa"),
330 cppflags => add(threads("-D_REENTRANT")),
331 lib_cppflags => add("-DB_ENDIAN -DBN_DIV2W"),
332 lflags => add(threads("-mt")),
333 ex_libs => add(threads("-lpthread")),
334 bn_ops => "BN_LLONG RC4_CHAR",
335 shared_cflag => "-KPIC",
336 shared_ldflag => "-G -dy -z text",
339 "solaris-sparcv8-cc" => {
340 inherit_from => [ "solaris-sparcv7-cc", asm("sparcv8_asm") ],
341 cflags => add_before("-xarch=v8"),
343 "solaris-sparcv9-cc" => {
344 inherit_from => [ "solaris-sparcv7-cc", asm("sparcv9_asm") ],
345 cflags => add_before("-xarch=v8plus"),
347 "solaris64-sparcv9-cc" => {
348 inherit_from => [ "solaris-sparcv7-cc", asm("sparcv9_asm") ],
349 cflags => add_before("-xarch=v9"),
350 bn_ops => "BN_LLONG RC4_CHAR",
354 #### IRIX 6.x configs
355 # Only N32 and N64 ABIs are supported.
356 "irix-mips3-gcc" => {
357 inherit_from => [ "BASE_unix", asm("mips64_asm") ],
359 CFLAGS => picker(debug => "-g -O0",
361 cflags => "-mabi=n32",
362 cppflags => combine("-DB_ENDIAN -DBN_DIV3W",
363 threads("-D_SGI_MP_SOURCE")),
364 cppflags => threads("-D_SGI_MP_SOURCE"),
365 lib_cppflags => "-DB_ENDIAN -DBN_DIV3W",
366 ex_libs => add(threads("-lpthread")),
367 bn_ops => "RC4_CHAR SIXTY_FOUR_BIT",
368 thread_scheme => "pthreads",
369 perlasm_scheme => "n32",
370 dso_scheme => "dlfcn",
371 shared_target => "irix-shared",
372 shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
376 inherit_from => [ "BASE_unix", asm("mips64_asm") ],
378 CFLAGS => picker(debug => "-g -O0",
380 cflags => "-n32 -mips3 -use_readonly_const -G0 -rdata_shared",
381 cppflags => threads("-D_SGI_MP_SOURCE"),
382 lib_cppflags => "-DB_ENDIAN -DBN_DIV3W",
383 ex_libs => add(threads("-lpthread")),
384 bn_ops => "RC4_CHAR SIXTY_FOUR_BIT",
385 thread_scheme => "pthreads",
386 perlasm_scheme => "n32",
387 dso_scheme => "dlfcn",
388 shared_target => "irix-shared",
389 shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
393 "irix64-mips4-gcc" => {
394 inherit_from => [ "BASE_unix", asm("mips64_asm") ],
396 CFLAGS => picker(debug => "-g -O0",
398 cflags => "-mabi=64 -mips4",
399 cppflags => threads("-D_SGI_MP_SOURCE"),
400 lib_cppflags => "-DB_ENDIAN -DBN_DIV3W",
401 ex_libs => add(threads("-lpthread")),
402 bn_ops => "RC4_CHAR SIXTY_FOUR_BIT_LONG",
403 thread_scheme => "pthreads",
404 perlasm_scheme => "64",
405 dso_scheme => "dlfcn",
406 shared_target => "irix-shared",
407 shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
410 "irix64-mips4-cc" => {
411 inherit_from => [ "BASE_unix", asm("mips64_asm") ],
413 CFLAGS => picker(debug => "-g -O0",
415 cflags => "-64 -mips4 -use_readonly_const -G0 -rdata_shared",
416 cppflags => threads("-D_SGI_MP_SOURCE"),
417 lib_cppflags => "-DB_ENDIAN -DBN_DIV3W",
418 ex_libs => threads("-lpthread"),
419 bn_ops => "RC4_CHAR SIXTY_FOUR_BIT_LONG",
420 thread_scheme => "pthreads",
421 perlasm_scheme => "64",
422 dso_scheme => "dlfcn",
423 shared_target => "irix-shared",
424 shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
428 #### Unified HP-UX ANSI C configs.
430 # - Originally we were optimizing at +O4 level. It should be noted
431 # that the only difference between +O3 and +O4 is global inter-
432 # procedural analysis. As it has to be performed during the link
433 # stage the compiler leaves behind certain pseudo-code in lib*.a
434 # which might be release or even patch level specific. Generating
435 # the machine code for and analyzing the *whole* program appears
436 # to be *extremely* memory demanding while the performance gain is
437 # actually questionable. The situation is intensified by the default
438 # HP-UX data set size limit (infamous 'maxdsiz' tunable) of 64MB
439 # which is way too low for +O4. In other words, doesn't +O3 make
441 # - Keep in mind that the HP compiler by default generates code
442 # suitable for execution on the host you're currently compiling at.
443 # If the toolkit is meant to be used on various PA-RISC processors
444 # consider './Configure hpux-parisc-[g]cc +DAportable'.
445 # - -DMD32_XARRAY triggers workaround for compiler bug we ran into in
446 # 32-bit message digests. (For the moment of this writing) HP C
447 # doesn't seem to "digest" too many local variables (they make "him"
448 # chew forever:-). For more details look-up MD32_XARRAY comment in
449 # crypto/sha/sha_lcl.h.
450 # - originally there were 32-bit hpux-parisc2-* targets. They were
451 # scrapped, because a) they were not interchangeable with other 32-bit
452 # targets; b) performance-critical 32-bit assembly modules implement
453 # even PA-RISC 2.0-specific code paths, which are chosen at run-time,
454 # thus adequate performance is provided even with PA-RISC 1.1 build.
457 defines => add("_XOPEN_SOURCE", "_XOPEN_SOURCE_EXTENDED",
458 "_HPUX_ALT_XOPEN_SOCKET_API"),
460 "hpux-parisc-gcc" => {
461 inherit_from => [ "BASE_unix", "hpux-network" ],
463 CFLAGS => picker(debug => "-O0 -g",
465 cflags => add(threads("-pthread")),
466 lib_cppflags => "-DB_ENDIAN -DBN_DIV2W",
467 ex_libs => add("-ldld", threads("-pthread")),
468 bn_ops => "BN_LLONG",
469 thread_scheme => "pthreads",
471 shared_target => "hpux-shared",
472 shared_cflag => "-fPIC",
473 shared_ldflag => "-shared",
474 shared_extension => ".sl.\$(SHLIB_VERSION_NUMBER)",
476 "hpux-parisc1_1-gcc" => {
477 inherit_from => [ "hpux-parisc-gcc", asm("parisc11_asm") ],
478 multilib => "/pa1.1",
480 "hpux64-parisc2-gcc" => {
481 inherit_from => [ "BASE_unix", "hpux-network",
482 asm("parisc20_64_asm") ],
484 CFLAGS => combine(picker(debug => "-O0 -g",
486 cflags => add(threads("-pthread")),
487 lib_cppflags => "-DB_ENDIAN",
488 ex_libs => add("-ldl", threads("-pthread")),
489 bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
490 thread_scheme => "pthreads",
491 dso_scheme => "dlfcn",
492 shared_target => "hpux-shared",
493 shared_cflag => "-fpic",
494 shared_ldflag => "-shared",
495 shared_extension => ".sl.\$(SHLIB_VERSION_NUMBER)",
496 multilib => "/pa20_64",
499 # More attempts at unified 10.X and 11.X targets for HP C compiler.
500 "hpux-parisc-cc" => {
501 inherit_from => [ "BASE_unix", "hpux-network" ],
503 CFLAGS => picker(debug => "+O0 +d -g",
505 cflags => "+Optrs_strongly_typed -Ae +ESlit",
506 cppflags => threads("-D_REENTRANT"),
507 lib_cppflags => "-DB_ENDIAN -DBN_DIV2W -DMD32_XARRAY",
508 ex_libs => add("-ldld", threads("-lpthread")),
509 bn_ops => "RC4_CHAR",
510 thread_scheme => "pthreads",
512 shared_target => "hpux-shared",
513 shared_cflag => "+Z",
514 shared_ldflag => "-b",
515 shared_extension => ".sl.\$(SHLIB_VERSION_NUMBER)",
517 "hpux-parisc1_1-cc" => {
518 inherit_from => [ "hpux-parisc-cc", asm("parisc11_asm") ],
519 cflags => add_before("+DA1.1"),
520 multilib => "/pa1.1",
522 "hpux64-parisc2-cc" => {
523 inherit_from => [ "BASE_unix", "hpux-network",
524 asm("parisc20_64_asm") ],
526 CFLAGS => picker(debug => "+O0 +d -g",
528 cflags => "+DD64 +Optrs_strongly_typed -Ae +ESlit",
529 cppflags => threads("-D_REENTRANT") ,
530 lib_cppflags => "-DB_ENDIAN -DMD32_XARRAY",
531 ex_libs => add("-ldl", threads("-lpthread")),
532 bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
533 thread_scheme => "pthreads",
534 dso_scheme => "dlfcn",
535 shared_target => "hpux-shared",
536 shared_cflag => "+Z",
537 shared_ldflag => "-b",
538 shared_extension => ".sl.\$(SHLIB_VERSION_NUMBER)",
539 multilib => "/pa20_64",
542 # HP/UX IA-64 targets
544 inherit_from => [ "BASE_unix", "hpux-network", asm("ia64_asm") ],
546 CFLAGS => picker(debug => "+O0 +d -g",
548 cflags => "-Ae +DD32 +Olit=all -z",
549 cppflags => add(threads("-D_REENTRANT")),
550 lib_cppflags => "-DB_ENDIAN",
551 ex_libs => add("-ldl", threads("-lpthread")),
552 bn_ops => "SIXTY_FOUR_BIT",
553 thread_scheme => "pthreads",
554 dso_scheme => "dlfcn",
555 shared_target => "hpux-shared",
556 shared_cflag => "+Z",
557 shared_ldflag => "-b",
558 shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
559 multilib => "/hpux32",
561 "hpux64-ia64-cc" => {
562 inherit_from => [ "BASE_unix", "hpux-network", asm("ia64_asm") ],
564 CFLAGS => picker(debug => "+O0 +d -g",
566 cflags => "-Ae +DD64 +Olit=all -z",
567 cppflags => threads("-D_REENTRANT"),
568 lib_cppflags => "-DB_ENDIAN",
569 ex_libs => add("-ldl", threads("-lpthread")),
570 bn_ops => "SIXTY_FOUR_BIT_LONG",
571 thread_scheme => "pthreads",
572 dso_scheme => "dlfcn",
573 shared_target => "hpux-shared",
574 shared_cflag => "+Z",
575 shared_ldflag => "-b",
576 shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
577 multilib => "/hpux64",
581 inherit_from => [ "BASE_unix", "hpux-network", asm("ia64_asm") ],
583 CFLAGS => picker(debug => "-O0 -g",
585 cflags => add(threads("-pthread")),
586 lib_cppflags => "-DB_ENDIAN",
587 ex_libs => add("-ldl", threads("-pthread")),
588 bn_ops => "SIXTY_FOUR_BIT",
589 thread_scheme => "pthreads",
590 dso_scheme => "dlfcn",
591 shared_target => "hpux-shared",
592 shared_cflag => "-fpic",
593 shared_ldflag => "-shared",
594 shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
595 multilib => "/hpux32",
597 "hpux64-ia64-gcc" => {
598 inherit_from => [ "BASE_unix", "hpux-network", asm("ia64_asm") ],
600 CFLAGS => picker(debug => "-O0 -g",
602 cflags => combine("-mlp64", threads("-pthread")),
603 lib_cppflags => "-DB_ENDIAN",
604 ex_libs => add("-ldl", threads("-pthread")),
605 bn_ops => "SIXTY_FOUR_BIT_LONG",
606 thread_scheme => "pthreads",
607 dso_scheme => "dlfcn",
608 shared_target => "hpux-shared",
609 shared_cflag => "-fpic",
610 shared_ldflag => "-shared",
611 shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
612 multilib => "/hpux64",
615 #### HP MPE/iX http://jazz.external.hp.com/src/openssl/
617 inherit_from => [ "BASE_unix" ],
620 cppflags => "-D_POSIX_SOURCE -D_SOCKET_SOURCE",
621 includes => [ "/SYSLOG/PUB" ],
622 lib_cppflags => "-DBN_DIV2W",
624 lflags => add("-L/SYSLOG/PUB"),
625 ex_libs => add("-lsyslog -lsocket -lcurses"),
626 thread_scheme => "(unknown)",
627 bn_ops => "BN_LLONG",
630 #### DEC Alpha Tru64 targets. Tru64 is marketing name for OSF/1 version 4
631 #### and forward. In reality 'uname -s' still returns "OSF1". Originally
632 #### there were even osf1-* configs targeting prior versions provided,
633 #### but not anymore...
634 "tru64-alpha-gcc" => {
635 inherit_from => [ "BASE_unix", asm("alpha_asm") ],
638 cflags => add("-std=c9x", threads("-pthread")),
639 cppflags => "-D_XOPEN_SOURCE=500 -D_OSF_SOURCE",
640 ex_libs => add("-lrt", threads("-pthread")), # for mlock(2)
641 bn_ops => "SIXTY_FOUR_BIT_LONG",
642 thread_scheme => "pthreads",
643 dso_scheme => "dlfcn",
644 shared_target => "alpha-osf1-shared",
645 shared_extension => ".so",
647 "tru64-alpha-cc" => {
648 inherit_from => [ "BASE_unix", asm("alpha_asm") ],
650 CFLAGS => "-tune host -fast",
651 cflags => add("-std1 -readonly_strings",
652 threads("-pthread")),
653 cppflags => "-D_XOPEN_SOURCE=500 -D_OSF_SOURCE",
654 ex_libs => add("-lrt", threads("-pthread")), # for mlock(2)
655 bn_ops => "SIXTY_FOUR_BIT_LONG",
656 thread_scheme => "pthreads",
657 dso_scheme => "dlfcn",
658 shared_target => "alpha-osf1-shared",
659 shared_ldflag => "-msym",
660 shared_extension => ".so",
664 #### Variety of LINUX:-)
666 # *-generic* is endian-neutral target, but ./config is free to
667 # throw in -D[BL]_ENDIAN, whichever appropriate...
668 "linux-generic32" => {
669 inherit_from => [ "BASE_unix" ],
672 CFLAGS => picker(default => "-Wall",
675 CXXFLAGS => picker(default => "-Wall",
678 cflags => threads("-pthread"),
679 cxxflags => combine("-std=c++11", threads("-pthread")),
680 lib_cppflags => "-DOPENSSL_USE_NODELETE",
681 ex_libs => add("-ldl", threads("-pthread")),
682 bn_ops => "BN_LLONG RC4_CHAR",
683 thread_scheme => "pthreads",
684 dso_scheme => "dlfcn",
685 shared_target => "linux-shared",
686 shared_cflag => "-fPIC",
687 shared_ldflag => "-Wl,-znodelete",
688 shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
689 enable => [ "afalgeng" ],
691 "linux-generic64" => {
692 inherit_from => [ "linux-generic32" ],
693 bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
697 inherit_from => [ "linux-generic32", asm("ppc32_asm") ],
698 perlasm_scheme => "linux32",
701 inherit_from => [ "linux-generic64", asm("ppc64_asm") ],
702 cflags => add("-m64"),
703 cxxflags => add("-m64"),
704 lib_cppflags => add("-DB_ENDIAN"),
705 perlasm_scheme => "linux64",
709 inherit_from => [ "linux-generic64", asm("ppc64_asm") ],
710 cflags => add("-m64"),
711 cxxflags => add("-m64"),
712 lib_cppflags => add("-DL_ENDIAN"),
713 perlasm_scheme => "linux64le",
717 ################################################################
718 # Note that -march is not among compiler options in linux-armv4
719 # target description. Not specifying one is intentional to give
722 # a) rely on your compiler default by not specifying one;
723 # b) specify your target platform explicitly for optimal
724 # performance, e.g. -march=armv6 or -march=armv7-a;
725 # c) build "universal" binary that targets *range* of platforms
726 # by specifying minimum and maximum supported architecture;
728 # As for c) option. It actually makes no sense to specify
729 # maximum to be less than ARMv7, because it's the least
730 # requirement for run-time switch between platform-specific
731 # code paths. And without run-time switch performance would be
732 # equivalent to one for minimum. Secondly, there are some
733 # natural limitations that you'd have to accept and respect.
734 # Most notably you can *not* build "universal" binary for
735 # big-endian platform. This is because ARMv7 processor always
736 # picks instructions in little-endian order. Another similar
737 # limitation is that -mthumb can't "cross" -march=armv6t2
738 # boundary, because that's where it became Thumb-2. Well, this
739 # limitation is a bit artificial, because it's not really
740 # impossible, but it's deemed too tricky to support. And of
741 # course you have to be sure that your binutils are actually
742 # up to the task of handling maximum target platform. With all
743 # this in mind here is an example of how to configure
746 # ./Configure linux-armv4 -march=armv6 -D__ARM_MAX_ARCH__=8
748 inherit_from => [ "linux-generic32", asm("armv4_asm") ],
749 perlasm_scheme => "linux32",
752 inherit_from => [ "linux-generic64", asm("aarch64_asm") ],
753 perlasm_scheme => "linux64",
755 "linux-arm64ilp32" => { # https://wiki.linaro.org/Platform/arm64-ilp32
756 inherit_from => [ "linux-generic32", asm("aarch64_asm") ],
757 cflags => add("-mabi=ilp32"),
758 cxxflags => add("-mabi=ilp32"),
759 bn_ops => "SIXTY_FOUR_BIT RC4_CHAR",
760 perlasm_scheme => "linux64",
764 # Configure script adds minimally required -march for assembly
765 # support, if no -march was specified at command line.
766 inherit_from => [ "linux-generic32", asm("mips32_asm") ],
767 cflags => add("-mabi=32"),
768 cxxflags => add("-mabi=32"),
769 lib_cppflags => add("-DBN_DIV3W"),
770 perlasm_scheme => "o32",
772 # mips32 and mips64 below refer to contemporary MIPS Architecture
773 # specifications, MIPS32 and MIPS64, rather than to kernel bitness.
775 inherit_from => [ "linux-generic32", asm("mips64_asm") ],
776 cflags => add("-mabi=n32"),
777 cxxflags => add("-mabi=n32"),
778 lib_cppflags => add("-DBN_DIV3W"),
779 bn_ops => "SIXTY_FOUR_BIT RC4_CHAR",
780 perlasm_scheme => "n32",
783 "linux64-mips64" => {
784 inherit_from => [ "linux-generic64", asm("mips64_asm") ],
785 cflags => add("-mabi=64"),
786 cxxflags => add("-mabi=64"),
787 lib_cppflags => add("-DBN_DIV3W"),
788 perlasm_scheme => "64",
792 #### IA-32 targets...
793 #### These two targets are a bit aged and are to be used on older Linux
794 #### machines where gcc doesn't understand -m32 and -m64
796 inherit_from => [ "linux-generic32", asm("x86_elf_asm") ],
797 CFLAGS => add(picker(release => "-fomit-frame-pointer")),
798 lib_cppflags => add("-DL_ENDIAN"),
799 bn_ops => "BN_LLONG",
802 inherit_from => [ "BASE_unix", asm("x86_asm") ],
804 CFLAGS => add(picker(default => "-Wall",
806 release => "-O3 -fomit-frame-pointer")),
807 lib_cppflags => add("-DL_ENDIAN"),
808 bn_ops => "BN_LLONG",
809 thread_scheme => "(unknown)",
810 perlasm_scheme => "a.out",
813 #### X86 / X86_64 targets
815 inherit_from => [ "linux-generic32", asm("x86_asm") ],
816 CFLAGS => add(picker(release => "-fomit-frame-pointer")),
817 cflags => add("-m32"),
818 cxxflags => add("-m32"),
819 lib_cppflags => add("-DL_ENDIAN"),
820 bn_ops => "BN_LLONG",
821 perlasm_scheme => "elf",
823 "linux-x86-clang" => {
824 inherit_from => [ "linux-x86" ],
829 inherit_from => [ "linux-generic64", asm("x86_64_asm") ],
830 cflags => add("-m64"),
831 cxxflags => add("-m64"),
832 lib_cppflags => add("-DL_ENDIAN"),
833 bn_ops => "SIXTY_FOUR_BIT_LONG",
834 perlasm_scheme => "elf",
837 "linux-x86_64-clang" => {
838 inherit_from => [ "linux-x86_64" ],
843 inherit_from => [ "linux-generic32", asm("x86_64_asm") ],
844 cflags => add("-mx32"),
845 cxxflags => add("-mx32"),
846 lib_cppflags => add("-DL_ENDIAN"),
847 bn_ops => "SIXTY_FOUR_BIT",
848 perlasm_scheme => "elf32",
853 inherit_from => [ "linux-generic64", asm("ia64_asm") ],
854 bn_ops => "SIXTY_FOUR_BIT_LONG",
858 inherit_from => [ "linux-generic64", asm("s390x_asm") ],
859 cflags => add("-m64"),
860 cxxflags => add("-m64"),
861 lib_cppflags => add("-DB_ENDIAN"),
862 perlasm_scheme => "64",
866 #### So called "highgprs" target for z/Architecture CPUs
867 # "Highgprs" is kernel feature first implemented in Linux
868 # 2.6.32, see /proc/cpuinfo. The idea is to preserve most
869 # significant bits of general purpose registers not only
870 # upon 32-bit process context switch, but even on
871 # asynchronous signal delivery to such process. This makes
872 # it possible to deploy 64-bit instructions even in legacy
873 # application context and achieve better [or should we say
874 # adequate] performance. The build is binary compatible with
875 # linux-generic32, and the idea is to be able to install the
876 # resulting libcrypto.so alongside generic one, e.g. as
877 # /lib/highgprs/libcrypto.so.x.y, for ldconfig and run-time
878 # linker to autodiscover. Unfortunately it doesn't work just
879 # yet, because of couple of bugs in glibc
880 # sysdeps/s390/dl-procinfo.c affecting ldconfig and ld.so.1...
882 inherit_from => [ "linux-generic32", asm("s390x_asm") ],
883 cflags => add("-m31 -Wa,-mzarch"),
884 cxxflags => add("-m31 -Wa,-mzarch"),
885 lib_cppflags => add("-DB_ENDIAN"),
886 bn_asm_src => sub { my $r=join(" ",@_); $r=~s|asm/s390x\.S|bn_asm.c|; $r; },
887 perlasm_scheme => "31",
888 multilib => "/highgprs",
891 #### SPARC Linux setups
893 inherit_from => [ "linux-generic32", asm("sparcv8_asm") ],
894 cflags => add("-mcpu=v8"),
895 cxxflags => add("-mcpu=v8"),
896 lib_cppflags => add("-DB_ENDIAN -DBN_DIV2W"),
899 # it's a real mess with -mcpu=ultrasparc option under Linux,
900 # but -Wa,-Av8plus should do the trick no matter what.
901 inherit_from => [ "linux-generic32", asm("sparcv9_asm") ],
902 cflags => add("-m32 -mcpu=ultrasparc -Wa,-Av8plus"),
903 cxxflags => add("-m32 -mcpu=ultrasparc -Wa,-Av8plus"),
904 lib_cppflags => add("-DB_ENDIAN -DBN_DIV2W"),
906 "linux64-sparcv9" => {
907 # GCC 3.1 is a requirement
908 inherit_from => [ "linux-generic64", asm("sparcv9_asm") ],
909 cflags => add("-m64 -mcpu=ultrasparc"),
910 cxxflags => add("-m64 -mcpu=ultrasparc"),
911 lib_cppflags => add("-DB_ENDIAN"),
912 bn_ops => "BN_LLONG RC4_CHAR",
916 "linux-alpha-gcc" => {
917 inherit_from => [ "linux-generic64", asm("alpha_asm") ],
918 lib_cppflags => add("-DL_ENDIAN"),
919 bn_ops => "SIXTY_FOUR_BIT_LONG",
921 "linux-c64xplus" => {
922 inherit_from => [ "BASE_unix" ],
923 # TI_CGT_C6000_7.3.x is a requirement
925 CFLAGS => "-o2 -ox -ms",
926 cflags => "--linux -ea=.s -eo=.o -mv6400+ -pden",
927 cxxflags => "--linux -ea=.s -eo=.o -mv6400+ -pden",
928 cppflags => combine("-DOPENSSL_SMALL_FOOTPRINT",
929 threads("-D_REENTRANT")),
930 bn_ops => "BN_LLONG",
931 cpuid_asm_src => "c64xpluscpuid.s",
932 bn_asm_src => "asm/bn-c64xplus.asm c64xplus-gf2m.s",
933 aes_asm_src => "aes-c64xplus.s aes_cbc.c aes-ctr.fake",
934 sha1_asm_src => "sha1-c64xplus.s sha256-c64xplus.s sha512-c64xplus.s",
935 rc4_asm_src => "rc4-c64xplus.s",
936 modes_asm_src => "ghash-c64xplus.s",
937 chacha_asm_src => "chacha-c64xplus.s",
938 poly1305_asm_src => "poly1305-c64xplus.s",
939 thread_scheme => "pthreads",
940 perlasm_scheme => "void",
941 dso_scheme => "dlfcn",
942 shared_target => "linux-shared",
943 shared_cflag => "--pic",
944 shared_ldflag => add("-z --sysv --shared"),
945 shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
951 # As for thread cflag. Idea is to maintain "collective" set of
952 # flags, which would cover all BSD flavors. -pthread applies
953 # to them all, but is treated differently. OpenBSD expands is
954 # as -D_POSIX_THREAD -lc_r, which is sufficient. FreeBSD 4.x
955 # expands it as -lc_r, which has to be accompanied by explicit
956 # -D_THREAD_SAFE and sometimes -D_REENTRANT. FreeBSD 5.x
957 # expands it as -lc_r, which seems to be sufficient?
958 inherit_from => [ "BASE_unix" ],
960 CFLAGS => picker(default => "-Wall",
963 cflags => threads("-pthread"),
964 cppflags => threads("-D_THREAD_SAFE -D_REENTRANT"),
965 ex_libs => add(threads("-pthread")),
966 enable => add("devcryptoeng"),
967 bn_ops => "BN_LLONG",
968 thread_scheme => "pthreads",
969 dso_scheme => "dlfcn",
970 shared_target => "bsd-gcc-shared",
971 shared_cflag => "-fPIC",
972 shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
975 inherit_from => [ "BSD-generic32" ],
976 bn_ops => "SIXTY_FOUR_BIT_LONG",
980 inherit_from => [ "BSD-generic32", asm("x86_asm") ],
981 CFLAGS => add(picker(release => "-fomit-frame-pointer")),
982 lib_cppflags => add("-DL_ENDIAN"),
983 bn_ops => "BN_LLONG",
984 shared_target => "bsd-shared",
985 perlasm_scheme => "a.out",
988 inherit_from => [ "BSD-x86" ],
989 perlasm_scheme => "elf",
993 inherit_from => [ "BSD-generic32", asm("sparcv8_asm") ],
994 cflags => add("-mcpu=v8"),
995 lib_cppflags => add("-DB_ENDIAN"),
998 # -DMD32_REG_T=int doesn't actually belong in sparc64 target, it
999 # simply *happens* to work around a compiler bug in gcc 3.3.3,
1000 # triggered by RIPEMD160 code.
1001 inherit_from => [ "BSD-generic64", asm("sparcv9_asm") ],
1002 lib_cppflags => add("-DB_ENDIAN -DMD32_REG_T=int"),
1003 bn_ops => "BN_LLONG",
1007 inherit_from => [ "BSD-generic64", asm("ia64_asm") ],
1008 lib_cppflags => add("-DL_ENDIAN"),
1009 bn_ops => "SIXTY_FOUR_BIT_LONG",
1013 inherit_from => [ "BSD-generic64", asm("x86_64_asm") ],
1014 lib_cppflags => add("-DL_ENDIAN"),
1015 bn_ops => "SIXTY_FOUR_BIT_LONG",
1016 perlasm_scheme => "elf",
1020 inherit_from => [ "BASE_unix", asm("x86_elf_asm") ],
1022 CFLAGS => "-fomit-frame-pointer -O3 -Wall",
1023 lib_cppflags => "-DPERL5 -DL_ENDIAN",
1024 ex_libs => add("-ldl"),
1025 bn_ops => "BN_LLONG",
1026 thread_scheme => "(unknown)",
1027 dso_scheme => "dlfcn",
1028 shared_target => "bsd-gcc-shared",
1029 shared_cflag => "-fPIC",
1030 shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
1034 inherit_from => [ "BASE_unix" ],
1036 CFLAGS => "-O -Wall",
1037 unistd => "<libc.h>",
1038 bn_ops => "BN_LLONG",
1039 thread_scheme => "(unknown)",
1042 inherit_from => [ "BASE_unix" ],
1044 CFLAGS => "-O3 -Wall",
1045 unistd => "<libc.h>",
1046 bn_ops => "BN_LLONG",
1047 thread_scheme => "(unknown)",
1050 #### SCO/Caldera targets.
1052 # Originally we had like unixware-*, unixware-*-pentium, unixware-*-p6, etc.
1053 # Now we only have blended unixware-* as it's the only one used by ./config.
1054 # If you want to optimize for particular microarchitecture, bypass ./config
1055 # and './Configure unixware-7 -Kpentium_pro' or whatever appropriate.
1056 # Note that not all targets include assembler support. Mostly because of
1057 # lack of motivation to support out-of-date platforms with out-of-date
1058 # compiler drivers and assemblers.
1060 # UnixWare 2.0x fails destest with -O.
1062 inherit_from => [ "BASE_unix" ],
1064 cflags => threads("-Kthread"),
1065 lib_cppflags => "-DFILIO_H -DNO_STRINGS_H",
1066 ex_libs => add("-lsocket -lnsl -lresolv -lx"),
1067 thread_scheme => "uithreads",
1070 inherit_from => [ "BASE_unix" ],
1073 cflags => threads("-Kthread"),
1074 lib_cppflags => "-DFILIO_H",
1075 ex_libs => add("-lsocket -lnsl -lresolv -lx"),
1076 thread_scheme => "uithreads",
1079 inherit_from => [ "BASE_unix", asm("x86_elf_asm") ],
1082 cflags => combine("-Kalloca", threads("-Kthread")),
1083 lib_cppflags => "-DFILIO_H",
1084 ex_libs => add("-lsocket -lnsl"),
1085 thread_scheme => "uithreads",
1086 bn_ops => "BN_LLONG",
1087 perlasm_scheme => "elf-1",
1088 dso_scheme => "dlfcn",
1089 shared_target => "svr5-shared",
1090 shared_cflag => "-Kpic",
1091 shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
1093 "unixware-7-gcc" => {
1094 inherit_from => [ "BASE_unix", asm("x86_elf_asm") ],
1096 CFLAGS => "-O3 -fomit-frame-pointer -Wall",
1097 cppflags => add(threads("-D_REENTRANT")),
1098 lib_cppflags => add("-DL_ENDIAN -DFILIO_H"),
1099 ex_libs => add("-lsocket -lnsl"),
1100 bn_ops => "BN_LLONG",
1101 thread_scheme => "pthreads",
1102 perlasm_scheme => "elf-1",
1103 dso_scheme => "dlfcn",
1104 shared_target => "gnu-shared",
1105 shared_cflag => "-fPIC",
1106 shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
1108 # SCO 5 - Ben Laurie says the -O breaks the SCO cc.
1110 inherit_from => [ "BASE_unix", asm("x86_elf_asm") ],
1113 ex_libs => add("-lsocket -lnsl"),
1114 thread_scheme => "(unknown)",
1115 perlasm_scheme => "elf-1",
1116 dso_scheme => "dlfcn",
1117 shared_target => "svr3-shared",
1118 shared_cflag => "-Kpic",
1119 shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
1122 inherit_from => [ "BASE_unix", asm("x86_elf_asm") ],
1124 cflags => "-O3 -fomit-frame-pointer",
1125 ex_libs => add("-lsocket -lnsl"),
1126 bn_ops => "BN_LLONG",
1127 thread_scheme => "(unknown)",
1128 perlasm_scheme => "elf-1",
1129 dso_scheme => "dlfcn",
1130 shared_target => "svr3-shared",
1131 shared_cflag => "-fPIC",
1132 shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
1136 # Below targets assume AIX >=5. Caveat lector. If you are accustomed
1137 # to control compilation "bitness" by setting $OBJECT_MODE environment
1138 # variable, then you should know that in OpenSSL case it's considered
1139 # only in ./config. Once configured, build procedure remains "deaf" to
1140 # current value of $OBJECT_MODE.
1142 inherit_from => [ "BASE_unix", asm("ppc32_asm") ],
1144 CFLAGS => picker(debug => "-O0 -g",
1146 cflags => add(threads("-pthread")),
1147 lib_cppflags => "-DB_ENDIAN",
1148 ex_libs => add(threads("-pthread")),
1150 bn_ops => "BN_LLONG RC4_CHAR",
1151 thread_scheme => "pthreads",
1152 perlasm_scheme => "aix32",
1153 dso_scheme => "dlfcn",
1154 shared_target => "aix-shared",
1155 shared_ldflag => "-shared -static-libgcc -Wl,-G",
1156 shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
1158 RANLIB => add("-X32"),
1161 inherit_from => [ "BASE_unix", asm("ppc64_asm") ],
1163 CFLAGS => picker(debug => "-O0 -g",
1165 cflags => combine("-maix64", threads("-pthread")),
1166 lib_cppflags => "-DB_ENDIAN",
1167 ex_libs => add(threads("-pthread")),
1169 bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
1170 thread_scheme => "pthreads",
1171 perlasm_scheme => "aix64",
1172 dso_scheme => "dlfcn",
1173 shared_target => "aix-shared",
1174 shared_ldflag => "-shared -static-libgcc -Wl,-G",
1175 shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
1177 RANLIB => add("-X64"),
1180 inherit_from => [ "BASE_unix", asm("ppc32_asm") ],
1182 CFLAGS => picker(debug => "-O0 -g",
1184 cflags => combine("-q32 -qmaxmem=16384 -qro -qroconst",
1185 threads("-qthreaded")),
1186 cppflags => threads("-D_THREAD_SAFE"),
1187 lib_cppflags => "-DB_ENDIAN",
1189 bn_ops => "BN_LLONG RC4_CHAR",
1190 thread_scheme => "pthreads",
1191 ex_libs => threads("-lpthreads"),
1192 perlasm_scheme => "aix32",
1193 dso_scheme => "dlfcn",
1194 shared_target => "aix-shared",
1195 shared_cflag => "-qpic",
1196 shared_ldflag => "-G",
1197 shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
1199 RANLIB => add("-X32"),
1202 inherit_from => [ "BASE_unix", asm("ppc64_asm") ],
1204 CFLAGS => picker(debug => "-O0 -g",
1206 cflags => combine("-q64 -qmaxmem=16384 -qro -qroconst",
1207 threads("-qthreaded")),
1208 cppflags => threads("-D_THREAD_SAFE"),
1209 lib_cppflags => "-DB_ENDIAN",
1211 bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
1212 thread_scheme => "pthreads",
1213 ex_libs => threads("-lpthreads"),
1214 perlasm_scheme => "aix64",
1215 dso_scheme => "dlfcn",
1216 shared_target => "aix-shared",
1217 shared_cflag => "-qpic",
1218 shared_ldflag => "-G",
1219 shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
1221 RANLIB => add("-X64"),
1224 # SIEMENS BS2000/OSD: an EBCDIC-based mainframe
1226 inherit_from => [ "BASE_unix" ],
1229 cflags => "-XLLML -XLLMK -XL",
1230 cppflags => "-DCHARSET_EBCDIC",
1231 lib_cppflags => "-DB_ENDIAN",
1232 ex_libs => add("-lsocket -lnsl"),
1233 bn_ops => "THIRTY_TWO_BIT RC4_CHAR",
1234 thread_scheme => "(unknown)",
1237 #### Visual C targets
1239 # Win64 targets, WIN64I denotes IA-64/Itanium and WIN64A - AMD64
1241 # Note about /wd4090, disable warning C4090. This warning returns false
1242 # positives in some situations. Disabling it altogether masks both
1243 # legitimate and false cases, but as we compile on multiple platforms,
1244 # we rely on other compilers to catch legitimate cases.
1246 # Also note that we force threads no matter what. Configuring "no-threads"
1249 # UNICODE is defined in VC-common and applies to all targets. It used to
1250 # be an opt-in option for VC-WIN32, but not anymore. The original reason
1251 # was because ANSI API was *native* system interface for no longer
1252 # supported Windows 9x. Keep in mind that UNICODE only affects how
1253 # OpenSSL libraries interact with underlying OS, it doesn't affect API
1254 # that OpenSSL presents to application.
1257 inherit_from => [ "BASE_Windows" ],
1260 CPP => '$(CC) /EP /C',
1261 CFLAGS => "/W3 /wd4090 /nologo",
1262 LDFLAGS => add("/debug"),
1264 defines => add("OPENSSL_SYS_WIN32", "WIN32_LEAN_AND_MEAN",
1265 "UNICODE", "_UNICODE",
1266 "_CRT_SECURE_NO_DEPRECATE",
1267 "_WINSOCK_DEPRECATED_NO_WARNINGS"),
1268 lib_cflags => add("/Zi /Fdossl_static.pdb"),
1269 lib_defines => add("L_ENDIAN"),
1270 dso_cflags => "/Zi /Fddso.pdb",
1271 bin_cflags => "/Zi /Fdapp.pdb",
1272 shared_ldflag => "/dll",
1273 shared_target => "win-shared", # meaningless except it gives Configure a hint
1274 thread_scheme => "winthreads",
1275 dso_scheme => "win32",
1276 apps_aux_src => add("win32_init.c"),
1277 bn_ops => "EXPORT_VAR_AS_FN",
1278 # additional parameter to build_scheme denotes install-path "flavour"
1279 build_scheme => add("VC-common", { separator => undef }),
1281 "VC-noCE-common" => {
1282 inherit_from => [ "VC-common" ],
1284 CFLAGS => add(picker(debug => '/Od',
1286 cflags => add(picker(default => '/Gs0 /GF /Gy',
1289 ($disabled{shared} ? "" : "/MDd");
1293 ($disabled{shared} ? "" : "/MD");
1295 defines => add(picker(default => [], # works as type cast
1296 debug => [ "DEBUG", "_DEBUG" ])),
1297 lib_cflags => add(sub { $disabled{shared} ? "/MT /Zl" : () }),
1298 # Following might/should appears controversial, i.e. defining
1299 # /MDd without evaluating $disabled{shared}. It works in
1300 # non-shared build because static library is compiled with /Zl
1301 # and bares no reference to specific RTL. And it works in
1302 # shared build because multiple /MDd options are not prohibited.
1303 # But why /MDd in static build? Well, basically this is just a
1304 # reference point, which allows to catch eventual errors that
1305 # would prevent those who want to wrap OpenSSL into own .DLL.
1306 # Why not /MD in release build then? Well, some are likely to
1307 # prefer [non-debug] openssl.exe to be free from Micorosoft RTL
1309 bin_cflags => add(picker(debug => "/MDd",
1310 release => sub { $disabled{shared} ? "/MT" : () },
1312 bin_lflags => add("/subsystem:console /opt:ref"),
1313 ex_libs => add(sub {
1315 push @ex_libs, 'ws2_32.lib' unless $disabled{sock};
1316 push @ex_libs, 'gdi32.lib advapi32.lib crypt32.lib user32.lib';
1317 return join(" ", @ex_libs);
1320 "VC-WIN64-common" => {
1321 inherit_from => [ "VC-noCE-common" ],
1323 ex_libs => add(sub {
1325 push @ex_libs, 'bufferoverflowu.lib' if (`cl 2>&1` =~ /14\.00\.4[0-9]{4}\./);
1326 return join(" ", @_, @ex_libs);
1328 bn_ops => add("SIXTY_FOUR_BIT"),
1331 inherit_from => [ "VC-WIN64-common", asm("ia64_asm"),
1332 sub { $disabled{shared} ? () : "ia64_uplink" } ],
1334 ASFLAGS => "-d debug",
1337 bn_asm_src => sub { return undef unless @_;
1338 my $r=join(" ",@_); $r=~s|bn-ia64.s|bn_asm.c|; $r; },
1339 perlasm_scheme => "ias",
1340 multilib => "-ia64",
1343 inherit_from => [ "VC-WIN64-common", asm("x86_64_asm"),
1344 sub { $disabled{shared} ? () : "x86_64_uplink" } ],
1345 AS => sub { vc_win64a_info()->{AS} },
1346 ASFLAGS => sub { vc_win64a_info()->{ASFLAGS} },
1347 asoutflag => sub { vc_win64a_info()->{asoutflag} },
1348 asflags => sub { vc_win64a_info()->{asflags} },
1350 bn_asm_src => sub { return undef unless @_;
1351 my $r=join(" ",@_); $r=~s|asm/x86_64-gcc|bn_asm|; $r; },
1352 perlasm_scheme => "auto",
1356 inherit_from => [ "VC-noCE-common", asm("x86_asm"),
1357 sub { $disabled{shared} ? () : "uplink_common" } ],
1358 CFLAGS => add("/WX"),
1359 AS => sub { vc_win32_info()->{AS} },
1360 ASFLAGS => sub { vc_win32_info()->{ASFLAGS} },
1361 asoutflag => sub { vc_win32_info()->{asoutflag} },
1362 asflags => sub { vc_win32_info()->{asflags} },
1364 bn_ops => add("BN_LLONG"),
1365 perlasm_scheme => sub { vc_win32_info()->{perlasm_scheme} },
1366 # "WOW" stands for "Windows on Windows", and "VC-WOW" engages
1367 # some installation path heuristics in windows-makefile.tmpl...
1368 build_scheme => add("VC-WOW", { separator => undef }),
1371 inherit_from => [ "VC-common" ],
1372 CFLAGS => add(picker(debug => "/Od",
1373 release => "/O1i")),
1374 CPPDEFINES => picker(debug => [ "DEBUG", "_DEBUG" ]),
1375 LDFLAGS => add("/nologo /opt:ref"),
1378 sub { vc_wince_info()->{cflags}; },
1379 sub { `cl 2>&1` =~ /Version ([0-9]+)\./ && $1>=14
1380 ? ($disabled{shared} ? " /MT" : " /MD")
1382 cppflags => sub { vc_wince_info()->{cppflags}; },
1383 lib_defines => add("NO_CHMOD", "OPENSSL_SMALL_FOOTPRINT"),
1384 lib_cppflags => sub { vc_wince_info()->{cppflags}; },
1386 add(combine(sub { defined(env('WCECOMPAT'))
1387 ? '$(WCECOMPAT)/include' : (); },
1388 sub { defined(env('PORTSDK_LIBPATH'))
1389 ? '$(PORTSDK_LIBPATH)/../../include'
1391 lflags => add(combine(sub { vc_wince_info()->{lflags}; },
1392 sub { defined(env('PORTSDK_LIBPATH'))
1393 ? "/entry:mainCRTstartup" : (); })),
1395 bn_ops => add("BN_LLONG"),
1396 ex_libs => add(sub {
1398 push @ex_libs, 'ws2.lib' unless $disabled{sock};
1399 push @ex_libs, 'crypt32.lib';
1400 if (defined(env('WCECOMPAT'))) {
1401 my $x = '$(WCECOMPAT)/lib';
1402 if (-f "$x/env('TARGETCPU')/wcecompatex.lib") {
1403 $x .= '/$(TARGETCPU)/wcecompatex.lib';
1405 $x .= '/wcecompatex.lib';
1409 push @ex_libs, '$(PORTSDK_LIBPATH)/portlib.lib'
1410 if (defined(env('PORTSDK_LIBPATH')));
1411 push @ex_libs, ' /nodefaultlib coredll.lib corelibc.lib'
1412 if (env('TARGETCPU') eq "X86");
1419 inherit_from => [ "BASE_unix", asm("x86_asm"),
1420 sub { $disabled{shared} ? () : "x86_uplink" } ],
1422 CFLAGS => picker(default => "-Wall",
1424 release => "-O3 -fomit-frame-pointer"),
1426 cppflags => combine("-DUNICODE -D_UNICODE -DWIN32_LEAN_AND_MEAN",
1428 lib_cppflags => "-DL_ENDIAN",
1429 sys_id => "MINGW32",
1430 ex_libs => add("-lws2_32 -lgdi32 -lcrypt32"),
1431 bn_ops => "BN_LLONG EXPORT_VAR_AS_FN",
1432 thread_scheme => "winthreads",
1433 perlasm_scheme => "coff",
1434 dso_scheme => "win32",
1435 shared_target => "mingw-shared",
1436 shared_cppflags => add("_WINDLL"),
1437 shared_ldflag => "-static-libgcc",
1438 shared_rcflag => "--target=pe-i386",
1439 shared_extension => ".dll",
1441 apps_aux_src => add("win32_init.c"),
1444 # As for OPENSSL_USE_APPLINK. Applink makes it possible to use
1445 # .dll compiled with one compiler with application compiled with
1446 # another compiler. It's possible to engage Applink support in
1447 # mingw64 build, but it's not done, because till mingw64
1448 # supports structured exception handling, one can't seriously
1449 # consider its binaries for using with non-mingw64 run-time
1450 # environment. And as mingw64 is always consistent with itself,
1451 # Applink is never engaged and can as well be omitted.
1452 inherit_from => [ "BASE_unix", asm("x86_64_asm") ],
1454 CFLAGS => picker(default => "-Wall",
1458 cppflags => combine("-DUNICODE -D_UNICODE -DWIN32_LEAN_AND_MEAN",
1460 lib_cppflags => "-DL_ENDIAN",
1461 sys_id => "MINGW64",
1462 ex_libs => add("-lws2_32 -lgdi32 -lcrypt32"),
1463 bn_ops => "SIXTY_FOUR_BIT EXPORT_VAR_AS_FN",
1464 thread_scheme => "winthreads",
1465 perlasm_scheme => "mingw64",
1466 dso_scheme => "win32",
1467 shared_target => "mingw-shared",
1468 shared_cppflags => add("_WINDLL"),
1469 shared_ldflag => "-static-libgcc",
1470 shared_rcflag => "--target=pe-x86-64",
1471 shared_extension => ".dll",
1473 apps_aux_src => add("win32_init.c"),
1478 inherit_from => [ "BASE_unix" ],
1481 lib_cppflags => "-DL_ENDIAN",
1487 inherit_from => [ "BASE_unix" ],
1489 CFLAGS => "-O -Wall",
1490 lib_cppflags => "-DTERMIOS -DL_ENDIAN",
1492 bn_ops => "BN_LLONG",
1493 dso_scheme => "win32",
1498 inherit_from => [ "BASE_unix", asm("x86_asm") ],
1500 CFLAGS => picker(default => "-Wall",
1502 release => "-O3 -fomit-frame-pointer"),
1503 lib_cppflags => "-DTERMIOS -DL_ENDIAN",
1505 bn_ops => "BN_LLONG",
1506 thread_scheme => "pthread",
1507 perlasm_scheme => "coff",
1508 dso_scheme => "dlfcn",
1509 shared_target => "cygwin-shared",
1510 shared_cppflags => "-D_WINDLL",
1511 shared_extension => ".dll",
1513 "Cygwin-x86_64" => {
1514 inherit_from => [ "BASE_unix", asm("x86_64_asm") ],
1516 CFLAGS => picker(default => "-Wall",
1519 lib_cppflags => "-DTERMIOS -DL_ENDIAN",
1521 bn_ops => "SIXTY_FOUR_BIT_LONG",
1522 thread_scheme => "pthread",
1523 perlasm_scheme => "mingw64",
1524 dso_scheme => "dlfcn",
1525 shared_target => "cygwin-shared",
1526 shared_cppflags => "-D_WINDLL",
1527 shared_extension => ".dll",
1529 # Backward compatibility for those using this target
1531 inherit_from => [ "Cygwin-x86" ]
1533 # In case someone constructs the Cygwin target name themself
1535 inherit_from => [ "Cygwin-x86" ]
1538 inherit_from => [ "Cygwin-x86" ]
1541 inherit_from => [ "Cygwin-x86" ]
1544 inherit_from => [ "Cygwin-x86" ]
1547 ##### MacOS X (a.k.a. Darwin) setup
1548 "darwin-common" => {
1549 inherit_from => [ "BASE_unix" ],
1552 CFLAGS => picker(debug => "-g -O0",
1554 cppflags => threads("-D_REENTRANT"),
1555 lflags => "-Wl,-search_paths_first",
1557 bn_ops => "BN_LLONG RC4_CHAR",
1558 thread_scheme => "pthreads",
1559 perlasm_scheme => "osx32",
1560 dso_scheme => "dlfcn",
1561 ranlib => "ranlib -c",
1562 shared_target => "darwin-shared",
1563 shared_cflag => "-fPIC",
1564 shared_extension => ".\$(SHLIB_VERSION_NUMBER).dylib",
1566 # Option "freeze" such as -std=gnu9x can't negatively interfere
1567 # with future defaults for below two targets, because MacOS X
1568 # for PPC has no future, it was discontinued by vendor in 2009.
1569 "darwin-ppc-cc" => {
1570 inherit_from => [ "darwin-common", asm("ppc32_asm") ],
1571 cflags => add("-arch ppc -std=gnu9x -Wa,-force_cpusubtype_ALL"),
1572 lib_cppflags => add("-DB_ENDIAN"),
1573 shared_cflag => add("-fno-common"),
1574 perlasm_scheme => "osx32",
1576 "darwin64-ppc-cc" => {
1577 inherit_from => [ "darwin-common", asm("ppc64_asm") ],
1578 cflags => add("-arch ppc64 -std=gnu9x"),
1579 lib_cppflags => add("-DB_ENDIAN"),
1580 bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
1581 perlasm_scheme => "osx64",
1583 "darwin-i386-cc" => {
1584 inherit_from => [ "darwin-common", asm("x86_asm") ],
1585 CFLAGS => add(picker(release => "-fomit-frame-pointer")),
1586 cflags => add("-arch i386"),
1587 lib_cppflags => add("-DL_ENDIAN"),
1588 bn_ops => "BN_LLONG RC4_INT",
1589 perlasm_scheme => "macosx",
1591 "darwin64-x86_64-cc" => {
1592 inherit_from => [ "darwin-common", asm("x86_64_asm") ],
1593 CFLAGS => add("-Wall"),
1594 cflags => add("-arch x86_64"),
1595 lib_cppflags => add("-DL_ENDIAN"),
1596 bn_ops => "SIXTY_FOUR_BIT_LONG",
1597 perlasm_scheme => "macosx",
1602 # It takes three prior-set environment variables to make it work:
1604 # CROSS_COMPILE=/where/toolchain/is/usr/bin/ [note ending slash]
1605 # CROSS_TOP=/where/SDKs/are
1606 # CROSS_SDK=iPhoneOSx.y.sdk
1608 # Exact paths vary with Xcode releases, but for couple of last ones
1609 # they would look like this:
1611 # CROSS_COMPILE=`xcode-select --print-path`/Toolchains/XcodeDefault.xctoolchain/usr/bin/
1612 # CROSS_TOP=`xcode-select --print-path`/Platforms/iPhoneOS.platform/Developer
1613 # CROSS_SDK=iPhoneOS.sdk
1615 "iphoneos-cross" => {
1616 inherit_from => [ "darwin-common" ],
1617 cflags => add("-isysroot \$(CROSS_TOP)/SDKs/\$(CROSS_SDK) -fno-common"),
1621 inherit_from => [ "darwin-common", asm("armv4_asm") ],
1622 # It should be possible to go below iOS 6 and even add -arch armv6,
1623 # thus targeting iPhone pre-3GS, but it's assumed to be irrelevant
1625 cflags => add("-arch armv7 -mios-version-min=6.0.0 -isysroot \$(CROSS_TOP)/SDKs/\$(CROSS_SDK) -fno-common"),
1627 perlasm_scheme => "ios32",
1630 inherit_from => [ "darwin-common", asm("aarch64_asm") ],
1631 cflags => add("-arch arm64 -mios-version-min=7.0.0 -isysroot \$(CROSS_TOP)/SDKs/\$(CROSS_SDK) -fno-common"),
1633 bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
1634 perlasm_scheme => "ios64",
1639 inherit_from => [ "BASE_unix" ],
1640 inherit_from => [ asm("x86_elf_asm") ],
1642 CFLAGS => "-O3 -fomit-frame-pointer -Wall",
1643 cflags => threads("-pthread"),
1644 lib_cppflags => "-DL_ENDIAN",
1645 ex_libs => add("-ldl", threads("-pthread")),
1646 bn_ops => "BN_LLONG",
1647 thread_scheme => "pthreads",
1648 dso_scheme => "dlfcn",
1649 shared_target => "linux-shared",
1650 shared_cflag => "-fPIC",
1651 shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
1654 ##### VxWorks for various targets
1655 "vxworks-ppc60x" => {
1656 inherit_from => [ "BASE_unix" ],
1658 CFLAGS => "-O2 -Wall -fstrength-reduce",
1659 cflags => "-mrtp -mhard-float -mstrict-align -fno-implicit-fp -fno-builtin -fno-strict-aliasing",
1660 cppflags => combine("-D_REENTRANT -DPPC32_fp60x -DCPU=PPC32",
1661 "_DTOOL_FAMILY=gnu -DTOOL=gnu",
1662 "-I\$(WIND_BASE)/target/usr/h",
1663 "-I\$(WIND_BASE)/target/usr/h/wrn/coreip"),
1664 sys_id => "VXWORKS",
1665 lflags => add("-L \$(WIND_BASE)/target/usr/lib/ppc/PPC32/common"),
1666 ex_libs => add("-Wl,--defsym,__wrs_rtp_base=0xe0000000"),
1668 "vxworks-ppcgen" => {
1669 inherit_from => [ "BASE_unix" ],
1671 CFLAGS => "-O1 -Wall",
1672 cflags => "-mrtp -msoft-float -mstrict-align -fno-builtin -fno-strict-aliasing",
1673 cppflags => combine("-D_REENTRANT -DPPC32 -DCPU=PPC32",
1674 "-DTOOL_FAMILY=gnu -DTOOL=gnu",
1675 "-I\$(WIND_BASE)/target/usr/h",
1676 "-I\$(WIND_BASE)/target/usr/h/wrn/coreip"),
1677 sys_id => "VXWORKS",
1678 lflags => add("-L \$(WIND_BASE)/target/usr/lib/ppc/PPC32/sfcommon"),
1679 ex_libs => add("-Wl,--defsym,__wrs_rtp_base=0xe0000000"),
1681 "vxworks-ppc405" => {
1682 inherit_from => [ "BASE_unix" ],
1685 cflags => "-msoft-float -mlongcall",
1686 cppflags => combine("-D_REENTRANT -DPPC32 -DCPU=PPC405",
1687 "-DTOOL_FAMILY=gnu -DTOOL=gnu",
1688 "-I\$(WIND_BASE)/target/h"),
1689 sys_id => "VXWORKS",
1690 lflags => add("-r"),
1692 "vxworks-ppc750" => {
1693 inherit_from => [ "BASE_unix" ],
1695 CFLAGS => "-ansi -fvolatile -Wall \$(DEBUG_FLAG)",
1696 cflags => "-nostdinc -fno-builtin -fno-for-scope -fsigned-char -msoft-float -mlongcall",
1697 cppflags => combine("-DPPC750 -D_REENTRANT -DCPU=PPC604",
1698 "-I\$(WIND_BASE)/target/h"),
1699 sys_id => "VXWORKS",
1700 lflags => add("-r"),
1702 "vxworks-ppc750-debug" => {
1703 inherit_from => [ "BASE_unix" ],
1705 CFLAGS => "-ansi -fvolatile -Wall -g",
1706 cflags => "-nostdinc -fno-builtin -fno-for-scope -fsigned-char -msoft-float -mlongcall",
1707 cppflags => combine("-DPPC750 -D_REENTRANT -DCPU=PPC604",
1708 "-DPEDANTIC -DDEBUG",
1709 "-I\$(WIND_BASE)/target/h"),
1710 sys_id => "VXWORKS",
1711 lflags => add("-r"),
1713 "vxworks-ppc860" => {
1714 inherit_from => [ "BASE_unix" ],
1716 cflags => "-nostdinc -msoft-float",
1717 cppflags => combine("-DCPU=PPC860 -DNO_STRINGS_H",
1718 "-I\$(WIND_BASE)/target/h"),
1719 sys_id => "VXWORKS",
1720 lflags => add("-r"),
1722 "vxworks-simlinux" => {
1723 inherit_from => [ "BASE_unix" ],
1725 cflags => "-B\$(WIND_BASE)/host/\$(WIND_HOST_TYPE)/lib/gcc-lib/ -fno-builtin -fno-defer-pop",
1726 cppflags => combine("-D_VSB_CONFIG_FILE=\"\$(WIND_BASE)/target/lib/h/config/vsbConfig.h\"",
1727 "-DL_ENDIAN -DCPU=SIMLINUX -DNO_STRINGS_H",
1728 "-DTOOL_FAMILY=gnu -DTOOL=gnu",
1729 "-DOPENSSL_NO_HW_PADLOCK",
1730 "-I\$(WIND_BASE)/target/h",
1731 "-I\$(WIND_BASE)/target/h/wrn/coreip"),
1732 sys_id => "VXWORKS",
1733 lflags => add("-r"),
1734 ranlib => "ranlibpentium",
1737 inherit_from => [ "BASE_unix", asm("mips32_asm") ],
1739 CFLAGS => "-O -G 0",
1740 cflags => "-mrtp -mips2 -B\$(WIND_BASE)/host/\$(WIND_HOST_TYPE)/lib/gcc-lib/ -msoft-float -mno-branch-likely -fno-builtin -fno-defer-pop",
1741 cppflags => combine("-D_VSB_CONFIG_FILE=\"\$(WIND_BASE)/target/lib/h/config/vsbConfig.h\"",
1742 "-DCPU=MIPS32 -DNO_STRINGS_H",
1743 "-DTOOL_FAMILY=gnu -DTOOL=gnu",
1744 "-DOPENSSL_NO_HW_PADLOCK",
1745 threads("-D_REENTRANT"),
1746 "-I\$(WIND_BASE)/target/h",
1747 "-I\$(WIND_BASE)/target/h/wrn/coreip"),
1748 sys_id => "VXWORKS",
1749 lflags => add("-L \$(WIND_BASE)/target/usr/lib/mips/MIPSI32/sfcommon"),
1750 ex_libs => add("-Wl,--defsym,__wrs_rtp_base=0xe0000000"),
1751 thread_scheme => "pthreads",
1752 perlasm_scheme => "o32",
1753 ranlib => "ranlibmips",
1758 inherit_from => [ "BASE_unix" ],
1759 CC => sub { env('CC') },
1760 cppflags => threads("-D_REENTRANT"),
1761 ex_libs => add("\$(LDLIBS)"),
1762 bn_ops => "BN_LLONG",
1763 thread_scheme => "pthreads",
1764 dso_scheme => sub { env('LIBSSL_dlfcn') },
1765 shared_target => "linux-shared",
1766 shared_cflag => "-fPIC",
1767 shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
1768 ranlib => sub { env('RANLIB') },
1770 "uClinux-dist64" => {
1771 inherit_from => [ "BASE_unix" ],
1772 CC => sub { env('CC') },
1773 cppflags => threads("-D_REENTRANT"),
1774 ex_libs => add("\$(LDLIBS)"),
1775 bn_ops => "SIXTY_FOUR_BIT_LONG",
1776 thread_scheme => "pthreads",
1777 dso_scheme => sub { env('LIBSSL_dlfcn') },
1778 shared_target => "linux-shared",
1779 shared_cflag => "-fPIC",
1780 shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
1781 ranlib => sub { env('RANLIB') },
1785 # Most things happen in vms-generic.
1786 # Note that vms_info extracts the pointer size from the end of
1787 # the target name, and will assume that anything matching /-p\d+$/
1788 # indicates the pointer size setting for the desired target.
1790 inherit_from => [ "BASE_VMS" ],
1793 CPP => '$(CC)/PREPROCESS_ONLY=SYS$OUTPUT:',
1795 combine(picker(default => "/STANDARD=(ISOC94,RELAXED)/NOLIST/PREFIX=ALL",
1796 debug => "/NOOPTIMIZE/DEBUG",
1797 release => "/OPTIMIZE/NODEBUG"),
1798 sub { my @warnings =
1799 @{vms_info()->{disable_warns}};
1801 ? "/WARNINGS=DISABLE=(".join(",",@warnings).")" : (); }),
1803 add("OPENSSL_USE_NODELETE",
1805 return vms_info()->{def_zlib}
1806 ? "LIBZ=\"\"\"".vms_info()->{def_zlib}."\"\"\"" : ();
1808 lflags => picker(default => "/MAP='F\$PARSE(\".MAP\",\"\$\@\")'",
1809 debug => "/DEBUG/TRACEBACK",
1810 release => "/NODEBUG/NOTRACEBACK"),
1811 lib_cflags => add("/NAMES=(AS_IS,SHORTENED)/EXTERN_MODEL=STRICT_REFDEF"),
1812 # no_inst_lib_cflags is used instead of lib_cflags by descrip.mms.tmpl
1813 # for object files belonging to selected internal libraries
1814 no_inst_lib_cflags => "",
1815 ex_libs => add(sub { return vms_info()->{zlib} || (); }),
1816 shared_target => "vms-shared",
1817 dso_scheme => "vms",
1818 thread_scheme => "pthreads",
1820 AS => sub { vms_info()->{AS} },
1821 ASFLAGS => sub { vms_info()->{ASFLAGS} },
1822 asoutflag => sub { vms_info()->{asoutflag} },
1823 asflags => sub { vms_info()->{asflags} },
1824 perlasm_scheme => sub { vms_info()->{perlasm_scheme} },
1826 apps_aux_src => "vms_term_sock.c",
1827 apps_init_src => "vms_decc_init.c",
1830 # From HELP CC/POINTER_SIZE:
1833 # LONG[=ARGV] The compiler assumes 64-bit pointers. If the ARGV option to
1834 # LONG or 64 is present, the main argument argv will be an
1835 # array of long pointers instead of an array of short pointers.
1837 # 64[=ARGV] Same as LONG.
1840 # We don't want the hassle of dealing with 32-bit pointers with argv, so
1841 # we force it to have 64-bit pointers, see the added cflags in the -p64
1842 # config targets below.
1845 inherit_from => [ "vms-generic" ],
1846 bn_ops => "SIXTY_FOUR_BIT RC4_INT",
1849 "vms-alpha-p32" => {
1850 inherit_from => [ "vms-alpha" ],
1851 cflags => add("/POINTER_SIZE=32"),
1852 pointer_size => "32",
1854 "vms-alpha-p64" => {
1855 inherit_from => [ "vms-alpha" ],
1856 cflags => add("/POINTER_SIZE=64=ARGV"),
1857 pointer_size => "64",
1860 inherit_from => [ "vms-generic",
1861 sub { vms_info()->{as}
1862 ? asm("ia64_asm")->() : () } ],
1863 bn_ops => "SIXTY_FOUR_BIT RC4_INT",
1866 modes_asm_src => "", # Because ghash-ia64.s doesn't work on VMS
1869 inherit_from => [ "vms-ia64" ],
1870 cflags => add("/POINTER_SIZE=32"),
1871 pointer_size => "32",
1874 inherit_from => [ "vms-ia64" ],
1875 cflags => add("/POINTER_SIZE=64=ARGV"),
1876 pointer_size => "64",