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