2 ## Standard openssl configuration targets.
6 #### Basic configs that should work on any 32-bit box
10 debug_cflags => "-O0 -g",
11 release_cflags => "-O3",
12 thread_cflag => "(unknown)",
18 thread_cflag => "(unknown)",
21 #### VOS Configurations
23 inherit_from => [ "BASE_unix" ],
25 cflags => "-Wall -DOPENSSL_SYS_VOS -D_POSIX_C_SOURCE=200112L -D_BSD -D_VOS_EXTENDED_NAMES -DB_ENDIAN",
26 debug_cflags => "-O0 -g -DBN_DEBUG -DREF_DEBUG -DCONF_DEBUG",
27 release_cflags => "-O3",
28 thread_cflag => "(unknown)",
32 shared_extension => ".so",
35 #### Solaris configurations
37 inherit_from => [ "BASE_unix" ],
39 cflags => "-DFILIO_H",
40 ex_libs => add("-lresolv -lsocket -lnsl -ldl"),
41 dso_scheme => "dlfcn",
42 shared_target => "solaris-shared",
43 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
45 #### Solaris x86 with GNU C setups
46 "solaris-x86-gcc" => {
47 # -DOPENSSL_NO_INLINE_ASM switches off inline assembler. We have
48 # to do it here because whenever GNU C instantiates an assembler
49 # template it surrounds it with #APP #NO_APP comment pair which
50 # (at least Solaris 7_x86) /usr/ccs/bin/as fails to assemble
51 # with "Illegal mnemonic" error message.
52 inherit_from => [ "solaris-common", asm("x86_elf_asm") ],
54 cflags => add_before("-Wall -DL_ENDIAN -DOPENSSL_NO_INLINE_ASM"),
55 debug_cflags => "-O0 -g",
56 release_cflags => "-O3 -fomit-frame-pointer",
57 thread_cflag => "-pthread",
59 shared_cflag => "-fPIC",
60 shared_ldflag => "-shared",
62 "solaris64-x86_64-gcc" => {
63 # -shared -static-libgcc might appear controversial, but modules
64 # taken from static libgcc do not have relocations and linking
65 # them into our shared objects doesn't have any negative side
66 # effects. On the contrary, doing so makes it possible to use
67 # gcc shared build with Sun C. Given that gcc generates faster
68 # code [thanks to inline assembler], I would actually recommend
69 # to consider using gcc shared build even with vendor compiler:-)
70 # <appro@fy.chalmers.se>
71 inherit_from => [ "solaris-common", asm("x86_64_asm") ],
73 cflags => add_before("-m64 -Wall -DL_ENDIAN"),
74 debug_cflags => "-O0 -g",
75 release_cflags => "-O3",
76 thread_cflag => "-pthread",
77 bn_ops => "SIXTY_FOUR_BIT_LONG",
78 perlasm_scheme => "elf",
79 shared_cflag => "-fPIC",
80 shared_ldflag => "-m64 -shared -static-libgcc",
84 #### Solaris x86 with Sun C setups
86 inherit_from => [ "solaris-common" ],
88 cflags => add_before("-xarch=generic -xstrconst -Xa -DL_ENDIAN"),
90 release_cflags => "-xO5 -xregs=frameptr -xdepend -xbuiltin",
91 thread_cflag => "-D_REENTRANT",
93 ex_libs => add("-lpthread"),
94 bn_ops => "BN_LLONG RC4_CHAR",
95 shared_cflag => "-KPIC",
96 shared_ldflag => "-G -dy -z text",
98 "solaris64-x86_64-cc" => {
99 inherit_from => [ "solaris-common", asm("x86_64_asm") ],
101 cflags => add_before("-xarch=generic64 -xstrconst -Xa -DL_ENDIAN"),
102 debug_cflags => "-g",
103 release_cflags => "-xO5 -xdepend -xbuiltin",
104 thread_cflag => "-D_REENTRANT",
105 lflags => add("-mt"),
106 ex_libs => add("-lpthread"),
107 bn_ops => "SIXTY_FOUR_BIT_LONG",
108 perlasm_scheme => "elf",
109 shared_cflag => "-KPIC",
110 shared_ldflag => "-xarch=generic64 -G -dy -z text",
114 #### SPARC Solaris with GNU C setups
115 "solaris-sparcv7-gcc" => {
116 inherit_from => [ "solaris-common" ],
118 cflags => add_before("-Wall -DB_ENDIAN -DBN_DIV2W"),
119 debug_cflags => "-O0 -g",
120 release_cflags => "-O3",
121 thread_cflag => "-pthread",
122 bn_ops => "BN_LLONG RC4_CHAR",
123 shared_cflag => "-fPIC",
124 shared_ldflag => "-shared",
126 "solaris-sparcv8-gcc" => {
127 inherit_from => [ "solaris-sparcv7-gcc", asm("sparcv8_asm") ],
128 cflags => add_before("-mcpu=v8"),
130 "solaris-sparcv9-gcc" => {
131 # -m32 should be safe to add as long as driver recognizes
133 inherit_from => [ "solaris-sparcv7-gcc", asm("sparcv9_asm") ],
134 cflags => add_before("-m32 -mcpu=ultrasparc"),
135 debug_cflags => "-DBN_DEBUG -DREF_DEBUG -DCONF_DEBUG -DBN_CTX_DEBUG -DPEDANTIC -O -g -pedantic -ansi -Wshadow -Wno-long-long -D__EXTENSIONS__",
137 "solaris64-sparcv9-gcc" => {
138 inherit_from => [ "solaris-sparcv9-gcc" ],
139 cflags => sub { my $f=join(" ",@_); $f =~ s/\-m32/-m64/; $f; },
140 bn_ops => "BN_LLONG RC4_CHAR",
141 shared_ldflag => "-m64 -shared",
145 #### SPARC Solaris with Sun C setups
146 # SC4.0 doesn't pass 'make test', upgrade to SC5.0 or SC4.2.
147 # SC4.2 is ok, better than gcc even on bn as long as you tell it -xarch=v8
148 # SC5.0 note: Compiler common patch 107357-01 or later is required!
149 "solaris-sparcv7-cc" => {
150 inherit_from => [ "solaris-common" ],
152 cflags => add_before("-xstrconst -Xa -DB_ENDIAN -DBN_DIV2W"),
153 debug_cflags => "-g -DBN_DEBUG -DREF_DEBUG -DCONF_DEBUG -DBN_CTX_DEBUG",
154 release_cflags => "-xO5 -xdepend",
155 thread_cflag => "-D_REENTRANT",
156 lflags => add("-mt"),
157 ex_libs => add("-lpthread"),
158 bn_ops => "BN_LLONG RC4_CHAR",
159 shared_cflag => "-KPIC",
160 shared_ldflag => "-G -dy -z text",
163 "solaris-sparcv8-cc" => {
164 inherit_from => [ "solaris-sparcv7-cc", asm("sparcv8_asm") ],
165 cflags => add_before("-xarch=v8"),
167 "solaris-sparcv9-cc" => {
168 inherit_from => [ "solaris-sparcv7-cc", asm("sparcv9_asm") ],
169 cflags => add_before("-xarch=v8plus -xtarget=ultra"),
171 "solaris64-sparcv9-cc" => {
172 inherit_from => [ "solaris-sparcv7-cc", asm("sparcv9_asm") ],
173 cflags => add_before("-xarch=v9 -xtarget=ultra"),
174 bn_ops => "BN_LLONG RC4_CHAR",
175 shared_ldflag => "-xarch=v9 -G -dy -z text",
179 #### IRIX 5.x configs
180 # -mips2 flag is added by ./config when appropriate.
182 inherit_from => [ "BASE_unix", asm("mips32_asm") ],
184 cflags => "-DB_ENDIAN",
185 debug_cflags => "-g -O0",
186 release_cflags => "-O3",
187 thread_cflag => "(unknown)",
188 bn_ops => "BN_LLONG RC4_CHAR",
189 perlasm_scheme => "o32",
190 dso_scheme => "dlfcn",
191 shared_target => "irix-shared",
192 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
195 inherit_from => [ "BASE_unix", asm("mips32_asm") ],
197 cflags => "-use_readonly_const -DB_ENDIAN",
198 debug_cflags => "-g -O0",
199 release_cflags => "-O2",
200 thread_cflag => "(unknown)",
201 bn_ops => "BN_LLONG RC4_CHAR",
202 perlasm_scheme => "o32",
203 dso_scheme => "dlfcn",
204 shared_target => "irix-shared",
205 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
207 #### IRIX 6.x configs
208 # Only N32 and N64 ABIs are supported. If you need O32 ABI build, invoke
209 # './Configure irix-cc -o32' manually.
210 "irix-mips3-gcc" => {
211 inherit_from => [ "BASE_unix", asm("mips64_asm") ],
213 cflags => "-mabi=n32 -DB_ENDIAN -DBN_DIV3W",
214 debug_cflags => "-g -O0",
215 release_cflags => "-O3",
216 thread_cflag => "-D_SGI_MP_SOURCE -pthread",
217 bn_ops => "RC4_CHAR SIXTY_FOUR_BIT",
218 perlasm_scheme => "n32",
219 dso_scheme => "dlfcn",
220 shared_target => "irix-shared",
221 shared_ldflag => "-mabi=n32",
222 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
226 inherit_from => [ "BASE_unix", asm("mips64_asm") ],
228 cflags => "-n32 -mips3 -use_readonly_const -G0 -rdata_shared -DB_ENDIAN -DBN_DIV3W",
229 debug_cflags => "-g -O0",
230 release_cflags => "-O2",
231 thread_cflag => "-D_SGI_MP_SOURCE",
232 ex_libs => add("-lpthread"),
233 bn_ops => "RC4_CHAR SIXTY_FOUR_BIT",
234 perlasm_scheme => "n32",
235 dso_scheme => "dlfcn",
236 shared_target => "irix-shared",
237 shared_ldflag => "-n32",
238 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
242 "irix64-mips4-gcc" => {
243 inherit_from => [ "BASE_unix", asm("mips64_asm") ],
245 cflags => "-mabi=64 -mips4 -DB_ENDIAN -DBN_DIV3W",
246 debug_cflags => "-g -O0",
247 release_cflags => "-O3",
248 thread_cflag => "-D_SGI_MP_SOURCE",
249 bn_ops => "RC4_CHAR SIXTY_FOUR_BIT_LONG",
250 perlasm_scheme => "64",
251 dso_scheme => "dlfcn",
252 shared_target => "irix-shared",
253 shared_ldflag => "-mabi=64",
254 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
257 "irix64-mips4-cc" => {
258 inherit_from => [ "BASE_unix", asm("mips64_asm") ],
260 cflags => "-64 -mips4 -use_readonly_const -G0 -rdata_shared -DB_ENDIAN -DBN_DIV3W",
261 debug_cflags => "-g -O0",
262 release_cflags => "-O2",
263 thread_cflag => "-D_SGI_MP_SOURCE",
264 ex_libs => add("-lpthread"),
265 bn_ops => "RC4_CHAR SIXTY_FOUR_BIT_LONG",
266 perlasm_scheme => "64",
267 dso_scheme => "dlfcn",
268 shared_target => "irix-shared",
269 shared_ldflag => "-64",
270 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
274 #### Unified HP-UX ANSI C configs.
276 # - Originally we were optimizing at +O4 level. It should be noted
277 # that the only difference between +O3 and +O4 is global inter-
278 # procedural analysis. As it has to be performed during the link
279 # stage the compiler leaves behind certain pseudo-code in lib*.a
280 # which might be release or even patch level specific. Generating
281 # the machine code for and analyzing the *whole* program appears
282 # to be *extremely* memory demanding while the performance gain is
283 # actually questionable. The situation is intensified by the default
284 # HP-UX data set size limit (infamous 'maxdsiz' tunable) of 64MB
285 # which is way too low for +O4. In other words, doesn't +O3 make
287 # - Keep in mind that the HP compiler by default generates code
288 # suitable for execution on the host you're currently compiling at.
289 # If the toolkit is meant to be used on various PA-RISC processors
290 # consider './Configure hpux-parisc-[g]cc +DAportable'.
291 # - -DMD32_XARRAY triggers workaround for compiler bug we ran into in
292 # 32-bit message digests. (For the moment of this writing) HP C
293 # doesn't seem to "digest" too many local variables (they make "him"
294 # chew forever:-). For more details look-up MD32_XARRAY comment in
295 # crypto/sha/sha_lcl.h.
296 # - originally there were 32-bit hpux-parisc2-* targets. They were
297 # scrapped, because a) they were not interchangeable with other 32-bit
298 # targets; a) when critical 32-bit assembly modules detect if they
299 # are executed on PA-RISC 2.0 and thus adequate performance is
301 # <appro@fy.chalmers.se>
302 "hpux-parisc-gcc" => {
303 inherit_from => [ "BASE_unix" ],
305 cflags => "-DB_ENDIAN -DBN_DIV2W",
306 debug_cflags => "-O0 -g",
307 release_cflags => "-O3",
308 thread_cflag => "-pthread",
309 ex_libs => add("-Wl,+s -ldld"),
310 bn_ops => "BN_LLONG",
312 shared_target => "hpux-shared",
313 shared_cflag => "-fPIC",
314 shared_ldflag => "-shared",
315 shared_extension => ".sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
317 "hpux-parisc1_1-gcc" => {
318 inherit_from => [ "hpux-parisc-gcc", asm("parisc11_asm") ],
319 multilib => "/pa1.1",
321 "hpux64-parisc2-gcc" => {
322 inherit_from => [ "BASE_unix", asm("parisc20_64_asm") ],
324 cflags => "-DB_ENDIAN",
325 debug_cflags => "-O0 -g",
326 release_cflags => "-O3",
327 thread_cflag => "-D_REENTRANT",
328 ex_libs => add("-ldl"),
329 bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
330 dso_scheme => "dlfcn",
331 shared_target => "hpux-shared",
332 shared_cflag => "-fpic",
333 shared_ldflag => "-shared",
334 shared_extension => ".sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
335 multilib => "/pa20_64",
338 # More attempts at unified 10.X and 11.X targets for HP C compiler.
340 # Chris Ruemmler <ruemmler@cup.hp.com>
341 # Kevin Steves <ks@hp.se>
342 "hpux-parisc-cc" => {
343 inherit_from => [ "BASE_unix" ],
345 cflags => "+Optrs_strongly_typed -Ae +ESlit -DB_ENDIAN -DBN_DIV2W -DMD32_XARRAY",
346 debug_cflags => "+O0 +d -g",
347 release_cflags => "+O3",
348 thread_cflag => "-D_REENTRANT",
349 ex_libs => add("-Wl,+s -ldld -lpthread"),
350 bn_ops => "RC4_CHAR",
352 shared_target => "hpux-shared",
353 shared_cflag => "+Z",
354 shared_ldflag => "-b",
355 shared_extension => ".sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
357 "hpux-parisc1_1-cc" => {
358 inherit_from => [ "hpux-parisc-cc", asm("parisc11_asm") ],
359 cflags => add_before("+DA1.1"),
360 multilib => "/pa1.1",
362 "hpux64-parisc2-cc" => {
363 inherit_from => [ "BASE_unix", asm("parisc20_64_asm") ],
365 cflags => "+DD64 +Optrs_strongly_typed -Ae +ESlit -DB_ENDIAN -DMD32_XARRAY",
366 debug_cflags => "+O0 +d -g",
367 release_cflags => "+O3",
368 thread_cflag => "-D_REENTRANT",
369 ex_libs => add("-ldl -lpthread"),
370 bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
371 dso_scheme => "dlfcn",
372 shared_target => "hpux-shared",
373 shared_cflag => "+Z",
374 shared_ldflag => "+DD64 -b",
375 shared_extension => ".sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
376 multilib => "/pa20_64",
379 # HP/UX IA-64 targets
381 inherit_from => [ "BASE_unix", asm("ia64_asm") ],
383 cflags => "-Ae +DD32 +Olit=all -z -DB_ENDIAN",
384 debug_cflags => "+O0 +d -g",
385 release_cflags => "+O2",
386 thread_cflag => "-D_REENTRANT",
387 ex_libs => add("-ldl -lpthread"),
388 bn_ops => "SIXTY_FOUR_BIT",
389 dso_scheme => "dlfcn",
390 shared_target => "hpux-shared",
391 shared_cflag => "+Z",
392 shared_ldflag => "+DD32 -b",
393 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
394 multilib => "/hpux32",
396 # Frank Geurts <frank.geurts@nl.abnamro.com> has patiently assisted
397 # with debugging of the following config.
398 "hpux64-ia64-cc" => {
399 inherit_from => [ "BASE_unix", asm("ia64_asm") ],
401 cflags => "-Ae +DD64 +Olit=all -z -DB_ENDIAN",
402 debug_cflags => "+O0 +d -g",
403 release_cflags => "+O3",
404 thread_cflag => "-D_REENTRANT",
405 ex_libs => add("-ldl -lpthread"),
406 bn_ops => "SIXTY_FOUR_BIT_LONG",
407 dso_scheme => "dlfcn",
408 shared_target => "hpux-shared",
409 shared_cflag => "+Z",
410 shared_ldflag => "+DD64 -b",
411 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
412 multilib => "/hpux64",
416 inherit_from => [ "BASE_unix", asm("ia64_asm") ],
418 cflags => "-DB_ENDIAN",
419 debug_cflags => "-O0 -g",
420 release_cflags => "-O3",
421 thread_cflag => "-pthread",
422 ex_libs => add("-ldl"),
423 bn_ops => "SIXTY_FOUR_BIT",
424 dso_scheme => "dlfcn",
425 shared_target => "hpux-shared",
426 shared_cflag => "-fpic",
427 shared_ldflag => "-shared",
428 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
429 multilib => "/hpux32",
431 "hpux64-ia64-gcc" => {
432 inherit_from => [ "BASE_unix", asm("ia64_asm") ],
434 cflags => "-mlp64 -DB_ENDIAN",
435 debug_cflags => "-O0 -g",
436 release_cflags => "-O3",
437 thread_cflag => "-pthread",
438 ex_libs => add("-ldl"),
439 bn_ops => "SIXTY_FOUR_BIT_LONG",
440 dso_scheme => "dlfcn",
441 shared_target => "hpux-shared",
442 shared_cflag => "-fpic",
443 shared_ldflag => "-mlp64 -shared",
444 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
445 multilib => "/hpux64",
448 #### HP MPE/iX http://jazz.external.hp.com/src/openssl/
450 inherit_from => [ "BASE_unix" ],
452 cflags => "-D_ENDIAN -DBN_DIV2W -O3 -D_POSIX_SOURCE -D_SOCKET_SOURCE -I/SYSLOG/PUB",
453 thread_cflag => "(unknown)",
455 ex_libs => add("-L/SYSLOG/PUB -lsyslog -lsocket -lcurses"),
456 bn_ops => "BN_LLONG",
459 #### DEC Alpha OSF/1/Tru64 targets.
460 "osf1-alpha-gcc" => {
461 inherit_from => [ "BASE_unix", asm("alpha_asm") ],
464 thread_cflag => "(unknown)",
465 bn_ops => "SIXTY_FOUR_BIT_LONG",
466 dso_scheme => "dlfcn",
467 shared_target => "alpha-osf1-shared",
468 shared_extension => ".so",
471 inherit_from => [ "BASE_unix", asm("alpha_asm") ],
473 cflags => "-std1 -tune host -O4 -readonly_strings",
474 thread_cflag => "(unknown)",
475 bn_ops => "SIXTY_FOUR_BIT_LONG",
476 dso_scheme => "dlfcn",
477 shared_target => "alpha-osf1-shared",
478 shared_extension => ".so",
480 "tru64-alpha-cc" => {
481 inherit_from => [ "BASE_unix", asm("alpha_asm") ],
483 cflags => "-std1 -tune host -fast -readonly_strings",
484 thread_cflag => "-pthread",
485 bn_ops => "SIXTY_FOUR_BIT_LONG",
486 dso_scheme => "dlfcn",
487 shared_target => "alpha-osf1-shared",
488 shared_ldflag => "-msym",
489 shared_extension => ".so",
493 #### Variety of LINUX:-)
495 # *-generic* is endian-neutral target, but ./config is free to
496 # throw in -D[BL]_ENDIAN, whichever appropriate...
497 "linux-generic32" => {
498 inherit_from => [ "BASE_unix" ],
501 debug_cflags => "-O0 -g -DBN_DEBUG -DREF_DEBUG -DCONF_DEBUG",
502 release_cflags => "-O3",
503 thread_cflag => "-pthread",
504 ex_libs => add("-ldl"),
505 bn_ops => "BN_LLONG RC4_CHAR",
506 dso_scheme => "dlfcn",
507 shared_target => "linux-shared",
508 shared_cflag => "-fPIC",
509 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
511 "linux-generic64" => {
512 inherit_from => [ "linux-generic32" ],
513 bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
517 inherit_from => [ "linux-generic32", asm("ppc32_asm") ],
518 perlasm_scheme => "linux32",
521 inherit_from => [ "linux-generic64", asm("ppc64_asm") ],
522 cflags => "-m64 -Wall -DB_ENDIAN",
523 perlasm_scheme => "linux64",
524 shared_ldflag => "-m64",
528 inherit_from => [ "linux-generic64", asm("ppc64_asm") ],
529 cflags => "-m64 -Wall -DL_ENDIAN",
530 perlasm_scheme => "linux64le",
531 shared_ldflag => "-m64",
535 ################################################################
536 # Note that -march is not among compiler options in linux-armv4
537 # target description. Not specifying one is intentional to give
540 # a) rely on your compiler default by not specifying one;
541 # b) specify your target platform explicitly for optimal
542 # performance, e.g. -march=armv6 or -march=armv7-a;
543 # c) build "universal" binary that targets *range* of platforms
544 # by specifying minimum and maximum supported architecture;
546 # As for c) option. It actually makes no sense to specify
547 # maximum to be less than ARMv7, because it's the least
548 # requirement for run-time switch between platform-specific
549 # code paths. And without run-time switch performance would be
550 # equivalent to one for minimum. Secondly, there are some
551 # natural limitations that you'd have to accept and respect.
552 # Most notably you can *not* build "universal" binary for
553 # big-endian platform. This is because ARMv7 processor always
554 # picks instructions in little-endian order. Another similar
555 # limitation is that -mthumb can't "cross" -march=armv6t2
556 # boundary, because that's where it became Thumb-2. Well, this
557 # limitation is a bit artificial, because it's not really
558 # impossible, but it's deemed too tricky to support. And of
559 # course you have to be sure that your binutils are actually
560 # up to the task of handling maximum target platform. With all
561 # this in mind here is an example of how to configure
564 # ./Configure linux-armv4 -march=armv6 -D__ARM_MAX_ARCH__=8
566 inherit_from => [ "linux-generic32", asm("armv4_asm") ],
567 perlasm_scheme => "linux32",
570 inherit_from => [ "linux-generic64", asm("aarch64_asm") ],
571 perlasm_scheme => "linux64",
573 "linux-arm64ilp32" => { # https://wiki.linaro.org/Platform/arm64-ilp32
574 inherit_from => [ "linux-generic32", asm("aarch64_asm") ],
575 cflags => "-mabi=ilp32 -Wall",
576 bn_ops => "SIXTY_FOUR_BIT RC4_CHAR",
577 perlasm_scheme => "linux64",
578 shared_ldflag => "-mabi=ilp32",
582 # Configure script adds minimally required -march for assembly
583 # support, if no -march was specified at command line.
584 inherit_from => [ "linux-generic32", asm("mips32_asm") ],
585 cflags => "-mabi=32 -Wall -DBN_DIV3W",
586 perlasm_scheme => "o32",
587 shared_ldflag => "-mabi=32",
589 # mips32 and mips64 below refer to contemporary MIPS Architecture
590 # specifications, MIPS32 and MIPS64, rather than to kernel bitness.
592 inherit_from => [ "linux-generic32", asm("mips64_asm") ],
593 cflags => "-mabi=n32 -Wall -DBN_DIV3W",
594 bn_ops => "SIXTY_FOUR_BIT RC4_CHAR",
595 perlasm_scheme => "n32",
596 shared_ldflag => "-mabi=n32",
599 "linux64-mips64" => {
600 inherit_from => [ "linux-generic64", asm("mips64_asm") ],
601 cflags => "-mabi=64 -O3 -Wall -DBN_DIV3W",
602 perlasm_scheme => "64",
603 shared_ldflag => "-mabi=64",
607 #### IA-32 targets...
609 inherit_from => [ "linux-generic32", asm("x86_elf_asm") ],
611 cflags => "-DL_ENDIAN -Wall",
612 debug_cflags => "-O0 -g -DBN_DEBUG -DREF_DEBUG -DCONF_DEBUG -DBN_CTX_DEBUG",
613 release_cflags => "-O3 -fomit-frame-pointer",
614 debug_ex_libs => "-lefence",
615 bn_ops => "BN_LLONG",
618 inherit_from => [ "BASE_unix", asm("x86_asm") ],
620 cflags => "-DL_ENDIAN -Wall",
621 debug_cflags => "-O0 -g",
622 release_cflags => "-O3 -fomit-frame-pointer",
623 thread_cflag => "(unknown)",
624 bn_ops => "BN_LLONG",
625 perlasm_scheme => "a.out",
629 inherit_from => [ "linux-generic64", asm("x86_64_asm") ],
630 cflags => "-m64 -DL_ENDIAN -Wall",
631 bn_ops => "SIXTY_FOUR_BIT_LONG",
632 perlasm_scheme => "elf",
633 shared_ldflag => "-m64",
636 "linux-x86_64-clang" => {
637 inherit_from => [ "linux-x86_64" ],
639 cflags => "-m64 -DL_ENDIAN -Wall -Wextra -Qunused-arguments",
642 inherit_from => [ "linux-generic32", asm("x86_64_asm") ],
643 cflags => "-mx32 -DL_ENDIAN -Wall",
644 bn_ops => "SIXTY_FOUR_BIT",
645 perlasm_scheme => "elf",
646 shared_ldflag => "-mx32",
651 inherit_from => [ "linux-generic64", asm("ia64_asm") ],
652 bn_ops => "SIXTY_FOUR_BIT_LONG",
656 inherit_from => [ "linux-generic64", asm("s390x_asm") ],
657 cflags => "-m64 -Wall -DB_ENDIAN",
658 perlasm_scheme => "64",
659 shared_ldflag => "-m64",
663 #### So called "highgprs" target for z/Architecture CPUs
664 # "Highgprs" is kernel feature first implemented in Linux
665 # 2.6.32, see /proc/cpuinfo. The idea is to preserve most
666 # significant bits of general purpose registers not only
667 # upon 32-bit process context switch, but even on
668 # asynchronous signal delivery to such process. This makes
669 # it possible to deploy 64-bit instructions even in legacy
670 # application context and achieve better [or should we say
671 # adequate] performance. The build is binary compatible with
672 # linux-generic32, and the idea is to be able to install the
673 # resulting libcrypto.so alongside generic one, e.g. as
674 # /lib/highgprs/libcrypto.so.x.y, for ldconfig and run-time
675 # linker to autodiscover. Unfortunately it doesn't work just
676 # yet, because of couple of bugs in glibc
677 # sysdeps/s390/dl-procinfo.c affecting ldconfig and ld.so.1...
679 inherit_from => [ "linux-generic32", asm("s390x_asm") ],
680 cflags => "-m31 -Wall -Wa,-mzarch -DB_ENDIAN",
681 bn_obj => sub { my $r=join(" ",@_); $r=~s/bn\-s390x/bn_asm/; $r; },
682 perlasm_scheme => "31",
683 shared_ldflag => "-m31",
684 multilib => "/highgprs",
687 #### SPARC Linux setups
688 # Ray Miller <ray.miller@computing-services.oxford.ac.uk> has
689 # patiently assisted with debugging of following two configs.
691 inherit_from => [ "linux-generic32", asm("sparcv8_asm") ],
692 cflags => "-mcpu=v8 -Wall -DB_ENDIAN -DBN_DIV2W",
695 # it's a real mess with -mcpu=ultrasparc option under Linux,
696 # but -Wa,-Av8plus should do the trick no matter what.
697 inherit_from => [ "linux-generic32", asm("sparcv9_asm") ],
698 cflags => "-m32 -mcpu=ultrasparc -Wall -Wa,-Av8plus -DB_ENDIAN -DBN_DIV2W",
699 shared_ldflag => "-m32",
701 "linux64-sparcv9" => {
702 # GCC 3.1 is a requirement
703 inherit_from => [ "linux-generic64", asm("sparcv9_asm") ],
704 cflags => "-m64 -mcpu=ultrasparc -Wall -DB_ENDIAN",
705 bn_ops => "BN_LLONG RC4_CHAR",
706 shared_ldflag => "-m64",
710 "linux-alpha-gcc" => {
711 inherit_from => [ "linux-generic64", asm("alpha_asm") ],
712 cflags => "-DL_ENDIAN",
713 bn_ops => "SIXTY_FOUR_BIT_LONG",
715 "linux-c64xplus" => {
716 inherit_from => [ "BASE_unix" ],
717 # TI_CGT_C6000_7.3.x is a requirement
719 cflags => "--linux -ea=.s -eo=.o -mv6400+ -o2 -ox -ms -pden -DOPENSSL_SMALL_FOOTPRINT",
720 thread_cflag => "-D_REENTRANT",
721 bn_ops => "BN_LLONG",
722 cpuid_asm_src => "c64xpluscpuid.s",
723 bn_asm_src => "asm/bn-c64xplus.asm c64xplus-gf2m.s",
724 aes_asm_src => "aes-c64xplus.s aes_cbc.c aes-ctr.fake",
725 sha1_asm_src => "sha1-c64xplus.s sha256-c64xplus.s sha512-c64xplus.s",
726 rc4_asm_src => "rc4-c64xplus.s",
727 modes_asm_src => "ghash-c64xplus.s",
728 chacha_asm_src => "chacha-c64xplus.s",
729 poly1305_asm_src => "poly1305-c64xplus.s",
730 perlasm_scheme => "void",
731 dso_scheme => "dlfcn",
732 shared_target => "linux-shared",
733 shared_cflag => "--pic",
734 shared_ldflag => "-z --sysv --shared",
735 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
739 #### Android: linux-* but without pointers to headers and libs.
741 # It takes pair of prior-set environment variables to make it work:
743 # CROSS_SYSROOT=/some/where/android-ndk-<ver>/platforms/android-<apiver>/arch-<
744 # CROSS_COMPILE=<prefix>
746 # As well as PATH adjusted to cover ${CROSS_COMPILE}gcc and company.
747 # For example to compile for ICS and ARM with NDK 10d, you'd:
749 # ANDROID_NDK=/some/where/android-ndk-10d
750 # CROSS_SYSROOT=$ANDROID_NDK/platforms/android-14/arch-arm
751 # CROSS_COMPILE=arm-linux-adroideabi-
752 # PATH=$ANDROID_NDK/toolchains/arm-linux-androideabi-4.8/prebuild/linux-x86_64/
755 inherit_from => [ "linux-generic32" ],
756 # Special note about unconditional -fPIC and -pie. The underlying
757 # reason is that Lollipop refuses to run non-PIE. But what about
758 # older systems and NDKs? -fPIC was never problem, so the only
759 # concern if -pie. Older toolchains, e.g. r4, appear to handle it
760 # and binaries turn mostly functional. "Mostly" means that oldest
761 # Androids, such as Froyo, fail to handle executable, but newer
762 # systems are perfectly capable of executing binaries targeting
763 # Froyo. Keep in mind that in the nutshell Android builds are
764 # about JNI, i.e. shared libraries, not applications.
765 cflags => "-mandroid -fPIC --sysroot=\$(CROSS_SYSROOT) -Wa,--noexecstack -Wall",
766 debug_cflags => "-O0 -g",
771 inherit_from => [ "android", asm("x86_asm") ],
772 release_cflags => "-O3 -fomit-frame-pointer",
773 bn_ops => "BN_LLONG",
774 perlasm_scheme => "android",
776 ################################################################
777 # Contemporary Android applications can provide multiple JNI
778 # providers in .apk, targeting multiple architectures. Among
779 # them there is "place" for two ARM flavours: generic eabi and
780 # armv7-a/hard-float. However, it should be noted that OpenSSL's
781 # ability to engage NEON is not constrained by ABI choice, nor
782 # is your ability to call OpenSSL from your application code
783 # compiled with floating-point ABI other than default 'soft'.
784 # [Latter thanks to __attribute__((pcs("aapcs"))) declaration.]
785 # This means that choice of ARM libraries you provide in .apk
786 # is driven by application needs. For example if application
787 # itself benefits from NEON or is floating-point intensive, then
788 # it might be appropriate to provide both libraries. Otherwise
789 # just generic eabi would do. But in latter case it would be
792 # ./Configure android-armeabi -D__ARM_MAX_ARCH__=8
794 # in order to build "universal" binary and allow OpenSSL take
795 # advantage of NEON when it's available.
797 "android-armeabi" => {
798 inherit_from => [ "android", asm("armv4_asm") ],
801 inherit_from => [ "android", asm("mips32_asm") ],
802 perlasm_scheme => "o32",
806 inherit_from => [ "linux-generic64" ],
807 cflags => "-mandroid -fPIC --sysroot=\$(CROSS_SYSROOT) -Wa,--noexecstack -Wall",
808 debug_cflags => "-O0 -g",
812 "android64-aarch64" => {
813 inherit_from => [ "android64", asm("aarch64_asm") ],
814 perlasm_scheme => "linux64",
819 # As for thread_cflag. Idea is to maintain "collective" set of
820 # flags, which would cover all BSD flavors. -pthread applies
821 # to them all, but is treated differently. OpenBSD expands is
822 # as -D_POSIX_THREAD -lc_r, which is sufficient. FreeBSD 4.x
823 # expands it as -lc_r, which has to be accompanied by explicit
824 # -D_THREAD_SAFE and sometimes -D_REENTRANT. FreeBSD 5.x
825 # expands it as -lc_r, which seems to be sufficient?
826 inherit_from => [ "BASE_unix" ],
829 debug_cflags => "-O0 -g",
830 release_cflags => "-O3",
831 thread_cflag => "-pthread -D_THREAD_SAFE -D_REENTRANT",
832 bn_ops => "BN_LLONG",
833 dso_scheme => "dlfcn",
834 shared_target => "bsd-gcc-shared",
835 shared_cflag => "-fPIC",
836 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
839 inherit_from => [ "BSD-generic32" ],
840 bn_ops => "SIXTY_FOUR_BIT_LONG",
844 inherit_from => [ "BSD-generic32", asm("x86_asm") ],
845 cflags => "-DL_ENDIAN -Wall",
846 release_cflags => "-O3 -fomit-frame-pointer",
847 bn_ops => "BN_LLONG",
848 shared_target => "bsd-shared",
849 perlasm_scheme => "a.out",
852 inherit_from => [ "BSD-x86" ],
853 perlasm_scheme => "elf",
857 inherit_from => [ "BSD-generic32", asm("sparcv8_asm") ],
858 cflags => "-mcpu=v8 -Wall -DB_ENDIAN",
861 # -DMD32_REG_T=int doesn't actually belong in sparc64 target, it
862 # simply *happens* to work around a compiler bug in gcc 3.3.3,
863 # triggered by RIPEMD160 code.
864 inherit_from => [ "BSD-generic64", asm("sparcv9_asm") ],
865 cflags => "-DB_ENDIAN -DMD32_REG_T=int -Wall",
866 bn_ops => "BN_LLONG",
870 inherit_from => [ "BSD-generic64", asm("ia64_asm") ],
871 cflags => "-DL_ENDIAN -Wall",
872 bn_ops => "SIXTY_FOUR_BIT_LONG",
876 inherit_from => [ "BSD-generic64", asm("x86_64_asm") ],
877 cflags => "-DL_ENDIAN -Wall",
878 bn_ops => "SIXTY_FOUR_BIT_LONG",
879 perlasm_scheme => "elf",
883 inherit_from => [ "BASE_unix", asm("x86_elf_asm") ],
885 cflags => "-DPERL5 -DL_ENDIAN -fomit-frame-pointer -O3 -Wall",
886 thread_cflag => "(unknown)",
887 ex_libs => add("-ldl"),
888 bn_ops => "BN_LLONG",
889 dso_scheme => "dlfcn",
890 shared_target => "bsd-gcc-shared",
891 shared_cflag => "-fPIC",
892 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
896 inherit_from => [ "BASE_unix" ],
898 cflags => "-O -Wall",
899 unistd => "<libc.h>",
900 thread_cflag => "(unknown)",
901 bn_ops => "BN_LLONG",
904 inherit_from => [ "BASE_unix" ],
906 cflags => "-O3 -Wall",
907 unistd => "<libc.h>",
908 thread_cflag => "(unknown)",
909 bn_ops => "BN_LLONG",
914 inherit_from => [ "BASE_unix" ],
916 cflags => "-DL_ENDIAN -DTERMIO",
917 thread_cflag => "(unknown)",
920 inherit_from => [ "BASE_unix" ],
922 ex_libs => add("-lsocket"),
923 dso_scheme => "dlfcn",
924 shared_target => "bsd-gcc-shared",
925 shared_cflag => "-fPIC",
926 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
929 inherit_from => [ "BASE_unix", asm("x86_elf_asm") ],
931 cflags => "-DL_ENDIAN -O2 -Wall",
932 ex_libs => add("-lsocket"),
933 dso_scheme => "dlfcn",
934 shared_target => "bsd-gcc-shared",
935 shared_cflag => "-fPIC",
936 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
939 #### SCO/Caldera targets.
941 # Originally we had like unixware-*, unixware-*-pentium, unixware-*-p6, etc.
942 # Now we only have blended unixware-* as it's the only one used by ./config.
943 # If you want to optimize for particular microarchitecture, bypass ./config
944 # and './Configure unixware-7 -Kpentium_pro' or whatever appropriate.
945 # Note that not all targets include assembler support. Mostly because of
946 # lack of motivation to support out-of-date platforms with out-of-date
947 # compiler drivers and assemblers. Tim Rice <tim@multitalents.net> has
948 # patiently assisted to debug most of it.
950 # UnixWare 2.0x fails destest with -O.
952 inherit_from => [ "BASE_unix" ],
954 cflags => "-DFILIO_H -DNO_STRINGS_H",
955 thread_cflag => "-Kthread",
956 ex_libs => add("-lsocket -lnsl -lresolv -lx"),
959 inherit_from => [ "BASE_unix" ],
961 cflags => "-O -DFILIO_H",
962 thread_cflag => "-Kthread",
963 ex_libs => add("-lsocket -lnsl -lresolv -lx"),
966 inherit_from => [ "BASE_unix", asm("x86_elf_asm") ],
968 cflags => "-O -DFILIO_H -Kalloca",
969 thread_cflag => "-Kthread",
970 ex_libs => add("-lsocket -lnsl"),
971 bn_ops => "BN_LLONG",
972 perlasm_scheme => "elf-1",
973 dso_scheme => "dlfcn",
974 shared_target => "svr5-shared",
975 shared_cflag => "-Kpic",
976 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
978 "unixware-7-gcc" => {
979 inherit_from => [ "BASE_unix", asm("x86_elf_asm") ],
981 cflags => "-DL_ENDIAN -DFILIO_H -O3 -fomit-frame-pointer -Wall",
982 thread_cflag => "-D_REENTRANT",
983 ex_libs => add("-lsocket -lnsl"),
984 bn_ops => "BN_LLONG",
985 perlasm_scheme => "elf-1",
986 dso_scheme => "dlfcn",
987 shared_target => "gnu-shared",
988 shared_cflag => "-fPIC",
989 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
991 # SCO 5 - Ben Laurie <ben@algroup.co.uk> says the -O breaks the SCO cc.
993 inherit_from => [ "BASE_unix", asm("x86_elf_asm") ],
996 thread_cflag => "(unknown)",
997 ex_libs => add("-lsocket -lnsl"),
998 perlasm_scheme => "elf-1",
999 dso_scheme => "dlfcn",
1000 shared_target => "svr3-shared",
1001 shared_cflag => "-Kpic",
1002 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
1005 inherit_from => [ "BASE_unix", asm("x86_elf_asm") ],
1007 cflags => "-O3 -fomit-frame-pointer",
1008 thread_cflag => "(unknown)",
1009 ex_libs => add("-lsocket -lnsl"),
1010 bn_ops => "BN_LLONG",
1011 perlasm_scheme => "elf-1",
1012 dso_scheme => "dlfcn",
1013 shared_target => "svr3-shared",
1014 shared_cflag => "-fPIC",
1015 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
1020 inherit_from => [ "BASE_unix", asm("ppc32_asm") ],
1022 cflags => "-DB_ENDIAN",
1023 debug_cflags => "-O0 -g",
1024 release_cflags => "-O",
1025 thread_cflag => "-pthread",
1027 bn_ops => "BN_LLONG RC4_CHAR",
1028 perlasm_scheme => "aix32",
1029 dso_scheme => "dlfcn",
1030 shared_target => "aix-shared",
1031 shared_ldflag => "-shared -Wl,-G",
1032 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
1036 inherit_from => [ "BASE_unix", asm("ppc64_asm") ],
1038 cflags => "-maix64 -DB_ENDIAN",
1039 debug_cflags => "-O0 -g",
1040 release_cflags => "-O",
1041 thread_cflag => "-pthread",
1043 bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
1044 perlasm_scheme => "aix64",
1045 dso_scheme => "dlfcn",
1046 shared_target => "aix-shared",
1047 shared_ldflag => "-maix64 -shared -Wl,-G",
1048 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
1051 # Below targets assume AIX 5. Idea is to effectively disregard
1052 # $OBJECT_MODE at build time. $OBJECT_MODE is respected at
1055 inherit_from => [ "BASE_unix", asm("ppc32_asm") ],
1057 cflags => "-q32 -DB_ENDIAN -qmaxmem=16384 -qro -qroconst",
1059 release_cflags => "-O",
1060 thread_cflag => "-qthreaded -D_THREAD_SAFE",
1062 bn_ops => "BN_LLONG RC4_CHAR",
1063 perlasm_scheme => "aix32",
1064 dso_scheme => "dlfcn",
1065 shared_target => "aix-shared",
1066 shared_ldflag => "-q32 -G",
1067 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
1071 inherit_from => [ "BASE_unix", asm("ppc64_asm") ],
1073 cflags => "-q64 -DB_ENDIAN -qmaxmem=16384 -qro -qroconst",
1075 release_cflags => "-O",
1076 thread_cflag => "-qthreaded -D_THREAD_SAFE",
1078 bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
1079 perlasm_scheme => "aix64",
1080 dso_scheme => "dlfcn",
1081 shared_target => "aix-shared",
1082 shared_ldflag => "-q64 -G",
1083 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
1087 # SIEMENS BS2000/OSD: an EBCDIC-based mainframe
1089 inherit_from => [ "BASE_unix" ],
1091 cflags => "-O -XLLML -XLLMK -XL -DB_ENDIAN -DCHARSET_EBCDIC",
1092 thread_cflag => "(unknown)",
1093 ex_libs => add("-lsocket -lnsl"),
1094 bn_ops => "THIRTY_TWO_BIT RC4_CHAR",
1097 # OS/390 Unix an EBCDIC-based Unix system on IBM mainframe
1098 # You need to compile using the c89.sh wrapper in the tools directory, because the
1099 # IBM compiler does not like the -L switch after any object modules.
1102 inherit_from => [ "BASE_unix" ],
1104 cflags => "-O -DB_ENDIAN -DCHARSET_EBCDIC -DNO_SYS_PARAM_H -D_ALL_SOURCE",
1105 thread_cflag => "(unknown)",
1106 bn_ops => "THIRTY_TWO_BIT RC4_CHAR",
1109 #### Visual C targets
1111 # Win64 targets, WIN64I denotes IA-64 and WIN64A - AMD64
1113 # Note about -wd4090, disable warning C4090. This warning returns false
1114 # positives in some situations. Disabling it altogether masks both
1115 # legitimate and false cases, but as we compile on multiple platforms,
1116 # we rely on other compilers to catch legitimate cases.
1118 inherit_from => [ "BASE_Windows" ],
1121 cflags => "-W3 -wd4090 -Gs0 -GF -Gy -nologo -DOPENSSL_SYS_WIN32 -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -D_CRT_SECURE_NO_DEPRECATE",
1122 shared_target => "win-shared", # meaningless except it gives Configure a hint
1123 dso_scheme => "win32",
1126 inherit_from => [ "VC-common", asm("ia64_asm") ],
1127 cflags => add("-DUNICODE -D_UNICODE"),
1129 bn_ops => "SIXTY_FOUR_BIT EXPORT_VAR_AS_FN",
1130 bn_obj => sub { my $r=join(" ",@_); $r=~s/bn\-//; $r; },
1132 perlasm_scheme => "ias",
1133 build_scheme => add("VC-W64", { separator => undef }),
1136 inherit_from => [ "VC-common", asm("x86_64_asm") ],
1137 cflags => add("-DUNICODE -D_UNICODE"),
1139 bn_ops => "SIXTY_FOUR_BIT EXPORT_VAR_AS_FN",
1140 bn_obj => sub { my $r=join(" ",@_); $r=~s/x86_64\-gcc/bn_asm/; $r; },
1141 perlasm_scheme => "auto",
1142 build_scheme => add("VC-W64", { separator => undef }),
1145 # x86 Win32 target defaults to ANSI API, if you want UNICODE,
1146 # configure with 'perl Configure VC-WIN32 -DUNICODE -D_UNICODE'
1147 inherit_from => [ "VC-common", asm("x86_asm") ],
1149 bn_ops => "BN_LLONG EXPORT_VAR_AS_FN",
1150 perlasm_scheme => "win32n",
1151 build_scheme => add("VC-W32", { separator => undef }),
1154 inherit_from => [ "BASE_Windows" ],
1157 bn_ops => "BN_LLONG EXPORT_VAR_AS_FN",
1158 dso_scheme => "win32",
1159 build_scheme => add("VC-WCE", { separator => undef }),
1162 #### Borland C++ 4.5
1164 inherit_from => [ "BASE_Windows" ],
1167 bn_ops => "BN_LLONG EXPORT_VAR_AS_FN",
1168 dso_scheme => "win32",
1169 build_scheme => add("BC", { separator => undef }),
1174 inherit_from => [ "BASE_unix", asm("x86_asm"),
1175 sub { $disabled{shared} ? () : "x86_uplink" } ],
1177 cflags => "-DL_ENDIAN -DWIN32_LEAN_AND_MEAN -DUNICODE -D_UNICODE -m32 -Wall",
1178 debug_cflags => "-g -O0",
1179 release_cflags => "-O3 -fomit-frame-pointer",
1180 thread_cflag => "-D_MT",
1181 sys_id => "MINGW32",
1182 ex_libs => add("-lws2_32 -lgdi32 -lcrypt32"),
1183 bn_ops => "BN_LLONG EXPORT_VAR_AS_FN",
1184 perlasm_scheme => "coff",
1185 dso_scheme => "win32",
1186 shared_target => "mingw-shared",
1187 shared_cflag => add("-D_WINDLL"),
1188 shared_ldflag => "-static-libgcc",
1189 shared_rcflag => "--target=pe-i386",
1190 shared_extension => ".dll",
1194 # As for OPENSSL_USE_APPLINK. Applink makes it possible to use
1195 # .dll compiled with one compiler with application compiled with
1196 # another compiler. It's possible to engage Applink support in
1197 # mingw64 build, but it's not done, because till mingw64
1198 # supports structured exception handling, one can't seriously
1199 # consider its binaries for using with non-mingw64 run-time
1200 # environment. And as mingw64 is always consistent with itself,
1201 # Applink is never engaged and can as well be omitted.
1202 inherit_from => [ "BASE_unix", asm("x86_64_asm") ],
1204 cflags => "-DL_ENDIAN -DWIN32_LEAN_AND_MEAN -DUNICODE -D_UNICODE -m64 -Wall",
1205 debug_cflags => "-g -O0",
1206 release_cflags => "-O3",
1207 thread_cflag => "-D_MT",
1208 sys_id => "MINGW64",
1209 ex_libs => add("-lws2_32 -lgdi32 -lcrypt32"),
1210 bn_ops => "SIXTY_FOUR_BIT EXPORT_VAR_AS_FN",
1211 perlasm_scheme => "mingw64",
1212 dso_scheme => "win32",
1213 shared_target => "mingw-shared",
1214 shared_cflag => add("-D_WINDLL"),
1215 shared_ldflag => "-static-libgcc",
1216 shared_rcflag => "--target=pe-x86-64",
1217 shared_extension => ".dll",
1223 inherit_from => [ "BASE_unix" ],
1225 cflags => "-DL_ENDIAN -O",
1231 inherit_from => [ "BASE_unix" ],
1233 cflags => "-DTERMIOS -DL_ENDIAN -O -Wall",
1235 bn_ops => "BN_LLONG",
1236 dso_scheme => "win32",
1241 inherit_from => [ "BASE_unix", asm("x86_asm") ],
1243 cflags => "-DTERMIOS -DL_ENDIAN -Wall",
1244 debug_cflags => "-g -O0",
1245 release_cflags => "-O3 -fomit-frame-pointer",
1247 bn_ops => "BN_LLONG",
1248 perlasm_scheme => "coff",
1249 dso_scheme => "dlfcn",
1250 shared_target => "cygwin-shared",
1251 shared_cflag => "-D_WINDLL",
1252 shared_ldflag => "-shared",
1253 shared_extension => ".dll",
1255 "Cygwin-x86_64" => {
1256 inherit_from => [ "BASE_unix", asm("x86_64_asm") ],
1258 cflags => "-DTERMIOS -DL_ENDIAN -Wall",
1259 debug_cflags => "-g -O0",
1260 release_cflags => "-O3",
1262 bn_ops => "SIXTY_FOUR_BIT_LONG",
1263 perlasm_scheme => "mingw64",
1264 dso_scheme => "dlfcn",
1265 shared_target => "cygwin-shared",
1266 shared_cflag => "-D_WINDLL",
1267 shared_ldflag => "-shared",
1268 shared_extension => ".dll",
1270 # Backward compatibility for those using this target
1272 inherit_from => [ "Cygwin-x86" ]
1274 # In case someone constructs the Cygwin target name themself
1276 inherit_from => [ "Cygwin-x86" ]
1279 inherit_from => [ "Cygwin-x86" ]
1282 inherit_from => [ "Cygwin-x86" ]
1285 inherit_from => [ "Cygwin-x86" ]
1288 #### NetWare from David Ward (dsward@novell.com)
1289 # requires either MetroWerks NLM development tools, or gcc / nlmconv
1290 # NetWare defaults socket bio to WinSock sockets. However,
1291 # the builds can be configured to use BSD sockets instead.
1292 # netware-clib => legacy CLib c-runtime support
1294 inherit_from => [ "BASE_Windows" ],
1296 build_scheme => add("netware", { separator => undef }),
1298 "netware-clib-bsdsock" => {
1299 inherit_from => [ "BASE_Windows" ],
1301 build_scheme => add("netware", { separator => undef }),
1303 "netware-clib-gcc" => {
1304 inherit_from => [ "BASE_unix" ],
1305 cc => "i586-netware-gcc",
1306 cflags => "-nostdinc -I/ndk/nwsdk/include/nlm -I/ndk/ws295sdk/include -DL_ENDIAN -DNETWARE_CLIB -DOPENSSL_SYS_NETWARE -O2 -Wall",
1308 "netware-clib-bsdsock-gcc" => {
1309 inherit_from => [ "BASE_unix" ],
1310 cc => "i586-netware-gcc",
1311 cflags => "-nostdinc -I/ndk/nwsdk/include/nlm -DNETWARE_BSDSOCK -DNETDB_USE_INTERNET -DL_ENDIAN -DNETWARE_CLIB -DOPENSSL_SYS_NETWARE -O2 -Wall",
1313 # netware-libc => LibC/NKS support
1315 inherit_from => [ "BASE_Windows" ],
1317 bn_ops => "BN_LLONG",
1318 build_scheme => add("netware", { separator => undef }),
1320 "netware-libc-bsdsock" => {
1321 inherit_from => [ "BASE_Windows" ],
1323 bn_ops => "BN_LLONG",
1324 build_scheme => add("netware", { separator => undef }),
1326 "netware-libc-gcc" => {
1327 inherit_from => [ "BASE_unix" ],
1328 cc => "i586-netware-gcc",
1329 cflags => "-nostdinc -I/ndk/libc/include -I/ndk/libc/include/winsock -DL_ENDIAN -DNETWARE_LIBC -DOPENSSL_SYS_NETWARE -DTERMIO -O2 -Wall",
1330 bn_ops => "BN_LLONG",
1332 "netware-libc-bsdsock-gcc" => {
1333 inherit_from => [ "BASE_unix" ],
1334 cc => "i586-netware-gcc",
1335 cflags => "-nostdinc -I/ndk/libc/include -DNETWARE_BSDSOCK -DL_ENDIAN -DNETWARE_LIBC -DOPENSSL_SYS_NETWARE -DTERMIO -O2 -Wall",
1336 bn_ops => "BN_LLONG",
1341 inherit_from => [ asm("x86_asm") ],
1343 cflags => "-I/dev/env/WATT_ROOT/inc -DTERMIO -DL_ENDIAN -fomit-frame-pointer -O2 -Wall",
1345 ex_libs => add("-L/dev/env/WATT_ROOT/lib -lwatt"),
1346 bn_ops => "BN_LLONG",
1347 perlasm_scheme => "a.out",
1350 #### Ultrix from Bernhard Simon <simon@zid.tuwien.ac.at>
1352 inherit_from => [ "BASE_unix" ],
1354 cflags => "-std1 -O -Olimit 2500 -DL_ENDIAN",
1355 thread_cflag => "(unknown)",
1358 inherit_from => [ "BASE_unix" ],
1360 cflags => "-O3 -DL_ENDIAN",
1361 thread_cflag => "(unknown)",
1362 bn_ops => "BN_LLONG",
1364 # K&R C is no longer supported; you need gcc on old Ultrix installations
1365 ##"ultrix","cc:-O2 -DNOPROTO -DNOCONST -DL_ENDIAN::(unknown):::::::",
1367 ##### MacOS X (a.k.a. Darwin) setup
1368 "darwin-common" => {
1369 inherit_from => [ "BASE_unix" ],
1373 debug_cflags => "-g -O0",
1374 release_cflags => "-O3",
1375 thread_cflag => "-D_REENTRANT",
1377 plib_lflags => "-Wl,-search_paths_first",
1378 bn_ops => "BN_LLONG RC4_CHAR",
1379 perlasm_scheme => "osx32",
1380 dso_scheme => "dlfcn",
1381 shared_target => "darwin-shared",
1382 shared_cflag => "-fPIC -fno-common",
1383 shared_ldflag => "-dynamiclib",
1384 shared_extension => ".\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
1386 "darwin-ppc-cc" => {
1387 inherit_from => [ "darwin-common", asm("ppc32_asm") ],
1388 cflags => "-arch ppc -DB_ENDIAN -Wa,-force_cpusubtype_ALL",
1389 perlasm_scheme => "osx32",
1390 shared_ldflag => "-arch ppc -dynamiclib",
1392 "darwin64-ppc-cc" => {
1393 inherit_from => [ "darwin-common", asm("ppc64_asm") ],
1394 cflags => "-arch ppc64 -DB_ENDIAN",
1395 bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
1396 perlasm_scheme => "osx64",
1397 shared_ldflag => "-arch ppc64 -dynamiclib",
1399 "darwin-i386-cc" => {
1400 inherit_from => [ "darwin-common", asm("x86_asm") ],
1401 cflags => "-arch i386 -DL_ENDIAN",
1402 release_cflags => "-O3 -fomit-frame-pointer",
1403 bn_ops => "BN_LLONG RC4_INT",
1404 perlasm_scheme => "macosx",
1405 shared_ldflag => "-arch i386 -dynamiclib",
1407 "darwin64-x86_64-cc" => {
1408 inherit_from => [ "darwin-common", asm("x86_64_asm") ],
1409 cflags => "-arch x86_64 -DL_ENDIAN -Wall",
1410 bn_ops => "SIXTY_FOUR_BIT_LONG",
1411 perlasm_scheme => "macosx",
1412 shared_ldflag => "-arch x86_64 -dynamiclib",
1417 # It takes three prior-set environment variables to make it work:
1419 # CROSS_COMPILE=/where/toolchain/is/usr/bin/ [note ending slash]
1420 # CROSS_TOP=/where/SDKs/are
1421 # CROSS_SDK=iPhoneOSx.y.sdk
1423 # Exact paths vary with Xcode releases, but for couple of last ones
1424 # they would look like this:
1426 # CROSS_COMPILE=`xcode-select --print-path`/Toolchains/XcodeDefault.xctoolchain/usr/bin/
1427 # CROSS_TOP=`xcode-select --print-path`/Platforms/iPhoneOS.platform/Developer
1428 # CROSS_SDK=iPhoneOS.sdk
1430 "iphoneos-cross" => {
1431 inherit_from => [ "darwin-common" ],
1432 cflags => "-isysroot \$(CROSS_TOP)/SDKs/\$(CROSS_SDK) -fno-common",
1436 inherit_from => [ "darwin-common", asm("armv4_asm") ],
1437 # It should be possible to go below iOS 6 and even add -arch armv6,
1438 # thus targeting iPhone pre-3GS, but it's assumed to be irrelevant
1440 cflags => "-arch armv7 -mios-version-min=6.0.0 -isysroot \$(CROSS_TOP)/SDKs/\$(CROSS_SDK) -fno-common",
1442 perlasm_scheme => "ios32",
1445 inherit_from => [ "darwin-common", asm("aarch64_asm") ],
1446 cflags => "-arch arm64 -mios-version-min=7.0.0 -isysroot \$(CROSS_TOP)/SDKs/\$(CROSS_SDK) -fno-common",
1448 bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
1449 perlasm_scheme => "ios64",
1454 inherit_from => [ "BASE_unix" ],
1455 inherit_from => [ asm("x86_elf_asm") ],
1457 cflags => "-DL_ENDIAN -O3 -fomit-frame-pointer -Wall",
1458 thread_cflag => "-pthread",
1459 ex_libs => add("-ldl"),
1460 bn_ops => "BN_LLONG",
1461 dso_scheme => "dlfcn",
1462 shared_target => "linux-shared",
1463 shared_cflag => "-fPIC",
1468 inherit_from => [ "BASE_unix" ],
1472 ##### VxWorks for various targets
1473 "vxworks-ppc60x" => {
1474 inherit_from => [ "BASE_unix" ],
1476 cflags => "-D_REENTRANT -mrtp -mhard-float -mstrict-align -fno-implicit-fp -DPPC32_fp60x -O2 -fstrength-reduce -fno-builtin -fno-strict-aliasing -Wall -DCPU=PPC32 -DTOOL_FAMILY=gnu -DTOOL=gnu -I\$(WIND_BASE)/target/usr/h -I\$(WIND_BASE)/target/usr/h/wrn/coreip",
1477 sys_id => "VXWORKS",
1478 ex_libs => add("-Wl,--defsym,__wrs_rtp_base=0xe0000000 -L \$(WIND_BASE)/target/usr/lib/ppc/PPC32/common"),
1480 "vxworks-ppcgen" => {
1481 inherit_from => [ "BASE_unix" ],
1483 cflags => "-D_REENTRANT -mrtp -msoft-float -mstrict-align -O1 -fno-builtin -fno-strict-aliasing -Wall -DCPU=PPC32 -DTOOL_FAMILY=gnu -DTOOL=gnu -I\$(WIND_BASE)/target/usr/h -I\$(WIND_BASE)/target/usr/h/wrn/coreip",
1484 sys_id => "VXWORKS",
1485 ex_libs => add("-Wl,--defsym,__wrs_rtp_base=0xe0000000 -L \$(WIND_BASE)/target/usr/lib/ppc/PPC32/sfcommon"),
1487 "vxworks-ppc405" => {
1488 inherit_from => [ "BASE_unix" ],
1490 cflags => "-g -msoft-float -mlongcall -DCPU=PPC405 -I\$(WIND_BASE)/target/h",
1491 sys_id => "VXWORKS",
1494 "vxworks-ppc750" => {
1495 inherit_from => [ "BASE_unix" ],
1497 cflags => "-ansi -nostdinc -DPPC750 -D_REENTRANT -fvolatile -fno-builtin -fno-for-scope -fsigned-char -Wall -msoft-float -mlongcall -DCPU=PPC604 -I\$(WIND_BASE)/target/h \$(DEBUG_FLAG)",
1498 sys_id => "VXWORKS",
1501 "vxworks-ppc750-debug" => {
1502 inherit_from => [ "BASE_unix" ],
1504 cflags => "-ansi -nostdinc -DPPC750 -D_REENTRANT -fvolatile -fno-builtin -fno-for-scope -fsigned-char -Wall -msoft-float -mlongcall -DCPU=PPC604 -I\$(WIND_BASE)/target/h -DBN_DEBUG -DREF_DEBUG -DCONF_DEBUG -DBN_CTX_DEBUG -DPEDANTIC -DDEBUG_SAFESTACK -DDEBUG -g",
1505 sys_id => "VXWORKS",
1508 "vxworks-ppc860" => {
1509 inherit_from => [ "BASE_unix" ],
1511 cflags => "-nostdinc -msoft-float -DCPU=PPC860 -DNO_STRINGS_H -I\$(WIND_BASE)/target/h",
1512 sys_id => "VXWORKS",
1515 "vxworks-simlinux" => {
1516 inherit_from => [ "BASE_unix" ],
1518 cflags => "-B\$(WIND_BASE)/host/\$(WIND_HOST_TYPE)/lib/gcc-lib/ -D_VSB_CONFIG_FILE=\"\$(WIND_BASE)/target/lib/h/config/vsbConfig.h\" -DL_ENDIAN -DCPU=SIMLINUX -DTOOL_FAMILY=gnu -DTOOL=gnu -fno-builtin -fno-defer-pop -DNO_STRINGS_H -I\$(WIND_BASE)/target/h -I\$(WIND_BASE)/target/h/wrn/coreip -DOPENSSL_NO_HW_PADLOCK",
1519 sys_id => "VXWORKS",
1521 ranlib => "ranlibpentium",
1524 inherit_from => [ "BASE_unix", asm("mips32_asm") ],
1526 cflags => "-mrtp -mips2 -O -G 0 -B\$(WIND_BASE)/host/\$(WIND_HOST_TYPE)/lib/gcc-lib/ -D_VSB_CONFIG_FILE=\"\$(WIND_BASE)/target/lib/h/config/vsbConfig.h\" -DCPU=MIPS32 -msoft-float -mno-branch-likely -DTOOL_FAMILY=gnu -DTOOL=gnu -fno-builtin -fno-defer-pop -DNO_STRINGS_H -I\$(WIND_BASE)/target/usr/h -I\$(WIND_BASE)/target/h/wrn/coreip",
1527 thread_cflag => "-D_REENTRANT",
1528 sys_id => "VXWORKS",
1529 ex_libs => add("-Wl,--defsym,__wrs_rtp_base=0xe0000000 -L \$(WIND_BASE)/target/usr/lib/mips/MIPSI32/sfcommon"),
1530 perlasm_scheme => "o32",
1531 ranlib => "ranlibmips",
1536 inherit_from => [ "BASE_unix" ],
1538 cflags => "\$(CFLAGS)",
1539 thread_cflag => "-D_REENTRANT",
1540 plib_lflags => "\$(LDFLAGS)",
1541 ex_libs => add("\$(LDLIBS)"),
1542 bn_ops => "BN_LLONG",
1543 dso_scheme => "$ENV{'LIBSSL_dlfcn'}",
1544 shared_target => "linux-shared",
1545 shared_cflag => "-fPIC",
1546 shared_ldflag => "-shared",
1547 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
1548 ranlib => "$ENV{'RANLIB'}",
1550 "uClinux-dist64" => {
1551 inherit_from => [ "BASE_unix" ],
1553 cflags => "\$(CFLAGS)",
1554 thread_cflag => "-D_REENTRANT",
1555 plib_lflags => "\$(LDFLAGS)",
1556 ex_libs => add("\$(LDLIBS)"),
1557 bn_ops => "SIXTY_FOUR_BIT_LONG",
1558 dso_scheme => "$ENV{'LIBSSL_dlfcn'}",
1559 shared_target => "linux-shared",
1560 shared_cflag => "-fPIC",
1561 shared_ldflag => "-shared",
1562 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
1563 ranlib => "$ENV{'RANLIB'}",
1568 inherit_from => [ "BASE_VMS" ],
1571 cflags => "/STANDARD=RELAXED/NOLIST/PREFIX=ALL/NAMES=(AS_IS,SHORTENED)",
1572 debug_cflags => "/NOOPTIMIZE/DEBUG",
1573 release_cflags => "/OPTIMIZE/NODEBUG",
1575 debug_lflags => "/DEBUG/TRACEBACK",
1576 release_lflags => "/NODEBUG/NOTRACEBACK",
1577 shared_target => "vms-shared",
1579 apps_aux_src => "vms_decc_init.c",
1582 # VMS on VAX is *unsupported*
1585 # bn_obj => "[.asm]vms.obj vms-helper.obj"
1588 # inherit_from => [ "vms-generic", asm("vms-asm") ],
1590 # debug_aflags => "/NOOPTIMIZE/DEBUG",
1591 # release_aflags => "/OPTIMIZE/NODEBUG",
1592 # bn_opts => "THIRTY_TWO_BIT RC4_CHAR RC4_CHUNK DES_PTR BF_PTR",
1595 inherit_from => [ "vms-generic" ],
1597 #debug_aflags => "/NOOPTIMIZE/DEBUG",
1598 #release_aflags => "/OPTIMIZE/NODEBUG",
1599 bn_opts => "SIXTY_FOUR_BIT RC4_INT RC4_CHUNK_LL DES_PTR BF_PTR",
1601 "vms-alpha-P32" => {
1602 inherit_from => [ "vms-alpha" ],
1603 cflags => add("/POINTER_SIZE=32"),
1604 ex_libs => sub { join(",", map { s|SHR([\./])|SHR32$1|g; $_ } @_) },
1606 "vms-alpha-P64" => {
1607 inherit_from => [ "vms-alpha" ],
1608 cflags => add("/POINTER_SIZE=64"),
1609 ex_libs => sub { join(",", map { s|SHR([\./])|SHR64$1|g; $_ } @_) },
1612 inherit_from => [ "vms-generic" ],
1614 #debug_aflags => "/NOOPTIMIZE/DEBUG",
1615 #release_aflags => "/OPTIMIZE/NODEBUG",
1616 bn_opts => "SIXTY_FOUR_BIT RC4_INT RC4_CHUNK_LL DES_PTR BF_PTR",
1619 inherit_from => [ "vms-ia64" ],
1620 cflags => add("/POINTER_SIZE=32"),
1621 ex_libs => sub { join(",", map { s|SHR([\./])|SHR32$1|g; $_ } @_) },
1624 inherit_from => [ "vms-ia64" ],
1625 cflags => add("/POINTER_SIZE=64"),
1626 ex_libs => sub { join(",", map { s|SHR([\./])|SHR64$1|g; $_ } @_) },