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
24 cflags => "-Wall -DOPENSSL_SYS_VOS -D_POSIX_C_SOURCE=200112L -D_BSD -D_VOS_EXTENDED_NAMES -DB_ENDIAN",
25 debug_cflags => "-O0 -g -DBN_DEBUG -DREF_DEBUG -DCONF_DEBUG",
26 release_cflags => "-O3",
27 thread_cflag => "(unknown)",
31 shared_extension => ".so",
34 #### Solaris configurations
37 cflags => "-DFILIO_H",
38 ex_libs => "-lresolv -lsocket -lnsl -ldl",
39 dso_scheme => "dlfcn",
40 shared_target => "solaris-shared",
41 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
43 #### Solaris x86 with GNU C setups
44 "solaris-x86-gcc" => {
45 # -DOPENSSL_NO_INLINE_ASM switches off inline assembler. We have
46 # to do it here because whenever GNU C instantiates an assembler
47 # template it surrounds it with #APP #NO_APP comment pair which
48 # (at least Solaris 7_x86) /usr/ccs/bin/as fails to assemble
49 # with "Illegal mnemonic" error message.
50 inherit_from => [ "solaris-common", asm("x86_elf_asm") ],
52 cflags => add_before("-Wall -DL_ENDIAN -DOPENSSL_NO_INLINE_ASM"),
53 debug_cflags => "-O0 -g",
54 release_cflags => "-O3 -fomit-frame-pointer",
55 thread_cflag => "-pthread",
57 shared_cflag => "-fPIC",
58 shared_ldflag => "-shared",
60 "solaris64-x86_64-gcc" => {
61 # -shared -static-libgcc might appear controversial, but modules
62 # taken from static libgcc do not have relocations and linking
63 # them into our shared objects doesn't have any negative side
64 # effects. On the contrary, doing so makes it possible to use
65 # gcc shared build with Sun C. Given that gcc generates faster
66 # code [thanks to inline assembler], I would actually recommend
67 # to consider using gcc shared build even with vendor compiler:-)
68 # <appro@fy.chalmers.se>
69 inherit_from => [ "solaris-common", asm("x86_64_asm") ],
71 cflags => add_before("-m64 -Wall -DL_ENDIAN"),
72 debug_cflags => "-O0 -g",
73 release_cflags => "-O3",
74 thread_cflag => "-pthread",
75 bn_ops => "SIXTY_FOUR_BIT_LONG",
76 perlasm_scheme => "elf",
77 shared_cflag => "-fPIC",
78 shared_ldflag => "-m64 -shared -static-libgcc",
82 #### Solaris x86 with Sun C setups
84 inherit_from => [ "solaris-common" ],
86 cflags => add_before("-xarch=generic -xstrconst -Xa -DL_ENDIAN"),
88 release_cflags => "-xO5 -xregs=frameptr -xdepend -xbuiltin",
89 thread_cflag => "-D_REENTRANT",
91 ex_libs => add("-lpthread"),
92 bn_ops => "BN_LLONG RC4_CHAR",
93 shared_cflag => "-KPIC",
94 shared_ldflag => "-G -dy -z text",
96 "solaris64-x86_64-cc" => {
97 inherit_from => [ "solaris-common", asm("x86_64_asm") ],
99 cflags => add_before("-xarch=generic64 -xstrconst -Xa -DL_ENDIAN"),
100 debug_cflags => "-g",
101 release_cflags => "-xO5 -xdepend -xbuiltin",
102 thread_cflag => "-D_REENTRANT",
103 lflags => add("-mt"),
104 ex_libs => add("-lpthread"),
105 bn_ops => "SIXTY_FOUR_BIT_LONG",
106 perlasm_scheme => "elf",
107 shared_cflag => "-KPIC",
108 shared_ldflag => "-xarch=generic64 -G -dy -z text",
112 #### SPARC Solaris with GNU C setups
113 "solaris-sparcv7-gcc" => {
114 inherit_from => [ "solaris-common" ],
116 cflags => add_before("-Wall -DB_ENDIAN -DBN_DIV2W"),
117 debug_cflags => "-O0 -g",
118 release_cflags => "-O3",
119 thread_cflag => "-pthread",
120 bn_ops => "BN_LLONG RC4_CHAR",
121 shared_cflag => "-fPIC",
122 shared_ldflag => "-shared",
124 "solaris-sparcv8-gcc" => {
125 inherit_from => [ "solaris-sparcv7-gcc", asm("sparcv8_asm") ],
126 cflags => add_before("-mcpu=v8"),
128 "solaris-sparcv9-gcc" => {
129 # -m32 should be safe to add as long as driver recognizes
131 inherit_from => [ "solaris-sparcv7-gcc", asm("sparcv9_asm") ],
132 cflags => add_before("-m32 -mcpu=ultrasparc"),
133 debug_cflags => "-DBN_DEBUG -DREF_DEBUG -DCONF_DEBUG -DBN_CTX_DEBUG -DPEDANTIC -O -g -pedantic -ansi -Wshadow -Wno-long-long -D__EXTENSIONS__",
135 "solaris64-sparcv9-gcc" => {
136 inherit_from => [ "solaris-sparcv9-gcc" ],
137 cflags => sub { my $f=join(" ",@_); $f =~ s/\-m32/-m64/; $f; },
138 bn_ops => "BN_LLONG RC4_CHAR",
139 shared_ldflag => "-m64 -shared",
143 #### SPARC Solaris with Sun C setups
144 # SC4.0 doesn't pass 'make test', upgrade to SC5.0 or SC4.2.
145 # SC4.2 is ok, better than gcc even on bn as long as you tell it -xarch=v8
146 # SC5.0 note: Compiler common patch 107357-01 or later is required!
147 "solaris-sparcv7-cc" => {
148 inherit_from => [ "solaris-common" ],
150 cflags => add_before("-xstrconst -Xa -DB_ENDIAN -DBN_DIV2W"),
151 debug_cflags => "-g -DBN_DEBUG -DREF_DEBUG -DCONF_DEBUG -DBN_CTX_DEBUG",
152 release_cflags => "-xO5 -xdepend",
153 thread_cflag => "-D_REENTRANT",
154 lflags => add("-mt"),
155 ex_libs => add("-lpthread"),
156 bn_ops => "BN_LLONG RC4_CHAR",
157 shared_cflag => "-KPIC",
158 shared_ldflag => "-G -dy -z text",
161 "solaris-sparcv8-cc" => {
162 inherit_from => [ "solaris-sparcv7-cc", asm("sparcv8_asm") ],
163 cflags => add_before("-xarch=v8"),
165 "solaris-sparcv9-cc" => {
166 inherit_from => [ "solaris-sparcv7-cc", asm("sparcv9_asm") ],
167 cflags => add_before("-xarch=v8plus -xtarget=ultra"),
169 "solaris64-sparcv9-cc" => {
170 inherit_from => [ "solaris-sparcv7-cc", asm("sparcv9_asm") ],
171 cflags => add_before("-xarch=v9 -xtarget=ultra"),
172 bn_ops => "BN_LLONG RC4_CHAR",
173 shared_ldflag => "-xarch=v9 -G -dy -z text",
177 #### IRIX 5.x configs
178 # -mips2 flag is added by ./config when appropriate.
180 inherit_from => [ asm("mips32_asm") ],
182 cflags => "-DB_ENDIAN",
183 debug_cflags => "-g -O0",
184 release_cflags => "-O3",
185 thread_cflag => "(unknown)",
186 bn_ops => "BN_LLONG RC4_CHAR",
187 perlasm_scheme => "o32",
188 dso_scheme => "dlfcn",
189 shared_target => "irix-shared",
190 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
193 inherit_from => [ asm("mips32_asm") ],
195 cflags => "-use_readonly_const -DB_ENDIAN",
196 debug_cflags => "-g -O0",
197 release_cflags => "-O2",
198 thread_cflag => "(unknown)",
199 bn_ops => "BN_LLONG RC4_CHAR",
200 perlasm_scheme => "o32",
201 dso_scheme => "dlfcn",
202 shared_target => "irix-shared",
203 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
205 #### IRIX 6.x configs
206 # Only N32 and N64 ABIs are supported. If you need O32 ABI build, invoke
207 # './Configure irix-cc -o32' manually.
208 "irix-mips3-gcc" => {
209 inherit_from => [ asm("mips64_asm") ],
211 cflags => "-mabi=n32 -DB_ENDIAN -DBN_DIV3W",
212 debug_cflags => "-g -O0",
213 release_cflags => "-O3",
214 thread_cflag => "-D_SGI_MP_SOURCE -pthread",
215 bn_ops => "RC4_CHAR SIXTY_FOUR_BIT",
216 perlasm_scheme => "n32",
217 dso_scheme => "dlfcn",
218 shared_target => "irix-shared",
219 shared_ldflag => "-mabi=n32",
220 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
224 inherit_from => [ asm("mips64_asm") ],
226 cflags => "-n32 -mips3 -use_readonly_const -G0 -rdata_shared -DB_ENDIAN -DBN_DIV3W",
227 debug_cflags => "-g -O0",
228 release_cflags => "-O2",
229 thread_cflag => "-D_SGI_MP_SOURCE",
230 ex_libs => "-lpthread",
231 bn_ops => "RC4_CHAR SIXTY_FOUR_BIT",
232 perlasm_scheme => "n32",
233 dso_scheme => "dlfcn",
234 shared_target => "irix-shared",
235 shared_ldflag => "-n32",
236 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
240 "irix64-mips4-gcc" => {
241 inherit_from => [ asm("mips64_asm") ],
243 cflags => "-mabi=64 -mips4 -DB_ENDIAN -DBN_DIV3W",
244 debug_cflags => "-g -O0",
245 release_cflags => "-O3",
246 thread_cflag => "-D_SGI_MP_SOURCE",
247 bn_ops => "RC4_CHAR SIXTY_FOUR_BIT_LONG",
248 perlasm_scheme => "64",
249 dso_scheme => "dlfcn",
250 shared_target => "irix-shared",
251 shared_ldflag => "-mabi=64",
252 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
255 "irix64-mips4-cc" => {
256 inherit_from => [ asm("mips64_asm") ],
258 cflags => "-64 -mips4 -use_readonly_const -G0 -rdata_shared -DB_ENDIAN -DBN_DIV3W",
259 debug_cflags => "-g -O0",
260 release_cflags => "-O2",
261 thread_cflag => "-D_SGI_MP_SOURCE",
262 ex_libs => "-lpthread",
263 bn_ops => "RC4_CHAR SIXTY_FOUR_BIT_LONG",
264 perlasm_scheme => "64",
265 dso_scheme => "dlfcn",
266 shared_target => "irix-shared",
267 shared_ldflag => "-64",
268 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
272 #### Unified HP-UX ANSI C configs.
274 # - Originally we were optimizing at +O4 level. It should be noted
275 # that the only difference between +O3 and +O4 is global inter-
276 # procedural analysis. As it has to be performed during the link
277 # stage the compiler leaves behind certain pseudo-code in lib*.a
278 # which might be release or even patch level specific. Generating
279 # the machine code for and analyzing the *whole* program appears
280 # to be *extremely* memory demanding while the performance gain is
281 # actually questionable. The situation is intensified by the default
282 # HP-UX data set size limit (infamous 'maxdsiz' tunable) of 64MB
283 # which is way too low for +O4. In other words, doesn't +O3 make
285 # - Keep in mind that the HP compiler by default generates code
286 # suitable for execution on the host you're currently compiling at.
287 # If the toolkit is ment to be used on various PA-RISC processors
288 # consider './Configure hpux-parisc-[g]cc +DAportable'.
289 # - -DMD32_XARRAY triggers workaround for compiler bug we ran into in
290 # 32-bit message digests. (For the moment of this writing) HP C
291 # doesn't seem to "digest" too many local variables (they make "him"
292 # chew forever:-). For more details look-up MD32_XARRAY comment in
293 # crypto/sha/sha_lcl.h.
294 # - originally there were 32-bit hpux-parisc2-* targets. They were
295 # scrapped, because a) they were not interchangable with other 32-bit
296 # targets; a) when critical 32-bit assembly modules detect if they
297 # are executed on PA-RISC 2.0 and thus adequate performance is
299 # <appro@fy.chalmers.se>
300 "hpux-parisc-gcc" => {
302 cflags => "-DB_ENDIAN -DBN_DIV2W",
303 debug_cflags => "-O0 -g",
304 release_cflags => "-O3",
305 thread_cflag => "-pthread",
306 ex_libs => "-Wl,+s -ldld",
307 bn_ops => "BN_LLONG",
309 shared_target => "hpux-shared",
310 shared_cflag => "-fPIC",
311 shared_ldflag => "-shared",
312 shared_extension => ".sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
314 "hpux-parisc1_1-gcc" => {
315 inherit_from => [ "hpux-parisc-gcc", asm("parisc11_asm") ],
316 multilib => "/pa1.1",
318 "hpux64-parisc2-gcc" => {
319 inherit_from => [ asm("parisc20_64_asm") ],
321 cflags => "-DB_ENDIAN",
322 debug_cflags => "-O0 -g",
323 release_cflags => "-O3",
324 thread_cflag => "-D_REENTRANT",
326 bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
327 dso_scheme => "dlfcn",
328 shared_target => "hpux-shared",
329 shared_cflag => "-fpic",
330 shared_ldflag => "-shared",
331 shared_extension => ".sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
332 multilib => "/pa20_64",
335 # More attempts at unified 10.X and 11.X targets for HP C compiler.
337 # Chris Ruemmler <ruemmler@cup.hp.com>
338 # Kevin Steves <ks@hp.se>
339 "hpux-parisc-cc" => {
341 cflags => "+Optrs_strongly_typed -Ae +ESlit -DB_ENDIAN -DBN_DIV2W -DMD32_XARRAY",
342 debug_cflags => "+O0 +d -g",
343 release_cflags => "+O3",
344 thread_cflag => "-D_REENTRANT",
345 ex_libs => "-Wl,+s -ldld -lpthread",
346 bn_ops => "RC4_CHAR",
348 shared_target => "hpux-shared",
349 shared_cflag => "+Z",
350 shared_ldflag => "-b",
351 shared_extension => ".sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
353 "hpux-parisc1_1-cc" => {
354 inherit_from => [ "hpux-parisc-cc", asm("parisc11_asm") ],
355 cflags => add_before("+DA1.1"),
356 multilib => "/pa1.1",
358 "hpux64-parisc2-cc" => {
359 inherit_from => [ asm("parisc20_64_asm") ],
361 cflags => "+DD64 +Optrs_strongly_typed -Ae +ESlit -DB_ENDIAN -DMD32_XARRAY",
362 debug_cflags => "+O0 +d -g",
363 release_cflags => "+O3",
364 thread_cflag => "-D_REENTRANT",
365 ex_libs => "-ldl -lpthread",
366 bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
367 dso_scheme => "dlfcn",
368 shared_target => "hpux-shared",
369 shared_cflag => "+Z",
370 shared_ldflag => "+DD64 -b",
371 shared_extension => ".sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
372 multilib => "/pa20_64",
375 # HP/UX IA-64 targets
377 inherit_from => [ asm("ia64_asm") ],
379 cflags => "-Ae +DD32 +Olit=all -z -DB_ENDIAN",
380 debug_cflags => "+O0 +d -g",
381 release_cflags => "+O2",
382 thread_cflag => "-D_REENTRANT",
383 ex_libs => "-ldl -lpthread",
384 bn_ops => "SIXTY_FOUR_BIT",
385 dso_scheme => "dlfcn",
386 shared_target => "hpux-shared",
387 shared_cflag => "+Z",
388 shared_ldflag => "+DD32 -b",
389 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
390 multilib => "/hpux32",
392 # Frank Geurts <frank.geurts@nl.abnamro.com> has patiently assisted
393 # with debugging of the following config.
394 "hpux64-ia64-cc" => {
395 inherit_from => [ asm("ia64_asm") ],
397 cflags => "-Ae +DD64 +Olit=all -z -DB_ENDIAN",
398 debug_cflags => "+O0 +d -g",
399 release_cflags => "+O3",
400 thread_cflag => "-D_REENTRANT",
401 ex_libs => "-ldl -lpthread",
402 bn_ops => "SIXTY_FOUR_BIT_LONG",
403 dso_scheme => "dlfcn",
404 shared_target => "hpux-shared",
405 shared_cflag => "+Z",
406 shared_ldflag => "+DD64 -b",
407 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
408 multilib => "/hpux64",
412 inherit_from => [ asm("ia64_asm") ],
414 cflags => "-DB_ENDIAN",
415 debug_cflags => "-O0 -g",
416 release_cflags => "-O3",
417 thread_cflag => "-pthread",
419 bn_ops => "SIXTY_FOUR_BIT",
420 dso_scheme => "dlfcn",
421 shared_target => "hpux-shared",
422 shared_cflag => "-fpic",
423 shared_ldflag => "-shared",
424 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
425 multilib => "/hpux32",
427 "hpux64-ia64-gcc" => {
428 inherit_from => [ asm("ia64_asm") ],
430 cflags => "-mlp64 -DB_ENDIAN",
431 debug_cflags => "-O0 -g",
432 release_cflags => "-O3",
433 thread_cflag => "-pthread",
435 bn_ops => "SIXTY_FOUR_BIT_LONG",
436 dso_scheme => "dlfcn",
437 shared_target => "hpux-shared",
438 shared_cflag => "-fpic",
439 shared_ldflag => "-mlp64 -shared",
440 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
441 multilib => "/hpux64",
444 #### HP MPE/iX http://jazz.external.hp.com/src/openssl/
447 cflags => "-D_ENDIAN -DBN_DIV2W -O3 -D_POSIX_SOURCE -D_SOCKET_SOURCE -I/SYSLOG/PUB",
448 thread_cflag => "(unknown)",
450 ex_libs => "-L/SYSLOG/PUB -lsyslog -lsocket -lcurses",
451 bn_ops => "BN_LLONG",
454 #### DEC Alpha OSF/1/Tru64 targets.
455 "osf1-alpha-gcc" => {
456 inherit_from => [ asm("alpha_asm") ],
459 thread_cflag => "(unknown)",
460 bn_ops => "SIXTY_FOUR_BIT_LONG",
461 dso_scheme => "dlfcn",
462 shared_target => "alpha-osf1-shared",
463 shared_extension => ".so",
466 inherit_from => [ asm("alpha_asm") ],
468 cflags => "-std1 -tune host -O4 -readonly_strings",
469 thread_cflag => "(unknown)",
470 bn_ops => "SIXTY_FOUR_BIT_LONG",
471 dso_scheme => "dlfcn",
472 shared_target => "alpha-osf1-shared",
473 shared_extension => ".so",
475 "tru64-alpha-cc" => {
476 inherit_from => [ asm("alpha_asm") ],
478 cflags => "-std1 -tune host -fast -readonly_strings",
479 thread_cflag => "-pthread",
480 bn_ops => "SIXTY_FOUR_BIT_LONG",
481 dso_scheme => "dlfcn",
482 shared_target => "alpha-osf1-shared",
483 shared_ldflag => "-msym",
484 shared_extension => ".so",
488 #### Variety of LINUX:-)
490 # *-generic* is endian-neutral target, but ./config is free to
491 # throw in -D[BL]_ENDIAN, whichever appropriate...
492 "linux-generic32" => {
495 debug_cflags => "-O0 -g -DBN_DEBUG -DREF_DEBUG -DCONF_DEBUG",
496 release_cflags => "-O3",
497 thread_cflag => "-pthread",
499 bn_ops => "BN_LLONG RC4_CHAR",
500 dso_scheme => "dlfcn",
501 shared_target => "linux-shared",
502 shared_cflag => "-fPIC",
503 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
505 "linux-generic64" => {
506 inherit_from => [ "linux-generic32" ],
507 bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
511 inherit_from => [ "linux-generic32", asm("ppc32_asm") ],
512 perlasm_scheme => "linux32",
515 inherit_from => [ "linux-generic64", asm("ppc64_asm") ],
516 cflags => "-m64 -Wall -DB_ENDIAN",
517 perlasm_scheme => "linux64",
518 shared_ldflag => "-m64",
522 inherit_from => [ "linux-generic64", asm("ppc64_asm") ],
523 cflags => "-m64 -Wall -DL_ENDIAN",
524 perlasm_scheme => "linux64le",
525 shared_ldflag => "-m64",
529 ################################################################
530 # Note that -march is not among compiler options in linux-armv4
531 # target description. Not specifying one is intentional to give
534 # a) rely on your compiler default by not specifying one;
535 # b) specify your target platform explicitly for optimal
536 # performance, e.g. -march=armv6 or -march=armv7-a;
537 # c) build "universal" binary that targets *range* of platforms
538 # by specifying minimum and maximum supported architecture;
540 # As for c) option. It actually makes no sense to specify
541 # maximum to be less than ARMv7, because it's the least
542 # requirement for run-time switch between platform-specific
543 # code paths. And without run-time switch performance would be
544 # equivalent to one for minimum. Secondly, there are some
545 # natural limitations that you'd have to accept and respect.
546 # Most notably you can *not* build "universal" binary for
547 # big-endian platform. This is because ARMv7 processor always
548 # picks instructions in little-endian order. Another similar
549 # limitation is that -mthumb can't "cross" -march=armv6t2
550 # boundary, because that's where it became Thumb-2. Well, this
551 # limitation is a bit artificial, because it's not really
552 # impossible, but it's deemed too tricky to support. And of
553 # course you have to be sure that your binutils are actually
554 # up to the task of handling maximum target platform. With all
555 # this in mind here is an example of how to configure
558 # ./Configure linux-armv4 -march=armv6 -D__ARM_MAX_ARCH__=8
560 inherit_from => [ "linux-generic32", asm("armv4_asm") ],
561 perlasm_scheme => "linux32",
564 inherit_from => [ "linux-generic64", asm("aarch64_asm") ],
565 perlasm_scheme => "linux64",
567 "linux-arm64ilp32" => { # https://wiki.linaro.org/Platform/arm64-ilp32
568 inherit_from => [ "linux-generic32", asm("aarch64_asm") ],
569 cflags => "-mabi=ilp32 -Wall",
570 bn_ops => "SIXTY_FOUR_BIT RC4_CHAR",
571 perlasm_scheme => "linux64",
572 shared_ldflag => "-mabi=ilp32",
576 # Configure script adds minimally required -march for assembly
577 # support, if no -march was specified at command line.
578 inherit_from => [ "linux-generic32", asm("mips32_asm") ],
579 cflags => "-mabi=32 -Wall -DBN_DIV3W",
580 perlasm_scheme => "o32",
581 shared_ldflag => "-mabi=32",
583 # mips32 and mips64 below refer to contemporary MIPS Architecture
584 # specifications, MIPS32 and MIPS64, rather than to kernel bitness.
586 inherit_from => [ "linux-generic32", asm("mips64_asm") ],
587 cflags => "-mabi=n32 -Wall -DBN_DIV3W",
588 bn_ops => "SIXTY_FOUR_BIT RC4_CHAR",
589 perlasm_scheme => "n32",
590 shared_ldflag => "-mabi=n32",
593 "linux64-mips64" => {
594 inherit_from => [ "linux-generic64", asm("mips64_asm") ],
595 cflags => "-mabi=64 -O3 -Wall -DBN_DIV3W",
596 perlasm_scheme => "64",
597 shared_ldflag => "-mabi=64",
601 #### IA-32 targets...
603 inherit_from => [ "linux-generic32", asm("x86_elf_asm") ],
605 cflags => "-DL_ENDIAN -Wall",
606 debug_cflags => "-O0 -g -DBN_DEBUG -DREF_DEBUG -DCONF_DEBUG -DBN_CTX_DEBUG",
607 release_cflags => "-O3 -fomit-frame-pointer",
608 debug_ex_libs => "-lefence",
609 bn_ops => "BN_LLONG",
612 inherit_from => [ asm("x86_asm") ],
614 cflags => "-DL_ENDIAN -Wall",
615 debug_cflags => "-O0 -g",
616 release_cflags => "-O3 -fomit-frame-pointer",
617 thread_cflag => "(unknown)",
618 bn_ops => "BN_LLONG",
619 perlasm_scheme => "a.out",
623 inherit_from => [ "linux-generic64", asm("x86_64_asm") ],
624 cflags => "-m64 -DL_ENDIAN -Wall",
625 bn_ops => "SIXTY_FOUR_BIT_LONG",
626 perlasm_scheme => "elf",
627 shared_ldflag => "-m64",
630 "linux-x86_64-clang" => {
631 inherit_from => [ "linux-x86_64" ],
633 cflags => "-m64 -DL_ENDIAN -Wall -Wextra -Qunused-arguments",
636 inherit_from => [ "linux-generic32", asm("x86_64_asm") ],
637 cflags => "-mx32 -DL_ENDIAN -Wall",
638 bn_ops => "SIXTY_FOUR_BIT",
639 perlasm_scheme => "elf",
640 shared_ldflag => "-mx32",
645 inherit_from => [ "linux-generic64", asm("ia64_asm") ],
646 bn_ops => "SIXTY_FOUR_BIT_LONG",
650 inherit_from => [ "linux-generic64", asm("s390x_asm") ],
651 cflags => "-m64 -Wall -DB_ENDIAN",
652 perlasm_scheme => "64",
653 shared_ldflag => "-m64",
657 #### So called "highgprs" target for z/Architecture CPUs
658 # "Highgprs" is kernel feature first implemented in Linux
659 # 2.6.32, see /proc/cpuinfo. The idea is to preserve most
660 # significant bits of general purpose registers not only
661 # upon 32-bit process context switch, but even on
662 # asynchronous signal delivery to such process. This makes
663 # it possible to deploy 64-bit instructions even in legacy
664 # application context and achieve better [or should we say
665 # adequate] performance. The build is binary compatible with
666 # linux-generic32, and the idea is to be able to install the
667 # resulting libcrypto.so alongside generic one, e.g. as
668 # /lib/highgprs/libcrypto.so.x.y, for ldconfig and run-time
669 # linker to autodiscover. Unfortunately it doesn't work just
670 # yet, because of couple of bugs in glibc
671 # sysdeps/s390/dl-procinfo.c affecting ldconfig and ld.so.1...
673 inherit_from => [ "linux-generic32", asm("s390x_asm") ],
674 cflags => "-m31 -Wall -Wa,-mzarch -DB_ENDIAN",
675 bn_obj => sub { my $r=join(" ",@_); $r=~s/bn\-s390x/bn_asm/; $r; },
676 perlasm_scheme => "31",
677 shared_ldflag => "-m31",
678 multilib => "/highgprs",
681 #### SPARC Linux setups
682 # Ray Miller <ray.miller@computing-services.oxford.ac.uk> has
683 # patiently assisted with debugging of following two configs.
685 inherit_from => [ "linux-generic32", asm("sparcv8_asm") ],
686 cflags => "-mcpu=v8 -Wall -DB_ENDIAN -DBN_DIV2W",
689 # it's a real mess with -mcpu=ultrasparc option under Linux,
690 # but -Wa,-Av8plus should do the trick no matter what.
691 inherit_from => [ "linux-generic32", asm("sparcv9_asm") ],
692 cflags => "-m32 -mcpu=ultrasparc -Wall -Wa,-Av8plus -DB_ENDIAN -DBN_DIV2W",
693 shared_ldflag => "-m32",
695 "linux64-sparcv9" => {
696 # GCC 3.1 is a requirement
697 inherit_from => [ "linux-generic64", asm("sparcv9_asm") ],
698 cflags => "-m64 -mcpu=ultrasparc -Wall -DB_ENDIAN",
699 bn_ops => "BN_LLONG RC4_CHAR",
700 shared_ldflag => "-m64",
704 "linux-alpha-gcc" => {
705 inherit_from => [ "linux-generic64", asm("alpha_asm") ],
706 cflags => "-DL_ENDIAN",
707 bn_ops => "SIXTY_FOUR_BIT_LONG",
709 "linux-c64xplus" => {
710 # TI_CGT_C6000_7.3.x is a requirement
712 cflags => "--linux -ea=.s -eo=.o -mv6400+ -o2 -ox -ms -pden -DOPENSSL_SMALL_FOOTPRINT",
713 thread_cflag => "-D_REENTRANT",
714 bn_ops => "BN_LLONG",
715 cpuid_asm_src => "c64xpluscpuid.s",
716 bn_asm_src => "asm/bn-c64xplus.asm c64xplus-gf2m.s",
717 aes_asm_src => "aes-c64xplus.s aes_cbc.c aes-ctr.fake",
718 sha1_asm_src => "sha1-c64xplus.s sha256-c64xplus.s sha512-c64xplus.s",
719 rc4_asm_src => "rc4-c64xplus.s",
720 modes_asm_src => "ghash-c64xplus.s",
721 chacha_asm_src => "chacha-c64xplus.s",
722 poly1305_asm_src => "poly1305-c64xplus.s",
723 perlasm_scheme => "void",
724 dso_scheme => "dlfcn",
725 shared_target => "linux-shared",
726 shared_cflag => "--pic",
727 shared_ldflag => "-z --sysv --shared",
728 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
732 #### Android: linux-* but without pointers to headers and libs.
734 # It takes pair of prior-set environment variables to make it work:
736 # CROSS_SYSROOT=/some/where/android-ndk-<ver>/platforms/android-<apiver>/arch-<
737 # CROSS_COMPILE=<prefix>
739 # As well as PATH adjusted to cover ${CROSS_COMPILE}gcc and company.
740 # For example to compile for ICS and ARM with NDK 10d, you'd:
742 # ANDROID_NDK=/some/where/android-ndk-10d
743 # CROSS_SYSROOT=$ANDROID_NDK/platforms/android-14/arch-arm
744 # CROSS_COMPILE=arm-linux-adroideabi-
745 # PATH=$ANDROID_NDK/toolchains/arm-linux-androideabi-4.8/prebuild/linux-x86_64/
748 inherit_from => [ "linux-generic32" ],
749 # Special note about unconditional -fPIC and -pie. The underlying
750 # reason is that Lollipop refuses to run non-PIE. But what about
751 # older systems and NDKs? -fPIC was never problem, so the only
752 # concern if -pie. Older toolchains, e.g. r4, appear to handle it
753 # and binaries turn mostly functional. "Mostly" means that oldest
754 # Androids, such as Froyo, fail to handle executable, but newer
755 # systems are perfectly capable of executing binaries targeting
756 # Froyo. Keep in mind that in the nutshell Android builds are
757 # about JNI, i.e. shared libraries, not applications.
758 cflags => "-mandroid -fPIC --sysroot=\$(CROSS_SYSROOT) -Wa,--noexecstack -Wall",
759 debug_cflags => "-O0 -g",
765 inherit_from => [ "android", asm("x86_asm") ],
766 release_cflags => "-O3 -fomit-frame-pointer",
767 bn_ops => "BN_LLONG",
768 perlasm_scheme => "android",
770 ################################################################
771 # Contemporary Android applications can provide multiple JNI
772 # providers in .apk, targeting multiple architectures. Among
773 # them there is "place" for two ARM flavours: generic eabi and
774 # armv7-a/hard-float. However, it should be noted that OpenSSL's
775 # ability to engage NEON is not constrained by ABI choice, nor
776 # is your ability to call OpenSSL from your application code
777 # compiled with floating-point ABI other than default 'soft'.
778 # [Latter thanks to __attribute__((pcs("aapcs"))) declaration.]
779 # This means that choice of ARM libraries you provide in .apk
780 # is driven by application needs. For example if application
781 # itself benefits from NEON or is floating-point intensive, then
782 # it might be appropriate to provide both libraries. Otherwise
783 # just generic eabi would do. But in latter case it would be
786 # ./Configure android-armeabi -D__ARM_MAX_ARCH__=8
788 # in order to build "universal" binary and allow OpenSSL take
789 # advantage of NEON when it's available.
791 "android-armeabi" => {
792 inherit_from => [ "android", asm("armv4_asm") ],
795 inherit_from => [ "android", asm("mips32_asm") ],
796 perlasm_scheme => "o32",
800 inherit_from => [ "linux-generic64" ],
801 cflags => "-mandroid -fPIC --sysroot=\$(CROSS_SYSROOT) -Wa,--noexecstack -Wall",
802 debug_cflags => "-O0 -g",
807 "android64-aarch64" => {
808 inherit_from => [ "android64", asm("aarch64_asm") ],
809 perlasm_scheme => "linux64",
814 # As for thread_cflag. Idea is to maintain "collective" set of
815 # flags, which would cover all BSD flavors. -pthread applies
816 # to them all, but is treated differently. OpenBSD expands is
817 # as -D_POSIX_THREAD -lc_r, which is sufficient. FreeBSD 4.x
818 # expands it as -lc_r, which has to be accompanied by explicit
819 # -D_THREAD_SAFE and sometimes -D_REENTRANT. FreeBSD 5.x
820 # expands it as -lc_r, which seems to be sufficient?
823 debug_cflags => "-O0 -g",
824 release_cflags => "-O3",
825 thread_cflag => "-pthread -D_THREAD_SAFE -D_REENTRANT",
826 bn_ops => "BN_LLONG",
827 dso_scheme => "dlfcn",
828 shared_target => "bsd-gcc-shared",
829 shared_cflag => "-fPIC",
830 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
833 inherit_from => [ "BSD-generic32" ],
834 bn_ops => "SIXTY_FOUR_BIT_LONG",
838 inherit_from => [ "BSD-generic32", asm("x86_asm") ],
839 cflags => "-DL_ENDIAN -Wall",
840 release_cflags => "-O3 -fomit-frame-pointer",
841 bn_ops => "BN_LLONG",
842 shared_target => "bsd-shared",
843 perlasm_scheme => "a.out",
846 inherit_from => [ "BSD-x86" ],
847 perlasm_scheme => "elf",
851 inherit_from => [ "BSD-generic32", asm("sparcv8_asm") ],
852 cflags => "-mcpu=v8 -Wall -DB_ENDIAN",
855 # -DMD32_REG_T=int doesn't actually belong in sparc64 target, it
856 # simply *happens* to work around a compiler bug in gcc 3.3.3,
857 # triggered by RIPEMD160 code.
858 inherit_from => [ "BSD-generic64", asm("sparcv9_asm") ],
859 cflags => "-DB_ENDIAN -DMD32_REG_T=int -Wall",
860 bn_ops => "BN_LLONG",
864 inherit_from => [ "BSD-generic64", asm("ia64_asm") ],
865 cflags => "-DL_ENDIAN -Wall",
866 bn_ops => "SIXTY_FOUR_BIT_LONG",
870 inherit_from => [ "BSD-generic64", asm("x86_64_asm") ],
871 cflags => "-DL_ENDIAN -Wall",
872 bn_ops => "SIXTY_FOUR_BIT_LONG",
873 perlasm_scheme => "elf",
877 inherit_from => [ asm("x86_elf_asm") ],
879 cflags => "-DPERL5 -DL_ENDIAN -fomit-frame-pointer -O3 -Wall",
880 thread_cflag => "(unknown)",
882 bn_ops => "BN_LLONG",
883 dso_scheme => "dlfcn",
884 shared_target => "bsd-gcc-shared",
885 shared_cflag => "-fPIC",
886 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
891 cflags => "-O -Wall",
892 unistd => "<libc.h>",
893 thread_cflag => "(unknown)",
894 bn_ops => "BN_LLONG",
898 cflags => "-O3 -Wall",
899 unistd => "<libc.h>",
900 thread_cflag => "(unknown)",
901 bn_ops => "BN_LLONG",
907 cflags => "-DL_ENDIAN -DTERMIO",
908 thread_cflag => "(unknown)",
912 ex_libs => "-lsocket",
913 dso_scheme => "dlfcn",
914 shared_target => "bsd-gcc-shared",
915 shared_cflag => "-fPIC",
916 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
919 inherit_from => [ asm("x86_elf_asm") ],
921 cflags => "-DL_ENDIAN -O2 -Wall",
922 ex_libs => "-lsocket",
923 dso_scheme => "dlfcn",
924 shared_target => "bsd-gcc-shared",
925 shared_cflag => "-fPIC",
926 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
929 #### SCO/Caldera targets.
931 # Originally we had like unixware-*, unixware-*-pentium, unixware-*-p6, etc.
932 # Now we only have blended unixware-* as it's the only one used by ./config.
933 # If you want to optimize for particular microarchitecture, bypass ./config
934 # and './Configure unixware-7 -Kpentium_pro' or whatever appropriate.
935 # Note that not all targets include assembler support. Mostly because of
936 # lack of motivation to support out-of-date platforms with out-of-date
937 # compiler drivers and assemblers. Tim Rice <tim@multitalents.net> has
938 # patiently assisted to debug most of it.
940 # UnixWare 2.0x fails destest with -O.
943 cflags => "-DFILIO_H -DNO_STRINGS_H",
944 thread_cflag => "-Kthread",
945 ex_libs => "-lsocket -lnsl -lresolv -lx",
949 cflags => "-O -DFILIO_H",
950 thread_cflag => "-Kthread",
951 ex_libs => "-lsocket -lnsl -lresolv -lx",
954 inherit_from => [ asm("x86_elf_asm") ],
956 cflags => "-O -DFILIO_H -Kalloca",
957 thread_cflag => "-Kthread",
958 ex_libs => "-lsocket -lnsl",
959 bn_ops => "BN_LLONG",
960 perlasm_scheme => "elf-1",
961 dso_scheme => "dlfcn",
962 shared_target => "svr5-shared",
963 shared_cflag => "-Kpic",
964 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
966 "unixware-7-gcc" => {
967 inherit_from => [ asm("x86_elf_asm") ],
969 cflags => "-DL_ENDIAN -DFILIO_H -O3 -fomit-frame-pointer -Wall",
970 thread_cflag => "-D_REENTRANT",
971 ex_libs => "-lsocket -lnsl",
972 bn_ops => "BN_LLONG",
973 perlasm_scheme => "elf-1",
974 dso_scheme => "dlfcn",
975 shared_target => "gnu-shared",
976 shared_cflag => "-fPIC",
977 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
979 # SCO 5 - Ben Laurie <ben@algroup.co.uk> says the -O breaks the SCO cc.
981 inherit_from => [ asm("x86_elf_asm") ],
984 thread_cflag => "(unknown)",
985 ex_libs => "-lsocket -lnsl",
986 perlasm_scheme => "elf-1",
987 dso_scheme => "dlfcn",
988 shared_target => "svr3-shared",
989 shared_cflag => "-Kpic",
990 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
993 inherit_from => [ asm("x86_elf_asm") ],
995 cflags => "-O3 -fomit-frame-pointer",
996 thread_cflag => "(unknown)",
997 ex_libs => "-lsocket -lnsl",
998 bn_ops => "BN_LLONG",
999 perlasm_scheme => "elf-1",
1000 dso_scheme => "dlfcn",
1001 shared_target => "svr3-shared",
1002 shared_cflag => "-fPIC",
1003 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
1008 inherit_from => [ asm("ppc32_asm") ],
1010 cflags => "-DB_ENDIAN",
1011 debug_cflags => "-O0 -g",
1012 release_cflags => "-O",
1013 thread_cflag => "-pthread",
1015 bn_ops => "BN_LLONG RC4_CHAR",
1016 perlasm_scheme => "aix32",
1017 dso_scheme => "dlfcn",
1018 shared_target => "aix-shared",
1019 shared_ldflag => "-shared -Wl,-G",
1020 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
1024 inherit_from => [ asm("ppc64_asm") ],
1026 cflags => "-maix64 -DB_ENDIAN",
1027 debug_cflags => "-O0 -g",
1028 release_cflags => "-O",
1029 thread_cflag => "-pthread",
1031 bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
1032 perlasm_scheme => "aix64",
1033 dso_scheme => "dlfcn",
1034 shared_target => "aix-shared",
1035 shared_ldflag => "-maix64 -shared -Wl,-G",
1036 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
1039 # Below targets assume AIX 5. Idea is to effectively disregard
1040 # $OBJECT_MODE at build time. $OBJECT_MODE is respected at
1043 inherit_from => [ asm("ppc32_asm") ],
1045 cflags => "-q32 -DB_ENDIAN -qmaxmem=16384 -qro -qroconst",
1047 release_cflags => "-O",
1048 thread_cflag => "-qthreaded -D_THREAD_SAFE",
1050 bn_ops => "BN_LLONG RC4_CHAR",
1051 perlasm_scheme => "aix32",
1052 dso_scheme => "dlfcn",
1053 shared_target => "aix-shared",
1054 shared_ldflag => "-q32 -G",
1055 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
1059 inherit_from => [ asm("ppc64_asm") ],
1061 cflags => "-q64 -DB_ENDIAN -qmaxmem=16384 -qro -qroconst",
1063 release_cflags => "-O",
1064 thread_cflag => "-qthreaded -D_THREAD_SAFE",
1066 bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
1067 perlasm_scheme => "aix64",
1068 dso_scheme => "dlfcn",
1069 shared_target => "aix-shared",
1070 shared_ldflag => "-q64 -G",
1071 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
1075 # SIEMENS BS2000/OSD: an EBCDIC-based mainframe
1078 cflags => "-O -XLLML -XLLMK -XL -DB_ENDIAN -DCHARSET_EBCDIC",
1079 thread_cflag => "(unknown)",
1080 ex_libs => "-lsocket -lnsl",
1081 bn_ops => "THIRTY_TWO_BIT RC4_CHAR",
1084 # OS/390 Unix an EBCDIC-based Unix system on IBM mainframe
1085 # You need to compile using the c89.sh wrapper in the tools directory, because the
1086 # IBM compiler does not like the -L switch after any object modules.
1090 cflags => "-O -DB_ENDIAN -DCHARSET_EBCDIC -DNO_SYS_PARAM_H -D_ALL_SOURCE",
1091 thread_cflag => "(unknown)",
1092 bn_ops => "THIRTY_TWO_BIT RC4_CHAR",
1095 #### Visual C targets
1097 # Win64 targets, WIN64I denotes IA-64 and WIN64A - AMD64
1099 # Note about -wd4090, disable warning C4090. This warning returns false
1100 # positives in some situations. Disabling it altogether masks both
1101 # legitimate and false cases, but as we compile on multiple platforms,
1102 # we rely on other compilers to catch legitimate cases.
1106 cflags => "-W3 -wd4090 -Gs0 -GF -Gy -nologo -DOPENSSL_SYS_WIN32 -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -D_CRT_SECURE_NO_DEPRECATE",
1107 dso_scheme => "win32",
1108 build_scheme => "mk1mf",
1111 inherit_from => [ "VC-common", asm("ia64_asm") ],
1112 cflags => add("-DUNICODE -D_UNICODE"),
1114 bn_ops => "SIXTY_FOUR_BIT EXPORT_VAR_AS_FN",
1115 bn_obj => sub { my $r=join(" ",@_); $r=~s/bn\-//; $r; },
1117 perlasm_scheme => "ias",
1118 build_scheme => [ "mk1mf", "VC-W64" ],
1121 inherit_from => [ "VC-common", asm("x86_64_asm") ],
1122 cflags => add("-DUNICODE -D_UNICODE"),
1124 bn_ops => "SIXTY_FOUR_BIT EXPORT_VAR_AS_FN",
1125 bn_obj => sub { my $r=join(" ",@_); $r=~s/x86_64\-gcc/bn_asm/; $r; },
1126 perlasm_scheme => "auto",
1127 build_scheme => [ "mk1mf", "VC-W64" ],
1130 # x86 Win32 target defaults to ANSI API, if you want UNICODE,
1131 # configure with 'perl Configure VC-WIN32 -DUNICODE -D_UNICODE'
1132 inherit_from => [ "VC-common", asm("x86_asm") ],
1134 bn_ops => "BN_LLONG EXPORT_VAR_AS_FN",
1135 perlasm_scheme => "win32n",
1136 build_scheme => [ "mk1mf", "VC-W32" ],
1141 bn_ops => "BN_LLONG EXPORT_VAR_AS_FN",
1142 dso_scheme => "win32",
1143 build_scheme => [ "mk1mf", "VC-WCE" ],
1146 #### Borland C++ 4.5
1150 bn_ops => "BN_LLONG EXPORT_VAR_AS_FN",
1151 dso_scheme => "win32",
1152 build_scheme => [ "mk1mf", "BC" ],
1157 inherit_from => [ asm("x86_asm"),
1158 sub { $disabled{shared} ? () : "x86_uplink" } ],
1160 cflags => "-DL_ENDIAN -DWIN32_LEAN_AND_MEAN -DUNICODE -D_UNICODE -m32 -Wall",
1161 debug_cflags => "-g -O0",
1162 release_cflags => "-O3 -fomit-frame-pointer",
1163 thread_cflag => "-D_MT",
1164 sys_id => "MINGW32",
1165 ex_libs => "-lws2_32 -lgdi32 -lcrypt32",
1166 bn_ops => "BN_LLONG EXPORT_VAR_AS_FN",
1167 perlasm_scheme => "coff",
1168 dso_scheme => "win32",
1169 shared_target => "mingw-shared",
1170 shared_cflag => add("-D_WINDLL"),
1171 shared_ldflag => "-static-libgcc",
1172 shared_rcflag => "--target=pe-i386",
1173 shared_extension => ".dll",
1177 # As for OPENSSL_USE_APPLINK. Applink makes it possible to use
1178 # .dll compiled with one compiler with application compiled with
1179 # another compiler. It's possible to engage Applink support in
1180 # mingw64 build, but it's not done, because till mingw64
1181 # supports structured exception handling, one can't seriously
1182 # consider its binaries for using with non-mingw64 run-time
1183 # environment. And as mingw64 is always consistent with itself,
1184 # Applink is never engaged and can as well be omitted.
1185 inherit_from => [ asm("x86_64_asm") ],
1187 cflags => "-DL_ENDIAN -DWIN32_LEAN_AND_MEAN -DUNICODE -D_UNICODE -m64 -Wall",
1188 debug_cflags => "-g -O0",
1189 release_cflags => "-O3",
1190 thread_cflag => "-D_MT",
1191 sys_id => "MINGW64",
1192 ex_libs => "-lws2_32 -lgdi32 -lcrypt32",
1193 bn_ops => "SIXTY_FOUR_BIT EXPORT_VAR_AS_FN",
1194 perlasm_scheme => "mingw64",
1195 dso_scheme => "win32",
1196 shared_target => "mingw-shared",
1197 shared_cflag => add("-D_WINDLL"),
1198 shared_ldflag => "-static-libgcc",
1199 shared_rcflag => "--target=pe-x86-64",
1200 shared_extension => ".dll",
1207 cflags => "-DL_ENDIAN -O",
1214 cflags => "-DTERMIOS -DL_ENDIAN -O -Wall",
1216 bn_ops => "BN_LLONG",
1217 dso_scheme => "win32",
1222 inherit_from => [ asm("x86_asm") ],
1224 cflags => "-DTERMIOS -DL_ENDIAN -Wall",
1225 debug_cflags => "-g -O0",
1226 release_cflags => "-O3 -fomit-frame-pointer",
1228 bn_ops => "BN_LLONG",
1229 perlasm_scheme => "coff",
1230 dso_scheme => "dlfcn",
1231 shared_target => "cygwin-shared",
1232 shared_cflag => "-D_WINDLL",
1233 shared_ldflag => "-shared",
1234 shared_extension => ".dll",
1236 "Cygwin-x86_64" => {
1237 inherit_from => [ asm("x86_64_asm") ],
1239 cflags => "-DTERMIOS -DL_ENDIAN -Wall",
1240 debug_cflags => "-g -O0",
1241 release_cflags => "-O3",
1243 bn_ops => "SIXTY_FOUR_BIT_LONG",
1244 perlasm_scheme => "mingw64",
1245 dso_scheme => "dlfcn",
1246 shared_target => "cygwin-shared",
1247 shared_cflag => "-D_WINDLL",
1248 shared_ldflag => "-shared",
1249 shared_extension => ".dll",
1251 # Backward compatibility for those using this target
1253 inherit_from => [ "Cygwin-x86" ]
1255 # In case someone constructs the Cygwin target name themself
1257 inherit_from => [ "Cygwin-x86" ]
1260 inherit_from => [ "Cygwin-x86" ]
1263 inherit_from => [ "Cygwin-x86" ]
1266 inherit_from => [ "Cygwin-x86" ]
1269 #### NetWare from David Ward (dsward@novell.com)
1270 # requires either MetroWerks NLM development tools, or gcc / nlmconv
1271 # NetWare defaults socket bio to WinSock sockets. However,
1272 # the builds can be configured to use BSD sockets instead.
1273 # netware-clib => legacy CLib c-runtime support
1276 build_scheme => [ "mk1mf", "netware" ],
1278 "netware-clib-bsdsock" => {
1280 build_scheme => [ "mk1mf", "netware" ],
1282 "netware-clib-gcc" => {
1283 cc => "i586-netware-gcc",
1284 cflags => "-nostdinc -I/ndk/nwsdk/include/nlm -I/ndk/ws295sdk/include -DL_ENDIAN -DNETWARE_CLIB -DOPENSSL_SYS_NETWARE -O2 -Wall",
1286 "netware-clib-bsdsock-gcc" => {
1287 cc => "i586-netware-gcc",
1288 cflags => "-nostdinc -I/ndk/nwsdk/include/nlm -DNETWARE_BSDSOCK -DNETDB_USE_INTERNET -DL_ENDIAN -DNETWARE_CLIB -DOPENSSL_SYS_NETWARE -O2 -Wall",
1290 # netware-libc => LibC/NKS support
1293 bn_ops => "BN_LLONG",
1294 build_scheme => [ "mk1mf", "netware" ],
1296 "netware-libc-bsdsock" => {
1298 bn_ops => "BN_LLONG",
1299 build_scheme => [ "mk1mf", "netware" ],
1301 "netware-libc-gcc" => {
1302 cc => "i586-netware-gcc",
1303 cflags => "-nostdinc -I/ndk/libc/include -I/ndk/libc/include/winsock -DL_ENDIAN -DNETWARE_LIBC -DOPENSSL_SYS_NETWARE -DTERMIO -O2 -Wall",
1304 bn_ops => "BN_LLONG",
1306 "netware-libc-bsdsock-gcc" => {
1307 cc => "i586-netware-gcc",
1308 cflags => "-nostdinc -I/ndk/libc/include -DNETWARE_BSDSOCK -DL_ENDIAN -DNETWARE_LIBC -DOPENSSL_SYS_NETWARE -DTERMIO -O2 -Wall",
1309 bn_ops => "BN_LLONG",
1314 inherit_from => [ asm("x86_asm") ],
1316 cflags => "-I/dev/env/WATT_ROOT/inc -DTERMIO -DL_ENDIAN -fomit-frame-pointer -O2 -Wall",
1318 ex_libs => "-L/dev/env/WATT_ROOT/lib -lwatt",
1319 bn_ops => "BN_LLONG",
1320 perlasm_scheme => "a.out",
1323 #### Ultrix from Bernhard Simon <simon@zid.tuwien.ac.at>
1326 cflags => "-std1 -O -Olimit 2500 -DL_ENDIAN",
1327 thread_cflag => "(unknown)",
1331 cflags => "-O3 -DL_ENDIAN",
1332 thread_cflag => "(unknown)",
1333 bn_ops => "BN_LLONG",
1335 # K&R C is no longer supported; you need gcc on old Ultrix installations
1336 ##"ultrix","cc:-O2 -DNOPROTO -DNOCONST -DL_ENDIAN::(unknown):::::::",
1338 ##### MacOS X (a.k.a. Darwin) setup
1339 "darwin-common" => {
1343 debug_cflags => "-g -O0",
1344 release_cflags => "-O3",
1345 thread_cflag => "-D_REENTRANT",
1347 plib_lflags => "-Wl,-search_paths_first",
1348 bn_ops => "BN_LLONG RC4_CHAR",
1349 perlasm_scheme => "osx32",
1350 dso_scheme => "dlfcn",
1351 shared_target => "darwin-shared",
1352 shared_cflag => "-fPIC -fno-common",
1353 shared_ldflag => "-dynamiclib",
1354 shared_extension => ".\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
1356 "darwin-ppc-cc" => {
1357 inherit_from => [ "darwin-common", asm("ppc32_asm") ],
1358 cflags => "-arch ppc -DB_ENDIAN -Wa,-force_cpusubtype_ALL",
1359 perlasm_scheme => "osx32",
1360 shared_ldflag => "-arch ppc -dynamiclib",
1362 "darwin64-ppc-cc" => {
1363 inherit_from => [ "darwin-common", asm("ppc64_asm") ],
1364 cflags => "-arch ppc64 -DB_ENDIAN",
1365 bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
1366 perlasm_scheme => "osx64",
1367 shared_ldflag => "-arch ppc64 -dynamiclib",
1369 "darwin-i386-cc" => {
1370 inherit_from => [ "darwin-common", asm("x86_asm") ],
1371 cflags => "-arch i386 -DL_ENDIAN",
1372 release_cflags => "-O3 -fomit-frame-pointer",
1373 bn_ops => "BN_LLONG RC4_INT",
1374 perlasm_scheme => "macosx",
1375 shared_ldflag => "-arch i386 -dynamiclib",
1377 "darwin64-x86_64-cc" => {
1378 inherit_from => [ "darwin-common", asm("x86_64_asm") ],
1379 cflags => "-arch x86_64 -DL_ENDIAN -Wall",
1380 bn_ops => "SIXTY_FOUR_BIT_LONG",
1381 perlasm_scheme => "macosx",
1382 shared_ldflag => "-arch x86_64 -dynamiclib",
1387 # It takes three prior-set environment variables to make it work:
1389 # CROSS_COMPILE=/where/toolchain/is/usr/bin/ [note ending slash]
1390 # CROSS_TOP=/where/SDKs/are
1391 # CROSS_SDK=iPhoneOSx.y.sdk
1393 # Exact paths vary with Xcode releases, but for couple of last ones
1394 # they would look like this:
1396 # CROSS_COMPILE=`xcode-select --print-path`/Toolchains/XcodeDefault.xctoolchain/usr/bin/
1397 # CROSS_TOP=`xcode-select --print-path`/Platforms/iPhoneOS.platform/Developer
1398 # CROSS_SDK=iPhoneOS.sdk
1400 "iphoneos-cross" => {
1401 inherit_from => [ "darwin-common" ],
1402 cflags => "-isysroot \$(CROSS_TOP)/SDKs/\$(CROSS_SDK) -fno-common",
1406 inherit_from => [ "darwin-common", asm("armv4_asm") ],
1407 # It should be possible to go below iOS 6 and even add -arch armv6,
1408 # thus targeting iPhone pre-3GS, but it's assumed to be irrelevant
1410 cflags => "-arch armv7 -mios-version-min=6.0.0 -isysroot \$(CROSS_TOP)/SDKs/\$(CROSS_SDK) -fno-common",
1412 perlasm_scheme => "ios32",
1415 inherit_from => [ "darwin-common", asm("aarch64_asm") ],
1416 cflags => "-arch arm64 -mios-version-min=7.0.0 -isysroot \$(CROSS_TOP)/SDKs/\$(CROSS_SDK) -fno-common",
1418 bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
1419 perlasm_scheme => "ios64",
1424 inherit_from => [ asm("x86_elf_asm") ],
1426 cflags => "-DL_ENDIAN -O3 -fomit-frame-pointer -Wall",
1427 thread_cflag => "-pthread",
1429 bn_ops => "BN_LLONG",
1430 dso_scheme => "dlfcn",
1431 shared_target => "linux-shared",
1432 shared_cflag => "-fPIC",
1440 ##### VxWorks for various targets
1441 "vxworks-ppc60x" => {
1443 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",
1444 sys_id => "VXWORKS",
1445 ex_libs => "-Wl,--defsym,__wrs_rtp_base=0xe0000000 -L \$(WIND_BASE)/target/usr/lib/ppc/PPC32/common",
1447 "vxworks-ppcgen" => {
1449 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",
1450 sys_id => "VXWORKS",
1451 ex_libs => "-Wl,--defsym,__wrs_rtp_base=0xe0000000 -L \$(WIND_BASE)/target/usr/lib/ppc/PPC32/sfcommon",
1453 "vxworks-ppc405" => {
1455 cflags => "-g -msoft-float -mlongcall -DCPU=PPC405 -I\$(WIND_BASE)/target/h",
1456 sys_id => "VXWORKS",
1459 "vxworks-ppc750" => {
1461 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)",
1462 sys_id => "VXWORKS",
1465 "vxworks-ppc750-debug" => {
1467 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",
1468 sys_id => "VXWORKS",
1471 "vxworks-ppc860" => {
1473 cflags => "-nostdinc -msoft-float -DCPU=PPC860 -DNO_STRINGS_H -I\$(WIND_BASE)/target/h",
1474 sys_id => "VXWORKS",
1477 "vxworks-simlinux" => {
1479 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",
1480 sys_id => "VXWORKS",
1482 ranlib => "ranlibpentium",
1485 inherit_from => [ asm("mips32_asm") ],
1487 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",
1488 thread_cflag => "-D_REENTRANT",
1489 sys_id => "VXWORKS",
1490 ex_libs => "-Wl,--defsym,__wrs_rtp_base=0xe0000000 -L \$(WIND_BASE)/target/usr/lib/mips/MIPSI32/sfcommon",
1491 perlasm_scheme => "o32",
1492 ranlib => "ranlibmips",
1498 cflags => "\$(CFLAGS)",
1499 thread_cflag => "-D_REENTRANT",
1500 plib_lflags => "\$(LDFLAGS)",
1501 ex_libs => "\$(LDLIBS)",
1502 bn_ops => "BN_LLONG",
1503 dso_scheme => "$ENV{'LIBSSL_dlfcn'}",
1504 shared_target => "linux-shared",
1505 shared_cflag => "-fPIC",
1506 shared_ldflag => "-shared",
1507 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
1508 ranlib => "$ENV{'RANLIB'}",
1510 "uClinux-dist64" => {
1512 cflags => "\$(CFLAGS)",
1513 thread_cflag => "-D_REENTRANT",
1514 plib_lflags => "\$(LDFLAGS)",
1515 ex_libs => "\$(LDLIBS)",
1516 bn_ops => "SIXTY_FOUR_BIT_LONG",
1517 dso_scheme => "$ENV{'LIBSSL_dlfcn'}",
1518 shared_target => "linux-shared",
1519 shared_cflag => "-fPIC",
1520 shared_ldflag => "-shared",
1521 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
1522 ranlib => "$ENV{'RANLIB'}",
1529 cflags => "/STANDARD=RELAXED/NOLIST/PREFIX=ALL/NAMES=(AS_IS,SHORTENED)",
1530 debug_cflags => "/NOOPTIMIZE/DEBUG",
1531 release_cflags => "/OPTIMIZE/NODEBUG",
1533 debug_lflags => "/DEBUG/TRACEBACK",
1534 release_lflags => "/NODEBUG/NOTRACEBACK",
1535 shared_target => "vms-shared",
1537 apps_aux_src => "vms_decc_init.c",
1538 build_file => "descrip.mms",
1539 build_scheme => [ "unified", "VMS" ],
1542 # VMS on VAX is *unsupported*
1545 # bn_obj => "[.asm]vms.obj vms-helper.obj"
1548 # inherit_from => [ "vms-generic", asm("vms-asm") ],
1550 # debug_aflags => "/NOOPTIMIZE/DEBUG",
1551 # release_aflags => "/OPTIMIZE/NODEBUG",
1552 # bn_opts => "THIRTY_TWO_BIT RC4_CHAR RC4_CHUNK DES_PTR BF_PTR",
1555 inherit_from => [ "vms-generic" ],
1557 #debug_aflags => "/NOOPTIMIZE/DEBUG",
1558 #release_aflags => "/OPTIMIZE/NODEBUG",
1559 bn_opts => "SIXTY_FOUR_BIT RC4_INT RC4_CHUNK_LL DES_PTR BF_PTR",
1561 "vms-alpha-P32" => {
1562 inherit_from => [ "vms-alpha" ],
1563 cflags => add("/POINTER_SIZE=32"),
1565 "vms-alpha-P64" => {
1566 inherit_from => [ "vms-alpha" ],
1567 cflags => add("/POINTER_SIZE=64"),
1570 inherit_from => [ "vms-generic" ],
1572 #debug_aflags => "/NOOPTIMIZE/DEBUG",
1573 #release_aflags => "/OPTIMIZE/NODEBUG",
1574 bn_opts => "SIXTY_FOUR_BIT RC4_INT RC4_CHUNK_LL DES_PTR BF_PTR",
1577 inherit_from => [ "vms-ia64" ],
1578 cflags => add("/POINTER_SIZE=32"),
1581 inherit_from => [ "vms-ia64" ],
1582 cflags => add("/POINTER_SIZE=64"),