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