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