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