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