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