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