]> git.ipfire.org Git - thirdparty/openssl.git/blame - Configurations/10-main.conf
rename MIN() macro
[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
RL
241 release => "-O3 -fomit-frame-pointer")),
242 cflags => add(threads("-pthread")),
68b8bcf4 243 lib_cppflags => add("-DL_ENDIAN"),
fcd2ac80 244 ex_libs => add(threads("-pthread")),
a01dab94 245 bn_ops => "BN_LLONG",
5e1b2353 246 shared_cflag => "-fPIC",
82b6b084 247 shared_ldflag => add_before("-shared -static-libgcc"),
e6f98ae4
RL
248 asm_arch => 'x86',
249 perlasm_scheme => 'elf',
5e1b2353 250 },
5e1b2353 251 "solaris64-x86_64-gcc" => {
7ead0c89
AP
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:-)
e3713c36 259 # -- <appro@openssl.org>
7b97581b 260 inherit_from => [ "solaris-common-gcc" ],
abe256e7
RL
261 CC => "gcc",
262 CFLAGS => add_before(picker(default => "-Wall",
8864f0de 263 debug => "-O0 -g",
abe256e7
RL
264 release => "-O3")),
265 cflags => add_before("-m64", threads("-pthread")),
68b8bcf4 266 lib_cppflags => add("-DL_ENDIAN"),
fcd2ac80 267 ex_libs => add(threads("-pthread")),
3e9e810f 268 bn_ops => "SIXTY_FOUR_BIT_LONG",
e6f98ae4 269 asm_arch => 'x86_64',
5e1b2353 270 perlasm_scheme => "elf",
5e1b2353 271 shared_cflag => "-fPIC",
82b6b084 272 shared_ldflag => add_before("-shared -static-libgcc"),
5e1b2353
RL
273 multilib => "/64",
274 },
f09e7ca9
RS
275
276#### Solaris x86 with Sun C setups
216a0cc4
AP
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
79c44b4e 281 # resistant code, which is incompatible with security by today's
216a0cc4
AP
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 #
5e1b2353 289 "solaris64-x86_64-cc" => {
7b97581b 290 inherit_from => [ "solaris-common-cc" ],
abe256e7
RL
291 CC => "cc",
292 CFLAGS => add_before(picker(debug => "-g",
8c3bc594 293 release => "-xO5 -xdepend -xbuiltin")),
abe256e7 294 cflags => add_before("-xarch=generic64 -xstrconst -Xa"),
68b8bcf4
RL
295 cppflags => add(threads("-D_REENTRANT")),
296 lib_cppflags => add("-DL_ENDIAN"),
9c62a279 297 thread_scheme => "pthreads",
8dd0ff1c 298 lflags => add(threads("-mt")),
9c62a279 299 ex_libs => add(threads("-lpthread")),
3e9e810f 300 bn_ops => "SIXTY_FOUR_BIT_LONG",
e6f98ae4 301 asm_arch => 'x86_64',
5e1b2353 302 perlasm_scheme => "elf",
5e1b2353 303 shared_cflag => "-KPIC",
82b6b084 304 shared_ldflag => add_before("-G -dy -z text"),
5e1b2353
RL
305 multilib => "/64",
306 },
f09e7ca9
RS
307
308#### SPARC Solaris with GNU C setups
5e1b2353 309 "solaris-sparcv7-gcc" => {
7b97581b 310 inherit_from => [ "solaris-common-gcc" ],
abe256e7
RL
311 CC => "gcc",
312 CFLAGS => add_before(picker(default => "-Wall",
8864f0de 313 debug => "-O0 -g",
abe256e7
RL
314 release => "-O3")),
315 cflags => add(threads("-pthread")),
68b8bcf4 316 lib_cppflags => add("-DB_ENDIAN -DBN_DIV2W"),
fcd2ac80 317 ex_libs => add(threads("-pthread")),
3e9e810f 318 bn_ops => "BN_LLONG RC4_CHAR",
5e1b2353 319 shared_cflag => "-fPIC",
82b6b084 320 shared_ldflag => add_before("-shared"),
5e1b2353 321 },
5e1b2353 322 "solaris-sparcv8-gcc" => {
30478c97 323 inherit_from => [ "solaris-sparcv7-gcc" ],
bdcd83e1 324 cflags => add_before("-mcpu=v8"),
e6f98ae4
RL
325 asm_arch => 'sparcv8',
326 perlasm_scheme => 'void',
5e1b2353 327 },
5e1b2353 328 "solaris-sparcv9-gcc" => {
7ead0c89 329 # -m32 should be safe to add as long as driver recognizes
f6739c3d 330 # -mcpu=ultrasparc
30478c97 331 inherit_from => [ "solaris-sparcv7-gcc" ],
463a7b8c 332 cflags => add_before("-m32 -mcpu=ultrasparc"),
e6f98ae4
RL
333 asm_arch => 'sparcv9',
334 perlasm_scheme => 'void',
5e1b2353
RL
335 },
336 "solaris64-sparcv9-gcc" => {
7ead0c89 337 inherit_from => [ "solaris-sparcv9-gcc" ],
f6739c3d 338 cflags => sub { my $f=join(" ",@_); $f =~ s/\-m32/-m64/; $f; },
3e9e810f 339 bn_ops => "BN_LLONG RC4_CHAR",
5e1b2353
RL
340 multilib => "/64",
341 },
f09e7ca9
RS
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!
5e1b2353 347 "solaris-sparcv7-cc" => {
7b97581b 348 inherit_from => [ "solaris-common-cc" ],
abe256e7
RL
349 CC => "cc",
350 CFLAGS => add_before(picker(debug => "-g",
8c3bc594 351 release => "-xO5 -xdepend")),
abe256e7 352 cflags => add_before("-xstrconst -Xa"),
68b8bcf4
RL
353 cppflags => add(threads("-D_REENTRANT")),
354 lib_cppflags => add("-DB_ENDIAN -DBN_DIV2W"),
9c62a279
RL
355 lflags => add(threads("-mt")),
356 ex_libs => add(threads("-lpthread")),
3e9e810f 357 bn_ops => "BN_LLONG RC4_CHAR",
5e1b2353 358 shared_cflag => "-KPIC",
82b6b084 359 shared_ldflag => add_before("-G -dy -z text"),
5e1b2353 360 },
f09e7ca9 361####
5e1b2353 362 "solaris-sparcv8-cc" => {
30478c97 363 inherit_from => [ "solaris-sparcv7-cc" ],
bdcd83e1 364 cflags => add_before("-xarch=v8"),
e6f98ae4
RL
365 asm_arch => 'sparcv8',
366 perlasm_scheme => 'void',
5e1b2353
RL
367 },
368 "solaris-sparcv9-cc" => {
30478c97 369 inherit_from => [ "solaris-sparcv7-cc" ],
fa4618a2 370 cflags => add_before("-xarch=v8plus"),
e6f98ae4
RL
371 asm_arch => 'sparcv9',
372 perlasm_scheme => 'void',
5e1b2353
RL
373 },
374 "solaris64-sparcv9-cc" => {
30478c97 375 inherit_from => [ "solaris-sparcv7-cc" ],
691e2efa 376 cflags => add_before("-m64 -xarch=sparc"),
3e9e810f 377 bn_ops => "BN_LLONG RC4_CHAR",
e6f98ae4
RL
378 asm_arch => 'sparcv9',
379 perlasm_scheme => 'void',
5e1b2353
RL
380 multilib => "/64",
381 },
f09e7ca9 382
f09e7ca9 383#### IRIX 6.x configs
c21c7830 384# Only N32 and N64 ABIs are supported.
1b712f3f
AP
385 "irix-common" => {
386 inherit_from => [ "BASE_unix" ],
387 template => 1,
388 cppflags => threads("-D_SGI_MP_SOURCE"),
b34446cc 389 lib_cppflags => "-DB_ENDIAN",
1b712f3f
AP
390 ex_libs => add(threads("-lpthread")),
391 thread_scheme => "pthreads",
392 dso_scheme => "dlfcn",
393 shared_target => "self",
1b712f3f
AP
394 shared_ldflag => "-shared -Wl,-Bsymbolic",
395 shared_sonameflag=> "-Wl,-soname,",
396 },
5e1b2353 397 "irix-mips3-gcc" => {
30478c97 398 inherit_from => [ "irix-common" ],
abe256e7
RL
399 CC => "gcc",
400 CFLAGS => picker(debug => "-g -O0",
401 release => "-O3"),
1b712f3f 402 LDFLAGS => "-static-libgcc",
abe256e7 403 cflags => "-mabi=n32",
3e9e810f 404 bn_ops => "RC4_CHAR SIXTY_FOUR_BIT",
e6f98ae4 405 asm_arch => 'mips64',
5e1b2353 406 perlasm_scheme => "n32",
5e1b2353
RL
407 multilib => "32",
408 },
409 "irix-mips3-cc" => {
30478c97 410 inherit_from => [ "irix-common" ],
abe256e7
RL
411 CC => "cc",
412 CFLAGS => picker(debug => "-g -O0",
413 release => "-O2"),
414 cflags => "-n32 -mips3 -use_readonly_const -G0 -rdata_shared",
3e9e810f 415 bn_ops => "RC4_CHAR SIXTY_FOUR_BIT",
e6f98ae4 416 asm_arch => 'mips64',
5e1b2353 417 perlasm_scheme => "n32",
5e1b2353
RL
418 multilib => "32",
419 },
7ead0c89 420 # N64 ABI builds.
5e1b2353 421 "irix64-mips4-gcc" => {
30478c97 422 inherit_from => [ "irix-common" ],
abe256e7
RL
423 CC => "gcc",
424 CFLAGS => picker(debug => "-g -O0",
425 release => "-O3"),
1b712f3f 426 LDFLAGS => "-static-libgcc",
abe256e7 427 cflags => "-mabi=64 -mips4",
3e9e810f 428 bn_ops => "RC4_CHAR SIXTY_FOUR_BIT_LONG",
e6f98ae4 429 asm_arch => 'mips64',
5e1b2353 430 perlasm_scheme => "64",
5e1b2353
RL
431 multilib => "64",
432 },
433 "irix64-mips4-cc" => {
30478c97 434 inherit_from => [ "irix-common" ],
abe256e7
RL
435 CC => "cc",
436 CFLAGS => picker(debug => "-g -O0",
437 release => "-O2"),
abe256e7 438 cflags => "-64 -mips4 -use_readonly_const -G0 -rdata_shared",
3e9e810f 439 bn_ops => "RC4_CHAR SIXTY_FOUR_BIT_LONG",
e6f98ae4 440 asm_arch => 'mips64',
5e1b2353 441 perlasm_scheme => "64",
5e1b2353
RL
442 multilib => "64",
443 },
f09e7ca9
RS
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.
b6453a68 460# If the toolkit is meant to be used on various PA-RISC processors
7ead0c89 461# consider './Configure hpux-parisc-[g]cc +DAportable'.
f09e7ca9
RS
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
706457b7 466# crypto/sha/sha_local.h.
7ead0c89 467# - originally there were 32-bit hpux-parisc2-* targets. They were
b6453a68 468# scrapped, because a) they were not interchangeable with other 32-bit
0b919cc5
AP
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.
3c3badcf
AP
472 "hpux-common" => {
473 inherit_from => [ "BASE_unix" ],
6e301900
AP
474 template => 1,
475 defines => add("_XOPEN_SOURCE", "_XOPEN_SOURCE_EXTENDED",
476 "_HPUX_ALT_XOPEN_SOCKET_API"),
3c3badcf
AP
477 lib_cppflags => "-DB_ENDIAN",
478 thread_scheme => "pthreads",
479 dso_scheme => "dlfcn", # overridden in 32-bit PA-RISC builds
0ef40b76
AP
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,",
6e301900 484 },
5e1b2353 485 "hpux-parisc-gcc" => {
3c3badcf 486 inherit_from => [ "hpux-common" ],
abe256e7
RL
487 CC => "gcc",
488 CFLAGS => picker(debug => "-O0 -g",
489 release => "-O3"),
490 cflags => add(threads("-pthread")),
3c3badcf 491 lib_cppflags => add("-DBN_DIV2W"),
6e301900 492 ex_libs => add("-ldld", threads("-pthread")),
3c3badcf 493 bn_ops => "BN_LLONG RC4_CHAR",
5e1b2353 494 dso_scheme => "dl",
5e1b2353 495 shared_cflag => "-fPIC",
0ef40b76 496 shared_ldflag => add_before("-shared"),
d4453024 497 shared_extension => ".sl.\$(SHLIB_VERSION_NUMBER)",
5e1b2353
RL
498 },
499 "hpux-parisc1_1-gcc" => {
30478c97 500 inherit_from => [ "hpux-parisc-gcc" ],
e6f98ae4
RL
501 asm_arch => 'parisc11',
502 perlasm_scheme => "32",
5e1b2353
RL
503 multilib => "/pa1.1",
504 },
5e1b2353 505 "hpux64-parisc2-gcc" => {
30478c97 506 inherit_from => [ "hpux-common" ],
abe256e7
RL
507 CC => "gcc",
508 CFLAGS => combine(picker(debug => "-O0 -g",
8c3bc594 509 release => "-O3")),
6e301900 510 cflags => add(threads("-pthread")),
6e301900 511 ex_libs => add("-ldl", threads("-pthread")),
3e9e810f 512 bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
e6f98ae4
RL
513 asm_arch => 'parisc20_64',
514 perlasm_scheme => "64",
5e1b2353 515 shared_cflag => "-fpic",
0ef40b76 516 shared_ldflag => add_before("-shared"),
d4453024 517 shared_extension => ".sl.\$(SHLIB_VERSION_NUMBER)",
5e1b2353
RL
518 multilib => "/pa20_64",
519 },
f09e7ca9 520
7ead0c89 521 # More attempts at unified 10.X and 11.X targets for HP C compiler.
5e1b2353 522 "hpux-parisc-cc" => {
3c3badcf 523 inherit_from => [ "hpux-common" ],
abe256e7
RL
524 CC => "cc",
525 CFLAGS => picker(debug => "+O0 +d -g",
526 release => "+O3"),
527 cflags => "+Optrs_strongly_typed -Ae +ESlit",
68b8bcf4 528 cppflags => threads("-D_REENTRANT"),
3c3badcf 529 lib_cppflags => add("-DBN_DIV2W -DMD32_XARRAY"),
6e301900 530 ex_libs => add("-ldld", threads("-lpthread")),
3e9e810f 531 bn_ops => "RC4_CHAR",
5e1b2353 532 dso_scheme => "dl",
5e1b2353 533 shared_cflag => "+Z",
0ef40b76 534 shared_ldflag => add_before("-b"),
d4453024 535 shared_extension => ".sl.\$(SHLIB_VERSION_NUMBER)",
5e1b2353
RL
536 },
537 "hpux-parisc1_1-cc" => {
30478c97 538 inherit_from => [ "hpux-parisc-cc" ],
bdcd83e1 539 cflags => add_before("+DA1.1"),
e6f98ae4
RL
540 asm_arch => 'parisc11',
541 perlasm_scheme => "32",
5e1b2353
RL
542 multilib => "/pa1.1",
543 },
5e1b2353 544 "hpux64-parisc2-cc" => {
30478c97 545 inherit_from => [ "hpux-common" ],
abe256e7
RL
546 CC => "cc",
547 CFLAGS => picker(debug => "+O0 +d -g",
548 release => "+O3") ,
549 cflags => "+DD64 +Optrs_strongly_typed -Ae +ESlit",
68b8bcf4 550 cppflags => threads("-D_REENTRANT") ,
3c3badcf 551 lib_cppflags => add("-DMD32_XARRAY"),
6e301900 552 ex_libs => add("-ldl", threads("-lpthread")),
3e9e810f 553 bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
e6f98ae4
RL
554 asm_arch => 'parisc20_64',
555 perlasm_scheme => "64",
5e1b2353 556 shared_cflag => "+Z",
0ef40b76 557 shared_ldflag => add_before("-b"),
d4453024 558 shared_extension => ".sl.\$(SHLIB_VERSION_NUMBER)",
5e1b2353
RL
559 multilib => "/pa20_64",
560 },
f09e7ca9 561
7ead0c89 562 # HP/UX IA-64 targets
5e1b2353 563 "hpux-ia64-cc" => {
30478c97 564 inherit_from => [ "hpux-common" ],
abe256e7
RL
565 CC => "cc",
566 CFLAGS => picker(debug => "+O0 +d -g",
567 release => "+O2"),
568 cflags => "-Ae +DD32 +Olit=all -z",
68b8bcf4 569 cppflags => add(threads("-D_REENTRANT")),
6e301900 570 ex_libs => add("-ldl", threads("-lpthread")),
3e9e810f 571 bn_ops => "SIXTY_FOUR_BIT",
e6f98ae4
RL
572 asm_arch => 'ia64',
573 perlasm_scheme => 'void',
5e1b2353 574 shared_cflag => "+Z",
0ef40b76 575 shared_ldflag => add_before("-b"),
5e1b2353
RL
576 multilib => "/hpux32",
577 },
5e1b2353 578 "hpux64-ia64-cc" => {
30478c97 579 inherit_from => [ "hpux-common" ],
abe256e7
RL
580 CC => "cc",
581 CFLAGS => picker(debug => "+O0 +d -g",
582 release => "+O3"),
583 cflags => "-Ae +DD64 +Olit=all -z",
68b8bcf4 584 cppflags => threads("-D_REENTRANT"),
9c62a279 585 ex_libs => add("-ldl", threads("-lpthread")),
3e9e810f 586 bn_ops => "SIXTY_FOUR_BIT_LONG",
e6f98ae4
RL
587 asm_arch => 'ia64',
588 perlasm_scheme => 'void',
5e1b2353 589 shared_cflag => "+Z",
0ef40b76 590 shared_ldflag => add_before("-b"),
5e1b2353
RL
591 multilib => "/hpux64",
592 },
7ead0c89 593 # GCC builds...
5e1b2353 594 "hpux-ia64-gcc" => {
30478c97 595 inherit_from => [ "hpux-common" ],
abe256e7
RL
596 CC => "gcc",
597 CFLAGS => picker(debug => "-O0 -g",
598 release => "-O3"),
599 cflags => add(threads("-pthread")),
fcd2ac80 600 ex_libs => add("-ldl", threads("-pthread")),
3e9e810f 601 bn_ops => "SIXTY_FOUR_BIT",
e6f98ae4
RL
602 asm_arch => 'ia64',
603 perlasm_scheme => 'void',
5e1b2353 604 shared_cflag => "-fpic",
0ef40b76 605 shared_ldflag => add_before("-shared"),
5e1b2353
RL
606 multilib => "/hpux32",
607 },
608 "hpux64-ia64-gcc" => {
30478c97 609 inherit_from => [ "hpux-common" ],
abe256e7
RL
610 CC => "gcc",
611 CFLAGS => picker(debug => "-O0 -g",
612 release => "-O3"),
613 cflags => combine("-mlp64", threads("-pthread")),
fcd2ac80 614 ex_libs => add("-ldl", threads("-pthread")),
3e9e810f 615 bn_ops => "SIXTY_FOUR_BIT_LONG",
e6f98ae4
RL
616 asm_arch => 'ia64',
617 perlasm_scheme => 'void',
5e1b2353 618 shared_cflag => "-fpic",
0ef40b76 619 shared_ldflag => add_before("-shared"),
5e1b2353
RL
620 multilib => "/hpux64",
621 },
f09e7ca9 622
f09e7ca9 623#### HP MPE/iX http://jazz.external.hp.com/src/openssl/
5e1b2353 624 "MPE/iX-gcc" => {
d2b2221a 625 inherit_from => [ "BASE_unix" ],
abe256e7
RL
626 CC => "gcc",
627 CFLAGS => "-O3",
68b8bcf4
RL
628 cppflags => "-D_POSIX_SOURCE -D_SOCKET_SOURCE",
629 includes => [ "/SYSLOG/PUB" ],
630 lib_cppflags => "-DBN_DIV2W",
5e1b2353 631 sys_id => "MPE",
47eeaf45
RL
632 lflags => add("-L/SYSLOG/PUB"),
633 ex_libs => add("-lsyslog -lsocket -lcurses"),
9c62a279 634 thread_scheme => "(unknown)",
3e9e810f 635 bn_ops => "BN_LLONG",
5e1b2353 636 },
f09e7ca9 637
b4de72bf
AP
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" => {
30478c97 643 inherit_from => [ "BASE_unix" ],
abe256e7
RL
644 CC => "gcc",
645 CFLAGS => "-O3",
646 cflags => add("-std=c9x", threads("-pthread")),
8c3bc594 647 cppflags => "-D_XOPEN_SOURCE=500 -D_OSF_SOURCE",
fcd2ac80 648 ex_libs => add("-lrt", threads("-pthread")), # for mlock(2)
3e9e810f 649 bn_ops => "SIXTY_FOUR_BIT_LONG",
e6f98ae4
RL
650 asm_arch => 'alpha',
651 perlasm_scheme => "void",
b4de72bf 652 thread_scheme => "pthreads",
5e1b2353
RL
653 dso_scheme => "dlfcn",
654 shared_target => "alpha-osf1-shared",
655 shared_extension => ".so",
656 },
657 "tru64-alpha-cc" => {
30478c97 658 inherit_from => [ "BASE_unix" ],
abe256e7
RL
659 CC => "cc",
660 CFLAGS => "-tune host -fast",
661 cflags => add("-std1 -readonly_strings",
662 threads("-pthread")),
8c3bc594 663 cppflags => "-D_XOPEN_SOURCE=500 -D_OSF_SOURCE",
fcd2ac80 664 ex_libs => add("-lrt", threads("-pthread")), # for mlock(2)
3e9e810f 665 bn_ops => "SIXTY_FOUR_BIT_LONG",
e6f98ae4
RL
666 asm_arch => 'alpha',
667 perlasm_scheme => "void",
9c62a279 668 thread_scheme => "pthreads",
5e1b2353
RL
669 dso_scheme => "dlfcn",
670 shared_target => "alpha-osf1-shared",
671 shared_ldflag => "-msym",
672 shared_extension => ".so",
673 },
f09e7ca9
RS
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...
cdf2986a 680 "linux-generic32" => {
d2b2221a 681 inherit_from => [ "BASE_unix" ],
abe256e7
RL
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")),
68b8bcf4 692 lib_cppflags => "-DOPENSSL_USE_NODELETE",
fcd2ac80 693 ex_libs => add("-ldl", threads("-pthread")),
3e9e810f 694 bn_ops => "BN_LLONG RC4_CHAR",
9c62a279 695 thread_scheme => "pthreads",
5e1b2353
RL
696 dso_scheme => "dlfcn",
697 shared_target => "linux-shared",
8c3bc594 698 shared_cflag => "-fPIC",
41999e7d 699 shared_ldflag => sub { $disabled{pinshared} ? () : "-Wl,-znodelete" },
9e381e8a 700 enable => [ "afalgeng" ],
5e1b2353 701 },
cdf2986a
TM
702 "linux-latomic" => {
703 inherit_from => [ "linux-generic32" ],
535130c3 704 ex_libs => add(threads("-latomic")),
535130c3 705 },
7ead0c89 706 "linux-generic64" => {
cdf2986a 707 inherit_from => [ "linux-generic32" ],
3e9e810f 708 bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
7ead0c89
AP
709 },
710
5e1b2353 711 "linux-ppc" => {
cdf2986a 712 inherit_from => [ "linux-latomic" ],
e6f98ae4 713 asm_arch => 'ppc32',
5e1b2353 714 perlasm_scheme => "linux32",
52c6c12c 715 lib_cppflags => add("-DB_ENDIAN"),
7ead0c89
AP
716 },
717 "linux-ppc64" => {
30478c97 718 inherit_from => [ "linux-generic64" ],
8c3bc594 719 cflags => add("-m64"),
72d7f221 720 cxxflags => add("-m64"),
68b8bcf4 721 lib_cppflags => add("-DB_ENDIAN"),
e6f98ae4 722 asm_arch => 'ppc64',
7ead0c89 723 perlasm_scheme => "linux64",
7ead0c89
AP
724 multilib => "64",
725 },
726 "linux-ppc64le" => {
30478c97 727 inherit_from => [ "linux-generic64" ],
8c3bc594 728 cflags => add("-m64"),
72d7f221 729 cxxflags => add("-m64"),
68b8bcf4 730 lib_cppflags => add("-DL_ENDIAN"),
e6f98ae4 731 asm_arch => 'ppc64',
7ead0c89 732 perlasm_scheme => "linux64le",
5e1b2353 733 },
f09e7ca9 734
5e1b2353 735 "linux-armv4" => {
7ead0c89
AP
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 #
cdf2986a 767 inherit_from => [ "linux-latomic" ],
e6f98ae4 768 asm_arch => 'armv4',
7ead0c89 769 perlasm_scheme => "linux32",
5e1b2353
RL
770 },
771 "linux-aarch64" => {
30478c97 772 inherit_from => [ "linux-generic64" ],
e6f98ae4 773 asm_arch => 'aarch64',
5e1b2353 774 perlasm_scheme => "linux64",
5e1b2353 775 },
a93d3e06 776 "linux-arm64ilp32" => { # https://wiki.linaro.org/Platform/arm64-ilp32
30478c97 777 inherit_from => [ "linux-generic32" ],
8864f0de 778 cflags => add("-mabi=ilp32"),
72d7f221 779 cxxflags => add("-mabi=ilp32"),
3e9e810f 780 bn_ops => "SIXTY_FOUR_BIT RC4_CHAR",
e6f98ae4 781 asm_arch => 'aarch64',
a93d3e06 782 perlasm_scheme => "linux64",
a93d3e06 783 },
7ead0c89 784
5e1b2353 785 "linux-mips32" => {
7ead0c89
AP
786 # Configure script adds minimally required -march for assembly
787 # support, if no -march was specified at command line.
cdf2986a 788 inherit_from => [ "linux-latomic" ],
8c3bc594 789 cflags => add("-mabi=32"),
72d7f221 790 cxxflags => add("-mabi=32"),
e6f98ae4 791 asm_arch => 'mips32',
5e1b2353 792 perlasm_scheme => "o32",
5e1b2353 793 },
7ead0c89
AP
794 # mips32 and mips64 below refer to contemporary MIPS Architecture
795 # specifications, MIPS32 and MIPS64, rather than to kernel bitness.
5e1b2353 796 "linux-mips64" => {
cdf2986a 797 inherit_from => [ "linux-latomic" ],
8c3bc594 798 cflags => add("-mabi=n32"),
72d7f221 799 cxxflags => add("-mabi=n32"),
76899264 800 bn_ops => "RC4_CHAR",
e6f98ae4 801 asm_arch => 'mips64',
5e1b2353 802 perlasm_scheme => "n32",
5e1b2353
RL
803 multilib => "32",
804 },
805 "linux64-mips64" => {
30478c97 806 inherit_from => [ "linux-generic64" ],
8c3bc594 807 cflags => add("-mabi=64"),
72d7f221 808 cxxflags => add("-mabi=64"),
e6f98ae4 809 asm_arch => 'mips64',
5e1b2353 810 perlasm_scheme => "64",
5e1b2353
RL
811 multilib => "64",
812 },
7ead0c89 813
c2955424 814 # riscv64 below refers to contemporary RISCV Architecture
815 # specifications,
816 "linux64-riscv64" => {
817 inherit_from => [ "linux-generic64"],
818 perlasm_scheme => "linux64",
819 },
820
7ead0c89 821 #### IA-32 targets...
7fbc0bfd
RL
822 #### These two targets are a bit aged and are to be used on older Linux
823 #### machines where gcc doesn't understand -m32 and -m64
5e1b2353 824 "linux-elf" => {
30478c97 825 inherit_from => [ "linux-generic32" ],
abe256e7 826 CFLAGS => add(picker(release => "-fomit-frame-pointer")),
68b8bcf4 827 lib_cppflags => add("-DL_ENDIAN"),
a01dab94 828 bn_ops => "BN_LLONG",
e6f98ae4
RL
829 asm_arch => 'x86',
830 perlasm_scheme => "elf",
5e1b2353
RL
831 },
832 "linux-aout" => {
30478c97 833 inherit_from => [ "BASE_unix" ],
abe256e7
RL
834 CC => "gcc",
835 CFLAGS => add(picker(default => "-Wall",
8864f0de
RL
836 debug => "-O0 -g",
837 release => "-O3 -fomit-frame-pointer")),
68b8bcf4 838 lib_cppflags => add("-DL_ENDIAN"),
a01dab94 839 bn_ops => "BN_LLONG",
9c62a279 840 thread_scheme => "(unknown)",
e6f98ae4 841 asm_arch => 'x86',
5e1b2353
RL
842 perlasm_scheme => "a.out",
843 },
7ead0c89 844
7fbc0bfd
RL
845 #### X86 / X86_64 targets
846 "linux-x86" => {
30478c97 847 inherit_from => [ "linux-generic32" ],
abe256e7
RL
848 CFLAGS => add(picker(release => "-fomit-frame-pointer")),
849 cflags => add("-m32"),
72d7f221 850 cxxflags => add("-m32"),
68b8bcf4 851 lib_cppflags => add("-DL_ENDIAN"),
7fbc0bfd 852 bn_ops => "BN_LLONG",
e6f98ae4 853 asm_arch => 'x86',
7fbc0bfd 854 perlasm_scheme => "elf",
7fbc0bfd
RL
855 },
856 "linux-x86-clang" => {
857 inherit_from => [ "linux-x86" ],
abe256e7
RL
858 CC => "clang",
859 CXX => "clang++",
7ea01f52 860 ex_libs => add(threads("-latomic")),
7fbc0bfd 861 },
5e1b2353 862 "linux-x86_64" => {
30478c97 863 inherit_from => [ "linux-generic64" ],
8c3bc594 864 cflags => add("-m64"),
72d7f221 865 cxxflags => add("-m64"),
68b8bcf4 866 lib_cppflags => add("-DL_ENDIAN"),
3e9e810f 867 bn_ops => "SIXTY_FOUR_BIT_LONG",
e6f98ae4 868 asm_arch => 'x86_64',
5e1b2353 869 perlasm_scheme => "elf",
5e1b2353
RL
870 multilib => "64",
871 },
7ead0c89
AP
872 "linux-x86_64-clang" => {
873 inherit_from => [ "linux-x86_64" ],
abe256e7
RL
874 CC => "clang",
875 CXX => "clang++",
7ead0c89 876 },
5e1b2353 877 "linux-x32" => {
30478c97 878 inherit_from => [ "linux-generic32" ],
8c3bc594 879 cflags => add("-mx32"),
72d7f221 880 cxxflags => add("-mx32"),
68b8bcf4 881 lib_cppflags => add("-DL_ENDIAN"),
3e9e810f 882 bn_ops => "SIXTY_FOUR_BIT",
e6f98ae4 883 asm_arch => 'x86_64',
2460c7f1 884 perlasm_scheme => "elf32",
5e1b2353
RL
885 multilib => "x32",
886 },
7ead0c89
AP
887
888 "linux-ia64" => {
30478c97 889 inherit_from => [ "linux-generic64" ],
3e9e810f 890 bn_ops => "SIXTY_FOUR_BIT_LONG",
e6f98ae4
RL
891 asm_arch => 'ia64',
892 perlasm_scheme => 'void',
7ead0c89
AP
893 },
894
5e1b2353 895 "linux64-s390x" => {
30478c97 896 inherit_from => [ "linux-generic64" ],
8c3bc594 897 cflags => add("-m64"),
72d7f221 898 cxxflags => add("-m64"),
68b8bcf4 899 lib_cppflags => add("-DB_ENDIAN"),
e6f98ae4 900 asm_arch => 's390x',
5e1b2353 901 perlasm_scheme => "64",
5e1b2353
RL
902 multilib => "64",
903 },
5e1b2353 904 "linux32-s390x" => {
7ead0c89
AP
905 #### So called "highgprs" target for z/Architecture CPUs
906 # "Highgprs" is kernel feature first implemented in Linux
907 # 2.6.32, see /proc/cpuinfo. The idea is to preserve most
908 # significant bits of general purpose registers not only
909 # upon 32-bit process context switch, but even on
910 # asynchronous signal delivery to such process. This makes
911 # it possible to deploy 64-bit instructions even in legacy
912 # application context and achieve better [or should we say
913 # adequate] performance. The build is binary compatible with
914 # linux-generic32, and the idea is to be able to install the
915 # resulting libcrypto.so alongside generic one, e.g. as
916 # /lib/highgprs/libcrypto.so.x.y, for ldconfig and run-time
917 # linker to autodiscover. Unfortunately it doesn't work just
918 # yet, because of couple of bugs in glibc
919 # sysdeps/s390/dl-procinfo.c affecting ldconfig and ld.so.1...
920 #
30478c97 921 inherit_from => [ "linux-generic32" ],
8c3bc594 922 cflags => add("-m31 -Wa,-mzarch"),
72d7f221 923 cxxflags => add("-m31 -Wa,-mzarch"),
68b8bcf4 924 lib_cppflags => add("-DB_ENDIAN"),
e6f98ae4 925 asm_arch => 's390x',
5e1b2353 926 perlasm_scheme => "31",
5e1b2353
RL
927 multilib => "/highgprs",
928 },
7ead0c89
AP
929
930 #### SPARC Linux setups
5e1b2353 931 "linux-sparcv8" => {
cdf2986a 932 inherit_from => [ "linux-latomic" ],
8c3bc594 933 cflags => add("-mcpu=v8"),
72d7f221 934 cxxflags => add("-mcpu=v8"),
abe256e7 935 lib_cppflags => add("-DB_ENDIAN -DBN_DIV2W"),
e6f98ae4
RL
936 asm_arch => 'sparcv8',
937 perlasm_scheme => 'void',
5e1b2353 938 },
5e1b2353 939 "linux-sparcv9" => {
7ead0c89
AP
940 # it's a real mess with -mcpu=ultrasparc option under Linux,
941 # but -Wa,-Av8plus should do the trick no matter what.
cdf2986a 942 inherit_from => [ "linux-latomic" ],
8c3bc594 943 cflags => add("-m32 -mcpu=ultrasparc -Wa,-Av8plus"),
72d7f221 944 cxxflags => add("-m32 -mcpu=ultrasparc -Wa,-Av8plus"),
abe256e7 945 lib_cppflags => add("-DB_ENDIAN -DBN_DIV2W"),
e6f98ae4
RL
946 asm_arch => 'sparcv9',
947 perlasm_scheme => 'void',
5e1b2353 948 },
5e1b2353 949 "linux64-sparcv9" => {
7ead0c89 950 # GCC 3.1 is a requirement
30478c97 951 inherit_from => [ "linux-generic64" ],
8c3bc594 952 cflags => add("-m64 -mcpu=ultrasparc"),
72d7f221 953 cxxflags => add("-m64 -mcpu=ultrasparc"),
abe256e7 954 lib_cppflags => add("-DB_ENDIAN"),
535130c3 955 ex_libs => add(threads("-latomic")),
3e9e810f 956 bn_ops => "BN_LLONG RC4_CHAR",
e6f98ae4
RL
957 asm_arch => 'sparcv9',
958 perlasm_scheme => 'void',
5e1b2353
RL
959 multilib => "64",
960 },
7ead0c89 961
5e1b2353 962 "linux-alpha-gcc" => {
30478c97 963 inherit_from => [ "linux-generic64" ],
abe256e7 964 lib_cppflags => add("-DL_ENDIAN"),
3e9e810f 965 bn_ops => "SIXTY_FOUR_BIT_LONG",
e6f98ae4
RL
966 asm_arch => 'alpha',
967 perlasm_scheme => "void",
5e1b2353 968 },
5e1b2353 969 "linux-c64xplus" => {
d2b2221a 970 inherit_from => [ "BASE_unix" ],
7ead0c89 971 # TI_CGT_C6000_7.3.x is a requirement
abe256e7
RL
972 CC => "cl6x",
973 CFLAGS => "-o2 -ox -ms",
974 cflags => "--linux -ea=.s -eo=.o -mv6400+ -pden",
72d7f221 975 cxxflags => "--linux -ea=.s -eo=.o -mv6400+ -pden",
8c3bc594 976 cppflags => combine("-DOPENSSL_SMALL_FOOTPRINT",
9c62a279 977 threads("-D_REENTRANT")),
5e1b2353 978 bn_ops => "BN_LLONG",
9c62a279 979 thread_scheme => "pthreads",
e6f98ae4 980 asm_arch => 'c64xplus',
5e1b2353
RL
981 perlasm_scheme => "void",
982 dso_scheme => "dlfcn",
983 shared_target => "linux-shared",
984 shared_cflag => "--pic",
b6d5ba1a 985 shared_ldflag => add("-z --sysv --shared"),
5e1b2353
RL
986 ranlib => "true",
987 },
f09e7ca9 988
1818572d 989#### *BSD
5e1b2353 990 "BSD-generic32" => {
9c62a279 991 # As for thread cflag. Idea is to maintain "collective" set of
1818572d
AP
992 # flags, which would cover all BSD flavors. -pthread applies
993 # to them all, but is treated differently. OpenBSD expands is
994 # as -D_POSIX_THREAD -lc_r, which is sufficient. FreeBSD 4.x
995 # expands it as -lc_r, which has to be accompanied by explicit
996 # -D_THREAD_SAFE and sometimes -D_REENTRANT. FreeBSD 5.x
997 # expands it as -lc_r, which seems to be sufficient?
d2b2221a 998 inherit_from => [ "BASE_unix" ],
abe256e7
RL
999 CC => "cc",
1000 CFLAGS => picker(default => "-Wall",
1001 debug => "-O0 -g",
1002 release => "-O3"),
1003 cflags => threads("-pthread"),
8c3bc594 1004 cppflags => threads("-D_THREAD_SAFE -D_REENTRANT"),
fcd2ac80 1005 ex_libs => add(threads("-pthread")),
619eb33a 1006 enable => add("devcryptoeng"),
3e9e810f 1007 bn_ops => "BN_LLONG",
9c62a279 1008 thread_scheme => "pthreads",
5e1b2353
RL
1009 dso_scheme => "dlfcn",
1010 shared_target => "bsd-gcc-shared",
1011 shared_cflag => "-fPIC",
5e1b2353 1012 },
7ead0c89
AP
1013 "BSD-generic64" => {
1014 inherit_from => [ "BSD-generic32" ],
3e9e810f 1015 bn_ops => "SIXTY_FOUR_BIT_LONG",
5e1b2353 1016 },
7ead0c89
AP
1017
1018 "BSD-x86" => {
30478c97 1019 inherit_from => [ "BSD-generic32" ],
abe256e7 1020 CFLAGS => add(picker(release => "-fomit-frame-pointer")),
68b8bcf4 1021 lib_cppflags => add("-DL_ENDIAN"),
a01dab94 1022 bn_ops => "BN_LLONG",
e6f98ae4 1023 asm_arch => 'x86',
7ead0c89 1024 perlasm_scheme => "a.out",
5e1b2353 1025 },
7ead0c89
AP
1026 "BSD-x86-elf" => {
1027 inherit_from => [ "BSD-x86" ],
1028 perlasm_scheme => "elf",
5e1b2353 1029 },
f09e7ca9 1030
7ead0c89 1031 "BSD-sparcv8" => {
30478c97 1032 inherit_from => [ "BSD-generic32" ],
8c3bc594 1033 cflags => add("-mcpu=v8"),
68b8bcf4 1034 lib_cppflags => add("-DB_ENDIAN"),
e6f98ae4
RL
1035 asm_arch => 'sparcv8',
1036 perlasm_scheme => 'void',
5e1b2353 1037 },
5e1b2353 1038 "BSD-sparc64" => {
7ead0c89
AP
1039 # -DMD32_REG_T=int doesn't actually belong in sparc64 target, it
1040 # simply *happens* to work around a compiler bug in gcc 3.3.3,
1041 # triggered by RIPEMD160 code.
30478c97 1042 inherit_from => [ "BSD-generic64" ],
68b8bcf4 1043 lib_cppflags => add("-DB_ENDIAN -DMD32_REG_T=int"),
3e9e810f 1044 bn_ops => "BN_LLONG",
e6f98ae4
RL
1045 asm_arch => 'sparcv9',
1046 perlasm_scheme => 'void',
5e1b2353 1047 },
7ead0c89 1048
5e1b2353 1049 "BSD-ia64" => {
30478c97 1050 inherit_from => [ "BSD-generic64" ],
68b8bcf4 1051 lib_cppflags => add("-DL_ENDIAN"),
3e9e810f 1052 bn_ops => "SIXTY_FOUR_BIT_LONG",
e6f98ae4
RL
1053 asm_arch => 'ia64',
1054 perlasm_scheme => 'void',
5e1b2353 1055 },
7ead0c89 1056
5e1b2353 1057 "BSD-x86_64" => {
30478c97 1058 inherit_from => [ "BSD-generic64" ],
68b8bcf4 1059 lib_cppflags => add("-DL_ENDIAN"),
3e9e810f 1060 bn_ops => "SIXTY_FOUR_BIT_LONG",
e6f98ae4 1061 asm_arch => 'x86_64',
5e1b2353 1062 perlasm_scheme => "elf",
5e1b2353 1063 },
f09e7ca9 1064
8e22f9d6
AJ
1065 "BSD-aarch64" => {
1066 inherit_from => [ "BSD-generic64" ],
1067 lib_cppflags => add("-DL_ENDIAN"),
1068 bn_ops => "SIXTY_FOUR_BIT_LONG",
1069 asm_arch => 'aarch64',
1070 perlasm_scheme => "linux64",
1071 },
1072
5e1b2353 1073 "bsdi-elf-gcc" => {
30478c97 1074 inherit_from => [ "BASE_unix" ],
abe256e7
RL
1075 CC => "gcc",
1076 CFLAGS => "-fomit-frame-pointer -O3 -Wall",
68b8bcf4 1077 lib_cppflags => "-DPERL5 -DL_ENDIAN",
98fdbce0 1078 ex_libs => add("-ldl"),
a01dab94 1079 bn_ops => "BN_LLONG",
e6f98ae4
RL
1080 asm_arch => 'x86',
1081 perlasm_scheme => "elf",
9c62a279 1082 thread_scheme => "(unknown)",
5e1b2353
RL
1083 dso_scheme => "dlfcn",
1084 shared_target => "bsd-gcc-shared",
1085 shared_cflag => "-fPIC",
5e1b2353 1086 },
f09e7ca9 1087
f09e7ca9
RS
1088#### SCO/Caldera targets.
1089#
1090# Originally we had like unixware-*, unixware-*-pentium, unixware-*-p6, etc.
1091# Now we only have blended unixware-* as it's the only one used by ./config.
1092# If you want to optimize for particular microarchitecture, bypass ./config
1093# and './Configure unixware-7 -Kpentium_pro' or whatever appropriate.
1094# Note that not all targets include assembler support. Mostly because of
1095# lack of motivation to support out-of-date platforms with out-of-date
e3713c36 1096# compiler drivers and assemblers.
f09e7ca9
RS
1097#
1098# UnixWare 2.0x fails destest with -O.
5e1b2353 1099 "unixware-2.0" => {
d2b2221a 1100 inherit_from => [ "BASE_unix" ],
abe256e7
RL
1101 CC => "cc",
1102 cflags => threads("-Kthread"),
68b8bcf4 1103 lib_cppflags => "-DFILIO_H -DNO_STRINGS_H",
98fdbce0 1104 ex_libs => add("-lsocket -lnsl -lresolv -lx"),
9c62a279 1105 thread_scheme => "uithreads",
5e1b2353
RL
1106 },
1107 "unixware-2.1" => {
d2b2221a 1108 inherit_from => [ "BASE_unix" ],
abe256e7
RL
1109 CC => "cc",
1110 CFLAGS => "-O",
1111 cflags => threads("-Kthread"),
68b8bcf4 1112 lib_cppflags => "-DFILIO_H",
98fdbce0 1113 ex_libs => add("-lsocket -lnsl -lresolv -lx"),
9c62a279 1114 thread_scheme => "uithreads",
5e1b2353
RL
1115 },
1116 "unixware-7" => {
30478c97 1117 inherit_from => [ "BASE_unix" ],
abe256e7
RL
1118 CC => "cc",
1119 CFLAGS => "-O",
1120 cflags => combine("-Kalloca", threads("-Kthread")),
68b8bcf4 1121 lib_cppflags => "-DFILIO_H",
98fdbce0 1122 ex_libs => add("-lsocket -lnsl"),
9c62a279 1123 thread_scheme => "uithreads",
a01dab94 1124 bn_ops => "BN_LLONG",
e6f98ae4 1125 asm_arch => 'x86',
5e1b2353
RL
1126 perlasm_scheme => "elf-1",
1127 dso_scheme => "dlfcn",
1128 shared_target => "svr5-shared",
1129 shared_cflag => "-Kpic",
5e1b2353
RL
1130 },
1131 "unixware-7-gcc" => {
30478c97 1132 inherit_from => [ "BASE_unix" ],
abe256e7
RL
1133 CC => "gcc",
1134 CFLAGS => "-O3 -fomit-frame-pointer -Wall",
68b8bcf4
RL
1135 cppflags => add(threads("-D_REENTRANT")),
1136 lib_cppflags => add("-DL_ENDIAN -DFILIO_H"),
98fdbce0 1137 ex_libs => add("-lsocket -lnsl"),
a01dab94 1138 bn_ops => "BN_LLONG",
9c62a279 1139 thread_scheme => "pthreads",
e6f98ae4 1140 asm_arch => 'x86',
5e1b2353
RL
1141 perlasm_scheme => "elf-1",
1142 dso_scheme => "dlfcn",
1143 shared_target => "gnu-shared",
1144 shared_cflag => "-fPIC",
5e1b2353 1145 },
e3713c36 1146# SCO 5 - Ben Laurie says the -O breaks the SCO cc.
5e1b2353 1147 "sco5-cc" => {
30478c97 1148 inherit_from => [ "BASE_unix" ],
5e1b2353
RL
1149 cc => "cc",
1150 cflags => "-belf",
98fdbce0 1151 ex_libs => add("-lsocket -lnsl"),
9c62a279 1152 thread_scheme => "(unknown)",
e6f98ae4 1153 asm_arch => 'x86',
5e1b2353
RL
1154 perlasm_scheme => "elf-1",
1155 dso_scheme => "dlfcn",
1156 shared_target => "svr3-shared",
1157 shared_cflag => "-Kpic",
5e1b2353
RL
1158 },
1159 "sco5-gcc" => {
30478c97 1160 inherit_from => [ "BASE_unix" ],
5e1b2353
RL
1161 cc => "gcc",
1162 cflags => "-O3 -fomit-frame-pointer",
98fdbce0 1163 ex_libs => add("-lsocket -lnsl"),
a01dab94 1164 bn_ops => "BN_LLONG",
9c62a279 1165 thread_scheme => "(unknown)",
e6f98ae4 1166 asm_arch => 'x86',
5e1b2353
RL
1167 perlasm_scheme => "elf-1",
1168 dso_scheme => "dlfcn",
1169 shared_target => "svr3-shared",
1170 shared_cflag => "-fPIC",
5e1b2353 1171 },
f09e7ca9
RS
1172
1173#### IBM's AIX.
f780eaad
AP
1174 # Below targets assume AIX >=5. Caveat lector. If you are accustomed
1175 # to control compilation "bitness" by setting $OBJECT_MODE environment
1176 # variable, then you should know that in OpenSSL case it's considered
1177 # only in ./config. Once configured, build procedure remains "deaf" to
1178 # current value of $OBJECT_MODE.
10aafed3
AP
1179 "aix-common" => {
1180 inherit_from => [ "BASE_unix" ],
1181 template => 1,
1182 sys_id => "AIX",
1183 lib_cppflags => "-DB_ENDIAN",
8f29569e 1184 lflags => "-Wl,-bsvr4",
10aafed3
AP
1185 thread_scheme => "pthreads",
1186 dso_scheme => "dlfcn",
ef2dfc99 1187 shared_target => "aix",
f3d6a364 1188 module_ldflags => "-Wl,-G,-bsymbolic,-bnoentry",
c1b38462 1189 shared_ldflag => "-Wl,-G,-bsymbolic,-bnoentry",
d3273ef6 1190 shared_defflag => "-Wl,-bE:",
69e0f8cc 1191 shared_fipsflag => "-Wl,-binitfini:_init:_cleanup",
fb82cbfe 1192 perl_platform => 'AIX',
10aafed3 1193 },
5e1b2353 1194 "aix-gcc" => {
30478c97 1195 inherit_from => [ "aix-common" ],
abe256e7
RL
1196 CC => "gcc",
1197 CFLAGS => picker(debug => "-O0 -g",
1198 release => "-O"),
1199 cflags => add(threads("-pthread")),
b1f9db69 1200 ex_libs => add(threads("-pthread")),
5e1b2353 1201 bn_ops => "BN_LLONG RC4_CHAR",
e6f98ae4 1202 asm_arch => 'ppc32',
5e1b2353 1203 perlasm_scheme => "aix32",
82b6b084 1204 shared_ldflag => add_before("-shared -static-libgcc"),
2a23cd7f
AP
1205 AR => add("-X32"),
1206 RANLIB => add("-X32"),
5e1b2353
RL
1207 },
1208 "aix64-gcc" => {
30478c97 1209 inherit_from => [ "aix-common" ],
abe256e7
RL
1210 CC => "gcc",
1211 CFLAGS => picker(debug => "-O0 -g",
1212 release => "-O"),
1213 cflags => combine("-maix64", threads("-pthread")),
b1f9db69 1214 ex_libs => add(threads("-pthread")),
5e1b2353 1215 bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
e6f98ae4 1216 asm_arch => 'ppc64',
5e1b2353 1217 perlasm_scheme => "aix64",
82b6b084 1218 shared_ldflag => add_before("-shared -static-libgcc"),
cff89b17 1219 shared_extension => "64.so.\$(SHLIB_VERSION_NUMBER)",
2a23cd7f
AP
1220 AR => add("-X64"),
1221 RANLIB => add("-X64"),
5e1b2353 1222 },
178fa72e
DB
1223 "aix64-gcc-as" => {
1224 inherit_from => [ "aix64-gcc" ],
1225 perlasm_scheme => "aix64-as",
1226 },
5e1b2353 1227 "aix-cc" => {
30478c97 1228 inherit_from => [ "aix-common" ],
abe256e7
RL
1229 CC => "cc",
1230 CFLAGS => picker(debug => "-O0 -g",
1231 release => "-O"),
1232 cflags => combine("-q32 -qmaxmem=16384 -qro -qroconst",
8c3bc594 1233 threads("-qthreaded")),
68b8bcf4 1234 cppflags => threads("-D_THREAD_SAFE"),
b1f9db69 1235 ex_libs => add(threads("-lpthreads")),
10aafed3 1236 bn_ops => "BN_LLONG RC4_CHAR",
e6f98ae4 1237 asm_arch => 'ppc32',
5e1b2353 1238 perlasm_scheme => "aix32",
4af14b7b 1239 shared_cflag => "-qpic",
2a23cd7f
AP
1240 AR => add("-X32"),
1241 RANLIB => add("-X32"),
5e1b2353
RL
1242 },
1243 "aix64-cc" => {
30478c97 1244 inherit_from => [ "aix-common" ],
abe256e7
RL
1245 CC => "cc",
1246 CFLAGS => picker(debug => "-O0 -g",
1247 release => "-O"),
1248 cflags => combine("-q64 -qmaxmem=16384 -qro -qroconst",
8c3bc594 1249 threads("-qthreaded")),
68b8bcf4 1250 cppflags => threads("-D_THREAD_SAFE"),
b1f9db69 1251 ex_libs => add(threads("-lpthreads")),
10aafed3 1252 bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
e6f98ae4 1253 asm_arch => 'ppc64',
5e1b2353
RL
1254 perlasm_scheme => "aix64",
1255 dso_scheme => "dlfcn",
4af14b7b 1256 shared_cflag => "-qpic",
cff89b17 1257 shared_extension => "64.so.\$(SHLIB_VERSION_NUMBER)",
2a23cd7f
AP
1258 AR => add("-X64"),
1259 RANLIB => add("-X64"),
5e1b2353 1260 },
f09e7ca9
RS
1261
1262# SIEMENS BS2000/OSD: an EBCDIC-based mainframe
5e1b2353 1263 "BS2000-OSD" => {
d2b2221a 1264 inherit_from => [ "BASE_unix" ],
abe256e7
RL
1265 CC => "c89",
1266 CFLAGS => "-O",
1267 cflags => "-XLLML -XLLMK -XL",
68b8bcf4
RL
1268 cppflags => "-DCHARSET_EBCDIC",
1269 lib_cppflags => "-DB_ENDIAN",
98fdbce0 1270 ex_libs => add("-lsocket -lnsl"),
3e9e810f 1271 bn_ops => "THIRTY_TWO_BIT RC4_CHAR",
9c62a279 1272 thread_scheme => "(unknown)",
5e1b2353 1273 },
f09e7ca9 1274
7ead0c89 1275#### Visual C targets
f09e7ca9 1276#
78a50c75 1277# Win64 targets, WIN64I denotes IA-64/Itanium and WIN64A - AMD64
f09e7ca9 1278#
78a50c75 1279# Note about /wd4090, disable warning C4090. This warning returns false
f09e7ca9
RS
1280# positives in some situations. Disabling it altogether masks both
1281# legitimate and false cases, but as we compile on multiple platforms,
1282# we rely on other compilers to catch legitimate cases.
2fe73036
RL
1283#
1284# Also note that we force threads no matter what. Configuring "no-threads"
1285# is ignored.
78a50c75
AP
1286#
1287# UNICODE is defined in VC-common and applies to all targets. It used to
1288# be an opt-in option for VC-WIN32, but not anymore. The original reason
1289# was because ANSI API was *native* system interface for no longer
1290# supported Windows 9x. Keep in mind that UNICODE only affects how
1291# OpenSSL libraries interact with underlying OS, it doesn't affect API
1292# that OpenSSL presents to application.
1293
7ead0c89 1294 "VC-common" => {
d2b2221a 1295 inherit_from => [ "BASE_Windows" ],
7ead0c89 1296 template => 1,
abe256e7 1297 CC => "cl",
16f2a444 1298 CPP => '"$(CC)" /EP /C',
78a50c75 1299 CFLAGS => "/W3 /wd4090 /nologo",
abe256e7 1300 coutflag => "/Fo",
23f3242f
TI
1301 LD => "link",
1302 LDFLAGS => "/nologo /debug",
1303 ldoutflag => "/out:",
a75a8756
TI
1304 ldpostoutflag => "",
1305 ld_resp_delim => "\n",
d5a6b54b 1306 bin_lflags => "setargv.obj",
2e535eb5
RL
1307 makedepcmd => '"$(CC)" /Zs /showIncludes',
1308 makedep_scheme => 'VC',
23f3242f
TI
1309 AR => "lib",
1310 ARFLAGS => "/nologo",
1311 aroutflag => "/out:",
e15eff3a 1312 ar_resp_delim => "\n",
6afb3634
TI
1313 RC => "rc",
1314 rcoutflag => "/fo",
8c3bc594 1315 defines => add("OPENSSL_SYS_WIN32", "WIN32_LEAN_AND_MEAN",
78a50c75 1316 "UNICODE", "_UNICODE",
68b8bcf4
RL
1317 "_CRT_SECURE_NO_DEPRECATE",
1318 "_WINSOCK_DEPRECATED_NO_WARNINGS"),
78a50c75
AP
1319 lib_cflags => add("/Zi /Fdossl_static.pdb"),
1320 lib_defines => add("L_ENDIAN"),
1321 dso_cflags => "/Zi /Fddso.pdb",
1322 bin_cflags => "/Zi /Fdapp.pdb",
ef2dfc99
RL
1323 # def_flag made to empty string so a .def file gets generated
1324 shared_defflag => '',
2fe73036 1325 shared_ldflag => "/dll",
e9abfc3a 1326 shared_target => "win-shared", # meaningless except it gives Configure a hint
5fee3fe2 1327 lddefflag => "/def:",
6afb3634 1328 ldresflag => " ",
5fee3fe2 1329 ld_implib_flag => "/implib:",
2fe73036 1330 thread_scheme => "winthreads",
5e1b2353 1331 dso_scheme => "win32",
95768961 1332 perl_platform => 'Windows::MSVC',
6a145a32
AP
1333 # additional parameter to build_scheme denotes install-path "flavour"
1334 build_scheme => add("VC-common", { separator => undef }),
5e1b2353 1335 },
2fe73036 1336 "VC-noCE-common" => {
acf15259 1337 inherit_from => [ "VC-common" ],
be1f4812 1338 template => 1,
abe256e7
RL
1339 CFLAGS => add(picker(debug => '/Od',
1340 release => '/O2')),
78a50c75
AP
1341 cflags => add(picker(default => '/Gs0 /GF /Gy',
1342 debug =>
2fe73036 1343 sub {
abe256e7 1344 ($disabled{shared} ? "" : "/MDd");
2fe73036
RL
1345 },
1346 release =>
1347 sub {
abe256e7 1348 ($disabled{shared} ? "" : "/MD");
2fe73036 1349 })),
fffb1c54
AP
1350 defines => add(picker(default => [], # works as type cast
1351 debug => [ "DEBUG", "_DEBUG" ])),
c32cbe97
AP
1352 lib_cflags => add(sub { $disabled{shared} ? "/MT /Zl" : () }),
1353 # Following might/should appears controversial, i.e. defining
1354 # /MDd without evaluating $disabled{shared}. It works in
1355 # non-shared build because static library is compiled with /Zl
1356 # and bares no reference to specific RTL. And it works in
1357 # shared build because multiple /MDd options are not prohibited.
1358 # But why /MDd in static build? Well, basically this is just a
1359 # reference point, which allows to catch eventual errors that
1360 # would prevent those who want to wrap OpenSSL into own .DLL.
1361 # Why not /MD in release build then? Well, some are likely to
1362 # prefer [non-debug] openssl.exe to be free from Micorosoft RTL
1363 # redistributable.
1364 bin_cflags => add(picker(debug => "/MDd",
1365 release => sub { $disabled{shared} ? "/MT" : () },
1366 )),
2fe73036 1367 bin_lflags => add("/subsystem:console /opt:ref"),
ef5b8296 1368 ex_libs => add(sub {
2fe73036
RL
1369 my @ex_libs = ();
1370 push @ex_libs, 'ws2_32.lib' unless $disabled{sock};
1371 push @ex_libs, 'gdi32.lib advapi32.lib crypt32.lib user32.lib';
1372 return join(" ", @ex_libs);
ef5b8296 1373 }),
2fe73036
RL
1374 },
1375 "VC-WIN64-common" => {
1376 inherit_from => [ "VC-noCE-common" ],
be1f4812 1377 template => 1,
ef5b8296 1378 ex_libs => add(sub {
2fe73036
RL
1379 my @ex_libs = ();
1380 push @ex_libs, 'bufferoverflowu.lib' if (`cl 2>&1` =~ /14\.00\.4[0-9]{4}\./);
1381 return join(" ", @_, @ex_libs);
ef5b8296 1382 }),
78a50c75 1383 bn_ops => add("SIXTY_FOUR_BIT"),
2fe73036 1384 },
7ead0c89 1385 "VC-WIN64I" => {
30478c97 1386 inherit_from => [ "VC-WIN64-common" ],
abe256e7
RL
1387 AS => "ias",
1388 ASFLAGS => "-d debug",
78a50c75 1389 asoutflag => "-o ",
5e1b2353 1390 sys_id => "WIN64I",
b19fe714 1391 uplink_arch => 'ia64',
e6f98ae4 1392 asm_arch => 'ia64',
5e1b2353 1393 perlasm_scheme => "ias",
6ddb62a5 1394 multilib => "-ia64",
5e1b2353
RL
1395 },
1396 "VC-WIN64A" => {
30478c97 1397 inherit_from => [ "VC-WIN64-common" ],
abe256e7
RL
1398 AS => sub { vc_win64a_info()->{AS} },
1399 ASFLAGS => sub { vc_win64a_info()->{ASFLAGS} },
2fe73036 1400 asoutflag => sub { vc_win64a_info()->{asoutflag} },
abe256e7 1401 asflags => sub { vc_win64a_info()->{asflags} },
5e1b2353 1402 sys_id => "WIN64A",
b19fe714 1403 uplink_arch => 'x86_64',
e6f98ae4 1404 asm_arch => 'x86_64',
5e1b2353 1405 perlasm_scheme => "auto",
6ddb62a5 1406 multilib => "-x64",
5e1b2353 1407 },
5e1b2353 1408 "VC-WIN32" => {
30478c97 1409 inherit_from => [ "VC-noCE-common" ],
abe256e7
RL
1410 AS => sub { vc_win32_info()->{AS} },
1411 ASFLAGS => sub { vc_win32_info()->{ASFLAGS} },
43800958 1412 asoutflag => sub { vc_win32_info()->{asoutflag} },
abe256e7 1413 asflags => sub { vc_win32_info()->{asflags} },
5e1b2353 1414 sys_id => "WIN32",
78a50c75 1415 bn_ops => add("BN_LLONG"),
989b2ad7 1416 uplink_arch => 'common',
e6f98ae4 1417 asm_arch => 'x86',
f0d484fc 1418 perlasm_scheme => sub { vc_win32_info()->{perlasm_scheme} },
6a145a32
AP
1419 # "WOW" stands for "Windows on Windows", and "VC-WOW" engages
1420 # some installation path heuristics in windows-makefile.tmpl...
1421 build_scheme => add("VC-WOW", { separator => undef }),
5e1b2353 1422 },
5e1b2353 1423 "VC-CE" => {
2fe73036 1424 inherit_from => [ "VC-common" ],
78a50c75
AP
1425 CFLAGS => add(picker(debug => "/Od",
1426 release => "/O1i")),
abe256e7
RL
1427 CPPDEFINES => picker(debug => [ "DEBUG", "_DEBUG" ]),
1428 LDFLAGS => add("/nologo /opt:ref"),
2fe73036 1429 cflags =>
abe256e7
RL
1430 combine('/GF /Gy',
1431 sub { vc_wince_info()->{cflags}; },
1432 sub { `cl 2>&1` =~ /Version ([0-9]+)\./ && $1>=14
1433 ? ($disabled{shared} ? " /MT" : " /MD")
1434 : " /MC"; }),
e548c1fe 1435 cppflags => sub { vc_wince_info()->{cppflags}; },
78a50c75 1436 lib_defines => add("NO_CHMOD", "OPENSSL_SMALL_FOOTPRINT"),
68b8bcf4 1437 lib_cppflags => sub { vc_wince_info()->{cppflags}; },
8c3bc594 1438 includes =>
368297d1
RL
1439 add(combine(sub { defined(env('WCECOMPAT'))
1440 ? '$(WCECOMPAT)/include' : (); },
1441 sub { defined(env('PORTSDK_LIBPATH'))
1442 ? '$(PORTSDK_LIBPATH)/../../include'
1443 : (); })),
abe256e7 1444 lflags => add(combine(sub { vc_wince_info()->{lflags}; },
47eeaf45
RL
1445 sub { defined(env('PORTSDK_LIBPATH'))
1446 ? "/entry:mainCRTstartup" : (); })),
5e1b2353 1447 sys_id => "WINCE",
78a50c75 1448 bn_ops => add("BN_LLONG"),
ef5b8296 1449 ex_libs => add(sub {
2fe73036
RL
1450 my @ex_libs = ();
1451 push @ex_libs, 'ws2.lib' unless $disabled{sock};
1452 push @ex_libs, 'crypt32.lib';
17f16617 1453 if (defined(env('WCECOMPAT'))) {
2fe73036 1454 my $x = '$(WCECOMPAT)/lib';
17f16617 1455 if (-f "$x/env('TARGETCPU')/wcecompatex.lib") {
2fe73036
RL
1456 $x .= '/$(TARGETCPU)/wcecompatex.lib';
1457 } else {
1458 $x .= '/wcecompatex.lib';
1459 }
1460 push @ex_libs, $x;
1461 }
1462 push @ex_libs, '$(PORTSDK_LIBPATH)/portlib.lib'
17f16617 1463 if (defined(env('PORTSDK_LIBPATH')));
a1736f37 1464 push @ex_libs, '/nodefaultlib coredll.lib corelibc.lib'
1465 if (env('TARGETCPU') =~ /^X86|^ARMV4[IT]/);
1466 return join(" ", @ex_libs);
ef5b8296 1467 }),
5e1b2353 1468 },
f09e7ca9 1469
7ead0c89 1470#### MinGW
9dd4ed28
RL
1471 "mingw-common" => {
1472 inherit_from => [ 'BASE_unix' ],
1473 template => 1,
abe256e7
RL
1474 CC => "gcc",
1475 CFLAGS => picker(default => "-Wall",
8c3bc594 1476 debug => "-g -O0",
9dd4ed28 1477 release => "-O3"),
68b8bcf4 1478 cppflags => combine("-DUNICODE -D_UNICODE -DWIN32_LEAN_AND_MEAN",
abe256e7 1479 threads("-D_MT")),
68b8bcf4 1480 lib_cppflags => "-DL_ENDIAN",
98fdbce0 1481 ex_libs => add("-lws2_32 -lgdi32 -lcrypt32"),
9c62a279 1482 thread_scheme => "winthreads",
5e1b2353 1483 dso_scheme => "win32",
520f434b 1484 shared_target => "mingw-shared",
8c3bc594 1485 shared_cppflags => add("_WINDLL"),
68ab559a 1486 shared_ldflag => "-static-libgcc",
9dd4ed28
RL
1487
1488 perl_platform => 'mingw',
1489 },
1490 "mingw" => {
30478c97 1491 inherit_from => [ "mingw-common" ],
9dd4ed28
RL
1492 CFLAGS => add(picker(release => "-fomit-frame-pointer")),
1493 cflags => "-m32",
1494 sys_id => "MINGW32",
1495 bn_ops => add("BN_LLONG"),
e6f98ae4 1496 asm_arch => 'x86',
b19fe714 1497 uplink_arch => 'x86',
9dd4ed28 1498 perlasm_scheme => "coff",
64c443e3 1499 shared_rcflag => "--target=pe-i386",
520f434b 1500 multilib => "",
5e1b2353 1501 },
5e1b2353 1502 "mingw64" => {
b19fe714 1503 # As for uplink_arch. Applink makes it possible to use
7ead0c89
AP
1504 # .dll compiled with one compiler with application compiled with
1505 # another compiler. It's possible to engage Applink support in
b19fe714 1506 # mingw64 build, but it's not done, because until mingw64
7ead0c89
AP
1507 # supports structured exception handling, one can't seriously
1508 # consider its binaries for using with non-mingw64 run-time
1509 # environment. And as mingw64 is always consistent with itself,
1510 # Applink is never engaged and can as well be omitted.
30478c97 1511 inherit_from => [ "mingw-common" ],
abe256e7 1512 cflags => "-m64",
5e1b2353 1513 sys_id => "MINGW64",
9dd4ed28 1514 bn_ops => add("SIXTY_FOUR_BIT"),
e6f98ae4 1515 asm_arch => 'x86_64',
b19fe714 1516 uplink_arch => undef,
5e1b2353 1517 perlasm_scheme => "mingw64",
64c443e3 1518 shared_rcflag => "--target=pe-x86-64",
520f434b 1519 multilib => "64",
5e1b2353 1520 },
f09e7ca9 1521
4d60c7e1
DW
1522#### UEFI
1523 "UEFI" => {
d2b2221a 1524 inherit_from => [ "BASE_unix" ],
abe256e7
RL
1525 CC => "cc",
1526 CFLAGS => "-O",
68b8bcf4 1527 lib_cppflags => "-DL_ENDIAN",
4d60c7e1
DW
1528 sys_id => "UEFI",
1529 },
1b721050
CZ
1530 "UEFI-x86" => {
1531 inherit_from => [ "UEFI" ],
1532 asm_arch => 'x86',
1533 perlasm_scheme => "win32n",
1534 },
1535 "UEFI-x86_64" => {
1536 inherit_from => [ "UEFI" ],
1537 asm_arch => 'x86_64',
1538 perlasm_scheme => "nasm",
1539 },
4d60c7e1 1540
7ead0c89 1541#### UWIN
5e1b2353 1542 "UWIN" => {
d2b2221a 1543 inherit_from => [ "BASE_unix" ],
abe256e7
RL
1544 CC => "cc",
1545 CFLAGS => "-O -Wall",
1546 lib_cppflags => "-DTERMIOS -DL_ENDIAN",
5e1b2353 1547 sys_id => "UWIN",
a01dab94 1548 bn_ops => "BN_LLONG",
5e1b2353
RL
1549 dso_scheme => "win32",
1550 },
f09e7ca9 1551
7ead0c89 1552#### Cygwin
9dd4ed28 1553 "Cygwin-common" => {
68ca1737 1554 inherit_from => [ "BASE_unix" ],
9dd4ed28
RL
1555 template => 1,
1556
abe256e7
RL
1557 CC => "gcc",
1558 CFLAGS => picker(default => "-Wall",
8864f0de 1559 debug => "-g -O0",
9dd4ed28 1560 release => "-O3"),
68b8bcf4 1561 lib_cppflags => "-DTERMIOS -DL_ENDIAN",
5e1b2353 1562 sys_id => "CYGWIN",
e58d9102 1563 thread_scheme => "pthread",
5e1b2353
RL
1564 dso_scheme => "dlfcn",
1565 shared_target => "cygwin-shared",
8c3bc594 1566 shared_cppflags => "-D_WINDLL",
9dd4ed28
RL
1567
1568 perl_platform => 'Cygwin',
1569 },
1570 "Cygwin-x86" => {
30478c97 1571 inherit_from => [ "Cygwin-common" ],
9dd4ed28
RL
1572 CFLAGS => add(picker(release => "-O3 -fomit-frame-pointer")),
1573 bn_ops => "BN_LLONG",
e6f98ae4 1574 asm_arch => 'x86',
9dd4ed28 1575 perlasm_scheme => "coff",
5e1b2353
RL
1576 },
1577 "Cygwin-x86_64" => {
30478c97 1578 inherit_from => [ "Cygwin-common" ],
abe256e7 1579 CC => "gcc",
3e9e810f 1580 bn_ops => "SIXTY_FOUR_BIT_LONG",
e6f98ae4 1581 asm_arch => 'x86_64',
5e1b2353 1582 perlasm_scheme => "mingw64",
5e1b2353 1583 },
b9ee2dac
RL
1584 # Backward compatibility for those using this target
1585 "Cygwin" => {
1586 inherit_from => [ "Cygwin-x86" ]
1587 },
1588 # In case someone constructs the Cygwin target name themself
1589 "Cygwin-i386" => {
1590 inherit_from => [ "Cygwin-x86" ]
1591 },
1592 "Cygwin-i486" => {
1593 inherit_from => [ "Cygwin-x86" ]
1594 },
1595 "Cygwin-i586" => {
1596 inherit_from => [ "Cygwin-x86" ]
1597 },
1598 "Cygwin-i686" => {
1599 inherit_from => [ "Cygwin-x86" ]
1600 },
f09e7ca9 1601
f09e7ca9 1602##### MacOS X (a.k.a. Darwin) setup
7ead0c89 1603 "darwin-common" => {
d2b2221a 1604 inherit_from => [ "BASE_unix" ],
7ead0c89 1605 template => 1,
abe256e7
RL
1606 CC => "cc",
1607 CFLAGS => picker(debug => "-g -O0",
8c3bc594
RL
1608 release => "-O3"),
1609 cppflags => threads("-D_REENTRANT"),
53043311 1610 lflags => add("-Wl,-search_paths_first"),
5e1b2353 1611 sys_id => "MACOSX",
3e9e810f 1612 bn_ops => "BN_LLONG RC4_CHAR",
9c62a279 1613 thread_scheme => "pthreads",
5e1b2353
RL
1614 perlasm_scheme => "osx32",
1615 dso_scheme => "dlfcn",
0c873419 1616 ranlib => "ranlib -c",
5e1b2353 1617 shared_target => "darwin-shared",
0c873419 1618 shared_cflag => "-fPIC",
d4453024 1619 shared_extension => ".\$(SHLIB_VERSION_NUMBER).dylib",
5e1b2353 1620 },
c75065e1
AP
1621 # Option "freeze" such as -std=gnu9x can't negatively interfere
1622 # with future defaults for below two targets, because MacOS X
1623 # for PPC has no future, it was discontinued by vendor in 2009.
c9741726
RL
1624 "darwin-ppc-cc" => { inherit_from => [ "darwin-ppc" ] }, # Historic alias
1625 "darwin-ppc" => {
30478c97 1626 inherit_from => [ "darwin-common" ],
8c3bc594 1627 cflags => add("-arch ppc -std=gnu9x -Wa,-force_cpusubtype_ALL"),
68b8bcf4 1628 lib_cppflags => add("-DB_ENDIAN"),
107783d9 1629 shared_cflag => add("-fno-common"),
e6f98ae4 1630 asm_arch => 'ppc32',
7ead0c89 1631 perlasm_scheme => "osx32",
7ead0c89 1632 },
c9741726
RL
1633 "darwin64-ppc-cc" => { inherit_from => [ "darwin64-ppc" ] }, # Historic alias
1634 "darwin64-ppc" => {
30478c97 1635 inherit_from => [ "darwin-common" ],
8c3bc594 1636 cflags => add("-arch ppc64 -std=gnu9x"),
68b8bcf4 1637 lib_cppflags => add("-DB_ENDIAN"),
3e9e810f 1638 bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
e6f98ae4 1639 asm_arch => 'ppc64',
5e1b2353 1640 perlasm_scheme => "osx64",
5e1b2353 1641 },
c9741726
RL
1642 "darwin-i386-cc" => { inherit_from => [ "darwin-i386" ] }, # Historic alias
1643 "darwin-i386" => {
30478c97 1644 inherit_from => [ "darwin-common" ],
abe256e7
RL
1645 CFLAGS => add(picker(release => "-fomit-frame-pointer")),
1646 cflags => add("-arch i386"),
68b8bcf4 1647 lib_cppflags => add("-DL_ENDIAN"),
3e9e810f 1648 bn_ops => "BN_LLONG RC4_INT",
e6f98ae4 1649 asm_arch => 'x86',
5e1b2353 1650 perlasm_scheme => "macosx",
5e1b2353 1651 },
c9741726
RL
1652 "darwin64-x86_64-cc" => { inherit_from => [ "darwin64-x86_64" ] }, # Historic alias
1653 "darwin64-x86_64" => {
30478c97 1654 inherit_from => [ "darwin-common" ],
abe256e7
RL
1655 CFLAGS => add("-Wall"),
1656 cflags => add("-arch x86_64"),
68b8bcf4 1657 lib_cppflags => add("-DL_ENDIAN"),
3e9e810f 1658 bn_ops => "SIXTY_FOUR_BIT_LONG",
e6f98ae4 1659 asm_arch => 'x86_64',
5e1b2353 1660 perlasm_scheme => "macosx",
5e1b2353 1661 },
23f04372
B
1662 "darwin64-arm64-cc" => { inherit_from => [ "darwin64-arm64" ] }, # "Historic" alias
1663 "darwin64-arm64" => {
1664 inherit_from => [ "darwin-common" ],
1665 CFLAGS => add("-Wall"),
1666 cflags => add("-arch arm64"),
1667 lib_cppflags => add("-DL_ENDIAN"),
1668 bn_ops => "SIXTY_FOUR_BIT_LONG",
7c0e98a5 1669 asm_arch => 'aarch64',
23f04372
B
1670 perlasm_scheme => "ios64",
1671 },
7ead0c89 1672
f09e7ca9 1673##### GNU Hurd
5e1b2353 1674 "hurd-x86" => {
d2b2221a 1675 inherit_from => [ "BASE_unix" ],
abe256e7
RL
1676 CC => "gcc",
1677 CFLAGS => "-O3 -fomit-frame-pointer -Wall",
1678 cflags => threads("-pthread"),
68b8bcf4 1679 lib_cppflags => "-DL_ENDIAN",
fcd2ac80 1680 ex_libs => add("-ldl", threads("-pthread")),
a01dab94 1681 bn_ops => "BN_LLONG",
e6f98ae4
RL
1682 asm_arch => 'x86',
1683 perlasm_scheme => 'elf',
9c62a279 1684 thread_scheme => "pthreads",
5e1b2353
RL
1685 dso_scheme => "dlfcn",
1686 shared_target => "linux-shared",
1687 shared_cflag => "-fPIC",
1688 },
f09e7ca9 1689
f09e7ca9 1690##### VxWorks for various targets
5e1b2353 1691 "vxworks-ppc60x" => {
d2b2221a 1692 inherit_from => [ "BASE_unix" ],
abe256e7
RL
1693 CC => "ccppc",
1694 CFLAGS => "-O2 -Wall -fstrength-reduce",
1695 cflags => "-mrtp -mhard-float -mstrict-align -fno-implicit-fp -fno-builtin -fno-strict-aliasing",
8c3bc594
RL
1696 cppflags => combine("-D_REENTRANT -DPPC32_fp60x -DCPU=PPC32",
1697 "_DTOOL_FAMILY=gnu -DTOOL=gnu",
1698 "-I\$(WIND_BASE)/target/usr/h",
1699 "-I\$(WIND_BASE)/target/usr/h/wrn/coreip"),
5e1b2353 1700 sys_id => "VXWORKS",
47eeaf45
RL
1701 lflags => add("-L \$(WIND_BASE)/target/usr/lib/ppc/PPC32/common"),
1702 ex_libs => add("-Wl,--defsym,__wrs_rtp_base=0xe0000000"),
5e1b2353
RL
1703 },
1704 "vxworks-ppcgen" => {
d2b2221a 1705 inherit_from => [ "BASE_unix" ],
abe256e7
RL
1706 CC => "ccppc",
1707 CFLAGS => "-O1 -Wall",
1708 cflags => "-mrtp -msoft-float -mstrict-align -fno-builtin -fno-strict-aliasing",
8c3bc594
RL
1709 cppflags => combine("-D_REENTRANT -DPPC32 -DCPU=PPC32",
1710 "-DTOOL_FAMILY=gnu -DTOOL=gnu",
1711 "-I\$(WIND_BASE)/target/usr/h",
1712 "-I\$(WIND_BASE)/target/usr/h/wrn/coreip"),
5e1b2353 1713 sys_id => "VXWORKS",
47eeaf45
RL
1714 lflags => add("-L \$(WIND_BASE)/target/usr/lib/ppc/PPC32/sfcommon"),
1715 ex_libs => add("-Wl,--defsym,__wrs_rtp_base=0xe0000000"),
5e1b2353
RL
1716 },
1717 "vxworks-ppc405" => {
d2b2221a 1718 inherit_from => [ "BASE_unix" ],
abe256e7
RL
1719 CC => "ccppc",
1720 CFLAGS => "-g",
1721 cflags => "-msoft-float -mlongcall",
8c3bc594
RL
1722 cppflags => combine("-D_REENTRANT -DPPC32 -DCPU=PPC405",
1723 "-DTOOL_FAMILY=gnu -DTOOL=gnu",
1724 "-I\$(WIND_BASE)/target/h"),
5e1b2353 1725 sys_id => "VXWORKS",
47eeaf45 1726 lflags => add("-r"),
5e1b2353
RL
1727 },
1728 "vxworks-ppc750" => {
d2b2221a 1729 inherit_from => [ "BASE_unix" ],
abe256e7
RL
1730 CC => "ccppc",
1731 CFLAGS => "-ansi -fvolatile -Wall \$(DEBUG_FLAG)",
1732 cflags => "-nostdinc -fno-builtin -fno-for-scope -fsigned-char -msoft-float -mlongcall",
8c3bc594
RL
1733 cppflags => combine("-DPPC750 -D_REENTRANT -DCPU=PPC604",
1734 "-I\$(WIND_BASE)/target/h"),
5e1b2353 1735 sys_id => "VXWORKS",
47eeaf45 1736 lflags => add("-r"),
5e1b2353
RL
1737 },
1738 "vxworks-ppc750-debug" => {
d2b2221a 1739 inherit_from => [ "BASE_unix" ],
abe256e7
RL
1740 CC => "ccppc",
1741 CFLAGS => "-ansi -fvolatile -Wall -g",
1742 cflags => "-nostdinc -fno-builtin -fno-for-scope -fsigned-char -msoft-float -mlongcall",
8c3bc594
RL
1743 cppflags => combine("-DPPC750 -D_REENTRANT -DCPU=PPC604",
1744 "-DPEDANTIC -DDEBUG",
1745 "-I\$(WIND_BASE)/target/h"),
5e1b2353 1746 sys_id => "VXWORKS",
47eeaf45 1747 lflags => add("-r"),
5e1b2353
RL
1748 },
1749 "vxworks-ppc860" => {
d2b2221a 1750 inherit_from => [ "BASE_unix" ],
abe256e7 1751 CC => "ccppc",
8c3bc594
RL
1752 cflags => "-nostdinc -msoft-float",
1753 cppflags => combine("-DCPU=PPC860 -DNO_STRINGS_H",
1754 "-I\$(WIND_BASE)/target/h"),
5e1b2353 1755 sys_id => "VXWORKS",
47eeaf45 1756 lflags => add("-r"),
5e1b2353
RL
1757 },
1758 "vxworks-simlinux" => {
d2b2221a 1759 inherit_from => [ "BASE_unix" ],
abe256e7 1760 CC => "ccpentium",
8c3bc594
RL
1761 cflags => "-B\$(WIND_BASE)/host/\$(WIND_HOST_TYPE)/lib/gcc-lib/ -fno-builtin -fno-defer-pop",
1762 cppflags => combine("-D_VSB_CONFIG_FILE=\"\$(WIND_BASE)/target/lib/h/config/vsbConfig.h\"",
1763 "-DL_ENDIAN -DCPU=SIMLINUX -DNO_STRINGS_H",
1764 "-DTOOL_FAMILY=gnu -DTOOL=gnu",
1765 "-DOPENSSL_NO_HW_PADLOCK",
1766 "-I\$(WIND_BASE)/target/h",
1767 "-I\$(WIND_BASE)/target/h/wrn/coreip"),
5e1b2353 1768 sys_id => "VXWORKS",
47eeaf45 1769 lflags => add("-r"),
5e1b2353
RL
1770 ranlib => "ranlibpentium",
1771 },
1772 "vxworks-mips" => {
30478c97 1773 inherit_from => [ "BASE_unix" ],
abe256e7
RL
1774 CC => "ccmips",
1775 CFLAGS => "-O -G 0",
1776 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
1777 cppflags => combine("-D_VSB_CONFIG_FILE=\"\$(WIND_BASE)/target/lib/h/config/vsbConfig.h\"",
1778 "-DCPU=MIPS32 -DNO_STRINGS_H",
1779 "-DTOOL_FAMILY=gnu -DTOOL=gnu",
1780 "-DOPENSSL_NO_HW_PADLOCK",
1781 threads("-D_REENTRANT"),
1782 "-I\$(WIND_BASE)/target/h",
1783 "-I\$(WIND_BASE)/target/h/wrn/coreip"),
5e1b2353 1784 sys_id => "VXWORKS",
47eeaf45
RL
1785 lflags => add("-L \$(WIND_BASE)/target/usr/lib/mips/MIPSI32/sfcommon"),
1786 ex_libs => add("-Wl,--defsym,__wrs_rtp_base=0xe0000000"),
9c62a279 1787 thread_scheme => "pthreads",
e6f98ae4 1788 asm_arch => 'mips32',
5e1b2353
RL
1789 perlasm_scheme => "o32",
1790 ranlib => "ranlibmips",
1791 },
f09e7ca9 1792
7ead0c89 1793#### uClinux
5e1b2353 1794 "uClinux-dist" => {
d2b2221a 1795 inherit_from => [ "BASE_unix" ],
abe256e7 1796 CC => sub { env('CC') },
8c3bc594 1797 cppflags => threads("-D_REENTRANT"),
98fdbce0 1798 ex_libs => add("\$(LDLIBS)"),
5e1b2353 1799 bn_ops => "BN_LLONG",
9c62a279 1800 thread_scheme => "pthreads",
17f16617 1801 dso_scheme => sub { env('LIBSSL_dlfcn') },
5e1b2353
RL
1802 shared_target => "linux-shared",
1803 shared_cflag => "-fPIC",
17f16617 1804 ranlib => sub { env('RANLIB') },
5e1b2353
RL
1805 },
1806 "uClinux-dist64" => {
d2b2221a 1807 inherit_from => [ "BASE_unix" ],
abe256e7 1808 CC => sub { env('CC') },
8c3bc594 1809 cppflags => threads("-D_REENTRANT"),
98fdbce0 1810 ex_libs => add("\$(LDLIBS)"),
5e1b2353 1811 bn_ops => "SIXTY_FOUR_BIT_LONG",
9c62a279 1812 thread_scheme => "pthreads",
17f16617 1813 dso_scheme => sub { env('LIBSSL_dlfcn') },
5e1b2353
RL
1814 shared_target => "linux-shared",
1815 shared_cflag => "-fPIC",
17f16617 1816 ranlib => sub { env('RANLIB') },
5e1b2353 1817 },
f09e7ca9 1818
e84193e4 1819 ##### VMS
ab907189
RL
1820 # Most things happen in vms-generic.
1821 # Note that vms_info extracts the pointer size from the end of
1822 # the target name, and will assume that anything matching /-p\d+$/
1823 # indicates the pointer size setting for the desired target.
e84193e4 1824 "vms-generic" => {
d2b2221a 1825 inherit_from => [ "BASE_VMS" ],
e84193e4 1826 template => 1,
abe256e7
RL
1827 CC => "CC/DECC",
1828 CPP => '$(CC)/PREPROCESS_ONLY=SYS$OUTPUT:',
1829 CFLAGS =>
ab907189
RL
1830 combine(picker(default => "/STANDARD=(ISOC94,RELAXED)/NOLIST/PREFIX=ALL",
1831 debug => "/NOOPTIMIZE/DEBUG",
1832 release => "/OPTIMIZE/NODEBUG"),
1833 sub { my @warnings =
1834 @{vms_info()->{disable_warns}};
1835 @warnings
1836 ? "/WARNINGS=DISABLE=(".join(",",@warnings).")" : (); }),
0cbb6f6a 1837 cflag_incfirst => '/FIRST_INCLUDE=',
68b8bcf4 1838 lib_defines =>
ab907189
RL
1839 add("OPENSSL_USE_NODELETE",
1840 sub {
1841 return vms_info()->{def_zlib}
1842 ? "LIBZ=\"\"\"".vms_info()->{def_zlib}."\"\"\"" : ();
1843 }),
2de2df7f 1844 lflags => picker(default => "/MAP='F\$PARSE(\".MAP\",\"\$\@\")'",
1ae4c07e 1845 debug => "/DEBUG/TRACEBACK",
8864f0de 1846 release => "/NODEBUG/NOTRACEBACK"),
2935f624 1847 # Because of dso_cflags below, we can't set the generic |cflags| here,
79c44b4e 1848 # as it can't be overridden, so we set separate C flags for libraries
2935f624
RL
1849 # and binaries instead.
1850 bin_cflags => add("/NAMES=(AS_IS,SHORTENED)/EXTERN_MODEL=STRICT_REFDEF"),
68a39960 1851 lib_cflags => add("/NAMES=(AS_IS,SHORTENED)/EXTERN_MODEL=STRICT_REFDEF"),
31be74d3
RL
1852 # Strictly speaking, DSOs should not need to have name shortening,
1853 # as all their exported symbols should be short enough to fit the
1854 # linker's 31 character per symbol name limit. However, providers
1855 # may be composed of more than one object file, and internal symbols
1856 # may and do surpass the 31 character limit.
1857 dso_cflags => add("/NAMES=(SHORTENED)"),
ab907189 1858 ex_libs => add(sub { return vms_info()->{zlib} || (); }),
e84193e4 1859 shared_target => "vms-shared",
ef2dfc99
RL
1860 # def_flag made to empty string so a .opt file gets generated
1861 shared_defflag => '',
ac722c9a 1862 dso_scheme => "vms",
9c62a279 1863 thread_scheme => "pthreads",
e84193e4 1864
2e535eb5 1865 makedep_scheme => 'VMS C',
abe256e7
RL
1866 AS => sub { vms_info()->{AS} },
1867 ASFLAGS => sub { vms_info()->{ASFLAGS} },
ab7134ef 1868 asoutflag => sub { vms_info()->{asoutflag} },
abe256e7 1869 asflags => sub { vms_info()->{asflags} },
ab7134ef
RL
1870 perlasm_scheme => sub { vms_info()->{perlasm_scheme} },
1871
d0ccefdb 1872 disable => add('pinshared', 'loadereng'),
d1dd5d6f 1873
e84193e4
RL
1874 },
1875
ab907189
RL
1876 # From HELP CC/POINTER_SIZE:
1877 #
1878 # ----------
1879 # LONG[=ARGV] The compiler assumes 64-bit pointers. If the ARGV option to
1880 # LONG or 64 is present, the main argument argv will be an
1881 # array of long pointers instead of an array of short pointers.
1882 #
1883 # 64[=ARGV] Same as LONG.
1884 # ----------
1885 #
1886 # We don't want the hassle of dealing with 32-bit pointers with argv, so
1887 # we force it to have 64-bit pointers, see the added cflags in the -p64
1888 # config targets below.
1889
e84193e4
RL
1890 "vms-alpha" => {
1891 inherit_from => [ "vms-generic" ],
ab907189
RL
1892 bn_ops => "SIXTY_FOUR_BIT RC4_INT",
1893 pointer_size => "",
e84193e4 1894 },
52d86d9b 1895 "vms-alpha-p32" => {
ab907189
RL
1896 inherit_from => [ "vms-alpha" ],
1897 cflags => add("/POINTER_SIZE=32"),
1898 pointer_size => "32",
e84193e4 1899 },
52d86d9b 1900 "vms-alpha-p64" => {
ab907189
RL
1901 inherit_from => [ "vms-alpha" ],
1902 cflags => add("/POINTER_SIZE=64=ARGV"),
1903 pointer_size => "64",
e84193e4
RL
1904 },
1905 "vms-ia64" => {
30478c97 1906 inherit_from => [ "vms-generic" ],
ab907189 1907 bn_ops => "SIXTY_FOUR_BIT RC4_INT",
e6f98ae4
RL
1908 asm_arch => sub { vms_info()->{AS} ? 'ia64' : undef },
1909 perlasm_scheme => 'ias',
ab907189 1910 pointer_size => "",
0f4844a9 1911
e84193e4 1912 },
52d86d9b 1913 "vms-ia64-p32" => {
ab907189
RL
1914 inherit_from => [ "vms-ia64" ],
1915 cflags => add("/POINTER_SIZE=32"),
1916 pointer_size => "32",
e84193e4 1917 },
52d86d9b 1918 "vms-ia64-p64" => {
ab907189
RL
1919 inherit_from => [ "vms-ia64" ],
1920 cflags => add("/POINTER_SIZE=64=ARGV"),
1921 pointer_size => "64",
e84193e4
RL
1922 },
1923
f09e7ca9 1924);