Build: remove EXTRA
[openssl.git] / Configurations / 00-base-templates.conf
1 # -*- Mode: perl -*-
2 my %targets=(
3     DEFAULTS => {
4         template        => 1,
5
6         cflags          => "",
7         cppflags        => "",
8         lflags          => "",
9         defines         => [],
10         includes        => [],
11         lib_cflags      => "",
12         lib_cppflags    => "",
13         lib_defines     => [],
14         thread_scheme   => "(unknown)", # Assume we don't know
15         thread_defines  => [],
16
17         apps_aux_src    => "",
18         apps_init_src   => "",
19         cpuid_asm_src   => "mem_clr.c",
20         uplink_aux_src  => "",
21         bn_asm_src      => "bn_asm.c",
22         ec_asm_src      => "",
23         des_asm_src     => "des_enc.c fcrypt_b.c",
24         aes_asm_src     => "aes_core.c aes_cbc.c",
25         bf_asm_src      => "bf_enc.c",
26         md5_asm_src     => "",
27         cast_asm_src    => "c_enc.c",
28         rc4_asm_src     => "rc4_enc.c rc4_skey.c",
29         rmd160_asm_src  => "",
30         rc5_asm_src     => "rc5_enc.c",
31         wp_asm_src      => "wp_block.c",
32         cmll_asm_src    => "camellia.c cmll_misc.c cmll_cbc.c",
33         modes_asm_src   => "",
34         padlock_asm_src => "",
35         chacha_asm_src  => "chacha_enc.c",
36         poly1305_asm_src        => "",
37         keccak1600_asm_src      => "keccak1600.c",
38
39         unistd          => "<unistd.h>",
40         shared_target   => "",
41         shared_cflag    => "",
42         shared_defines  => [],
43         shared_ldflag   => "",
44         shared_rcflag   => "",
45
46         #### Defaults for the benefit of the config targets who don't inherit
47         #### a BASE and assume Unix defaults
48         #### THESE WILL DISAPPEAR IN OpenSSL 1.2
49         build_scheme    => [ "unified", "unix" ],
50         build_file      => "Makefile",
51
52         AR              => "ar",
53         ARFLAGS         => "r",
54         CC              => "cc",
55         HASHBANGPERL    => "/usr/bin/env perl",
56         RANLIB          => sub { which("$config{cross_compile_prefix}ranlib")
57                                      ? "ranlib" : "" },
58         RC              => "windres",
59
60         #### THESE WILL BE ENABLED IN OpenSSL 1.2
61         #HASHBANGPERL   => "PERL", # Only Unix actually cares
62     },
63
64     BASE_common => {
65         template        => 1,
66
67         enable          => [],
68         disable         => [],
69
70         defines         =>
71             sub {
72                 my @defs = ();
73                 push @defs, "ZLIB" unless $disabled{zlib};
74                 push @defs, "ZLIB_SHARED" unless $disabled{"zlib-dynamic"};
75                 return [ @defs ];
76             },
77         includes        =>
78             sub {
79                 my @incs = ();
80                 push @incs, $withargs{zlib_include}
81                     if !$disabled{zlib} && $withargs{zlib_include};
82                 return [ @incs ];
83             },
84     },
85
86     BASE_unix => {
87         inherit_from    => [ "BASE_common" ],
88         template        => 1,
89
90         AR              => "ar",
91         ARFLAGS         => "r",
92         CC              => "cc",
93         lflags          =>
94             sub { $withargs{zlib_lib} ? "-L".$withargs{zlib_lib} : () },
95         ex_libs         =>
96             sub { !defined($disabled{zlib})
97                   && defined($disabled{"zlib-dynamic"})
98                   ? "-lz" : () },
99         HASHBANGPERL    => "/usr/bin/env perl", # Only Unix actually cares
100         RANLIB          => sub { which("$config{cross_compile_prefix}ranlib")
101                                      ? "ranlib" : "" },
102         RC              => "windres",
103
104         build_scheme    => [ "unified", "unix" ],
105         build_file      => "Makefile",
106
107         perl_platform   => 'Unix',
108     },
109
110     BASE_Windows => {
111         inherit_from    => [ "BASE_common" ],
112         template        => 1,
113
114         lib_defines      =>
115             sub {
116                 my @defs = ();
117                 unless ($disabled{"zlib-dynamic"}) {
118                     my $zlib = $withargs{zlib_lib} // "ZLIB1";
119                     push @defs, 'LIBZ=' . (quotify("perl", $zlib))[0];
120                 }
121                 return [ @defs ];
122             },
123         ex_libs         =>
124             sub {
125                 unless ($disabled{zlib}) {
126                     if (defined($disabled{"zlib-dynamic"})) {
127                         return $withargs{zlib_lib} // "ZLIB1";
128                     }
129                 }
130                 return ();
131             },
132
133         LD              => "link",
134         LDFLAGS         => "/nologo",
135         ldoutflag       => "/out:",
136         AR              => "lib",
137         ARFLAGS         => "/nologo",
138         aroutflag       => "/out:",
139         RC               => "rc",
140         rcoutflag        => "/fo",
141         MT              => "mt",
142         MTFLAGS         => "-nologo",
143         mtinflag        => "-manifest ",
144         mtoutflag       => "-outputresource:",
145
146         build_file      => "makefile",
147         build_scheme    => [ "unified", "windows" ],
148
149         perl_platform   => 'Windows',
150     },
151
152     BASE_VMS => {
153         inherit_from    => [ "BASE_common" ],
154         template        => 1,
155
156         includes        =>
157             add(sub {
158                     my @incs = ();
159                     # GNV$ZLIB_INCLUDE is the standard logical name for later
160                     # zlib incarnations.
161                     push @incs, 'GNV$ZLIB_INCLUDE:'
162                         if !$disabled{zlib} && !$withargs{zlib_include};
163                     return [ @incs ];
164                 }),
165
166         build_file       => "descrip.mms",
167         build_scheme     => [ "unified", "VMS" ],
168
169         perl_platform    => 'VMS',
170     },
171
172     uplink_common => {
173         template        => 1,
174         apps_init_src   => add("../ms/applink.c"),
175         uplink_aux_src  => add("../ms/uplink.c"),
176         defines         => add("OPENSSL_USE_APPLINK"),
177     },
178     x86_uplink => {
179         inherit_from    => [ "uplink_common" ],
180         template        => 1,
181         uplink_aux_src  => add("uplink-x86.s"),
182     },
183     x86_64_uplink => {
184         inherit_from    => [ "uplink_common" ],
185         template        => 1,
186         uplink_aux_src  => add("uplink-x86_64.s"),
187     },
188     ia64_uplink => {
189         inherit_from    => [ "uplink_common" ],
190         template        => 1,
191         uplink_aux_src  => add("uplink-ia64.s"),
192     },
193
194     x86_asm => {
195         template        => 1,
196         cpuid_asm_src   => "x86cpuid.s",
197         bn_asm_src      => "bn-586.s co-586.s x86-mont.s x86-gf2m.s",
198         ec_asm_src      => "ecp_nistz256.c ecp_nistz256-x86.s",
199         des_asm_src     => "des-586.s crypt586.s",
200         aes_asm_src     => "aes-586.s vpaes-x86.s aesni-x86.s",
201         bf_asm_src      => "bf-586.s",
202         md5_asm_src     => "md5-586.s",
203         cast_asm_src    => "cast-586.s",
204         sha1_asm_src    => "sha1-586.s sha256-586.s sha512-586.s",
205         rc4_asm_src     => "rc4-586.s",
206         rmd160_asm_src  => "rmd-586.s",
207         rc5_asm_src     => "rc5-586.s",
208         wp_asm_src      => "wp_block.c wp-mmx.s",
209         cmll_asm_src    => "cmll-x86.s",
210         modes_asm_src   => "ghash-x86.s",
211         padlock_asm_src => "e_padlock-x86.s",
212         chacha_asm_src  => "chacha-x86.s",
213         poly1305_asm_src=> "poly1305-x86.s",
214     },
215     x86_elf_asm => {
216         template        => 1,
217         inherit_from    => [ "x86_asm" ],
218         perlasm_scheme  => "elf"
219     },
220     x86_64_asm => {
221         template        => 1,
222         cpuid_asm_src   => "x86_64cpuid.s",
223         bn_asm_src      => "asm/x86_64-gcc.c x86_64-mont.s x86_64-mont5.s x86_64-gf2m.s rsaz_exp.c rsaz-x86_64.s rsaz-avx2.s",
224         ec_asm_src      => "ecp_nistz256.c ecp_nistz256-x86_64.s x25519-x86_64.s",
225         aes_asm_src     => "aes-x86_64.s vpaes-x86_64.s bsaes-x86_64.s aesni-x86_64.s aesni-sha1-x86_64.s aesni-sha256-x86_64.s aesni-mb-x86_64.s",
226         md5_asm_src     => "md5-x86_64.s",
227         sha1_asm_src    => "sha1-x86_64.s sha256-x86_64.s sha512-x86_64.s sha1-mb-x86_64.s sha256-mb-x86_64.s",
228         rc4_asm_src     => "rc4-x86_64.s rc4-md5-x86_64.s",
229         wp_asm_src      => "wp-x86_64.s",
230         cmll_asm_src    => "cmll-x86_64.s cmll_misc.c",
231         modes_asm_src   => "ghash-x86_64.s aesni-gcm-x86_64.s",
232         padlock_asm_src => "e_padlock-x86_64.s",
233         chacha_asm_src  => "chacha-x86_64.s",
234         poly1305_asm_src=> "poly1305-x86_64.s",
235         keccak1600_asm_src      => "keccak1600-x86_64.s",
236     },
237     ia64_asm => {
238         template        => 1,
239         cpuid_asm_src   => "ia64cpuid.s",
240         bn_asm_src      => "bn-ia64.s ia64-mont.s",
241         aes_asm_src     => "aes_core.c aes_cbc.c aes-ia64.s",
242         sha1_asm_src    => "sha1-ia64.s sha256-ia64.s sha512-ia64.s",
243         modes_asm_src   => "ghash-ia64.s",
244         perlasm_scheme  => "void"
245     },
246     sparcv9_asm => {
247         template        => 1,
248         cpuid_asm_src   => "sparcv9cap.c sparccpuid.S",
249         bn_asm_src      => "asm/sparcv8plus.S sparcv9-mont.S sparcv9a-mont.S vis3-mont.S sparct4-mont.S sparcv9-gf2m.S",
250         ec_asm_src      => "ecp_nistz256.c ecp_nistz256-sparcv9.S",
251         des_asm_src     => "des_enc-sparc.S fcrypt_b.c dest4-sparcv9.S",
252         aes_asm_src     => "aes_core.c aes_cbc.c aes-sparcv9.S aest4-sparcv9.S aesfx-sparcv9.S",
253         md5_asm_src     => "md5-sparcv9.S",
254         sha1_asm_src    => "sha1-sparcv9.S sha256-sparcv9.S sha512-sparcv9.S",
255         cmll_asm_src    => "camellia.c cmll_misc.c cmll_cbc.c cmllt4-sparcv9.S",
256         modes_asm_src   => "ghash-sparcv9.S",
257         poly1305_asm_src=> "poly1305-sparcv9.S",
258         perlasm_scheme  => "void"
259     },
260     sparcv8_asm => {
261         template        => 1,
262         cpuid_asm_src   => "",
263         bn_asm_src      => "asm/sparcv8.S",
264         des_asm_src     => "des_enc-sparc.S fcrypt_b.c",
265         perlasm_scheme  => "void"
266     },
267     alpha_asm => {
268         template        => 1,
269         cpuid_asm_src   => "alphacpuid.s",
270         bn_asm_src      => "bn_asm.c alpha-mont.S",
271         sha1_asm_src    => "sha1-alpha.S",
272         modes_asm_src   => "ghash-alpha.S",
273         perlasm_scheme  => "void"
274     },
275     mips32_asm => {
276         template        => 1,
277         bn_asm_src      => "bn-mips.S mips-mont.S",
278         aes_asm_src     => "aes_cbc.c aes-mips.S",
279         sha1_asm_src    => "sha1-mips.S sha256-mips.S",
280     },
281     mips64_asm => {
282         inherit_from    => [ "mips32_asm" ],
283         template        => 1,
284         sha1_asm_src    => add("sha512-mips.S"),
285         poly1305_asm_src=> "poly1305-mips.S",
286     },
287     s390x_asm => {
288         template        => 1,
289         cpuid_asm_src   => "s390xcap.c s390xcpuid.S",
290         bn_asm_src      => "asm/s390x.S s390x-mont.S s390x-gf2m.s",
291         aes_asm_src     => "aes-s390x.S aes-ctr.fake aes-xts.fake",
292         sha1_asm_src    => "sha1-s390x.S sha256-s390x.S sha512-s390x.S",
293         rc4_asm_src     => "rc4-s390x.s",
294         modes_asm_src   => "ghash-s390x.S",
295         chacha_asm_src  => "chacha-s390x.S",
296         poly1305_asm_src=> "poly1305-s390x.S",
297         keccak1600_asm_src      => "keccak1600-s390x.S",
298     },
299     armv4_asm => {
300         template        => 1,
301         cpuid_asm_src   => "armcap.c armv4cpuid.S",
302         bn_asm_src      => "bn_asm.c armv4-mont.S armv4-gf2m.S",
303         ec_asm_src      => "ecp_nistz256.c ecp_nistz256-armv4.S",
304         aes_asm_src     => "aes_cbc.c aes-armv4.S bsaes-armv7.S aesv8-armx.S",
305         sha1_asm_src    => "sha1-armv4-large.S sha256-armv4.S sha512-armv4.S",
306         modes_asm_src   => "ghash-armv4.S ghashv8-armx.S",
307         chacha_asm_src  => "chacha-armv4.S",
308         poly1305_asm_src=> "poly1305-armv4.S", 
309         keccak1600_asm_src      => "keccak1600-armv4.S",
310         perlasm_scheme  => "void"
311     },
312     aarch64_asm => {
313         template        => 1,
314         cpuid_asm_src   => "armcap.c arm64cpuid.S",
315         ec_asm_src      => "ecp_nistz256.c ecp_nistz256-armv8.S",
316         bn_asm_src      => "bn_asm.c armv8-mont.S",
317         aes_asm_src     => "aes_core.c aes_cbc.c aesv8-armx.S vpaes-armv8.S",
318         sha1_asm_src    => "sha1-armv8.S sha256-armv8.S sha512-armv8.S",
319         modes_asm_src   => "ghashv8-armx.S",
320         chacha_asm_src  => "chacha-armv8.S",
321         poly1305_asm_src=> "poly1305-armv8.S",
322         keccak1600_asm_src      => "keccak1600-armv8.S",
323     },
324     parisc11_asm => {
325         template        => 1,
326         cpuid_asm_src   => "pariscid.s",
327         bn_asm_src      => "bn_asm.c parisc-mont.s",
328         aes_asm_src     => "aes_core.c aes_cbc.c aes-parisc.s",
329         sha1_asm_src    => "sha1-parisc.s sha256-parisc.s sha512-parisc.s",
330         rc4_asm_src     => "rc4-parisc.s",
331         modes_asm_src   => "ghash-parisc.s",
332         perlasm_scheme  => "32"
333     },
334     parisc20_64_asm => {
335         template        => 1,
336         inherit_from    => [ "parisc11_asm" ],
337         perlasm_scheme  => "64",
338     },
339     ppc32_asm => {
340         template        => 1,
341         cpuid_asm_src   => "ppccpuid.s ppccap.c",
342         bn_asm_src      => "bn-ppc.s ppc-mont.s",
343         aes_asm_src     => "aes_core.c aes_cbc.c aes-ppc.s vpaes-ppc.s aesp8-ppc.s",
344         sha1_asm_src    => "sha1-ppc.s sha256-ppc.s sha512-ppc.s sha256p8-ppc.s sha512p8-ppc.s",
345         modes_asm_src   => "ghashp8-ppc.s",
346         chacha_asm_src  => "chacha-ppc.s",
347         poly1305_asm_src=> "poly1305-ppc.s poly1305-ppcfp.s",
348     },
349     ppc64_asm => {
350         inherit_from    => [ "ppc32_asm" ],
351         template        => 1,
352         ec_asm_src      => "ecp_nistz256.c ecp_nistz256-ppc64.s x25519-ppc64.s",
353         keccak1600_asm_src      => "keccak1600-ppc64.s",
354     },
355 );