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