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