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