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