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