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