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