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