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