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