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