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 => "-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 => "-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 => "-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 => "-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",
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 => "-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 => "-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 => "-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 => "-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",
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",
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 => "-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",
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",
772 inherit_from => [ "android", asm("x86_asm") ],
773 release_cflags => "-O3 -fomit-frame-pointer",
774 bn_ops => "BN_LLONG",
775 perlasm_scheme => "android",
777 ################################################################
778 # Contemporary Android applications can provide multiple JNI
779 # providers in .apk, targeting multiple architectures. Among
780 # them there is "place" for two ARM flavours: generic eabi and
781 # armv7-a/hard-float. However, it should be noted that OpenSSL's
782 # ability to engage NEON is not constrained by ABI choice, nor
783 # is your ability to call OpenSSL from your application code
784 # compiled with floating-point ABI other than default 'soft'.
785 # [Latter thanks to __attribute__((pcs("aapcs"))) declaration.]
786 # This means that choice of ARM libraries you provide in .apk
787 # is driven by application needs. For example if application
788 # itself benefits from NEON or is floating-point intensive, then
789 # it might be appropriate to provide both libraries. Otherwise
790 # just generic eabi would do. But in latter case it would be
793 # ./Configure android-armeabi -D__ARM_MAX_ARCH__=8
795 # in order to build "universal" binary and allow OpenSSL take
796 # advantage of NEON when it's available.
798 "android-armeabi" => {
799 inherit_from => [ "android", asm("armv4_asm") ],
802 inherit_from => [ "android", asm("mips32_asm") ],
803 perlasm_scheme => "o32",
807 inherit_from => [ "linux-generic64" ],
808 cflags => "-mandroid -fPIC --sysroot=\$(CROSS_SYSROOT) -Wa,--noexecstack -Wall",
809 debug_cflags => "-O0 -g",
814 "android64-aarch64" => {
815 inherit_from => [ "android64", asm("aarch64_asm") ],
816 perlasm_scheme => "linux64",
821 # As for thread_cflag. Idea is to maintain "collective" set of
822 # flags, which would cover all BSD flavors. -pthread applies
823 # to them all, but is treated differently. OpenBSD expands is
824 # as -D_POSIX_THREAD -lc_r, which is sufficient. FreeBSD 4.x
825 # expands it as -lc_r, which has to be accompanied by explicit
826 # -D_THREAD_SAFE and sometimes -D_REENTRANT. FreeBSD 5.x
827 # expands it as -lc_r, which seems to be sufficient?
828 inherit_from => [ "BASE_unix" ],
831 debug_cflags => "-O0 -g",
832 release_cflags => "-O3",
833 thread_cflag => "-pthread -D_THREAD_SAFE -D_REENTRANT",
834 bn_ops => "BN_LLONG",
835 dso_scheme => "dlfcn",
836 shared_target => "bsd-gcc-shared",
837 shared_cflag => "-fPIC",
838 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
841 inherit_from => [ "BSD-generic32" ],
842 bn_ops => "SIXTY_FOUR_BIT_LONG",
846 inherit_from => [ "BSD-generic32", asm("x86_asm") ],
847 cflags => "-DL_ENDIAN -Wall",
848 release_cflags => "-O3 -fomit-frame-pointer",
849 bn_ops => "BN_LLONG",
850 shared_target => "bsd-shared",
851 perlasm_scheme => "a.out",
854 inherit_from => [ "BSD-x86" ],
855 perlasm_scheme => "elf",
859 inherit_from => [ "BSD-generic32", asm("sparcv8_asm") ],
860 cflags => "-mcpu=v8 -Wall -DB_ENDIAN",
863 # -DMD32_REG_T=int doesn't actually belong in sparc64 target, it
864 # simply *happens* to work around a compiler bug in gcc 3.3.3,
865 # triggered by RIPEMD160 code.
866 inherit_from => [ "BSD-generic64", asm("sparcv9_asm") ],
867 cflags => "-DB_ENDIAN -DMD32_REG_T=int -Wall",
868 bn_ops => "BN_LLONG",
872 inherit_from => [ "BSD-generic64", asm("ia64_asm") ],
873 cflags => "-DL_ENDIAN -Wall",
874 bn_ops => "SIXTY_FOUR_BIT_LONG",
878 inherit_from => [ "BSD-generic64", asm("x86_64_asm") ],
879 cflags => "-DL_ENDIAN -Wall",
880 bn_ops => "SIXTY_FOUR_BIT_LONG",
881 perlasm_scheme => "elf",
885 inherit_from => [ "BASE_unix", asm("x86_elf_asm") ],
887 cflags => "-DPERL5 -DL_ENDIAN -fomit-frame-pointer -O3 -Wall",
888 thread_cflag => "(unknown)",
890 bn_ops => "BN_LLONG",
891 dso_scheme => "dlfcn",
892 shared_target => "bsd-gcc-shared",
893 shared_cflag => "-fPIC",
894 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
898 inherit_from => [ "BASE_unix" ],
900 cflags => "-O -Wall",
901 unistd => "<libc.h>",
902 thread_cflag => "(unknown)",
903 bn_ops => "BN_LLONG",
906 inherit_from => [ "BASE_unix" ],
908 cflags => "-O3 -Wall",
909 unistd => "<libc.h>",
910 thread_cflag => "(unknown)",
911 bn_ops => "BN_LLONG",
916 inherit_from => [ "BASE_unix" ],
918 cflags => "-DL_ENDIAN -DTERMIO",
919 thread_cflag => "(unknown)",
922 inherit_from => [ "BASE_unix" ],
924 ex_libs => "-lsocket",
925 dso_scheme => "dlfcn",
926 shared_target => "bsd-gcc-shared",
927 shared_cflag => "-fPIC",
928 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
931 inherit_from => [ "BASE_unix", asm("x86_elf_asm") ],
933 cflags => "-DL_ENDIAN -O2 -Wall",
934 ex_libs => "-lsocket",
935 dso_scheme => "dlfcn",
936 shared_target => "bsd-gcc-shared",
937 shared_cflag => "-fPIC",
938 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
941 #### SCO/Caldera targets.
943 # Originally we had like unixware-*, unixware-*-pentium, unixware-*-p6, etc.
944 # Now we only have blended unixware-* as it's the only one used by ./config.
945 # If you want to optimize for particular microarchitecture, bypass ./config
946 # and './Configure unixware-7 -Kpentium_pro' or whatever appropriate.
947 # Note that not all targets include assembler support. Mostly because of
948 # lack of motivation to support out-of-date platforms with out-of-date
949 # compiler drivers and assemblers. Tim Rice <tim@multitalents.net> has
950 # patiently assisted to debug most of it.
952 # UnixWare 2.0x fails destest with -O.
954 inherit_from => [ "BASE_unix" ],
956 cflags => "-DFILIO_H -DNO_STRINGS_H",
957 thread_cflag => "-Kthread",
958 ex_libs => "-lsocket -lnsl -lresolv -lx",
961 inherit_from => [ "BASE_unix" ],
963 cflags => "-O -DFILIO_H",
964 thread_cflag => "-Kthread",
965 ex_libs => "-lsocket -lnsl -lresolv -lx",
968 inherit_from => [ "BASE_unix", asm("x86_elf_asm") ],
970 cflags => "-O -DFILIO_H -Kalloca",
971 thread_cflag => "-Kthread",
972 ex_libs => "-lsocket -lnsl",
973 bn_ops => "BN_LLONG",
974 perlasm_scheme => "elf-1",
975 dso_scheme => "dlfcn",
976 shared_target => "svr5-shared",
977 shared_cflag => "-Kpic",
978 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
980 "unixware-7-gcc" => {
981 inherit_from => [ "BASE_unix", asm("x86_elf_asm") ],
983 cflags => "-DL_ENDIAN -DFILIO_H -O3 -fomit-frame-pointer -Wall",
984 thread_cflag => "-D_REENTRANT",
985 ex_libs => "-lsocket -lnsl",
986 bn_ops => "BN_LLONG",
987 perlasm_scheme => "elf-1",
988 dso_scheme => "dlfcn",
989 shared_target => "gnu-shared",
990 shared_cflag => "-fPIC",
991 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
993 # SCO 5 - Ben Laurie <ben@algroup.co.uk> says the -O breaks the SCO cc.
995 inherit_from => [ "BASE_unix", asm("x86_elf_asm") ],
998 thread_cflag => "(unknown)",
999 ex_libs => "-lsocket -lnsl",
1000 perlasm_scheme => "elf-1",
1001 dso_scheme => "dlfcn",
1002 shared_target => "svr3-shared",
1003 shared_cflag => "-Kpic",
1004 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
1007 inherit_from => [ "BASE_unix", asm("x86_elf_asm") ],
1009 cflags => "-O3 -fomit-frame-pointer",
1010 thread_cflag => "(unknown)",
1011 ex_libs => "-lsocket -lnsl",
1012 bn_ops => "BN_LLONG",
1013 perlasm_scheme => "elf-1",
1014 dso_scheme => "dlfcn",
1015 shared_target => "svr3-shared",
1016 shared_cflag => "-fPIC",
1017 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
1022 inherit_from => [ "BASE_unix", asm("ppc32_asm") ],
1024 cflags => "-DB_ENDIAN",
1025 debug_cflags => "-O0 -g",
1026 release_cflags => "-O",
1027 thread_cflag => "-pthread",
1029 bn_ops => "BN_LLONG RC4_CHAR",
1030 perlasm_scheme => "aix32",
1031 dso_scheme => "dlfcn",
1032 shared_target => "aix-shared",
1033 shared_ldflag => "-shared -Wl,-G",
1034 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
1038 inherit_from => [ "BASE_unix", asm("ppc64_asm") ],
1040 cflags => "-maix64 -DB_ENDIAN",
1041 debug_cflags => "-O0 -g",
1042 release_cflags => "-O",
1043 thread_cflag => "-pthread",
1045 bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
1046 perlasm_scheme => "aix64",
1047 dso_scheme => "dlfcn",
1048 shared_target => "aix-shared",
1049 shared_ldflag => "-maix64 -shared -Wl,-G",
1050 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
1053 # Below targets assume AIX 5. Idea is to effectively disregard
1054 # $OBJECT_MODE at build time. $OBJECT_MODE is respected at
1057 inherit_from => [ "BASE_unix", asm("ppc32_asm") ],
1059 cflags => "-q32 -DB_ENDIAN -qmaxmem=16384 -qro -qroconst",
1061 release_cflags => "-O",
1062 thread_cflag => "-qthreaded -D_THREAD_SAFE",
1064 bn_ops => "BN_LLONG RC4_CHAR",
1065 perlasm_scheme => "aix32",
1066 dso_scheme => "dlfcn",
1067 shared_target => "aix-shared",
1068 shared_ldflag => "-q32 -G",
1069 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
1073 inherit_from => [ "BASE_unix", asm("ppc64_asm") ],
1075 cflags => "-q64 -DB_ENDIAN -qmaxmem=16384 -qro -qroconst",
1077 release_cflags => "-O",
1078 thread_cflag => "-qthreaded -D_THREAD_SAFE",
1080 bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
1081 perlasm_scheme => "aix64",
1082 dso_scheme => "dlfcn",
1083 shared_target => "aix-shared",
1084 shared_ldflag => "-q64 -G",
1085 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
1089 # SIEMENS BS2000/OSD: an EBCDIC-based mainframe
1091 inherit_from => [ "BASE_unix" ],
1093 cflags => "-O -XLLML -XLLMK -XL -DB_ENDIAN -DCHARSET_EBCDIC",
1094 thread_cflag => "(unknown)",
1095 ex_libs => "-lsocket -lnsl",
1096 bn_ops => "THIRTY_TWO_BIT RC4_CHAR",
1099 # OS/390 Unix an EBCDIC-based Unix system on IBM mainframe
1100 # You need to compile using the c89.sh wrapper in the tools directory, because the
1101 # IBM compiler does not like the -L switch after any object modules.
1104 inherit_from => [ "BASE_unix" ],
1106 cflags => "-O -DB_ENDIAN -DCHARSET_EBCDIC -DNO_SYS_PARAM_H -D_ALL_SOURCE",
1107 thread_cflag => "(unknown)",
1108 bn_ops => "THIRTY_TWO_BIT RC4_CHAR",
1111 #### Visual C targets
1113 # Win64 targets, WIN64I denotes IA-64 and WIN64A - AMD64
1115 # Note about -wd4090, disable warning C4090. This warning returns false
1116 # positives in some situations. Disabling it altogether masks both
1117 # legitimate and false cases, but as we compile on multiple platforms,
1118 # we rely on other compilers to catch legitimate cases.
1120 inherit_from => [ "BASE_Windows" ],
1123 cflags => "-W3 -wd4090 -Gs0 -GF -Gy -nologo -DOPENSSL_SYS_WIN32 -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -D_CRT_SECURE_NO_DEPRECATE",
1124 shared_target => "win-shared", # meaningless except it gives Configure a hint
1125 dso_scheme => "win32",
1128 inherit_from => [ "VC-common", asm("ia64_asm") ],
1129 cflags => add("-DUNICODE -D_UNICODE"),
1131 bn_ops => "SIXTY_FOUR_BIT EXPORT_VAR_AS_FN",
1132 bn_obj => sub { my $r=join(" ",@_); $r=~s/bn\-//; $r; },
1134 perlasm_scheme => "ias",
1135 build_scheme => add("VC-W64", { separator => undef }),
1138 inherit_from => [ "VC-common", asm("x86_64_asm") ],
1139 cflags => add("-DUNICODE -D_UNICODE"),
1141 bn_ops => "SIXTY_FOUR_BIT EXPORT_VAR_AS_FN",
1142 bn_obj => sub { my $r=join(" ",@_); $r=~s/x86_64\-gcc/bn_asm/; $r; },
1143 perlasm_scheme => "auto",
1144 build_scheme => add("VC-W64", { separator => undef }),
1147 # x86 Win32 target defaults to ANSI API, if you want UNICODE,
1148 # configure with 'perl Configure VC-WIN32 -DUNICODE -D_UNICODE'
1149 inherit_from => [ "VC-common", asm("x86_asm") ],
1151 bn_ops => "BN_LLONG EXPORT_VAR_AS_FN",
1152 perlasm_scheme => "win32n",
1153 build_scheme => add("VC-W32", { separator => undef }),
1156 inherit_from => [ "BASE_Windows" ],
1159 bn_ops => "BN_LLONG EXPORT_VAR_AS_FN",
1160 dso_scheme => "win32",
1161 build_scheme => add("VC-WCE", { separator => undef }),
1164 #### Borland C++ 4.5
1166 inherit_from => [ "BASE_Windows" ],
1169 bn_ops => "BN_LLONG EXPORT_VAR_AS_FN",
1170 dso_scheme => "win32",
1171 build_scheme => add("BC", { separator => undef }),
1176 inherit_from => [ "BASE_unix", asm("x86_asm"),
1177 sub { $disabled{shared} ? () : "x86_uplink" } ],
1179 cflags => "-DL_ENDIAN -DWIN32_LEAN_AND_MEAN -DUNICODE -D_UNICODE -m32 -Wall",
1180 debug_cflags => "-g -O0",
1181 release_cflags => "-O3 -fomit-frame-pointer",
1182 thread_cflag => "-D_MT",
1183 sys_id => "MINGW32",
1184 ex_libs => "-lws2_32 -lgdi32 -lcrypt32",
1185 bn_ops => "BN_LLONG EXPORT_VAR_AS_FN",
1186 perlasm_scheme => "coff",
1187 dso_scheme => "win32",
1188 shared_target => "mingw-shared",
1189 shared_cflag => add("-D_WINDLL"),
1190 shared_ldflag => "-static-libgcc",
1191 shared_rcflag => "--target=pe-i386",
1192 shared_extension => ".dll",
1196 # As for OPENSSL_USE_APPLINK. Applink makes it possible to use
1197 # .dll compiled with one compiler with application compiled with
1198 # another compiler. It's possible to engage Applink support in
1199 # mingw64 build, but it's not done, because till mingw64
1200 # supports structured exception handling, one can't seriously
1201 # consider its binaries for using with non-mingw64 run-time
1202 # environment. And as mingw64 is always consistent with itself,
1203 # Applink is never engaged and can as well be omitted.
1204 inherit_from => [ "BASE_unix", asm("x86_64_asm") ],
1206 cflags => "-DL_ENDIAN -DWIN32_LEAN_AND_MEAN -DUNICODE -D_UNICODE -m64 -Wall",
1207 debug_cflags => "-g -O0",
1208 release_cflags => "-O3",
1209 thread_cflag => "-D_MT",
1210 sys_id => "MINGW64",
1211 ex_libs => "-lws2_32 -lgdi32 -lcrypt32",
1212 bn_ops => "SIXTY_FOUR_BIT EXPORT_VAR_AS_FN",
1213 perlasm_scheme => "mingw64",
1214 dso_scheme => "win32",
1215 shared_target => "mingw-shared",
1216 shared_cflag => add("-D_WINDLL"),
1217 shared_ldflag => "-static-libgcc",
1218 shared_rcflag => "--target=pe-x86-64",
1219 shared_extension => ".dll",
1225 inherit_from => [ "BASE_unix" ],
1227 cflags => "-DL_ENDIAN -O",
1233 inherit_from => [ "BASE_unix" ],
1235 cflags => "-DTERMIOS -DL_ENDIAN -O -Wall",
1237 bn_ops => "BN_LLONG",
1238 dso_scheme => "win32",
1243 inherit_from => [ "BASE_unix", asm("x86_asm") ],
1245 cflags => "-DTERMIOS -DL_ENDIAN -Wall",
1246 debug_cflags => "-g -O0",
1247 release_cflags => "-O3 -fomit-frame-pointer",
1249 bn_ops => "BN_LLONG",
1250 perlasm_scheme => "coff",
1251 dso_scheme => "dlfcn",
1252 shared_target => "cygwin-shared",
1253 shared_cflag => "-D_WINDLL",
1254 shared_ldflag => "-shared",
1255 shared_extension => ".dll",
1257 "Cygwin-x86_64" => {
1258 inherit_from => [ "BASE_unix", asm("x86_64_asm") ],
1260 cflags => "-DTERMIOS -DL_ENDIAN -Wall",
1261 debug_cflags => "-g -O0",
1262 release_cflags => "-O3",
1264 bn_ops => "SIXTY_FOUR_BIT_LONG",
1265 perlasm_scheme => "mingw64",
1266 dso_scheme => "dlfcn",
1267 shared_target => "cygwin-shared",
1268 shared_cflag => "-D_WINDLL",
1269 shared_ldflag => "-shared",
1270 shared_extension => ".dll",
1272 # Backward compatibility for those using this target
1274 inherit_from => [ "Cygwin-x86" ]
1276 # In case someone constructs the Cygwin target name themself
1278 inherit_from => [ "Cygwin-x86" ]
1281 inherit_from => [ "Cygwin-x86" ]
1284 inherit_from => [ "Cygwin-x86" ]
1287 inherit_from => [ "Cygwin-x86" ]
1290 #### NetWare from David Ward (dsward@novell.com)
1291 # requires either MetroWerks NLM development tools, or gcc / nlmconv
1292 # NetWare defaults socket bio to WinSock sockets. However,
1293 # the builds can be configured to use BSD sockets instead.
1294 # netware-clib => legacy CLib c-runtime support
1296 inherit_from => [ "BASE_Windows" ],
1298 build_scheme => add("netware", { separator => undef }),
1300 "netware-clib-bsdsock" => {
1301 inherit_from => [ "BASE_Windows" ],
1303 build_scheme => add("netware", { separator => undef }),
1305 "netware-clib-gcc" => {
1306 inherit_from => [ "BASE_unix" ],
1307 cc => "i586-netware-gcc",
1308 cflags => "-nostdinc -I/ndk/nwsdk/include/nlm -I/ndk/ws295sdk/include -DL_ENDIAN -DNETWARE_CLIB -DOPENSSL_SYS_NETWARE -O2 -Wall",
1310 "netware-clib-bsdsock-gcc" => {
1311 inherit_from => [ "BASE_unix" ],
1312 cc => "i586-netware-gcc",
1313 cflags => "-nostdinc -I/ndk/nwsdk/include/nlm -DNETWARE_BSDSOCK -DNETDB_USE_INTERNET -DL_ENDIAN -DNETWARE_CLIB -DOPENSSL_SYS_NETWARE -O2 -Wall",
1315 # netware-libc => LibC/NKS support
1317 inherit_from => [ "BASE_Windows" ],
1319 bn_ops => "BN_LLONG",
1320 build_scheme => add("netware", { separator => undef }),
1322 "netware-libc-bsdsock" => {
1323 inherit_from => [ "BASE_Windows" ],
1325 bn_ops => "BN_LLONG",
1326 build_scheme => add("netware", { separator => undef }),
1328 "netware-libc-gcc" => {
1329 inherit_from => [ "BASE_unix" ],
1330 cc => "i586-netware-gcc",
1331 cflags => "-nostdinc -I/ndk/libc/include -I/ndk/libc/include/winsock -DL_ENDIAN -DNETWARE_LIBC -DOPENSSL_SYS_NETWARE -DTERMIO -O2 -Wall",
1332 bn_ops => "BN_LLONG",
1334 "netware-libc-bsdsock-gcc" => {
1335 inherit_from => [ "BASE_unix" ],
1336 cc => "i586-netware-gcc",
1337 cflags => "-nostdinc -I/ndk/libc/include -DNETWARE_BSDSOCK -DL_ENDIAN -DNETWARE_LIBC -DOPENSSL_SYS_NETWARE -DTERMIO -O2 -Wall",
1338 bn_ops => "BN_LLONG",
1343 inherit_from => [ asm("x86_asm") ],
1345 cflags => "-I/dev/env/WATT_ROOT/inc -DTERMIO -DL_ENDIAN -fomit-frame-pointer -O2 -Wall",
1347 ex_libs => "-L/dev/env/WATT_ROOT/lib -lwatt",
1348 bn_ops => "BN_LLONG",
1349 perlasm_scheme => "a.out",
1352 #### Ultrix from Bernhard Simon <simon@zid.tuwien.ac.at>
1354 inherit_from => [ "BASE_unix" ],
1356 cflags => "-std1 -O -Olimit 2500 -DL_ENDIAN",
1357 thread_cflag => "(unknown)",
1360 inherit_from => [ "BASE_unix" ],
1362 cflags => "-O3 -DL_ENDIAN",
1363 thread_cflag => "(unknown)",
1364 bn_ops => "BN_LLONG",
1366 # K&R C is no longer supported; you need gcc on old Ultrix installations
1367 ##"ultrix","cc:-O2 -DNOPROTO -DNOCONST -DL_ENDIAN::(unknown):::::::",
1369 ##### MacOS X (a.k.a. Darwin) setup
1370 "darwin-common" => {
1371 inherit_from => [ "BASE_unix" ],
1375 debug_cflags => "-g -O0",
1376 release_cflags => "-O3",
1377 thread_cflag => "-D_REENTRANT",
1379 plib_lflags => "-Wl,-search_paths_first",
1380 bn_ops => "BN_LLONG RC4_CHAR",
1381 perlasm_scheme => "osx32",
1382 dso_scheme => "dlfcn",
1383 shared_target => "darwin-shared",
1384 shared_cflag => "-fPIC -fno-common",
1385 shared_ldflag => "-dynamiclib",
1386 shared_extension => ".\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
1388 "darwin-ppc-cc" => {
1389 inherit_from => [ "darwin-common", asm("ppc32_asm") ],
1390 cflags => "-arch ppc -DB_ENDIAN -Wa,-force_cpusubtype_ALL",
1391 perlasm_scheme => "osx32",
1392 shared_ldflag => "-arch ppc -dynamiclib",
1394 "darwin64-ppc-cc" => {
1395 inherit_from => [ "darwin-common", asm("ppc64_asm") ],
1396 cflags => "-arch ppc64 -DB_ENDIAN",
1397 bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
1398 perlasm_scheme => "osx64",
1399 shared_ldflag => "-arch ppc64 -dynamiclib",
1401 "darwin-i386-cc" => {
1402 inherit_from => [ "darwin-common", asm("x86_asm") ],
1403 cflags => "-arch i386 -DL_ENDIAN",
1404 release_cflags => "-O3 -fomit-frame-pointer",
1405 bn_ops => "BN_LLONG RC4_INT",
1406 perlasm_scheme => "macosx",
1407 shared_ldflag => "-arch i386 -dynamiclib",
1409 "darwin64-x86_64-cc" => {
1410 inherit_from => [ "darwin-common", asm("x86_64_asm") ],
1411 cflags => "-arch x86_64 -DL_ENDIAN -Wall",
1412 bn_ops => "SIXTY_FOUR_BIT_LONG",
1413 perlasm_scheme => "macosx",
1414 shared_ldflag => "-arch x86_64 -dynamiclib",
1419 # It takes three prior-set environment variables to make it work:
1421 # CROSS_COMPILE=/where/toolchain/is/usr/bin/ [note ending slash]
1422 # CROSS_TOP=/where/SDKs/are
1423 # CROSS_SDK=iPhoneOSx.y.sdk
1425 # Exact paths vary with Xcode releases, but for couple of last ones
1426 # they would look like this:
1428 # CROSS_COMPILE=`xcode-select --print-path`/Toolchains/XcodeDefault.xctoolchain/usr/bin/
1429 # CROSS_TOP=`xcode-select --print-path`/Platforms/iPhoneOS.platform/Developer
1430 # CROSS_SDK=iPhoneOS.sdk
1432 "iphoneos-cross" => {
1433 inherit_from => [ "darwin-common" ],
1434 cflags => "-isysroot \$(CROSS_TOP)/SDKs/\$(CROSS_SDK) -fno-common",
1438 inherit_from => [ "darwin-common", asm("armv4_asm") ],
1439 # It should be possible to go below iOS 6 and even add -arch armv6,
1440 # thus targeting iPhone pre-3GS, but it's assumed to be irrelevant
1442 cflags => "-arch armv7 -mios-version-min=6.0.0 -isysroot \$(CROSS_TOP)/SDKs/\$(CROSS_SDK) -fno-common",
1444 perlasm_scheme => "ios32",
1447 inherit_from => [ "darwin-common", asm("aarch64_asm") ],
1448 cflags => "-arch arm64 -mios-version-min=7.0.0 -isysroot \$(CROSS_TOP)/SDKs/\$(CROSS_SDK) -fno-common",
1450 bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
1451 perlasm_scheme => "ios64",
1456 inherit_from => [ "BASE_unix" ],
1457 inherit_from => [ asm("x86_elf_asm") ],
1459 cflags => "-DL_ENDIAN -O3 -fomit-frame-pointer -Wall",
1460 thread_cflag => "-pthread",
1462 bn_ops => "BN_LLONG",
1463 dso_scheme => "dlfcn",
1464 shared_target => "linux-shared",
1465 shared_cflag => "-fPIC",
1470 inherit_from => [ "BASE_unix" ],
1474 ##### VxWorks for various targets
1475 "vxworks-ppc60x" => {
1476 inherit_from => [ "BASE_unix" ],
1478 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",
1479 sys_id => "VXWORKS",
1480 ex_libs => "-Wl,--defsym,__wrs_rtp_base=0xe0000000 -L \$(WIND_BASE)/target/usr/lib/ppc/PPC32/common",
1482 "vxworks-ppcgen" => {
1483 inherit_from => [ "BASE_unix" ],
1485 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",
1486 sys_id => "VXWORKS",
1487 ex_libs => "-Wl,--defsym,__wrs_rtp_base=0xe0000000 -L \$(WIND_BASE)/target/usr/lib/ppc/PPC32/sfcommon",
1489 "vxworks-ppc405" => {
1490 inherit_from => [ "BASE_unix" ],
1492 cflags => "-g -msoft-float -mlongcall -DCPU=PPC405 -I\$(WIND_BASE)/target/h",
1493 sys_id => "VXWORKS",
1496 "vxworks-ppc750" => {
1497 inherit_from => [ "BASE_unix" ],
1499 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)",
1500 sys_id => "VXWORKS",
1503 "vxworks-ppc750-debug" => {
1504 inherit_from => [ "BASE_unix" ],
1506 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",
1507 sys_id => "VXWORKS",
1510 "vxworks-ppc860" => {
1511 inherit_from => [ "BASE_unix" ],
1513 cflags => "-nostdinc -msoft-float -DCPU=PPC860 -DNO_STRINGS_H -I\$(WIND_BASE)/target/h",
1514 sys_id => "VXWORKS",
1517 "vxworks-simlinux" => {
1518 inherit_from => [ "BASE_unix" ],
1520 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",
1521 sys_id => "VXWORKS",
1523 ranlib => "ranlibpentium",
1526 inherit_from => [ "BASE_unix", asm("mips32_asm") ],
1528 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",
1529 thread_cflag => "-D_REENTRANT",
1530 sys_id => "VXWORKS",
1531 ex_libs => "-Wl,--defsym,__wrs_rtp_base=0xe0000000 -L \$(WIND_BASE)/target/usr/lib/mips/MIPSI32/sfcommon",
1532 perlasm_scheme => "o32",
1533 ranlib => "ranlibmips",
1538 inherit_from => [ "BASE_unix" ],
1540 cflags => "\$(CFLAGS)",
1541 thread_cflag => "-D_REENTRANT",
1542 plib_lflags => "\$(LDFLAGS)",
1543 ex_libs => "\$(LDLIBS)",
1544 bn_ops => "BN_LLONG",
1545 dso_scheme => "$ENV{'LIBSSL_dlfcn'}",
1546 shared_target => "linux-shared",
1547 shared_cflag => "-fPIC",
1548 shared_ldflag => "-shared",
1549 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
1550 ranlib => "$ENV{'RANLIB'}",
1552 "uClinux-dist64" => {
1553 inherit_from => [ "BASE_unix" ],
1555 cflags => "\$(CFLAGS)",
1556 thread_cflag => "-D_REENTRANT",
1557 plib_lflags => "\$(LDFLAGS)",
1558 ex_libs => "\$(LDLIBS)",
1559 bn_ops => "SIXTY_FOUR_BIT_LONG",
1560 dso_scheme => "$ENV{'LIBSSL_dlfcn'}",
1561 shared_target => "linux-shared",
1562 shared_cflag => "-fPIC",
1563 shared_ldflag => "-shared",
1564 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
1565 ranlib => "$ENV{'RANLIB'}",
1570 inherit_from => [ "BASE_VMS" ],
1573 cflags => "/STANDARD=RELAXED/NOLIST/PREFIX=ALL/NAMES=(AS_IS,SHORTENED)",
1574 debug_cflags => "/NOOPTIMIZE/DEBUG",
1575 release_cflags => "/OPTIMIZE/NODEBUG",
1577 debug_lflags => "/DEBUG/TRACEBACK",
1578 release_lflags => "/NODEBUG/NOTRACEBACK",
1579 shared_target => "vms-shared",
1581 apps_aux_src => "vms_decc_init.c",
1584 # VMS on VAX is *unsupported*
1587 # bn_obj => "[.asm]vms.obj vms-helper.obj"
1590 # inherit_from => [ "vms-generic", asm("vms-asm") ],
1592 # debug_aflags => "/NOOPTIMIZE/DEBUG",
1593 # release_aflags => "/OPTIMIZE/NODEBUG",
1594 # bn_opts => "THIRTY_TWO_BIT RC4_CHAR RC4_CHUNK DES_PTR BF_PTR",
1597 inherit_from => [ "vms-generic" ],
1599 #debug_aflags => "/NOOPTIMIZE/DEBUG",
1600 #release_aflags => "/OPTIMIZE/NODEBUG",
1601 bn_opts => "SIXTY_FOUR_BIT RC4_INT RC4_CHUNK_LL DES_PTR BF_PTR",
1603 "vms-alpha-P32" => {
1604 inherit_from => [ "vms-alpha" ],
1605 cflags => add("/POINTER_SIZE=32"),
1607 "vms-alpha-P64" => {
1608 inherit_from => [ "vms-alpha" ],
1609 cflags => add("/POINTER_SIZE=64"),
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"),
1623 inherit_from => [ "vms-ia64" ],
1624 cflags => add("/POINTER_SIZE=64"),