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