VirtualBox

source: vbox/trunk/src/libs/openssl-3.1.0/Configurations/10-main.conf@ 99366

最後變更 在這個檔案從99366是 99366,由 vboxsync 提交於 23 月 前

openssl-3.1.0: Applied and adjusted our OpenSSL changes to 3.0.7. bugref:10418

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

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