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