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