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