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