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