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