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