VirtualBox

source: vbox/trunk/src/libs/openssl-3.1.5/Configurations/10-main.conf@ 104285

Last change on this file since 104285 was 104078, checked in by vboxsync, 11 months ago

openssl-3.1.5: Applied and adjusted our OpenSSL changes to 3.1.4. bugref:10638

File size: 84.3 KB
Line 
1## -*- mode: perl; -*-
2## Standard openssl configuration targets.
3
4# Helper functions for the Windows configs
5my $vc_win64a_info = {};
6sub vc_win64a_info {
7 unless (%$vc_win64a_info) {
8 if (`nasm -v 2>NUL` =~ /NASM version ([0-9]+\.[0-9]+)/ && $1 >= 2.0) {
9 $vc_win64a_info = { AS => "nasm",
10 ASFLAGS => "-g",
11 asflags => "-Ox -f win64 -DNEAR",
12 asoutflag => "-o ",
13 perlasm_scheme => "nasm" };
14 } elsif ($disabled{asm}) {
15 # assembler is still used to compile uplink shim
16 $vc_win64a_info = { AS => "ml64",
17 ASFLAGS => "/nologo /Zi",
18 asflags => "/c /Cp /Cx",
19 asoutflag => "/Fo",
20 perlasm_scheme => "masm" };
21 } else {
22 $die->("NASM not found - make sure it's installed and available on %PATH%\n");
23 $vc_win64a_info = { AS => "{unknown}",
24 ASFLAGS => "",
25 asflags => "",
26 asoutflag => "",
27 perlasm_scheme => "auto" };
28 }
29 }
30 return $vc_win64a_info;
31}
32
33my $vc_win32_info = {};
34sub vc_win32_info {
35 unless (%$vc_win32_info) {
36 my $ver=`nasm -v 2>NUL`;
37 my $vew=`nasmw -v 2>NUL`;
38 if ($ver ne "" || $vew ne "") {
39 $vc_win32_info = { AS => $ver ge $vew ? "nasm" : "nasmw",
40 ASFLAGS => "",
41 asflags => "-f win32",
42 asoutflag => "-o ",
43 perlasm_scheme => "win32n" };
44 } elsif ($disabled{asm}) {
45 # not actually used, uplink shim is inlined into C code
46 $vc_win32_info = { AS => "ml",
47 ASFLAGS => "/nologo /Zi",
48 asflags => "/Cp /coff /c /Cx",
49 asoutflag => "/Fo",
50 perlasm_scheme => "win32" };
51 } else {
52 $die->("NASM not found - make sure it's installed and available on %PATH%\n");
53 $vc_win32_info = { AS => "{unknown}",
54 ASFLAGS => "",
55 asflags => "",
56 asoutflag => "",
57 perlasm_scheme => "win32" };
58 }
59 }
60 return $vc_win32_info;
61}
62
63my $vc_wince_info = {};
64sub vc_wince_info {
65 unless (%$vc_wince_info) {
66 # sanity check
67 $die->('%OSVERSION% is not defined') if (!defined(env('OSVERSION')));
68 $die->('%PLATFORM% is not defined') if (!defined(env('PLATFORM')));
69 $die->('%TARGETCPU% is not defined') if (!defined(env('TARGETCPU')));
70
71 #
72 # Idea behind this is to mimic flags set by eVC++ IDE...
73 #
74 my $wcevers = env('OSVERSION'); # WCENNN
75 my $wcevernum;
76 my $wceverdotnum;
77 if ($wcevers =~ /^WCE([1-9])([0-9]{2})$/) {
78 $wcevernum = "$1$2";
79 $wceverdotnum = "$1.$2";
80 } else {
81 $die->('%OSVERSION% value is insane');
82 $wcevernum = "{unknown}";
83 $wceverdotnum = "{unknown}";
84 }
85 my $wcecdefs = "-D_WIN32_WCE=$wcevernum -DUNDER_CE=$wcevernum"; # -D_WIN32_WCE=NNN
86 my $wcelflag = "/subsystem:windowsce,$wceverdotnum"; # ...,N.NN
87
88 my $wceplatf = env('PLATFORM');
89
90 $wceplatf =~ tr/a-z0-9 /A-Z0-9_/;
91 $wcecdefs .= " -DWCE_PLATFORM_$wceplatf";
92
93 my $wcetgt = env('TARGETCPU'); # just shorter name...
94 SWITCH: for($wcetgt) {
95 /^X86/ && do { $wcecdefs.=" -Dx86 -D_X86_ -D_i386_ -Di_386_";
96 $wcelflag.=" /machine:X86"; last; };
97 /^ARMV4[IT]/ && do { $wcecdefs.=" -DARM -D_ARM_ -D$wcetgt";
98 $wcecdefs.=" -DTHUMB -D_THUMB_" if($wcetgt=~/T$/);
99 $wcecdefs.=" -QRarch4T -QRinterwork-return";
100 $wcelflag.=" /machine:THUMB"; last; };
101 /^ARM/ && do { $wcecdefs.=" -DARM -D_ARM_ -D$wcetgt";
102 $wcelflag.=" /machine:ARM"; last; };
103 /^MIPSIV/ && do { $wcecdefs.=" -DMIPS -D_MIPS_ -DR4000 -D$wcetgt";
104 $wcecdefs.=" -D_MIPS64 -QMmips4 -QMn32";
105 $wcelflag.=" /machine:MIPSFPU"; last; };
106 /^MIPS16/ && do { $wcecdefs.=" -DMIPS -D_MIPS_ -DR4000 -D$wcetgt";
107 $wcecdefs.=" -DMIPSII -QMmips16";
108 $wcelflag.=" /machine:MIPS16"; last; };
109 /^MIPSII/ && do { $wcecdefs.=" -DMIPS -D_MIPS_ -DR4000 -D$wcetgt";
110 $wcecdefs.=" -QMmips2";
111 $wcelflag.=" /machine:MIPS"; last; };
112 /^R4[0-9]{3}/ && do { $wcecdefs.=" -DMIPS -D_MIPS_ -DR4000";
113 $wcelflag.=" /machine:MIPS"; last; };
114 /^SH[0-9]/ && do { $wcecdefs.=" -D$wcetgt -D_${wcetgt}_ -DSHx";
115 $wcecdefs.=" -Qsh4" if ($wcetgt =~ /^SH4/);
116 $wcelflag.=" /machine:$wcetgt"; last; };
117 { $wcecdefs.=" -D$wcetgt -D_${wcetgt}_";
118 $wcelflag.=" /machine:$wcetgt"; last; };
119 }
120
121 $vc_wince_info = { cppflags => $wcecdefs,
122 lflags => $wcelflag };
123 }
124 return $vc_wince_info;
125}
126
127# Helper functions for the VMS configs
128my $vms_info = {};
129sub vms_info {
130 my $pointer_size_str = $config{target} =~ m|-p(\d+)$| ? $1 : "";
131
132 # For the case where Configure iterate through all config targets, such
133 # as when listing them and their details, we reset info if the pointer
134 # size changes.
135 if (%$vms_info && $vms_info->{pointer_size} ne $pointer_size_str) {
136 $vms_info = {};
137 }
138
139 unless (%$vms_info) {
140 $vms_info->{disable_warns} = [
141 "CXXPRAGMANA", # Shut up about unknown / unsupported pragmas
142 ];
143 $vms_info->{pointer_size} = $pointer_size_str;
144 if ($pointer_size_str eq "64") {
145 `PIPE CC /NOCROSS_REFERENCE /NOLIST /NOOBJECT /WARNINGS = DISABLE = ( MAYLOSEDATA3, EMPTYFILE ) NL: 2> NL:`;
146 if ($? == 0) {
147 push @{$vms_info->{disable_warns}}, "MAYLOSEDATA3";
148 }
149 }
150
151 unless ($disabled{zlib}) {
152 my $default_zlib = 'GNV$LIBZSHR' . $pointer_size_str;
153 if (defined($disabled{"zlib-dynamic"})) {
154 $vms_info->{zlib} = $withargs{zlib_lib} || "$default_zlib/SHARE";
155 } else {
156 $vms_info->{def_zlib} = $withargs{zlib_lib} || $default_zlib;
157 # In case the --with-zlib-lib value contains something like
158 # /SHARE or /LIB or so at the end, remove it.
159 $vms_info->{def_zlib} =~ s|/.*$||g;
160 }
161 }
162
163 if ($config{target} =~ /-ia64/) {
164 `PIPE ias -H 2> NL:`;
165 if ($? == 0) {
166 $vms_info->{AS} = "ias";
167 $vms_info->{ASFLAGS} = '-d debug';
168 $vms_info->{asflags} = '"-N" vms_upcase';
169 $vms_info->{asoutflag} = "-o ";
170 $vms_info->{perlasm_scheme} = "ias";
171 }
172 }
173 }
174 return $vms_info;
175}
176
177my %targets = (
178
179#### Basic configs that should work on any 32-bit box
180 "gcc" => {
181 inherit_from => [ "BASE_unix" ],
182 CC => "gcc",
183 CFLAGS => picker(debug => "-O0 -g",
184 release => "-O3"),
185 thread_scheme => "(unknown)",
186 bn_ops => "BN_LLONG",
187 },
188 "cc" => {
189 inherit_from => [ "BASE_unix" ],
190 CC => "cc",
191 CFLAGS => "-O",
192 thread_scheme => "(unknown)",
193 },
194
195#### VOS Configurations
196 "vos-gcc" => {
197 inherit_from => [ "BASE_unix" ],
198 CC => "gcc",
199 CFLAGS => picker(default => "-Wall",
200 debug => "-O0 -g",
201 release => "-O3"),
202 cppflags => "-D_POSIX_C_SOURCE=200112L -D_BSD -D_VOS_EXTENDED_NAMES",
203 lib_cppflags => "-DB_ENDIAN",
204 thread_scheme => "(unknown)",
205 sys_id => "VOS",
206 lflags => add("-Wl,-map"),
207 bn_ops => "BN_LLONG",
208 shared_extension => ".so",
209 },
210
211#### Solaris configurations
212 "solaris-common" => {
213 inherit_from => [ "BASE_unix" ],
214 template => 1,
215 lib_cppflags => "-DFILIO_H",
216 ex_libs => add("-lsocket -lnsl -ldl"),
217 dso_scheme => "dlfcn",
218 thread_scheme => "pthreads",
219 },
220#### Solaris common with Sun C setups
221 "solaris-common-cc" => {
222 inherit_from => [ "solaris-common" ],
223 template => 1,
224 shared_target => "solaris",
225 shared_ldflag => "-Wl,-Bsymbolic",
226 shared_defflag => "-Wl,-M,",
227 shared_sonameflag=> "-Wl,-h,",
228 },
229#### Solaris common with GNU C setups
230 "solaris-common-gcc" => {
231 inherit_from => [ "solaris-common" ],
232 template => 1,
233 shared_target => "solaris-gcc-shared", # The rest is on shared_info.pl
234 },
235#### Solaris x86 with GNU C setups
236 "solaris-x86-gcc" => {
237 # NB. GNU C has to be configured to use GNU assembler, and not
238 # /usr/ccs/bin/as. Failure to comply will result in compile
239 # failures [at least] in 32-bit build.
240 inherit_from => [ "solaris-common-gcc" ],
241 CC => "gcc",
242 CFLAGS => add_before(picker(default => "-Wall",
243 debug => "-O0 -g",
244 release => "-O3 -fomit-frame-pointer")),
245 cflags => add(threads("-pthread")),
246 lib_cppflags => add("-DL_ENDIAN"),
247 ex_libs => add(threads("-pthread")),
248 bn_ops => "BN_LLONG",
249 shared_cflag => "-fPIC",
250 shared_ldflag => add_before("-shared -static-libgcc"),
251 asm_arch => 'x86',
252 perlasm_scheme => 'elf',
253 },
254 "solaris64-x86_64-gcc" => {
255 # -shared -static-libgcc might appear controversial, but modules
256 # taken from static libgcc do not have relocations and linking
257 # them into our shared objects doesn't have any negative side
258 # effects. On the contrary, doing so makes it possible to use
259 # gcc shared build with Sun C. Given that gcc generates faster
260 # code [thanks to inline assembler], I would actually recommend
261 # to consider using gcc shared build even with vendor compiler:-)
262 # -- <[email protected]>
263 inherit_from => [ "solaris-common-gcc" ],
264 CC => "gcc",
265 CFLAGS => add_before(picker(default => "-Wall",
266 debug => "-O0 -g",
267 release => "-O3")),
268 cflags => add_before("-m64", threads("-pthread")),
269 lib_cppflags => add("-DL_ENDIAN"),
270 ex_libs => add(threads("-pthread")),
271 bn_ops => "SIXTY_FOUR_BIT_LONG",
272 asm_arch => 'x86_64',
273 perlasm_scheme => "elf",
274 shared_cflag => "-fPIC",
275 shared_ldflag => add_before("-shared -static-libgcc"),
276 multilib => "/64",
277 },
278
279#### Solaris x86 with Sun C setups
280 # There used to be solaris-x86-cc target, but it was removed,
281 # primarily because vendor assembler can't assemble our modules
282 # with -KPIC flag. As result it, assembly support, was not even
283 # available as option. But its lack means lack of side-channel
284 # resistant code, which is incompatible with security by today's
285 # standards. Fortunately gcc is readily available prepackaged
286 # option, which we can firmly point at...
287 #
288 # On related note, solaris64-x86_64-cc target won't compile code
289 # paths utilizing AVX and post-Haswell instruction extensions.
290 # Consider switching to solaris64-x86_64-gcc even here...
291 #
292 "solaris64-x86_64-cc" => {
293 inherit_from => [ "solaris-common-cc" ],
294 CC => "cc",
295 CFLAGS => add_before(picker(debug => "-g",
296 release => "-xO5 -xdepend -xbuiltin")),
297 cflags => add_before("-xarch=generic64 -xstrconst -Xa"),
298 cppflags => add(threads("-D_REENTRANT")),
299 lib_cppflags => add("-DL_ENDIAN"),
300 thread_scheme => "pthreads",
301 lflags => add(threads("-mt")),
302 ex_libs => add(threads("-lpthread")),
303 bn_ops => "SIXTY_FOUR_BIT_LONG",
304 asm_arch => 'x86_64',
305 perlasm_scheme => "elf",
306 shared_cflag => "-KPIC",
307 shared_ldflag => add_before("-G -dy -z text"),
308 multilib => "/64",
309 },
310
311#### SPARC Solaris with GNU C setups
312 "solaris-sparcv7-gcc" => {
313 inherit_from => [ "solaris-common-gcc" ],
314 CC => "gcc",
315 CFLAGS => add_before(picker(default => "-Wall",
316 debug => "-O0 -g",
317 release => "-O3")),
318 cflags => add(threads("-pthread")),
319 lib_cppflags => add("-DB_ENDIAN -DBN_DIV2W"),
320 ex_libs => add(threads("-pthread")),
321 bn_ops => "BN_LLONG RC4_CHAR",
322 shared_cflag => "-fPIC",
323 shared_ldflag => add_before("-shared -static-libgcc"),
324 },
325 "solaris-sparcv8-gcc" => {
326 inherit_from => [ "solaris-sparcv7-gcc" ],
327 cflags => add_before("-mcpu=v8"),
328 asm_arch => 'sparcv8',
329 perlasm_scheme => 'void',
330 },
331 "solaris-sparcv9-gcc" => {
332 # -m32 should be safe to add as long as driver recognizes
333 # -mcpu=ultrasparc
334 inherit_from => [ "solaris-sparcv7-gcc" ],
335 cflags => add_before("-m32 -mcpu=ultrasparc"),
336 asm_arch => 'sparcv9',
337 perlasm_scheme => 'void',
338 },
339 "solaris64-sparcv9-gcc" => {
340 inherit_from => [ "solaris-sparcv9-gcc" ],
341 cflags => sub { my $f=join(" ",@_); $f =~ s/\-m32/-m64/; $f; },
342 bn_ops => "BN_LLONG RC4_CHAR",
343 multilib => "/64",
344 },
345
346#### SPARC Solaris with Sun C setups
347# SC4.0 doesn't pass 'make test', upgrade to SC5.0 or SC4.2.
348# SC4.2 is ok, better than gcc even on bn as long as you tell it -xarch=v8
349# SC5.0 note: Compiler common patch 107357-01 or later is required!
350 "solaris-sparcv7-cc" => {
351 inherit_from => [ "solaris-common-cc" ],
352 CC => "cc",
353 CFLAGS => add_before(picker(debug => "-g",
354 release => "-xO5 -xdepend")),
355 cflags => add_before("-xstrconst -Xa"),
356 cppflags => add(threads("-D_REENTRANT")),
357 lib_cppflags => add("-DB_ENDIAN -DBN_DIV2W"),
358 lflags => add(threads("-mt")),
359 ex_libs => add(threads("-lpthread")),
360 bn_ops => "BN_LLONG RC4_CHAR",
361 shared_cflag => "-KPIC",
362 shared_ldflag => add_before("-G -dy -z text"),
363 },
364####
365 "solaris-sparcv8-cc" => {
366 inherit_from => [ "solaris-sparcv7-cc" ],
367 cflags => add_before("-xarch=v8"),
368 asm_arch => 'sparcv8',
369 perlasm_scheme => 'void',
370 },
371 "solaris-sparcv9-cc" => {
372 inherit_from => [ "solaris-sparcv7-cc" ],
373 cflags => add_before("-xarch=v8plus"),
374 asm_arch => 'sparcv9',
375 perlasm_scheme => 'void',
376 },
377 "solaris64-sparcv9-cc" => {
378 inherit_from => [ "solaris-sparcv7-cc" ],
379 cflags => add_before("-m64 -xarch=sparc"),
380 bn_ops => "BN_LLONG RC4_CHAR",
381 asm_arch => 'sparcv9',
382 perlasm_scheme => 'void',
383 multilib => "/64",
384 },
385
386#### IRIX 6.x configs
387# Only N32 and N64 ABIs are supported.
388 "irix-common" => {
389 inherit_from => [ "BASE_unix" ],
390 template => 1,
391 cppflags => threads("-D_SGI_MP_SOURCE"),
392 lib_cppflags => "-DB_ENDIAN",
393 ex_libs => add(threads("-lpthread")),
394 thread_scheme => "pthreads",
395 dso_scheme => "dlfcn",
396 shared_target => "self",
397 shared_ldflag => "-shared -Wl,-Bsymbolic",
398 shared_sonameflag=> "-Wl,-soname,",
399 },
400 "irix-mips3-gcc" => {
401 inherit_from => [ "irix-common" ],
402 CC => "gcc",
403 CFLAGS => picker(debug => "-g -O0",
404 release => "-O3"),
405 LDFLAGS => "-static-libgcc",
406 cflags => "-mabi=n32",
407 bn_ops => "RC4_CHAR SIXTY_FOUR_BIT",
408 asm_arch => 'mips64',
409 perlasm_scheme => "n32",
410 multilib => "32",
411 },
412 "irix-mips3-cc" => {
413 inherit_from => [ "irix-common" ],
414 CC => "cc",
415 CFLAGS => picker(debug => "-g -O0",
416 release => "-O2"),
417 cflags => "-n32 -mips3 -use_readonly_const -G0 -rdata_shared",
418 bn_ops => "RC4_CHAR SIXTY_FOUR_BIT",
419 asm_arch => 'mips64',
420 perlasm_scheme => "n32",
421 multilib => "32",
422 },
423 # N64 ABI builds.
424 "irix64-mips4-gcc" => {
425 inherit_from => [ "irix-common" ],
426 CC => "gcc",
427 CFLAGS => picker(debug => "-g -O0",
428 release => "-O3"),
429 LDFLAGS => "-static-libgcc",
430 cflags => "-mabi=64 -mips4",
431 bn_ops => "RC4_CHAR SIXTY_FOUR_BIT_LONG",
432 asm_arch => 'mips64',
433 perlasm_scheme => "64",
434 multilib => "64",
435 },
436 "irix64-mips4-cc" => {
437 inherit_from => [ "irix-common" ],
438 CC => "cc",
439 CFLAGS => picker(debug => "-g -O0",
440 release => "-O2"),
441 cflags => "-64 -mips4 -use_readonly_const -G0 -rdata_shared",
442 bn_ops => "RC4_CHAR SIXTY_FOUR_BIT_LONG",
443 asm_arch => 'mips64',
444 perlasm_scheme => "64",
445 multilib => "64",
446 },
447
448#### Unified HP-UX ANSI C configs.
449# Special notes:
450# - Originally we were optimizing at +O4 level. It should be noted
451# that the only difference between +O3 and +O4 is global inter-
452# procedural analysis. As it has to be performed during the link
453# stage the compiler leaves behind certain pseudo-code in lib*.a
454# which might be release or even patch level specific. Generating
455# the machine code for and analyzing the *whole* program appears
456# to be *extremely* memory demanding while the performance gain is
457# actually questionable. The situation is intensified by the default
458# HP-UX data set size limit (infamous 'maxdsiz' tunable) of 64MB
459# which is way too low for +O4. In other words, doesn't +O3 make
460# more sense?
461# - Keep in mind that the HP compiler by default generates code
462# suitable for execution on the host you're currently compiling at.
463# If the toolkit is meant to be used on various PA-RISC processors
464# consider './Configure hpux-parisc-[g]cc +DAportable'.
465# - -DMD32_XARRAY triggers workaround for compiler bug we ran into in
466# 32-bit message digests. (For the moment of this writing) HP C
467# doesn't seem to "digest" too many local variables (they make "him"
468# chew forever:-). For more details look-up MD32_XARRAY comment in
469# crypto/sha/sha_local.h.
470# - originally there were 32-bit hpux-parisc2-* targets. They were
471# scrapped, because a) they were not interchangeable with other 32-bit
472# targets; b) performance-critical 32-bit assembly modules implement
473# even PA-RISC 2.0-specific code paths, which are chosen at run-time,
474# thus adequate performance is provided even with PA-RISC 1.1 build.
475 "hpux-common" => {
476 inherit_from => [ "BASE_unix" ],
477 template => 1,
478 defines => add("_XOPEN_SOURCE", "_XOPEN_SOURCE_EXTENDED",
479 "_HPUX_ALT_XOPEN_SOCKET_API"),
480 lib_cppflags => "-DB_ENDIAN",
481 thread_scheme => "pthreads",
482 dso_scheme => "dlfcn", # overridden in 32-bit PA-RISC builds
483 shared_target => "self",
484 bin_lflags => "-Wl,+s,+cdp,../:,+cdp,./:",
485 shared_ldflag => "-Wl,-B,symbolic,+vnocompatwarnings,-z,+s,+cdp,../:,+cdp,./:",
486 shared_sonameflag=> "-Wl,+h,",
487 },
488 "hpux-parisc-gcc" => {
489 inherit_from => [ "hpux-common" ],
490 CC => "gcc",
491 CFLAGS => picker(debug => "-O0 -g",
492 release => "-O3"),
493 cflags => add(threads("-pthread")),
494 lib_cppflags => add("-DBN_DIV2W"),
495 ex_libs => add("-ldld", threads("-pthread")),
496 bn_ops => "BN_LLONG RC4_CHAR",
497 dso_scheme => "dl",
498 shared_cflag => "-fPIC",
499 shared_ldflag => add_before("-shared"),
500 shared_extension => ".sl.\$(SHLIB_VERSION_NUMBER)",
501 },
502 "hpux-parisc1_1-gcc" => {
503 inherit_from => [ "hpux-parisc-gcc" ],
504 asm_arch => 'parisc11',
505 perlasm_scheme => "32",
506 multilib => "/pa1.1",
507 },
508 "hpux64-parisc2-gcc" => {
509 inherit_from => [ "hpux-common" ],
510 CC => "gcc",
511 CFLAGS => combine(picker(debug => "-O0 -g",
512 release => "-O3")),
513 cflags => add(threads("-pthread")),
514 ex_libs => add("-ldl", threads("-pthread")),
515 bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
516 asm_arch => 'parisc20_64',
517 perlasm_scheme => "64",
518 shared_cflag => "-fpic",
519 shared_ldflag => add_before("-shared"),
520 shared_extension => ".sl.\$(SHLIB_VERSION_NUMBER)",
521 multilib => "/pa20_64",
522 },
523
524 # More attempts at unified 10.X and 11.X targets for HP C compiler.
525 "hpux-parisc-cc" => {
526 inherit_from => [ "hpux-common" ],
527 CC => "cc",
528 CFLAGS => picker(debug => "+O0 +d -g",
529 release => "+O3"),
530 cflags => "+Optrs_strongly_typed -Ae +ESlit",
531 cppflags => threads("-D_REENTRANT"),
532 lib_cppflags => add("-DBN_DIV2W -DMD32_XARRAY"),
533 ex_libs => add("-ldld", threads("-lpthread")),
534 bn_ops => "RC4_CHAR",
535 dso_scheme => "dl",
536 shared_cflag => "+Z",
537 shared_ldflag => add_before("-b"),
538 shared_extension => ".sl.\$(SHLIB_VERSION_NUMBER)",
539 },
540 "hpux-parisc1_1-cc" => {
541 inherit_from => [ "hpux-parisc-cc" ],
542 cflags => add_before("+DA1.1"),
543 asm_arch => 'parisc11',
544 perlasm_scheme => "32",
545 multilib => "/pa1.1",
546 },
547 "hpux64-parisc2-cc" => {
548 inherit_from => [ "hpux-common" ],
549 CC => "cc",
550 CFLAGS => picker(debug => "+O0 +d -g",
551 release => "+O3") ,
552 cflags => "+DD64 +Optrs_strongly_typed -Ae +ESlit",
553 cppflags => threads("-D_REENTRANT") ,
554 lib_cppflags => add("-DMD32_XARRAY"),
555 ex_libs => add("-ldl", threads("-lpthread")),
556 bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
557 asm_arch => 'parisc20_64',
558 perlasm_scheme => "64",
559 shared_cflag => "+Z",
560 shared_ldflag => add_before("-b"),
561 shared_extension => ".sl.\$(SHLIB_VERSION_NUMBER)",
562 multilib => "/pa20_64",
563 },
564
565 # HP/UX IA-64 targets
566 "hpux-ia64-cc" => {
567 inherit_from => [ "hpux-common" ],
568 CC => "cc",
569 CFLAGS => picker(debug => "+O0 +d -g",
570 release => "+O2"),
571 cflags => "-Ae +DD32 +Olit=all -z",
572 cppflags => add(threads("-D_REENTRANT")),
573 ex_libs => add("-ldl", threads("-lpthread")),
574 bn_ops => "SIXTY_FOUR_BIT",
575 asm_arch => 'ia64',
576 perlasm_scheme => 'void',
577 shared_cflag => "+Z",
578 shared_ldflag => add_before("-b"),
579 multilib => "/hpux32",
580 },
581 "hpux64-ia64-cc" => {
582 inherit_from => [ "hpux-common" ],
583 CC => "cc",
584 CFLAGS => picker(debug => "+O0 +d -g",
585 release => "+O3"),
586 cflags => "-Ae +DD64 +Olit=all -z",
587 cppflags => threads("-D_REENTRANT"),
588 ex_libs => add("-ldl", threads("-lpthread")),
589 bn_ops => "SIXTY_FOUR_BIT_LONG",
590 asm_arch => 'ia64',
591 perlasm_scheme => 'void',
592 shared_cflag => "+Z",
593 shared_ldflag => add_before("-b"),
594 multilib => "/hpux64",
595 },
596 # GCC builds...
597 "hpux-ia64-gcc" => {
598 inherit_from => [ "hpux-common" ],
599 CC => "gcc",
600 CFLAGS => picker(debug => "-O0 -g",
601 release => "-O3"),
602 cflags => add(threads("-pthread")),
603 ex_libs => add("-ldl", threads("-pthread")),
604 bn_ops => "SIXTY_FOUR_BIT",
605 asm_arch => 'ia64',
606 perlasm_scheme => 'void',
607 shared_cflag => "-fpic",
608 shared_ldflag => add_before("-shared"),
609 multilib => "/hpux32",
610 },
611 "hpux64-ia64-gcc" => {
612 inherit_from => [ "hpux-common" ],
613 CC => "gcc",
614 CFLAGS => picker(debug => "-O0 -g",
615 release => "-O3"),
616 cflags => combine("-mlp64", threads("-pthread")),
617 ex_libs => add("-ldl", threads("-pthread")),
618 bn_ops => "SIXTY_FOUR_BIT_LONG",
619 asm_arch => 'ia64',
620 perlasm_scheme => 'void',
621 shared_cflag => "-fpic",
622 shared_ldflag => add_before("-shared"),
623 multilib => "/hpux64",
624 },
625
626#### HP MPE/iX http://jazz.external.hp.com/src/openssl/
627 "MPE/iX-gcc" => {
628 inherit_from => [ "BASE_unix" ],
629 CC => "gcc",
630 CFLAGS => "-O3",
631 cppflags => "-D_POSIX_SOURCE -D_SOCKET_SOURCE",
632 includes => [ "/SYSLOG/PUB" ],
633 lib_cppflags => "-DBN_DIV2W",
634 sys_id => "MPE",
635 lflags => add("-L/SYSLOG/PUB"),
636 ex_libs => add("-lsyslog -lsocket -lcurses"),
637 thread_scheme => "(unknown)",
638 bn_ops => "BN_LLONG",
639 },
640
641#### DEC Alpha Tru64 targets. Tru64 is marketing name for OSF/1 version 4
642#### and forward. In reality 'uname -s' still returns "OSF1". Originally
643#### there were even osf1-* configs targeting prior versions provided,
644#### but not anymore...
645 "tru64-alpha-gcc" => {
646 inherit_from => [ "BASE_unix" ],
647 CC => "gcc",
648 CFLAGS => "-O3",
649 cflags => add("-std=c9x", threads("-pthread")),
650 cppflags => "-D_XOPEN_SOURCE=500 -D_OSF_SOURCE",
651 ex_libs => add("-lrt", threads("-pthread")), # for mlock(2)
652 bn_ops => "SIXTY_FOUR_BIT_LONG",
653 asm_arch => 'alpha',
654 perlasm_scheme => "void",
655 thread_scheme => "pthreads",
656 dso_scheme => "dlfcn",
657 shared_target => "alpha-osf1-shared",
658 shared_extension => ".so",
659 },
660 "tru64-alpha-cc" => {
661 inherit_from => [ "BASE_unix" ],
662 CC => "cc",
663 CFLAGS => "-tune host -fast",
664 cflags => add("-std1 -readonly_strings",
665 threads("-pthread")),
666 cppflags => "-D_XOPEN_SOURCE=500 -D_OSF_SOURCE",
667 ex_libs => add("-lrt", threads("-pthread")), # for mlock(2)
668 bn_ops => "SIXTY_FOUR_BIT_LONG",
669 asm_arch => 'alpha',
670 perlasm_scheme => "void",
671 thread_scheme => "pthreads",
672 dso_scheme => "dlfcn",
673 shared_target => "alpha-osf1-shared",
674 shared_ldflag => "-msym",
675 shared_extension => ".so",
676 },
677
678####
679#### Variety of LINUX:-)
680####
681# *-generic* is endian-neutral target, but ./config is free to
682# throw in -D[BL]_ENDIAN, whichever appropriate...
683 "linux-generic32" => {
684 inherit_from => [ "BASE_unix" ],
685 CC => "gcc",
686 CXX => "g++",
687 CFLAGS => picker(default => "-Wall",
688 debug => "-O0 -g",
689 release => "-O3"),
690 CXXFLAGS => picker(default => "-Wall",
691 debug => "-O0 -g",
692 release => "-O3"),
693 cflags => threads("-pthread"),
694 cxxflags => combine("-std=c++11", threads("-pthread")),
695 lib_cppflags => "-DOPENSSL_USE_NODELETE",
696 ex_libs => add("-ldl", threads("-pthread")),
697 bn_ops => "BN_LLONG RC4_CHAR",
698 thread_scheme => "pthreads",
699 dso_scheme => "dlfcn",
700 shared_target => "linux-shared",
701 shared_cflag => "-fPIC",
702 shared_ldflag => sub { $disabled{pinshared} ? () : "-Wl,-znodelete" },
703 enable => [ "afalgeng" ],
704 },
705 "linux-latomic" => {
706 inherit_from => [ "linux-generic32" ],
707 ex_libs => add(threads("-latomic")),
708 },
709 "linux-generic64" => {
710 inherit_from => [ "linux-generic32" ],
711 bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
712 },
713
714 "linux-ppc" => {
715 inherit_from => [ "linux-latomic" ],
716 asm_arch => 'ppc32',
717 perlasm_scheme => "linux32",
718 lib_cppflags => add("-DB_ENDIAN"),
719 },
720 "linux-ppc64" => {
721 inherit_from => [ "linux-generic64" ],
722 cflags => add("-m64"),
723 cxxflags => add("-m64"),
724 lib_cppflags => add("-DB_ENDIAN"),
725 asm_arch => 'ppc64',
726 perlasm_scheme => "linux64",
727 multilib => "64",
728 },
729 "linux-ppc64le" => {
730 inherit_from => [ "linux-generic64" ],
731 cflags => add("-m64"),
732 cxxflags => add("-m64"),
733 lib_cppflags => add("-DL_ENDIAN"),
734 asm_arch => 'ppc64',
735 perlasm_scheme => "linux64le",
736 },
737
738 "linux-armv4" => {
739 ################################################################
740 # Note that -march is not among compiler options in linux-armv4
741 # target description. Not specifying one is intentional to give
742 # you choice to:
743 #
744 # a) rely on your compiler default by not specifying one;
745 # b) specify your target platform explicitly for optimal
746 # performance, e.g. -march=armv6 or -march=armv7-a;
747 # c) build "universal" binary that targets *range* of platforms
748 # by specifying minimum and maximum supported architecture;
749 #
750 # As for c) option. It actually makes no sense to specify
751 # maximum to be less than ARMv7, because it's the least
752 # requirement for run-time switch between platform-specific
753 # code paths. And without run-time switch performance would be
754 # equivalent to one for minimum. Secondly, there are some
755 # natural limitations that you'd have to accept and respect.
756 # Most notably you can *not* build "universal" binary for
757 # big-endian platform. This is because ARMv7 processor always
758 # picks instructions in little-endian order. Another similar
759 # limitation is that -mthumb can't "cross" -march=armv6t2
760 # boundary, because that's where it became Thumb-2. Well, this
761 # limitation is a bit artificial, because it's not really
762 # impossible, but it's deemed too tricky to support. And of
763 # course you have to be sure that your binutils are actually
764 # up to the task of handling maximum target platform. With all
765 # this in mind here is an example of how to configure
766 # "universal" build:
767 #
768 # ./Configure linux-armv4 -march=armv6 -D__ARM_MAX_ARCH__=8
769 #
770 inherit_from => [ "linux-latomic" ],
771 asm_arch => 'armv4',
772 perlasm_scheme => "linux32",
773 },
774 "linux-aarch64" => {
775 inherit_from => [ "linux-generic64" ],
776 asm_arch => 'aarch64',
777 perlasm_scheme => "linux64",
778 },
779 "linux-arm64ilp32" => { # https://wiki.linaro.org/Platform/arm64-ilp32
780 inherit_from => [ "linux-generic32" ],
781 cflags => add("-mabi=ilp32"),
782 cxxflags => add("-mabi=ilp32"),
783 bn_ops => "SIXTY_FOUR_BIT RC4_CHAR",
784 asm_arch => 'aarch64',
785 perlasm_scheme => "linux64",
786 },
787
788 "linux-mips32" => {
789 # Configure script adds minimally required -march for assembly
790 # support, if no -march was specified at command line.
791 inherit_from => [ "linux-latomic" ],
792 cflags => add("-mabi=32"),
793 cxxflags => add("-mabi=32"),
794 asm_arch => 'mips32',
795 perlasm_scheme => "o32",
796 },
797 # mips32 and mips64 below refer to contemporary MIPS Architecture
798 # specifications, MIPS32 and MIPS64, rather than to kernel bitness.
799 "linux-mips64" => {
800 inherit_from => [ "linux-latomic" ],
801 cflags => add("-mabi=n32"),
802 cxxflags => add("-mabi=n32"),
803 bn_ops => "RC4_CHAR SIXTY_FOUR_BIT",
804 asm_arch => 'mips64',
805 perlasm_scheme => "n32",
806 multilib => "32",
807 },
808 "linux64-mips64" => {
809 inherit_from => [ "linux-generic64" ],
810 cflags => add("-mabi=64"),
811 cxxflags => add("-mabi=64"),
812 asm_arch => 'mips64',
813 perlasm_scheme => "64",
814 multilib => "64",
815 },
816
817 # riscv below refers to contemporary RISCV Architecture
818 # specifications,
819 "linux64-riscv64" => {
820 inherit_from => [ "linux-generic64"],
821 perlasm_scheme => "linux64",
822 asm_arch => 'riscv64',
823 },
824
825 "linux32-riscv32" => {
826 inherit_from => [ "linux-latomic" ],
827 perlasm_scheme => "linux32",
828 asm_arch => 'riscv32',
829 },
830
831 # loongarch64 below refers to contemporary LoongArch Architecture
832 # specifications,
833 "linux64-loongarch64" => {
834 inherit_from => [ "linux-generic64"],
835 perlasm_scheme => "linux64",
836 asm_arch => 'loongarch64',
837 lib_cppflags => add("-DL_ENDIAN"),
838 },
839
840 #### IA-32 targets...
841 #### These two targets are a bit aged and are to be used on older Linux
842 #### machines where gcc doesn't understand -m32 and -m64
843 "linux-elf" => {
844 inherit_from => [ "linux-generic32" ],
845 CFLAGS => add(picker(release => "-fomit-frame-pointer")),
846 lib_cppflags => add("-DL_ENDIAN"),
847 bn_ops => "BN_LLONG",
848 asm_arch => 'x86',
849 perlasm_scheme => "elf",
850 },
851 "linux-aout" => {
852 inherit_from => [ "BASE_unix" ],
853 CC => "gcc",
854 CFLAGS => add(picker(default => "-Wall",
855 debug => "-O0 -g",
856 release => "-O3 -fomit-frame-pointer")),
857 lib_cppflags => add("-DL_ENDIAN"),
858 bn_ops => "BN_LLONG",
859 thread_scheme => "(unknown)",
860 asm_arch => 'x86',
861 perlasm_scheme => "a.out",
862 },
863
864 #### X86 / X86_64 targets
865 "linux-x86" => {
866 inherit_from => [ "linux-generic32" ],
867 CFLAGS => add(picker(release => "-fomit-frame-pointer")),
868 cflags => add("-m32"),
869 cxxflags => add("-m32"),
870 lib_cppflags => add("-DL_ENDIAN"),
871 bn_ops => "BN_LLONG",
872 asm_arch => 'x86',
873 perlasm_scheme => "elf",
874 },
875 "linux-x86-clang" => {
876 inherit_from => [ "linux-x86" ],
877 CC => "clang",
878 CXX => "clang++",
879 ex_libs => add(threads("-latomic")),
880 },
881 "linux-x86_64" => {
882 inherit_from => [ "linux-generic64" ],
883 cflags => add("-m64"),
884 cxxflags => add("-m64"),
885 lib_cppflags => add("-DL_ENDIAN"),
886 bn_ops => "SIXTY_FOUR_BIT_LONG",
887 asm_arch => 'x86_64',
888 perlasm_scheme => "elf",
889 multilib => "64",
890 },
891 "linux-x86_64-clang" => {
892 inherit_from => [ "linux-x86_64" ],
893 CC => "clang",
894 CXX => "clang++",
895 },
896 "linux-x32" => {
897 inherit_from => [ "linux-generic32" ],
898 cflags => add("-mx32"),
899 cxxflags => add("-mx32"),
900 lib_cppflags => add("-DL_ENDIAN"),
901 bn_ops => "SIXTY_FOUR_BIT",
902 asm_arch => 'x86_64',
903 perlasm_scheme => "elf32",
904 multilib => "x32",
905 },
906
907 "linux-ia64" => {
908 inherit_from => [ "linux-generic64" ],
909 bn_ops => "SIXTY_FOUR_BIT_LONG",
910 asm_arch => 'ia64',
911 perlasm_scheme => 'void',
912 },
913
914 "linux64-s390x" => {
915 inherit_from => [ "linux-generic64" ],
916 cflags => add("-m64"),
917 cxxflags => add("-m64"),
918 lib_cppflags => add("-DB_ENDIAN"),
919 asm_arch => 's390x',
920 perlasm_scheme => "64",
921 multilib => "64",
922 },
923 "linux32-s390x" => {
924 #### So called "highgprs" target for z/Architecture CPUs
925 # "Highgprs" is kernel feature first implemented in Linux
926 # 2.6.32, see /proc/cpuinfo. The idea is to preserve most
927 # significant bits of general purpose registers not only
928 # upon 32-bit process context switch, but even on
929 # asynchronous signal delivery to such process. This makes
930 # it possible to deploy 64-bit instructions even in legacy
931 # application context and achieve better [or should we say
932 # adequate] performance. The build is binary compatible with
933 # linux-generic32, and the idea is to be able to install the
934 # resulting libcrypto.so alongside generic one, e.g. as
935 # /lib/highgprs/libcrypto.so.x.y, for ldconfig and run-time
936 # linker to autodiscover. Unfortunately it doesn't work just
937 # yet, because of couple of bugs in glibc
938 # sysdeps/s390/dl-procinfo.c affecting ldconfig and ld.so.1...
939 #
940 inherit_from => [ "linux-generic32" ],
941 cflags => add("-m31 -Wa,-mzarch"),
942 cxxflags => add("-m31 -Wa,-mzarch"),
943 lib_cppflags => add("-DB_ENDIAN"),
944 asm_arch => 's390x',
945 perlasm_scheme => "31",
946 multilib => "/highgprs",
947 },
948
949 #### SPARC Linux setups
950 "linux-sparcv8" => {
951 inherit_from => [ "linux-latomic" ],
952 cflags => add("-mcpu=v8"),
953 cxxflags => add("-mcpu=v8"),
954 lib_cppflags => add("-DB_ENDIAN -DBN_DIV2W"),
955 asm_arch => 'sparcv8',
956 perlasm_scheme => 'void',
957 },
958 "linux-sparcv9" => {
959 # it's a real mess with -mcpu=ultrasparc option under Linux,
960 # but -Wa,-Av8plus should do the trick no matter what.
961 inherit_from => [ "linux-latomic" ],
962 cflags => add("-m32 -mcpu=ultrasparc -Wa,-Av8plus"),
963 cxxflags => add("-m32 -mcpu=ultrasparc -Wa,-Av8plus"),
964 lib_cppflags => add("-DB_ENDIAN -DBN_DIV2W"),
965 asm_arch => 'sparcv9',
966 perlasm_scheme => 'void',
967 },
968 "linux64-sparcv9" => {
969 # GCC 3.1 is a requirement
970 inherit_from => [ "linux-generic64" ],
971 cflags => add("-m64 -mcpu=ultrasparc"),
972 cxxflags => add("-m64 -mcpu=ultrasparc"),
973 lib_cppflags => add("-DB_ENDIAN"),
974 ex_libs => add(threads("-latomic")),
975 bn_ops => "BN_LLONG RC4_CHAR",
976 asm_arch => 'sparcv9',
977 perlasm_scheme => 'void',
978 multilib => "64",
979 },
980
981 "linux-alpha-gcc" => {
982 inherit_from => [ "linux-generic64" ],
983 lib_cppflags => add("-DL_ENDIAN"),
984 bn_ops => "SIXTY_FOUR_BIT_LONG",
985 asm_arch => 'alpha',
986 perlasm_scheme => "void",
987 },
988 "linux-c64xplus" => {
989 inherit_from => [ "BASE_unix" ],
990 # TI_CGT_C6000_7.3.x is a requirement
991 CC => "cl6x",
992 CFLAGS => "-o2 -ox -ms",
993 cflags => "--linux -ea=.s -eo=.o -mv6400+ -pden",
994 cxxflags => "--linux -ea=.s -eo=.o -mv6400+ -pden",
995 cppflags => combine("-DOPENSSL_SMALL_FOOTPRINT",
996 threads("-D_REENTRANT")),
997 bn_ops => "BN_LLONG",
998 thread_scheme => "pthreads",
999 asm_arch => 'c64xplus',
1000 perlasm_scheme => "void",
1001 dso_scheme => "dlfcn",
1002 shared_target => "linux-shared",
1003 shared_cflag => "--pic",
1004 shared_ldflag => add("-z --sysv --shared"),
1005 ranlib => "true",
1006 },
1007
1008#### *BSD
1009 "BSD-generic32" => {
1010 # As for thread cflag. Idea is to maintain "collective" set of
1011 # flags, which would cover all BSD flavors. -pthread applies
1012 # to them all, but is treated differently. OpenBSD expands is
1013 # as -D_POSIX_THREAD -lc_r, which is sufficient. FreeBSD 4.x
1014 # expands it as -lc_r, which has to be accompanied by explicit
1015 # -D_THREAD_SAFE and sometimes -D_REENTRANT. FreeBSD 5.x
1016 # expands it as -lc_r, which seems to be sufficient?
1017 inherit_from => [ "BASE_unix" ],
1018 CC => "cc",
1019 CFLAGS => picker(default => "-Wall",
1020 debug => "-O0 -g",
1021 release => "-O3"),
1022 cflags => threads("-pthread"),
1023 cppflags => threads("-D_THREAD_SAFE -D_REENTRANT"),
1024 ex_libs => add(threads("-pthread")),
1025 enable => add("devcryptoeng"),
1026 bn_ops => "BN_LLONG",
1027 thread_scheme => "pthreads",
1028 dso_scheme => "dlfcn",
1029 shared_target => "bsd-gcc-shared",
1030 shared_cflag => "-fPIC",
1031 },
1032 "BSD-generic64" => {
1033 inherit_from => [ "BSD-generic32" ],
1034 bn_ops => "SIXTY_FOUR_BIT_LONG",
1035 },
1036
1037 "BSD-x86" => {
1038 inherit_from => [ "BSD-generic32" ],
1039 CFLAGS => add(picker(release => "-fomit-frame-pointer")),
1040 lib_cppflags => add("-DL_ENDIAN"),
1041 bn_ops => "BN_LLONG",
1042 asm_arch => 'x86',
1043 perlasm_scheme => "a.out",
1044 },
1045 "BSD-x86-elf" => {
1046 inherit_from => [ "BSD-x86" ],
1047 perlasm_scheme => "elf",
1048 },
1049
1050 "BSD-sparcv8" => {
1051 inherit_from => [ "BSD-generic32" ],
1052 cflags => add("-mcpu=v8"),
1053 lib_cppflags => add("-DB_ENDIAN"),
1054 asm_arch => 'sparcv8',
1055 perlasm_scheme => 'void',
1056 },
1057 "BSD-sparc64" => {
1058 # -DMD32_REG_T=int doesn't actually belong in sparc64 target, it
1059 # simply *happens* to work around a compiler bug in gcc 3.3.3,
1060 # triggered by RIPEMD160 code.
1061 inherit_from => [ "BSD-generic64" ],
1062 lib_cppflags => add("-DB_ENDIAN -DMD32_REG_T=int"),
1063 bn_ops => "BN_LLONG",
1064 asm_arch => 'sparcv9',
1065 perlasm_scheme => 'void',
1066 },
1067
1068 "BSD-ia64" => {
1069 inherit_from => [ "BSD-generic64" ],
1070 lib_cppflags => add("-DL_ENDIAN"),
1071 bn_ops => "SIXTY_FOUR_BIT_LONG",
1072 asm_arch => 'ia64',
1073 perlasm_scheme => 'void',
1074 },
1075
1076 "BSD-x86_64" => {
1077 inherit_from => [ "BSD-generic64" ],
1078 lib_cppflags => add("-DL_ENDIAN"),
1079 bn_ops => "SIXTY_FOUR_BIT_LONG",
1080 asm_arch => 'x86_64',
1081 perlasm_scheme => "elf",
1082 },
1083
1084 "BSD-aarch64" => {
1085 inherit_from => [ "BSD-generic64" ],
1086 lib_cppflags => add("-DL_ENDIAN"),
1087 bn_ops => "SIXTY_FOUR_BIT_LONG",
1088 asm_arch => 'aarch64',
1089 perlasm_scheme => "linux64",
1090 },
1091
1092 "BSD-ppc" => {
1093 inherit_from => [ "BSD-generic32" ],
1094 asm_arch => 'ppc32',
1095 perlasm_scheme => "linux32",
1096 lib_cppflags => add("-DB_ENDIAN"),
1097 },
1098
1099 "BSD-ppc64" => {
1100 inherit_from => [ "BSD-generic64" ],
1101 cflags => add("-m64"),
1102 cxxflags => add("-m64"),
1103 lib_cppflags => add("-DB_ENDIAN"),
1104 asm_arch => 'ppc64',
1105 perlasm_scheme => "linux64",
1106 },
1107
1108 "BSD-ppc64le" => {
1109 inherit_from => [ "BSD-generic64" ],
1110 cflags => add("-m64"),
1111 cxxflags => add("-m64"),
1112 lib_cppflags => add("-DL_ENDIAN"),
1113 asm_arch => 'ppc64',
1114 perlasm_scheme => "linux64le",
1115 },
1116
1117 # riscv below refers to contemporary RISCV Architecture
1118 # specifications,
1119 "BSD-riscv64" => {
1120 inherit_from => [ "BSD-generic64"],
1121 perlasm_scheme => "linux64",
1122 asm_arch => 'riscv64',
1123 },
1124
1125 "BSD-riscv32" => {
1126 inherit_from => [ "BSD-generic32"],
1127 perlasm_scheme => "linux32",
1128 asm_arch => 'riscv32',
1129 },
1130
1131 "BSD-armv4" => {
1132 ################################################################
1133 # Note that -march is not among compiler options in linux-armv4
1134 # target description. Not specifying one is intentional to give
1135 # you choice to:
1136 #
1137 # a) rely on your compiler default by not specifying one;
1138 # b) specify your target platform explicitly for optimal
1139 # performance, e.g. -march=armv6 or -march=armv7-a;
1140 # c) build "universal" binary that targets *range* of platforms
1141 # by specifying minimum and maximum supported architecture;
1142 #
1143 # As for c) option. It actually makes no sense to specify
1144 # maximum to be less than ARMv7, because it's the least
1145 # requirement for run-time switch between platform-specific
1146 # code paths. And without run-time switch performance would be
1147 # equivalent to one for minimum. Secondly, there are some
1148 # natural limitations that you'd have to accept and respect.
1149 # Most notably you can *not* build "universal" binary for
1150 # big-endian platform. This is because ARMv7 processor always
1151 # picks instructions in little-endian order. Another similar
1152 # limitation is that -mthumb can't "cross" -march=armv6t2
1153 # boundary, because that's where it became Thumb-2. Well, this
1154 # limitation is a bit artificial, because it's not really
1155 # impossible, but it's deemed too tricky to support. And of
1156 # course you have to be sure that your binutils are actually
1157 # up to the task of handling maximum target platform. With all
1158 # this in mind here is an example of how to configure
1159 # "universal" build:
1160 #
1161 # ./Configure BSD-armv4 -march=armv6 -D__ARM_MAX_ARCH__=8
1162 #
1163 inherit_from => [ "BSD-generic32" ],
1164 asm_arch => 'armv4',
1165 perlasm_scheme => "linux32",
1166 },
1167
1168 "bsdi-elf-gcc" => {
1169 inherit_from => [ "BASE_unix" ],
1170 CC => "gcc",
1171 CFLAGS => "-fomit-frame-pointer -O3 -Wall",
1172 lib_cppflags => "-DPERL5 -DL_ENDIAN",
1173 ex_libs => add("-ldl"),
1174 bn_ops => "BN_LLONG",
1175 asm_arch => 'x86',
1176 perlasm_scheme => "elf",
1177 thread_scheme => "(unknown)",
1178 dso_scheme => "dlfcn",
1179 shared_target => "bsd-gcc-shared",
1180 shared_cflag => "-fPIC",
1181 },
1182
1183#### SCO/Caldera targets.
1184#
1185# Originally we had like unixware-*, unixware-*-pentium, unixware-*-p6, etc.
1186# Now we only have blended unixware-* as it's the only one used by ./config.
1187# If you want to optimize for particular microarchitecture, bypass ./config
1188# and './Configure unixware-7 -Kpentium_pro' or whatever appropriate.
1189# Note that not all targets include assembler support. Mostly because of
1190# lack of motivation to support out-of-date platforms with out-of-date
1191# compiler drivers and assemblers.
1192#
1193# UnixWare 2.0x fails destest with -O.
1194 "unixware-2.0" => {
1195 inherit_from => [ "BASE_unix" ],
1196 CC => "cc",
1197 cflags => threads("-Kthread"),
1198 lib_cppflags => "-DFILIO_H -DNO_STRINGS_H",
1199 ex_libs => add("-lsocket -lnsl -lresolv -lx"),
1200 thread_scheme => "uithreads",
1201 },
1202 "unixware-2.1" => {
1203 inherit_from => [ "BASE_unix" ],
1204 CC => "cc",
1205 CFLAGS => "-O",
1206 cflags => threads("-Kthread"),
1207 lib_cppflags => "-DFILIO_H",
1208 ex_libs => add("-lsocket -lnsl -lresolv -lx"),
1209 thread_scheme => "uithreads",
1210 },
1211 "unixware-7" => {
1212 inherit_from => [ "BASE_unix" ],
1213 CC => "cc",
1214 CFLAGS => "-O",
1215 cflags => combine("-Kalloca", threads("-Kthread")),
1216 lib_cppflags => "-DFILIO_H",
1217 ex_libs => add("-lsocket -lnsl"),
1218 thread_scheme => "uithreads",
1219 bn_ops => "BN_LLONG",
1220 asm_arch => 'x86',
1221 perlasm_scheme => "elf-1",
1222 dso_scheme => "dlfcn",
1223 shared_target => "svr5-shared",
1224 shared_cflag => "-Kpic",
1225 },
1226 "unixware-7-gcc" => {
1227 inherit_from => [ "BASE_unix" ],
1228 CC => "gcc",
1229 CFLAGS => "-O3 -fomit-frame-pointer -Wall",
1230 cppflags => add(threads("-D_REENTRANT")),
1231 lib_cppflags => add("-DL_ENDIAN -DFILIO_H"),
1232 ex_libs => add("-lsocket -lnsl"),
1233 bn_ops => "BN_LLONG",
1234 thread_scheme => "pthreads",
1235 asm_arch => 'x86',
1236 perlasm_scheme => "elf-1",
1237 dso_scheme => "dlfcn",
1238 shared_target => "gnu-shared",
1239 shared_cflag => "-fPIC",
1240 },
1241# SCO 5 - Ben Laurie says the -O breaks the SCO cc.
1242 "sco5-cc" => {
1243 inherit_from => [ "BASE_unix" ],
1244 cc => "cc",
1245 cflags => "-belf",
1246 ex_libs => add("-lsocket -lnsl"),
1247 thread_scheme => "(unknown)",
1248 asm_arch => 'x86',
1249 perlasm_scheme => "elf-1",
1250 dso_scheme => "dlfcn",
1251 shared_target => "svr3-shared",
1252 shared_cflag => "-Kpic",
1253 },
1254 "sco5-gcc" => {
1255 inherit_from => [ "BASE_unix" ],
1256 cc => "gcc",
1257 cflags => "-O3 -fomit-frame-pointer",
1258 ex_libs => add("-lsocket -lnsl"),
1259 bn_ops => "BN_LLONG",
1260 thread_scheme => "(unknown)",
1261 asm_arch => 'x86',
1262 perlasm_scheme => "elf-1",
1263 dso_scheme => "dlfcn",
1264 shared_target => "svr3-shared",
1265 shared_cflag => "-fPIC",
1266 },
1267
1268#### IBM's AIX.
1269 # Below targets assume AIX >=5. Caveat lector. If you are accustomed
1270 # to control compilation "bitness" by setting $OBJECT_MODE environment
1271 # variable, then you should know that in OpenSSL case it's considered
1272 # only in ./config. Once configured, build procedure remains "deaf" to
1273 # current value of $OBJECT_MODE.
1274 "aix-common" => {
1275 inherit_from => [ "BASE_unix" ],
1276 template => 1,
1277 sys_id => "AIX",
1278 lib_cppflags => "-DB_ENDIAN",
1279 lflags => "-Wl,-bsvr4",
1280 thread_scheme => "pthreads",
1281 dso_scheme => "dlfcn",
1282 shared_target => "aix",
1283 module_ldflags => "-Wl,-G,-bsymbolic,-bnoentry",
1284 shared_ldflag => "-Wl,-G,-bsymbolic,-bnoentry",
1285 shared_defflag => "-Wl,-bE:",
1286 shared_fipsflag => "-Wl,-binitfini:_init:_cleanup",
1287 perl_platform => 'AIX',
1288 },
1289 "aix-gcc" => {
1290 inherit_from => [ "aix-common" ],
1291 CC => "gcc",
1292 CFLAGS => picker(debug => "-O0 -g",
1293 release => "-O"),
1294 cflags => add(threads("-pthread")),
1295 ex_libs => add(threads("-pthread")),
1296 bn_ops => "BN_LLONG RC4_CHAR",
1297 asm_arch => 'ppc32',
1298 perlasm_scheme => "aix32",
1299 shared_ldflag => add_before("-shared -static-libgcc"),
1300 AR => add("-X32"),
1301 RANLIB => add("-X32"),
1302 },
1303 "aix64-gcc" => {
1304 inherit_from => [ "aix-common" ],
1305 CC => "gcc",
1306 CFLAGS => picker(debug => "-O0 -g",
1307 release => "-O"),
1308 cflags => combine("-maix64", threads("-pthread")),
1309 ex_libs => add(threads("-pthread")),
1310 bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
1311 asm_arch => 'ppc64',
1312 perlasm_scheme => "aix64",
1313 shared_ldflag => add_before("-shared -static-libgcc"),
1314 shared_extension => "64.so.\$(SHLIB_VERSION_NUMBER)",
1315 AR => add("-X64"),
1316 RANLIB => add("-X64"),
1317 },
1318 "aix64-gcc-as" => {
1319 inherit_from => [ "aix64-gcc" ],
1320 perlasm_scheme => "aix64-as",
1321 },
1322 "aix-cc" => {
1323 inherit_from => [ "aix-common" ],
1324 CC => "cc",
1325 CFLAGS => picker(debug => "-O0 -g",
1326 release => "-O"),
1327 cflags => combine("-q32 -qmaxmem=16384 -qro -qroconst",
1328 threads("-qthreaded")),
1329 cppflags => threads("-D_THREAD_SAFE"),
1330 ex_libs => add(threads("-lpthreads")),
1331 bn_ops => "BN_LLONG RC4_CHAR",
1332 asm_arch => 'ppc32',
1333 perlasm_scheme => "aix32",
1334 shared_cflag => "-qpic",
1335 AR => add("-X32"),
1336 RANLIB => add("-X32"),
1337 },
1338 "aix64-cc" => {
1339 inherit_from => [ "aix-common" ],
1340 CC => "cc",
1341 CFLAGS => picker(debug => "-O0 -g",
1342 release => "-O"),
1343 cflags => combine("-q64 -qmaxmem=16384 -qro -qroconst",
1344 threads("-qthreaded")),
1345 cppflags => threads("-D_THREAD_SAFE"),
1346 ex_libs => add(threads("-lpthreads")),
1347 bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
1348 asm_arch => 'ppc64',
1349 perlasm_scheme => "aix64",
1350 dso_scheme => "dlfcn",
1351 shared_cflag => "-qpic",
1352 shared_extension => "64.so.\$(SHLIB_VERSION_NUMBER)",
1353 AR => add("-X64"),
1354 RANLIB => add("-X64"),
1355 },
1356
1357# SIEMENS BS2000/OSD: an EBCDIC-based mainframe
1358 "BS2000-OSD" => {
1359 inherit_from => [ "BASE_unix" ],
1360 CC => "c89",
1361 CFLAGS => "-O",
1362 cflags => "-XLLML -XLLMK -XL",
1363 cppflags => "-DCHARSET_EBCDIC",
1364 lib_cppflags => "-DB_ENDIAN",
1365 ex_libs => add("-lsocket -lnsl"),
1366 bn_ops => "THIRTY_TWO_BIT RC4_CHAR",
1367 thread_scheme => "(unknown)",
1368 },
1369
1370#### Visual C targets
1371#
1372# Win64 targets, WIN64I denotes IA-64/Itanium and WIN64A - AMD64
1373#
1374# Note about /wd4090, disable warning C4090. This warning returns false
1375# positives in some situations. Disabling it altogether masks both
1376# legitimate and false cases, but as we compile on multiple platforms,
1377# we rely on other compilers to catch legitimate cases.
1378#
1379# Also note that we force threads no matter what. Configuring "no-threads"
1380# is ignored.
1381#
1382# UNICODE is defined in VC-common and applies to all targets. It used to
1383# be an opt-in option for VC-WIN32, but not anymore. The original reason
1384# was because ANSI API was *native* system interface for no longer
1385# supported Windows 9x. Keep in mind that UNICODE only affects how
1386# OpenSSL libraries interact with underlying OS, it doesn't affect API
1387# that OpenSSL presents to application.
1388
1389 "VC-common" => {
1390 inherit_from => [ "BASE_Windows" ],
1391 template => 1,
1392 CC => "cl",
1393 CPP => '$(CC) /EP /C',
1394 CFLAGS => "/W3 /wd4090 /nologo",
1395 coutflag => "/Fo",
1396 LD => "link",
1397 LDFLAGS => "/nologo /debug",
1398 ldoutflag => "/out:",
1399 ldpostoutflag => "",
1400 ld_resp_delim => "\n",
1401 bin_lflags => "setargv.obj",
1402 makedepcmd => '$(CC) /Zs /showIncludes',
1403 makedep_scheme => 'VC',
1404 AR => "lib",
1405 ARFLAGS => "/nologo",
1406 aroutflag => "/out:",
1407 ar_resp_delim => "\n",
1408 RC => "rc",
1409 rcoutflag => "/fo",
1410 defines => add("OPENSSL_SYS_WIN32", "WIN32_LEAN_AND_MEAN",
1411 "UNICODE", "_UNICODE",
1412 "_CRT_SECURE_NO_DEPRECATE",
1413 "_WINSOCK_DEPRECATED_NO_WARNINGS"),
1414 lib_cflags => add("/Zi /Fdossl_static.pdb"),
1415 lib_defines => add("L_ENDIAN"),
1416 dso_cflags => "/Zi /Fddso.pdb",
1417 bin_cflags => "/Zi /Fdapp.pdb",
1418 # def_flag made to empty string so a .def file gets generated
1419 shared_defflag => '',
1420 shared_ldflag => "/dll",
1421 shared_target => "win-shared", # meaningless except it gives Configure a hint
1422 lddefflag => "/def:",
1423 ldresflag => " ",
1424 ld_implib_flag => "/implib:",
1425 thread_scheme => "winthreads",
1426 dso_scheme => "win32",
1427 perl_platform => 'Windows::MSVC',
1428 # additional parameter to build_scheme denotes install-path "flavour"
1429 build_scheme => add("VC-common", { separator => undef }),
1430 },
1431 "VC-noCE-common" => {
1432 inherit_from => [ "VC-common" ],
1433 template => 1,
1434 CFLAGS => add(picker(debug => '/Od',
1435 release => '/O2')),
1436 cflags => add(picker(default => '/Gs0 /GF /Gy',
1437 debug =>
1438 sub {
1439 ($disabled{shared} ? "" : "/MDd");
1440 },
1441 release =>
1442 sub {
1443 ($disabled{shared} ? "" : "/MD");
1444 })),
1445 defines => add(picker(default => [], # works as type cast
1446 debug => [ "DEBUG", "_DEBUG" ])),
1447 lib_cflags => add(sub { $disabled{shared} ? "/MT /Zl" : () }),
1448 # Following might/should appears controversial, i.e. defining
1449 # /MDd without evaluating $disabled{shared}. It works in
1450 # non-shared build because static library is compiled with /Zl
1451 # and bares no reference to specific RTL. And it works in
1452 # shared build because multiple /MDd options are not prohibited.
1453 # But why /MDd in static build? Well, basically this is just a
1454 # reference point, which allows to catch eventual errors that
1455 # would prevent those who want to wrap OpenSSL into own .DLL.
1456 # Why not /MD in release build then? Well, some are likely to
1457 # prefer [non-debug] openssl.exe to be free from Micorosoft RTL
1458 # redistributable.
1459 bin_cflags => add(picker(debug => "/MDd",
1460 release => sub { $disabled{shared} ? "/MT" : () },
1461 )),
1462 bin_lflags => add("/subsystem:console /opt:ref"),
1463 ex_libs => add(sub {
1464 my @ex_libs = ();
1465 push @ex_libs, 'ws2_32.lib' unless $disabled{sock};
1466 push @ex_libs, 'gdi32.lib advapi32.lib crypt32.lib user32.lib';
1467 return join(" ", @ex_libs);
1468 }),
1469 },
1470 "VC-WIN64-common" => {
1471 inherit_from => [ "VC-noCE-common" ],
1472 template => 1,
1473 ex_libs => add(sub {
1474 my @ex_libs = ();
1475 push @ex_libs, 'bufferoverflowu.lib' if (`cl 2>&1` =~ /14\.00\.4[0-9]{4}\./);
1476 return join(" ", @_, @ex_libs);
1477 }),
1478 bn_ops => add("SIXTY_FOUR_BIT"),
1479 },
1480 "VC-WIN64I" => {
1481 inherit_from => [ "VC-WIN64-common" ],
1482 AS => "ias",
1483 ASFLAGS => "-d debug",
1484 asoutflag => "-o ",
1485 sys_id => "WIN64I",
1486 uplink_arch => 'ia64',
1487 asm_arch => 'ia64',
1488 perlasm_scheme => "ias",
1489 multilib => "-ia64",
1490 },
1491 "VC-WIN64A" => {
1492 inherit_from => [ "VC-WIN64-common" ],
1493 AS => sub { vc_win64a_info()->{AS} },
1494 ASFLAGS => sub { vc_win64a_info()->{ASFLAGS} },
1495 asoutflag => sub { vc_win64a_info()->{asoutflag} },
1496 asflags => sub { vc_win64a_info()->{asflags} },
1497 sys_id => "WIN64A",
1498 uplink_arch => 'x86_64',
1499 asm_arch => 'x86_64',
1500 perlasm_scheme => sub { vc_win64a_info()->{perlasm_scheme} },
1501 multilib => "-x64",
1502 },
1503 "VC-WIN32" => {
1504 inherit_from => [ "VC-noCE-common" ],
1505 AS => sub { vc_win32_info()->{AS} },
1506 ASFLAGS => sub { vc_win32_info()->{ASFLAGS} },
1507 asoutflag => sub { vc_win32_info()->{asoutflag} },
1508 asflags => sub { vc_win32_info()->{asflags} },
1509 sys_id => "WIN32",
1510 bn_ops => add("BN_LLONG"),
1511 uplink_arch => 'common',
1512 asm_arch => 'x86',
1513 perlasm_scheme => sub { vc_win32_info()->{perlasm_scheme} },
1514 # "WOW" stands for "Windows on Windows", and "VC-WOW" engages
1515 # some installation path heuristics in windows-makefile.tmpl...
1516 build_scheme => add("VC-WOW", { separator => undef }),
1517 },
1518 "VC-CE" => {
1519 inherit_from => [ "VC-common" ],
1520 CFLAGS => add(picker(debug => "/Od",
1521 release => "/O1i")),
1522 CPPDEFINES => picker(debug => [ "DEBUG", "_DEBUG" ]),
1523 LDFLAGS => add("/nologo /opt:ref"),
1524 cflags =>
1525 combine('/GF /Gy',
1526 sub { vc_wince_info()->{cflags}; },
1527 sub { `cl 2>&1` =~ /Version ([0-9]+)\./ && $1>=14
1528 ? ($disabled{shared} ? " /MT" : " /MD")
1529 : " /MC"; }),
1530 cppflags => sub { vc_wince_info()->{cppflags}; },
1531 lib_defines => add("NO_CHMOD", "OPENSSL_SMALL_FOOTPRINT"),
1532 lib_cppflags => sub { vc_wince_info()->{cppflags}; },
1533 includes =>
1534 add(combine(sub { defined(env('WCECOMPAT'))
1535 ? '$(WCECOMPAT)/include' : (); },
1536 sub { defined(env('PORTSDK_LIBPATH'))
1537 ? '$(PORTSDK_LIBPATH)/../../include'
1538 : (); })),
1539 lflags => add(combine(sub { vc_wince_info()->{lflags}; },
1540 sub { defined(env('PORTSDK_LIBPATH'))
1541 ? "/entry:mainCRTstartup" : (); })),
1542 sys_id => "WINCE",
1543 bn_ops => add("BN_LLONG"),
1544 ex_libs => add(sub {
1545 my @ex_libs = ();
1546 push @ex_libs, 'ws2.lib' unless $disabled{sock};
1547 push @ex_libs, 'crypt32.lib';
1548 if (defined(env('WCECOMPAT'))) {
1549 my $x = '$(WCECOMPAT)/lib';
1550 if (-f "$x/env('TARGETCPU')/wcecompatex.lib") {
1551 $x .= '/$(TARGETCPU)/wcecompatex.lib';
1552 } else {
1553 $x .= '/wcecompatex.lib';
1554 }
1555 push @ex_libs, $x;
1556 }
1557 push @ex_libs, '$(PORTSDK_LIBPATH)/portlib.lib'
1558 if (defined(env('PORTSDK_LIBPATH')));
1559 push @ex_libs, '/nodefaultlib coredll.lib corelibc.lib'
1560 if (env('TARGETCPU') =~ /^X86|^ARMV4[IT]/);
1561 return join(" ", @ex_libs);
1562 }),
1563 },
1564
1565#### MinGW
1566 "mingw-common" => {
1567 inherit_from => [ 'BASE_unix' ],
1568 template => 1,
1569 CC => "gcc",
1570 CFLAGS => picker(default => "-Wall",
1571 debug => "-g -O0",
1572 release => "-O3"),
1573 cppflags => combine("-DUNICODE -D_UNICODE -DWIN32_LEAN_AND_MEAN",
1574 threads("-D_MT")),
1575 lib_cppflags => "-DL_ENDIAN",
1576 ex_libs => add("-lws2_32 -lgdi32 -lcrypt32"),
1577 thread_scheme => "winthreads",
1578 dso_scheme => "win32",
1579 shared_target => "mingw-shared",
1580 shared_cppflags => add("_WINDLL"),
1581 shared_ldflag => "-static-libgcc",
1582
1583 perl_platform => 'mingw',
1584 },
1585 "mingw" => {
1586 inherit_from => [ "mingw-common" ],
1587 CFLAGS => add(picker(release => "-fomit-frame-pointer")),
1588 cflags => "-m32",
1589 sys_id => "MINGW32",
1590 bn_ops => add("BN_LLONG"),
1591 asm_arch => 'x86',
1592 uplink_arch => 'x86',
1593 perlasm_scheme => "coff",
1594 shared_rcflag => "--target=pe-i386",
1595 multilib => "",
1596 },
1597 "mingw64" => {
1598 # As for uplink_arch. Applink makes it possible to use
1599 # .dll compiled with one compiler with application compiled with
1600 # another compiler. It's possible to engage Applink support in
1601 # mingw64 build, but it's not done, because until mingw64
1602 # supports structured exception handling, one can't seriously
1603 # consider its binaries for using with non-mingw64 run-time
1604 # environment. And as mingw64 is always consistent with itself,
1605 # Applink is never engaged and can as well be omitted.
1606 inherit_from => [ "mingw-common" ],
1607 cflags => "-m64",
1608 sys_id => "MINGW64",
1609 bn_ops => add("SIXTY_FOUR_BIT"),
1610 asm_arch => 'x86_64',
1611 uplink_arch => undef,
1612 perlasm_scheme => "mingw64",
1613 shared_rcflag => "--target=pe-x86-64",
1614 multilib => "64",
1615 },
1616
1617#### UEFI
1618 "UEFI" => {
1619 inherit_from => [ "BASE_unix" ],
1620 CC => "cc",
1621 CFLAGS => "-O",
1622 lib_cppflags => "-DL_ENDIAN",
1623 sys_id => "UEFI",
1624 },
1625 "UEFI-x86" => {
1626 inherit_from => [ "UEFI" ],
1627 asm_arch => 'x86',
1628 perlasm_scheme => "win32n",
1629 },
1630 "UEFI-x86_64" => {
1631 inherit_from => [ "UEFI" ],
1632 asm_arch => 'x86_64',
1633 perlasm_scheme => "nasm",
1634 },
1635
1636#### UWIN
1637 "UWIN" => {
1638 inherit_from => [ "BASE_unix" ],
1639 CC => "cc",
1640 CFLAGS => "-O -Wall",
1641 lib_cppflags => "-DTERMIOS -DL_ENDIAN",
1642 sys_id => "UWIN",
1643 bn_ops => "BN_LLONG",
1644 dso_scheme => "win32",
1645 },
1646
1647#### Cygwin
1648 "Cygwin-common" => {
1649 inherit_from => [ "BASE_unix" ],
1650 template => 1,
1651
1652 CC => "gcc",
1653 CFLAGS => picker(default => "-Wall",
1654 debug => "-g -O0",
1655 release => "-O3"),
1656 lib_cppflags => "-DTERMIOS -DL_ENDIAN",
1657 sys_id => "CYGWIN",
1658 thread_scheme => "pthread",
1659 dso_scheme => "dlfcn",
1660 shared_target => "cygwin-shared",
1661 shared_cppflags => "-D_WINDLL",
1662
1663 perl_platform => 'Cygwin',
1664 },
1665 "Cygwin-x86" => {
1666 inherit_from => [ "Cygwin-common" ],
1667 CFLAGS => add(picker(release => "-O3 -fomit-frame-pointer")),
1668 bn_ops => "BN_LLONG",
1669 asm_arch => 'x86',
1670 perlasm_scheme => "coff",
1671 },
1672 "Cygwin-x86_64" => {
1673 inherit_from => [ "Cygwin-common" ],
1674 CC => "gcc",
1675 bn_ops => "SIXTY_FOUR_BIT_LONG",
1676 asm_arch => 'x86_64',
1677 perlasm_scheme => "mingw64",
1678 },
1679 # Backward compatibility for those using this target
1680 "Cygwin" => {
1681 inherit_from => [ "Cygwin-x86" ]
1682 },
1683 # In case someone constructs the Cygwin target name themself
1684 "Cygwin-i386" => {
1685 inherit_from => [ "Cygwin-x86" ]
1686 },
1687 "Cygwin-i486" => {
1688 inherit_from => [ "Cygwin-x86" ]
1689 },
1690 "Cygwin-i586" => {
1691 inherit_from => [ "Cygwin-x86" ]
1692 },
1693 "Cygwin-i686" => {
1694 inherit_from => [ "Cygwin-x86" ]
1695 },
1696
1697##### MacOS X (a.k.a. Darwin) setup
1698 "darwin-common" => {
1699 inherit_from => [ "BASE_unix" ],
1700 template => 1,
1701 CC => "cc",
1702 CFLAGS => picker(debug => "-g -O0",
1703 release => "-O3"),
1704 cppflags => threads("-D_REENTRANT"),
1705 lflags => add("-Wl,-search_paths_first"),
1706 sys_id => "MACOSX",
1707 bn_ops => "BN_LLONG RC4_CHAR",
1708 thread_scheme => "pthreads",
1709 perlasm_scheme => "osx32",
1710 dso_scheme => "dlfcn",
1711 ranlib => "ranlib -c",
1712 shared_target => "darwin-shared",
1713 shared_cflag => "-fPIC",
1714 shared_extension => ".\$(SHLIB_VERSION_NUMBER).dylib",
1715 },
1716 # Option "freeze" such as -std=gnu9x can't negatively interfere
1717 # with future defaults for below two targets, because MacOS X
1718 # for PPC has no future, it was discontinued by vendor in 2009.
1719 "darwin-ppc-cc" => { inherit_from => [ "darwin-ppc" ] }, # Historic alias
1720 "darwin-ppc" => {
1721 inherit_from => [ "darwin-common" ],
1722 cflags => add("-arch ppc -std=gnu9x -Wa,-force_cpusubtype_ALL"),
1723 lib_cppflags => add("-DB_ENDIAN"),
1724 shared_cflag => add("-fno-common"),
1725 asm_arch => 'ppc32',
1726 perlasm_scheme => "osx32",
1727 },
1728 "darwin64-ppc-cc" => { inherit_from => [ "darwin64-ppc" ] }, # Historic alias
1729 "darwin64-ppc" => {
1730 inherit_from => [ "darwin-common" ],
1731 cflags => add("-arch ppc64 -std=gnu9x"),
1732 lib_cppflags => add("-DB_ENDIAN"),
1733 bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
1734 asm_arch => 'ppc64',
1735 perlasm_scheme => "osx64",
1736 },
1737 "darwin-i386-cc" => { inherit_from => [ "darwin-i386" ] }, # Historic alias
1738 "darwin-i386" => {
1739 inherit_from => [ "darwin-common" ],
1740 CFLAGS => add(picker(release => "-fomit-frame-pointer")),
1741 cflags => add("-arch i386"),
1742 lib_cppflags => add("-DL_ENDIAN"),
1743 bn_ops => "BN_LLONG RC4_INT",
1744 asm_arch => 'x86',
1745 perlasm_scheme => "macosx",
1746 },
1747 "darwin64-x86_64-cc" => { inherit_from => [ "darwin64-x86_64" ] }, # Historic alias
1748 "darwin64-x86_64" => {
1749 inherit_from => [ "darwin-common" ],
1750 CFLAGS => add("-Wall"),
1751 cflags => add("-arch x86_64"),
1752 lib_cppflags => add("-DL_ENDIAN"),
1753 bn_ops => "SIXTY_FOUR_BIT_LONG",
1754 asm_arch => 'x86_64',
1755 perlasm_scheme => "macosx",
1756 },
1757 "darwin64-arm64-cc" => { inherit_from => [ "darwin64-arm64" ] }, # "Historic" alias
1758 "darwin64-arm64" => {
1759 inherit_from => [ "darwin-common" ],
1760 CFLAGS => add("-Wall"),
1761 cflags => add("-arch arm64"),
1762 lib_cppflags => add("-DL_ENDIAN"),
1763 bn_ops => "SIXTY_FOUR_BIT_LONG",
1764 asm_arch => 'aarch64',
1765 perlasm_scheme => "ios64",
1766 },
1767
1768##### GNU Hurd
1769 "hurd-x86" => {
1770 inherit_from => [ "BASE_unix" ],
1771 CC => "gcc",
1772 CFLAGS => "-O3 -fomit-frame-pointer -Wall",
1773 cflags => threads("-pthread"),
1774 lib_cppflags => "-DL_ENDIAN",
1775 ex_libs => add("-ldl", threads("-pthread")),
1776 bn_ops => "BN_LLONG",
1777 asm_arch => 'x86',
1778 perlasm_scheme => 'elf',
1779 thread_scheme => "pthreads",
1780 dso_scheme => "dlfcn",
1781 shared_target => "linux-shared",
1782 shared_cflag => "-fPIC",
1783 },
1784
1785##### VxWorks for various targets
1786 "vxworks-ppc60x" => {
1787 inherit_from => [ "BASE_unix" ],
1788 CC => "ccppc",
1789 CFLAGS => "-O2 -Wall -fstrength-reduce",
1790 cflags => "-mrtp -mhard-float -mstrict-align -fno-implicit-fp -fno-builtin -fno-strict-aliasing",
1791 cppflags => combine("-D_REENTRANT -DPPC32_fp60x -DCPU=PPC32",
1792 "_DTOOL_FAMILY=gnu -DTOOL=gnu",
1793 "-I\$(WIND_BASE)/target/usr/h",
1794 "-I\$(WIND_BASE)/target/usr/h/wrn/coreip"),
1795 sys_id => "VXWORKS",
1796 lflags => add("-L \$(WIND_BASE)/target/usr/lib/ppc/PPC32/common"),
1797 ex_libs => add("-Wl,--defsym,__wrs_rtp_base=0xe0000000"),
1798 },
1799 "vxworks-ppcgen" => {
1800 inherit_from => [ "BASE_unix" ],
1801 CC => "ccppc",
1802 CFLAGS => "-O1 -Wall",
1803 cflags => "-mrtp -msoft-float -mstrict-align -fno-builtin -fno-strict-aliasing",
1804 cppflags => combine("-D_REENTRANT -DPPC32 -DCPU=PPC32",
1805 "-DTOOL_FAMILY=gnu -DTOOL=gnu",
1806 "-I\$(WIND_BASE)/target/usr/h",
1807 "-I\$(WIND_BASE)/target/usr/h/wrn/coreip"),
1808 sys_id => "VXWORKS",
1809 lflags => add("-L \$(WIND_BASE)/target/usr/lib/ppc/PPC32/sfcommon"),
1810 ex_libs => add("-Wl,--defsym,__wrs_rtp_base=0xe0000000"),
1811 },
1812 "vxworks-ppc405" => {
1813 inherit_from => [ "BASE_unix" ],
1814 CC => "ccppc",
1815 CFLAGS => "-g",
1816 cflags => "-msoft-float -mlongcall",
1817 cppflags => combine("-D_REENTRANT -DPPC32 -DCPU=PPC405",
1818 "-DTOOL_FAMILY=gnu -DTOOL=gnu",
1819 "-I\$(WIND_BASE)/target/h"),
1820 sys_id => "VXWORKS",
1821 lflags => add("-r"),
1822 },
1823 "vxworks-ppc750" => {
1824 inherit_from => [ "BASE_unix" ],
1825 CC => "ccppc",
1826 CFLAGS => "-ansi -fvolatile -Wall \$(DEBUG_FLAG)",
1827 cflags => "-nostdinc -fno-builtin -fno-for-scope -fsigned-char -msoft-float -mlongcall",
1828 cppflags => combine("-DPPC750 -D_REENTRANT -DCPU=PPC604",
1829 "-I\$(WIND_BASE)/target/h"),
1830 sys_id => "VXWORKS",
1831 lflags => add("-r"),
1832 },
1833 "vxworks-ppc750-debug" => {
1834 inherit_from => [ "BASE_unix" ],
1835 CC => "ccppc",
1836 CFLAGS => "-ansi -fvolatile -Wall -g",
1837 cflags => "-nostdinc -fno-builtin -fno-for-scope -fsigned-char -msoft-float -mlongcall",
1838 cppflags => combine("-DPPC750 -D_REENTRANT -DCPU=PPC604",
1839 "-DPEDANTIC -DDEBUG",
1840 "-I\$(WIND_BASE)/target/h"),
1841 sys_id => "VXWORKS",
1842 lflags => add("-r"),
1843 },
1844 "vxworks-ppc860" => {
1845 inherit_from => [ "BASE_unix" ],
1846 CC => "ccppc",
1847 cflags => "-nostdinc -msoft-float",
1848 cppflags => combine("-DCPU=PPC860 -DNO_STRINGS_H",
1849 "-I\$(WIND_BASE)/target/h"),
1850 sys_id => "VXWORKS",
1851 lflags => add("-r"),
1852 },
1853 "vxworks-simlinux" => {
1854 inherit_from => [ "BASE_unix" ],
1855 CC => "ccpentium",
1856 cflags => "-B\$(WIND_BASE)/host/\$(WIND_HOST_TYPE)/lib/gcc-lib/ -fno-builtin -fno-defer-pop",
1857 cppflags => combine("-D_VSB_CONFIG_FILE=\"\$(WIND_BASE)/target/lib/h/config/vsbConfig.h\"",
1858 "-DL_ENDIAN -DCPU=SIMLINUX -DNO_STRINGS_H",
1859 "-DTOOL_FAMILY=gnu -DTOOL=gnu",
1860 "-DOPENSSL_NO_HW_PADLOCK",
1861 "-I\$(WIND_BASE)/target/h",
1862 "-I\$(WIND_BASE)/target/h/wrn/coreip"),
1863 sys_id => "VXWORKS",
1864 lflags => add("-r"),
1865 ranlib => "ranlibpentium",
1866 },
1867 "vxworks-mips" => {
1868 inherit_from => [ "BASE_unix" ],
1869 CC => "ccmips",
1870 CFLAGS => "-O -G 0",
1871 cflags => "-mrtp -mips2 -B\$(WIND_BASE)/host/\$(WIND_HOST_TYPE)/lib/gcc-lib/ -msoft-float -mno-branch-likely -fno-builtin -fno-defer-pop",
1872 cppflags => combine("-D_VSB_CONFIG_FILE=\"\$(WIND_BASE)/target/lib/h/config/vsbConfig.h\"",
1873 "-DCPU=MIPS32 -DNO_STRINGS_H",
1874 "-DTOOL_FAMILY=gnu -DTOOL=gnu",
1875 "-DOPENSSL_NO_HW_PADLOCK",
1876 threads("-D_REENTRANT"),
1877 "-I\$(WIND_BASE)/target/h",
1878 "-I\$(WIND_BASE)/target/h/wrn/coreip"),
1879 sys_id => "VXWORKS",
1880 lflags => add("-L \$(WIND_BASE)/target/usr/lib/mips/MIPSI32/sfcommon"),
1881 ex_libs => add("-Wl,--defsym,__wrs_rtp_base=0xe0000000"),
1882 thread_scheme => "pthreads",
1883 asm_arch => 'mips32',
1884 perlasm_scheme => "o32",
1885 ranlib => "ranlibmips",
1886 },
1887
1888#### uClinux
1889 "uClinux-dist" => {
1890 inherit_from => [ "BASE_unix" ],
1891 CC => sub { env('CC') },
1892 cppflags => threads("-D_REENTRANT"),
1893 ex_libs => add("\$(LDLIBS)"),
1894 bn_ops => "BN_LLONG",
1895 thread_scheme => "pthreads",
1896 dso_scheme => sub { env('LIBSSL_dlfcn') },
1897 shared_target => "linux-shared",
1898 shared_cflag => "-fPIC",
1899 ranlib => sub { env('RANLIB') },
1900 },
1901 "uClinux-dist64" => {
1902 inherit_from => [ "BASE_unix" ],
1903 CC => sub { env('CC') },
1904 cppflags => threads("-D_REENTRANT"),
1905 ex_libs => add("\$(LDLIBS)"),
1906 bn_ops => "SIXTY_FOUR_BIT_LONG",
1907 thread_scheme => "pthreads",
1908 dso_scheme => sub { env('LIBSSL_dlfcn') },
1909 shared_target => "linux-shared",
1910 shared_cflag => "-fPIC",
1911 ranlib => sub { env('RANLIB') },
1912 },
1913
1914 ##### VMS
1915 # Most things happen in vms-generic.
1916 # Note that vms_info extracts the pointer size from the end of
1917 # the target name, and will assume that anything matching /-p\d+$/
1918 # indicates the pointer size setting for the desired target.
1919 "vms-generic" => {
1920 inherit_from => [ "BASE_VMS" ],
1921 template => 1,
1922 CC => "CC/DECC",
1923 CPP => '$(CC)/PREPROCESS_ONLY=SYS$OUTPUT:',
1924 CFLAGS =>
1925 combine(picker(default => "/STANDARD=(ISOC94,RELAXED)/NOLIST/PREFIX=ALL",
1926 debug => "/NOOPTIMIZE/DEBUG",
1927 release => "/OPTIMIZE/NODEBUG"),
1928 sub { my @warnings =
1929 @{vms_info()->{disable_warns}};
1930 @warnings
1931 ? "/WARNINGS=DISABLE=(".join(",",@warnings).")" : (); }),
1932 cflag_incfirst => '/FIRST_INCLUDE=',
1933 lib_defines =>
1934 add("OPENSSL_USE_NODELETE",
1935 sub {
1936 return vms_info()->{def_zlib}
1937 ? "LIBZ=\"\"\"".vms_info()->{def_zlib}."\"\"\"" : ();
1938 }),
1939 lflags => picker(default => "/MAP='F\$PARSE(\".MAP\",\"\$\@\")'",
1940 debug => "/DEBUG/TRACEBACK",
1941 release => "/NODEBUG/NOTRACEBACK"),
1942 # Because of dso_cflags below, we can't set the generic |cflags| here,
1943 # as it can't be overridden, so we set separate C flags for libraries
1944 # and binaries instead.
1945 bin_cflags => add("/NAMES=(AS_IS,SHORTENED)/EXTERN_MODEL=STRICT_REFDEF"),
1946 lib_cflags => add("/NAMES=(AS_IS,SHORTENED)/EXTERN_MODEL=STRICT_REFDEF"),
1947 # Strictly speaking, DSOs should not need to have name shortening,
1948 # as all their exported symbols should be short enough to fit the
1949 # linker's 31 character per symbol name limit. However, providers
1950 # may be composed of more than one object file, and internal symbols
1951 # may and do surpass the 31 character limit.
1952 dso_cflags => add("/NAMES=(SHORTENED)"),
1953 ex_libs => add(sub { return vms_info()->{zlib} || (); }),
1954 shared_target => "vms-shared",
1955 # def_flag made to empty string so a .opt file gets generated
1956 shared_defflag => '',
1957 dso_scheme => "vms",
1958 thread_scheme => "pthreads",
1959
1960 makedep_scheme => 'VMS C',
1961 AS => sub { vms_info()->{AS} },
1962 ASFLAGS => sub { vms_info()->{ASFLAGS} },
1963 asoutflag => sub { vms_info()->{asoutflag} },
1964 asflags => sub { vms_info()->{asflags} },
1965 perlasm_scheme => sub { vms_info()->{perlasm_scheme} },
1966
1967 disable => add('pinshared', 'loadereng'),
1968
1969 },
1970
1971 # From HELP CC/POINTER_SIZE:
1972 #
1973 # ----------
1974 # LONG[=ARGV] The compiler assumes 64-bit pointers. If the ARGV option to
1975 # LONG or 64 is present, the main argument argv will be an
1976 # array of long pointers instead of an array of short pointers.
1977 #
1978 # 64[=ARGV] Same as LONG.
1979 # ----------
1980 #
1981 # We don't want the hassle of dealing with 32-bit pointers with argv, so
1982 # we force it to have 64-bit pointers, see the added cflags in the -p64
1983 # config targets below.
1984
1985 "vms-alpha" => {
1986 inherit_from => [ "vms-generic" ],
1987 bn_ops => "SIXTY_FOUR_BIT RC4_INT",
1988 pointer_size => "",
1989 },
1990 "vms-alpha-p32" => {
1991 inherit_from => [ "vms-alpha" ],
1992 cflags => add("/POINTER_SIZE=32"),
1993 pointer_size => "32",
1994 },
1995 "vms-alpha-p64" => {
1996 inherit_from => [ "vms-alpha" ],
1997 cflags => add("/POINTER_SIZE=64=ARGV"),
1998 pointer_size => "64",
1999 },
2000 "vms-ia64" => {
2001 inherit_from => [ "vms-generic" ],
2002 bn_ops => "SIXTY_FOUR_BIT RC4_INT",
2003 asm_arch => sub { vms_info()->{AS} ? 'ia64' : undef },
2004 perlasm_scheme => 'ias',
2005 pointer_size => "",
2006
2007 },
2008 "vms-ia64-p32" => {
2009 inherit_from => [ "vms-ia64" ],
2010 cflags => add("/POINTER_SIZE=32"),
2011 pointer_size => "32",
2012 },
2013 "vms-ia64-p64" => {
2014 inherit_from => [ "vms-ia64" ],
2015 cflags => add("/POINTER_SIZE=64=ARGV"),
2016 pointer_size => "64",
2017 },
2018 "vms-x86_64" => {
2019 inherit_from => [ "vms-generic" ],
2020 bn_ops => "SIXTY_FOUR_BIT",
2021 pointer_size => "",
2022 },
2023 "vms-x86_64-p32" => {
2024 inherit_from => [ "vms-x86_64" ],
2025 cflags => add("/POINTER_SIZE=32"),
2026 pointer_size => "32",
2027 },
2028 "vms-x86_64-p64" => {
2029 inherit_from => [ "vms-x86_64" ],
2030 cflags => add("/POINTER_SIZE=64=ARGV"),
2031 pointer_size => "64",
2032 }
2033);
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette