Move cast_asm_src file information to build.info files
[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         rc4_asm_src     => "rc4_enc.c rc4_skey.c",
18         rmd160_asm_src  => "",
19         rc5_asm_src     => "rc5_enc.c",
20         wp_asm_src      => "wp_block.c",
21         cmll_asm_src    => "camellia.c cmll_misc.c cmll_cbc.c",
22         modes_asm_src   => "",
23         padlock_asm_src => "",
24         chacha_asm_src  => "chacha_enc.c",
25         poly1305_asm_src        => "",
26         keccak1600_asm_src      => "keccak1600.c",
27
28         unistd          => "<unistd.h>",
29         shared_target   => "",
30         shared_cflag    => "",
31         shared_defines  => [],
32         shared_ldflag   => "",
33         shared_rcflag   => "",
34
35         #### Defaults for the benefit of the config targets who don't inherit
36         #### a BASE and assume Unix defaults
37         #### THESE WILL DISAPPEAR IN OpenSSL 1.2
38         build_scheme    => [ "unified", "unix" ],
39         build_file      => "Makefile",
40
41         AR              => "ar",
42         ARFLAGS         => "r",
43         CC              => "cc",
44         HASHBANGPERL    => "/usr/bin/env perl",
45         RANLIB          => sub { which("$config{cross_compile_prefix}ranlib")
46                                      ? "ranlib" : "" },
47         RC              => "windres",
48
49         #### THESE WILL BE ENABLED IN OpenSSL 1.2
50         #HASHBANGPERL   => "PERL", # Only Unix actually cares
51     },
52
53     BASE_common => {
54         template        => 1,
55
56         enable          => [],
57         disable         => [],
58
59         defines         =>
60             sub {
61                 my @defs = ();
62                 push @defs, "ZLIB" unless $disabled{zlib};
63                 push @defs, "ZLIB_SHARED" unless $disabled{"zlib-dynamic"};
64                 return [ @defs ];
65             },
66         includes        =>
67             sub {
68                 my @incs = ();
69                 push @incs, $withargs{zlib_include}
70                     if !$disabled{zlib} && $withargs{zlib_include};
71                 return [ @incs ];
72             },
73     },
74
75     BASE_unix => {
76         inherit_from    => [ "BASE_common" ],
77         template        => 1,
78
79         AR              => "ar",
80         ARFLAGS         => "r",
81         CC              => "cc",
82         lflags          =>
83             sub { $withargs{zlib_lib} ? "-L".$withargs{zlib_lib} : () },
84         ex_libs         =>
85             sub { !defined($disabled{zlib})
86                   && defined($disabled{"zlib-dynamic"})
87                   ? "-lz" : () },
88         HASHBANGPERL    => "/usr/bin/env perl", # Only Unix actually cares
89         RANLIB          => sub { which("$config{cross_compile_prefix}ranlib")
90                                      ? "ranlib" : "" },
91         RC              => "windres",
92
93         build_scheme    => [ "unified", "unix" ],
94         build_file      => "Makefile",
95
96         perl_platform   => 'Unix',
97     },
98
99     BASE_Windows => {
100         inherit_from    => [ "BASE_common" ],
101         template        => 1,
102
103         lib_defines      =>
104             sub {
105                 my @defs = ();
106                 unless ($disabled{"zlib-dynamic"}) {
107                     my $zlib = $withargs{zlib_lib} // "ZLIB1";
108                     push @defs, 'LIBZ=' . (quotify("perl", $zlib))[0];
109                 }
110                 return [ @defs ];
111             },
112         ex_libs         =>
113             sub {
114                 unless ($disabled{zlib}) {
115                     if (defined($disabled{"zlib-dynamic"})) {
116                         return $withargs{zlib_lib} // "ZLIB1";
117                     }
118                 }
119                 return ();
120             },
121
122         LD              => "link",
123         LDFLAGS         => "/nologo",
124         ldoutflag       => "/out:",
125         AR              => "lib",
126         ARFLAGS         => "/nologo",
127         aroutflag       => "/out:",
128         RC               => "rc",
129         rcoutflag        => "/fo",
130         MT              => "mt",
131         MTFLAGS         => "-nologo",
132         mtinflag        => "-manifest ",
133         mtoutflag       => "-outputresource:",
134
135         build_file      => "makefile",
136         build_scheme    => [ "unified", "windows" ],
137
138         perl_platform   => 'Windows',
139     },
140
141     BASE_VMS => {
142         inherit_from    => [ "BASE_common" ],
143         template        => 1,
144
145         includes        =>
146             add(sub {
147                     my @incs = ();
148                     # GNV$ZLIB_INCLUDE is the standard logical name for later
149                     # zlib incarnations.
150                     push @incs, 'GNV$ZLIB_INCLUDE:'
151                         if !$disabled{zlib} && !$withargs{zlib_include};
152                     return [ @incs ];
153                 }),
154
155         build_file       => "descrip.mms",
156         build_scheme     => [ "unified", "VMS" ],
157
158         perl_platform    => 'VMS',
159     },
160
161     x86_asm => {
162         template        => 1,
163         rc4_asm_src     => "rc4-586.s",
164         rmd160_asm_src  => "rmd-586.s",
165         rc5_asm_src     => "rc5-586.s",
166         wp_asm_src      => "wp_block.c wp-mmx.s",
167         cmll_asm_src    => "cmll-x86.s",
168         modes_asm_src   => "ghash-x86.s",
169         padlock_asm_src => "e_padlock-x86.s",
170         chacha_asm_src  => "chacha-x86.s",
171         poly1305_asm_src=> "poly1305-x86.s",
172     },
173     x86_elf_asm => {
174         template        => 1,
175         inherit_from    => [ "x86_asm" ],
176     },
177     x86_64_asm => {
178         template        => 1,
179         rc4_asm_src     => "rc4-x86_64.s rc4-md5-x86_64.s",
180         wp_asm_src      => "wp-x86_64.s",
181         cmll_asm_src    => "cmll-x86_64.s cmll_misc.c",
182         modes_asm_src   => "ghash-x86_64.s aesni-gcm-x86_64.s",
183         padlock_asm_src => "e_padlock-x86_64.s",
184         chacha_asm_src  => "chacha-x86_64.s",
185         poly1305_asm_src=> "poly1305-x86_64.s",
186         keccak1600_asm_src      => "keccak1600-x86_64.s",
187     },
188     ia64_asm => {
189         template        => 1,
190         modes_asm_src   => "ghash-ia64.s",
191         chacha_asm_src  => "chacha-ia64.S",
192         poly1305_asm_src=> "asm/poly1305-ia64.S",
193     },
194     sparcv9_asm => {
195         template        => 1,
196         cmll_asm_src    => "camellia.c cmll_misc.c cmll_cbc.c cmllt4-sparcv9.S",
197         modes_asm_src   => "ghash-sparcv9.S",
198         poly1305_asm_src=> "poly1305-sparcv9.S",
199     },
200     sparcv8_asm => {
201         template        => 1,
202     },
203     alpha_asm => {
204         template        => 1,
205         modes_asm_src   => "ghash-alpha.S",
206     },
207     mips32_asm => {
208         template        => 1,
209     },
210     mips64_asm => {
211         inherit_from    => [ "mips32_asm" ],
212         template        => 1,
213         poly1305_asm_src=> "poly1305-mips.S",
214     },
215     s390x_asm => {
216         template        => 1,
217         rc4_asm_src     => "rc4-s390x.s",
218         modes_asm_src   => "ghash-s390x.S",
219         chacha_asm_src  => "chacha-s390x.S",
220         poly1305_asm_src=> "poly1305-s390x.S",
221         keccak1600_asm_src      => "keccak1600-s390x.S",
222     },
223     armv4_asm => {
224         template        => 1,
225         modes_asm_src   => "ghash-armv4.S ghashv8-armx.S",
226         chacha_asm_src  => "chacha-armv4.S",
227         poly1305_asm_src=> "poly1305-armv4.S",
228         keccak1600_asm_src      => "keccak1600-armv4.S",
229     },
230     aarch64_asm => {
231         template        => 1,
232         modes_asm_src   => "ghashv8-armx.S",
233         chacha_asm_src  => "chacha-armv8.S",
234         poly1305_asm_src=> "poly1305-armv8.S",
235         keccak1600_asm_src      => "keccak1600-armv8.S",
236     },
237     parisc11_asm => {
238         template        => 1,
239         rc4_asm_src     => "rc4-parisc.s",
240         modes_asm_src   => "ghash-parisc.s",
241     },
242     parisc20_64_asm => {
243         template        => 1,
244         inherit_from    => [ "parisc11_asm" ],
245     },
246     ppc32_asm => {
247         template        => 1,
248         modes_asm_src   => "ghashp8-ppc.s",
249         chacha_asm_src  => "chacha-ppc.s",
250         poly1305_asm_src=> "poly1305-ppc.s poly1305-ppcfp.s",
251     },
252     ppc64_asm => {
253         inherit_from    => [ "ppc32_asm" ],
254         template        => 1,
255         keccak1600_asm_src      => "keccak1600-ppc64.s",
256     },
257 );