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