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