2 ## Standard openssl configuration targets.
6 return sub { add($opts{default} || (),
7 $opts{$config{build_type}} || ())->(); }
12 return sub { add($disabled{threads} ? () : @flags)->(); }
17 return sub { add(@stuff)->(); }
22 #### Basic configs that should work on any 32-bit box
25 cflags => picker(debug => "-O0 -g",
27 thread_scheme => "(unknown)",
33 thread_scheme => "(unknown)",
36 #### VOS Configurations
38 inherit_from => [ "BASE_unix" ],
40 cflags => picker(default => "-Wall -DOPENSSL_SYS_VOS -D_POSIX_C_SOURCE=200112L -D_BSD -D_VOS_EXTENDED_NAMES -DB_ENDIAN",
41 debug => "-O0 -g -DBN_DEBUG -DREF_DEBUG -DCONF_DEBUG",
43 thread_scheme => "(unknown)",
47 shared_extension => ".so",
50 #### Solaris configurations
52 inherit_from => [ "BASE_unix" ],
54 cflags => "-DFILIO_H",
55 ex_libs => add("-lresolv -lsocket -lnsl -ldl"),
56 dso_scheme => "dlfcn",
57 thread_scheme => "pthreads",
58 shared_target => "solaris-shared",
59 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
61 #### Solaris x86 with GNU C setups
62 "solaris-x86-gcc" => {
63 # -DOPENSSL_NO_INLINE_ASM switches off inline assembler. We have
64 # to do it here because whenever GNU C instantiates an assembler
65 # template it surrounds it with #APP #NO_APP comment pair which
66 # (at least Solaris 7_x86) /usr/ccs/bin/as fails to assemble
67 # with "Illegal mnemonic" error message.
68 inherit_from => [ "solaris-common", asm("x86_elf_asm") ],
70 cflags => add_before(picker(default => "-Wall -DL_ENDIAN -DOPENSSL_NO_INLINE_ASM",
72 release => "-O3 -fomit-frame-pointer"),
75 shared_cflag => "-fPIC",
76 shared_ldflag => "-shared",
78 "solaris64-x86_64-gcc" => {
79 # -shared -static-libgcc might appear controversial, but modules
80 # taken from static libgcc do not have relocations and linking
81 # them into our shared objects doesn't have any negative side
82 # effects. On the contrary, doing so makes it possible to use
83 # gcc shared build with Sun C. Given that gcc generates faster
84 # code [thanks to inline assembler], I would actually recommend
85 # to consider using gcc shared build even with vendor compiler:-)
86 # <appro@fy.chalmers.se>
87 inherit_from => [ "solaris-common", asm("x86_64_asm") ],
89 cflags => add_before(picker(default => "-m64 -Wall -DL_ENDIAN",
93 bn_ops => "SIXTY_FOUR_BIT_LONG",
94 perlasm_scheme => "elf",
95 shared_cflag => "-fPIC",
96 shared_ldflag => "-m64 -shared -static-libgcc",
100 #### Solaris x86 with Sun C setups
101 "solaris-x86-cc" => {
102 inherit_from => [ "solaris-common" ],
104 cflags => add_before(picker(default => "-xarch=generic -xstrconst -Xa -DL_ENDIAN",
106 release => "-xO5 -xregs=frameptr -xdepend -xbuiltin"),
107 threads("-D_REENTRANT")),
108 lflags => add(threads("-mt")),
109 ex_libs => add(threads("-lpthread")),
110 bn_ops => "BN_LLONG RC4_CHAR",
111 shared_cflag => "-KPIC",
112 shared_ldflag => "-G -dy -z text",
114 "solaris64-x86_64-cc" => {
115 inherit_from => [ "solaris-common", asm("x86_64_asm") ],
117 cflags => add_before(picker(default => "-xarch=generic64 -xstrconst -Xa -DL_ENDIAN",
119 release => "-xO5 -xdepend -xbuiltin"),
120 threads("-D_REENTRANT")),
121 thread_scheme => "pthreads",
122 lflags => add(threads("-mt")),
123 ex_libs => add(threads("-lpthread")),
124 bn_ops => "SIXTY_FOUR_BIT_LONG",
125 perlasm_scheme => "elf",
126 shared_cflag => "-KPIC",
127 shared_ldflag => "-xarch=generic64 -G -dy -z text",
131 #### SPARC Solaris with GNU C setups
132 "solaris-sparcv7-gcc" => {
133 inherit_from => [ "solaris-common" ],
135 cflags => add_before(picker(default => "-Wall -DB_ENDIAN -DBN_DIV2W",
138 threads("-pthread")),
139 bn_ops => "BN_LLONG RC4_CHAR",
140 shared_cflag => "-fPIC",
141 shared_ldflag => "-shared",
143 "solaris-sparcv8-gcc" => {
144 inherit_from => [ "solaris-sparcv7-gcc", asm("sparcv8_asm") ],
145 cflags => add_before("-mcpu=v8"),
147 "solaris-sparcv9-gcc" => {
148 # -m32 should be safe to add as long as driver recognizes
150 inherit_from => [ "solaris-sparcv7-gcc", asm("sparcv9_asm") ],
151 cflags => add_before(picker(default => "-m32 -mcpu=ultrasparc",
152 debug => "-DBN_DEBUG -DREF_DEBUG -DCONF_DEBUG -DBN_CTX_DEBUG -DPEDANTIC -O -g -pedantic -ansi -Wshadow -Wno-long-long -D__EXTENSIONS__")),
154 "solaris64-sparcv9-gcc" => {
155 inherit_from => [ "solaris-sparcv9-gcc" ],
156 cflags => sub { my $f=join(" ",@_); $f =~ s/\-m32/-m64/; $f; },
157 bn_ops => "BN_LLONG RC4_CHAR",
158 shared_ldflag => "-m64 -shared",
162 #### SPARC Solaris with Sun C setups
163 # SC4.0 doesn't pass 'make test', upgrade to SC5.0 or SC4.2.
164 # SC4.2 is ok, better than gcc even on bn as long as you tell it -xarch=v8
165 # SC5.0 note: Compiler common patch 107357-01 or later is required!
166 "solaris-sparcv7-cc" => {
167 inherit_from => [ "solaris-common" ],
169 cflags => add_before(picker(default => "-xstrconst -Xa -DB_ENDIAN -DBN_DIV2W",
170 debug => "-g -DBN_DEBUG -DREF_DEBUG -DCONF_DEBUG -DBN_CTX_DEBUG",
171 release => "-xO5 -xdepend"),
172 threads("-D_REENTRANT")),
173 lflags => add(threads("-mt")),
174 ex_libs => add(threads("-lpthread")),
175 bn_ops => "BN_LLONG RC4_CHAR",
176 shared_cflag => "-KPIC",
177 shared_ldflag => "-G -dy -z text",
180 "solaris-sparcv8-cc" => {
181 inherit_from => [ "solaris-sparcv7-cc", asm("sparcv8_asm") ],
182 cflags => add_before("-xarch=v8"),
184 "solaris-sparcv9-cc" => {
185 inherit_from => [ "solaris-sparcv7-cc", asm("sparcv9_asm") ],
186 cflags => add_before("-xarch=v8plus -xtarget=ultra"),
188 "solaris64-sparcv9-cc" => {
189 inherit_from => [ "solaris-sparcv7-cc", asm("sparcv9_asm") ],
190 cflags => add_before("-xarch=v9 -xtarget=ultra"),
191 bn_ops => "BN_LLONG RC4_CHAR",
192 shared_ldflag => "-xarch=v9 -G -dy -z text",
196 #### IRIX 5.x configs
197 # -mips2 flag is added by ./config when appropriate.
199 inherit_from => [ "BASE_unix", asm("mips32_asm") ],
201 cflags => picker(default => "-DB_ENDIAN",
204 bn_ops => "BN_LLONG RC4_CHAR",
205 thread_scheme => "(unknown)",
206 perlasm_scheme => "o32",
207 dso_scheme => "dlfcn",
208 shared_target => "irix-shared",
209 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
212 inherit_from => [ "BASE_unix", asm("mips32_asm") ],
214 cflags => picker(default => "-use_readonly_const -DB_ENDIAN",
217 bn_ops => "BN_LLONG RC4_CHAR",
218 thread_scheme => "(unknown)",
219 perlasm_scheme => "o32",
220 dso_scheme => "dlfcn",
221 shared_target => "irix-shared",
222 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
224 #### IRIX 6.x configs
225 # Only N32 and N64 ABIs are supported. If you need O32 ABI build, invoke
226 # './Configure irix-cc -o32' manually.
227 "irix-mips3-gcc" => {
228 inherit_from => [ "BASE_unix", asm("mips64_asm") ],
230 cflags => combine(picker(default => "-mabi=n32 -DB_ENDIAN -DBN_DIV3W",
233 threads("-D_SGI_MP_SOURCE -pthread")),
234 bn_ops => "RC4_CHAR SIXTY_FOUR_BIT",
235 thread_scheme => "pthreads",
236 perlasm_scheme => "n32",
237 dso_scheme => "dlfcn",
238 shared_target => "irix-shared",
239 shared_ldflag => "-mabi=n32",
240 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
244 inherit_from => [ "BASE_unix", asm("mips64_asm") ],
246 cflags => combine(picker(default => "-n32 -mips3 -use_readonly_const -G0 -rdata_shared -DB_ENDIAN -DBN_DIV3W",
249 threads("-D_SGI_MP_SOURCE")),
250 ex_libs => add(threads("-lpthread")),
251 bn_ops => "RC4_CHAR SIXTY_FOUR_BIT",
252 thread_scheme => "pthreads",
253 perlasm_scheme => "n32",
254 dso_scheme => "dlfcn",
255 shared_target => "irix-shared",
256 shared_ldflag => "-n32",
257 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
261 "irix64-mips4-gcc" => {
262 inherit_from => [ "BASE_unix", asm("mips64_asm") ],
264 cflags => combine(picker(default => "-mabi=64 -mips4 -DB_ENDIAN -DBN_DIV3W",
267 threads("-D_SGI_MP_SOURCE")),
268 bn_ops => "RC4_CHAR SIXTY_FOUR_BIT_LONG",
269 thread_scheme => "pthreads",
270 perlasm_scheme => "64",
271 dso_scheme => "dlfcn",
272 shared_target => "irix-shared",
273 shared_ldflag => "-mabi=64",
274 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
277 "irix64-mips4-cc" => {
278 inherit_from => [ "BASE_unix", asm("mips64_asm") ],
280 cflags => combine(picker(default => "-64 -mips4 -use_readonly_const -G0 -rdata_shared -DB_ENDIAN -DBN_DIV3W",
283 threads("-D_SGI_MP_SOURCE")),
284 ex_libs => add(threads("-lpthread")),
285 bn_ops => "RC4_CHAR SIXTY_FOUR_BIT_LONG",
286 thread_scheme => "pthreads",
287 perlasm_scheme => "64",
288 dso_scheme => "dlfcn",
289 shared_target => "irix-shared",
290 shared_ldflag => "-64",
291 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
295 #### Unified HP-UX ANSI C configs.
297 # - Originally we were optimizing at +O4 level. It should be noted
298 # that the only difference between +O3 and +O4 is global inter-
299 # procedural analysis. As it has to be performed during the link
300 # stage the compiler leaves behind certain pseudo-code in lib*.a
301 # which might be release or even patch level specific. Generating
302 # the machine code for and analyzing the *whole* program appears
303 # to be *extremely* memory demanding while the performance gain is
304 # actually questionable. The situation is intensified by the default
305 # HP-UX data set size limit (infamous 'maxdsiz' tunable) of 64MB
306 # which is way too low for +O4. In other words, doesn't +O3 make
308 # - Keep in mind that the HP compiler by default generates code
309 # suitable for execution on the host you're currently compiling at.
310 # If the toolkit is meant to be used on various PA-RISC processors
311 # consider './Configure hpux-parisc-[g]cc +DAportable'.
312 # - -DMD32_XARRAY triggers workaround for compiler bug we ran into in
313 # 32-bit message digests. (For the moment of this writing) HP C
314 # doesn't seem to "digest" too many local variables (they make "him"
315 # chew forever:-). For more details look-up MD32_XARRAY comment in
316 # crypto/sha/sha_lcl.h.
317 # - originally there were 32-bit hpux-parisc2-* targets. They were
318 # scrapped, because a) they were not interchangeable with other 32-bit
319 # targets; a) when critical 32-bit assembly modules detect if they
320 # are executed on PA-RISC 2.0 and thus adequate performance is
322 # <appro@fy.chalmers.se>
323 "hpux-parisc-gcc" => {
324 inherit_from => [ "BASE_unix" ],
326 cflags => combine(picker(default => "-DB_ENDIAN -DBN_DIV2W",
329 threads("-pthread")),
330 ex_libs => add("-Wl,+s -ldld"),
331 bn_ops => "BN_LLONG",
332 thread_scheme => "pthreads",
334 shared_target => "hpux-shared",
335 shared_cflag => "-fPIC",
336 shared_ldflag => "-shared",
337 shared_extension => ".sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
339 "hpux-parisc1_1-gcc" => {
340 inherit_from => [ "hpux-parisc-gcc", asm("parisc11_asm") ],
341 multilib => "/pa1.1",
343 "hpux64-parisc2-gcc" => {
344 inherit_from => [ "BASE_unix", asm("parisc20_64_asm") ],
346 cflags => combine(picker(default => "-DB_ENDIAN",
349 threads("-D_REENTRANT")),
350 ex_libs => add("-ldl"),
351 bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
352 thread_scheme => "pthreads",
353 dso_scheme => "dlfcn",
354 shared_target => "hpux-shared",
355 shared_cflag => "-fpic",
356 shared_ldflag => "-shared",
357 shared_extension => ".sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
358 multilib => "/pa20_64",
361 # More attempts at unified 10.X and 11.X targets for HP C compiler.
363 # Chris Ruemmler <ruemmler@cup.hp.com>
364 # Kevin Steves <ks@hp.se>
365 "hpux-parisc-cc" => {
366 inherit_from => [ "BASE_unix" ],
368 cflags => combine(picker(default => "+Optrs_strongly_typed -Ae +ESlit -DB_ENDIAN -DBN_DIV2W -DMD32_XARRAY",
369 debug => "+O0 +d -g",
371 threads("-D_REENTRANT")),
372 ex_libs => add("-Wl,+s -ldld",threads("-lpthread")),
373 bn_ops => "RC4_CHAR",
374 thread_scheme => "pthreads",
376 shared_target => "hpux-shared",
377 shared_cflag => "+Z",
378 shared_ldflag => "-b",
379 shared_extension => ".sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
381 "hpux-parisc1_1-cc" => {
382 inherit_from => [ "hpux-parisc-cc", asm("parisc11_asm") ],
383 cflags => add_before("+DA1.1"),
384 multilib => "/pa1.1",
386 "hpux64-parisc2-cc" => {
387 inherit_from => [ "BASE_unix", asm("parisc20_64_asm") ],
389 cflags => combine(picker(default => "+DD64 +Optrs_strongly_typed -Ae +ESlit -DB_ENDIAN -DMD32_XARRAY",
390 debug => "+O0 +d -g",
392 threads("-D_REENTRANT")),
393 ex_libs => add("-ldl",threads("-lpthread")),
394 bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
395 thread_scheme => "pthreads",
396 dso_scheme => "dlfcn",
397 shared_target => "hpux-shared",
398 shared_cflag => "+Z",
399 shared_ldflag => "+DD64 -b",
400 shared_extension => ".sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
401 multilib => "/pa20_64",
404 # HP/UX IA-64 targets
406 inherit_from => [ "BASE_unix", asm("ia64_asm") ],
408 cflags => combine(picker(default => "-Ae +DD32 +Olit=all -z -DB_ENDIAN",
409 debug => "+O0 +d -g",
411 threads("-D_REENTRANT")),
412 ex_libs => add("-ldl",threads("-lpthread")),
413 bn_ops => "SIXTY_FOUR_BIT",
414 thread_scheme => "pthreads",
415 dso_scheme => "dlfcn",
416 shared_target => "hpux-shared",
417 shared_cflag => "+Z",
418 shared_ldflag => "+DD32 -b",
419 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
420 multilib => "/hpux32",
422 # Frank Geurts <frank.geurts@nl.abnamro.com> has patiently assisted
423 # with debugging of the following config.
424 "hpux64-ia64-cc" => {
425 inherit_from => [ "BASE_unix", asm("ia64_asm") ],
427 cflags => combine(picker(default => "-Ae +DD64 +Olit=all -z -DB_ENDIAN",
428 debug => "+O0 +d -g",
430 threads("-D_REENTRANT")),
431 ex_libs => add("-ldl", threads("-lpthread")),
432 bn_ops => "SIXTY_FOUR_BIT_LONG",
433 thread_scheme => "pthreads",
434 dso_scheme => "dlfcn",
435 shared_target => "hpux-shared",
436 shared_cflag => "+Z",
437 shared_ldflag => "+DD64 -b",
438 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
439 multilib => "/hpux64",
443 inherit_from => [ "BASE_unix", asm("ia64_asm") ],
445 cflags => combine(picker(default => "-DB_ENDIAN",
448 threads("-pthread")),
449 ex_libs => add("-ldl"),
450 bn_ops => "SIXTY_FOUR_BIT",
451 thread_scheme => "pthreads",
452 dso_scheme => "dlfcn",
453 shared_target => "hpux-shared",
454 shared_cflag => "-fpic",
455 shared_ldflag => "-shared",
456 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
457 multilib => "/hpux32",
459 "hpux64-ia64-gcc" => {
460 inherit_from => [ "BASE_unix", asm("ia64_asm") ],
462 cflags => picker(default => "-mlp64 -DB_ENDIAN",
465 threads("-pthread")),
466 ex_libs => add("-ldl"),
467 bn_ops => "SIXTY_FOUR_BIT_LONG",
468 thread_scheme => "pthreads",
469 dso_scheme => "dlfcn",
470 shared_target => "hpux-shared",
471 shared_cflag => "-fpic",
472 shared_ldflag => "-mlp64 -shared",
473 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
474 multilib => "/hpux64",
477 #### HP MPE/iX http://jazz.external.hp.com/src/openssl/
479 inherit_from => [ "BASE_unix" ],
481 cflags => "-D_ENDIAN -DBN_DIV2W -O3 -D_POSIX_SOURCE -D_SOCKET_SOURCE -I/SYSLOG/PUB",
483 ex_libs => add("-L/SYSLOG/PUB -lsyslog -lsocket -lcurses"),
484 thread_scheme => "(unknown)",
485 bn_ops => "BN_LLONG",
488 #### DEC Alpha OSF/1/Tru64 targets.
489 "osf1-alpha-gcc" => {
490 inherit_from => [ "BASE_unix", asm("alpha_asm") ],
493 bn_ops => "SIXTY_FOUR_BIT_LONG",
494 thread_scheme => "(unknown)",
495 dso_scheme => "dlfcn",
496 shared_target => "alpha-osf1-shared",
497 shared_extension => ".so",
500 inherit_from => [ "BASE_unix", asm("alpha_asm") ],
502 cflags => "-std1 -tune host -O4 -readonly_strings",
503 bn_ops => "SIXTY_FOUR_BIT_LONG",
504 thread_scheme => "(unknown)",
505 dso_scheme => "dlfcn",
506 shared_target => "alpha-osf1-shared",
507 shared_extension => ".so",
509 "tru64-alpha-cc" => {
510 inherit_from => [ "BASE_unix", asm("alpha_asm") ],
512 cflags => combine("-std1 -tune host -fast -readonly_strings",
513 threads("-pthread")),
514 bn_ops => "SIXTY_FOUR_BIT_LONG",
515 thread_scheme => "pthreads",
516 dso_scheme => "dlfcn",
517 shared_target => "alpha-osf1-shared",
518 shared_ldflag => "-msym",
519 shared_extension => ".so",
523 #### Variety of LINUX:-)
525 # *-generic* is endian-neutral target, but ./config is free to
526 # throw in -D[BL]_ENDIAN, whichever appropriate...
527 "linux-generic32" => {
528 inherit_from => [ "BASE_unix" ],
530 cflags => combine(picker(default => "-Wall",
531 debug => "-O0 -g -DBN_DEBUG -DREF_DEBUG -DCONF_DEBUG",
533 threads("-pthread")),
534 ex_libs => add("-ldl"),
535 bn_ops => "BN_LLONG RC4_CHAR",
536 thread_scheme => "pthreads",
537 dso_scheme => "dlfcn",
538 shared_target => "linux-shared",
539 shared_cflag => "-fPIC",
540 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
542 "linux-generic64" => {
543 inherit_from => [ "linux-generic32" ],
544 bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
548 inherit_from => [ "linux-generic32", asm("ppc32_asm") ],
549 perlasm_scheme => "linux32",
552 inherit_from => [ "linux-generic64", asm("ppc64_asm") ],
553 cflags => add("-m64 -DB_ENDIAN"),
554 perlasm_scheme => "linux64",
555 shared_ldflag => "-m64",
559 inherit_from => [ "linux-generic64", asm("ppc64_asm") ],
560 cflags => add("-m64 -DL_ENDIAN"),
561 perlasm_scheme => "linux64le",
562 shared_ldflag => "-m64",
566 ################################################################
567 # Note that -march is not among compiler options in linux-armv4
568 # target description. Not specifying one is intentional to give
571 # a) rely on your compiler default by not specifying one;
572 # b) specify your target platform explicitly for optimal
573 # performance, e.g. -march=armv6 or -march=armv7-a;
574 # c) build "universal" binary that targets *range* of platforms
575 # by specifying minimum and maximum supported architecture;
577 # As for c) option. It actually makes no sense to specify
578 # maximum to be less than ARMv7, because it's the least
579 # requirement for run-time switch between platform-specific
580 # code paths. And without run-time switch performance would be
581 # equivalent to one for minimum. Secondly, there are some
582 # natural limitations that you'd have to accept and respect.
583 # Most notably you can *not* build "universal" binary for
584 # big-endian platform. This is because ARMv7 processor always
585 # picks instructions in little-endian order. Another similar
586 # limitation is that -mthumb can't "cross" -march=armv6t2
587 # boundary, because that's where it became Thumb-2. Well, this
588 # limitation is a bit artificial, because it's not really
589 # impossible, but it's deemed too tricky to support. And of
590 # course you have to be sure that your binutils are actually
591 # up to the task of handling maximum target platform. With all
592 # this in mind here is an example of how to configure
595 # ./Configure linux-armv4 -march=armv6 -D__ARM_MAX_ARCH__=8
597 inherit_from => [ "linux-generic32", asm("armv4_asm") ],
598 perlasm_scheme => "linux32",
601 inherit_from => [ "linux-generic64", asm("aarch64_asm") ],
602 perlasm_scheme => "linux64",
604 "linux-arm64ilp32" => { # https://wiki.linaro.org/Platform/arm64-ilp32
605 inherit_from => [ "linux-generic32", asm("aarch64_asm") ],
606 cflags => add("-mabi=ilp32"),
607 bn_ops => "SIXTY_FOUR_BIT RC4_CHAR",
608 perlasm_scheme => "linux64",
609 shared_ldflag => "-mabi=ilp32",
613 # Configure script adds minimally required -march for assembly
614 # support, if no -march was specified at command line.
615 inherit_from => [ "linux-generic32", asm("mips32_asm") ],
616 cflags => add("-mabi=32 -DBN_DIV3W"),
617 perlasm_scheme => "o32",
618 shared_ldflag => "-mabi=32",
620 # mips32 and mips64 below refer to contemporary MIPS Architecture
621 # specifications, MIPS32 and MIPS64, rather than to kernel bitness.
623 inherit_from => [ "linux-generic32", asm("mips64_asm") ],
624 cflags => add("-mabi=n32 -DBN_DIV3W"),
625 bn_ops => "SIXTY_FOUR_BIT RC4_CHAR",
626 perlasm_scheme => "n32",
627 shared_ldflag => "-mabi=n32",
630 "linux64-mips64" => {
631 inherit_from => [ "linux-generic64", asm("mips64_asm") ],
632 cflags => add("-mabi=64 -DBN_DIV3W"),
633 perlasm_scheme => "64",
634 shared_ldflag => "-mabi=64",
638 #### IA-32 targets...
640 inherit_from => [ "linux-generic32", asm("x86_elf_asm") ],
641 cflags => add(picker(default => "-DL_ENDIAN",
642 release => "-fomit-frame-pointer")),
643 ex_libs => add(picker(debug => "-lefence")),
644 bn_ops => "BN_LLONG",
647 inherit_from => [ "BASE_unix", asm("x86_asm") ],
649 cflags => add(picker(default => "-DL_ENDIAN -Wall",
651 release => "-O3 -fomit-frame-pointer")),
652 bn_ops => "BN_LLONG",
653 thread_scheme => "(unknown)",
654 perlasm_scheme => "a.out",
658 inherit_from => [ "linux-generic64", asm("x86_64_asm") ],
659 cflags => add("-m64 -DL_ENDIAN"),
660 bn_ops => "SIXTY_FOUR_BIT_LONG",
661 perlasm_scheme => "elf",
662 shared_ldflag => "-m64",
665 "linux-x86_64-clang" => {
666 inherit_from => [ "linux-x86_64" ],
668 cflags => add("-Wextra -Qunused-arguments"),
671 inherit_from => [ "linux-generic32", asm("x86_64_asm") ],
672 cflags => add("-mx32 -DL_ENDIAN"),
673 bn_ops => "SIXTY_FOUR_BIT",
674 perlasm_scheme => "elf",
675 shared_ldflag => "-mx32",
680 inherit_from => [ "linux-generic64", asm("ia64_asm") ],
681 bn_ops => "SIXTY_FOUR_BIT_LONG",
685 inherit_from => [ "linux-generic64", asm("s390x_asm") ],
686 cflags => add("-m64 -DB_ENDIAN"),
687 perlasm_scheme => "64",
688 shared_ldflag => "-m64",
692 #### So called "highgprs" target for z/Architecture CPUs
693 # "Highgprs" is kernel feature first implemented in Linux
694 # 2.6.32, see /proc/cpuinfo. The idea is to preserve most
695 # significant bits of general purpose registers not only
696 # upon 32-bit process context switch, but even on
697 # asynchronous signal delivery to such process. This makes
698 # it possible to deploy 64-bit instructions even in legacy
699 # application context and achieve better [or should we say
700 # adequate] performance. The build is binary compatible with
701 # linux-generic32, and the idea is to be able to install the
702 # resulting libcrypto.so alongside generic one, e.g. as
703 # /lib/highgprs/libcrypto.so.x.y, for ldconfig and run-time
704 # linker to autodiscover. Unfortunately it doesn't work just
705 # yet, because of couple of bugs in glibc
706 # sysdeps/s390/dl-procinfo.c affecting ldconfig and ld.so.1...
708 inherit_from => [ "linux-generic32", asm("s390x_asm") ],
709 cflags => add("-m31 -Wa,-mzarch -DB_ENDIAN"),
710 bn_obj => sub { my $r=join(" ",@_); $r=~s/bn\-s390x/bn_asm/; $r; },
711 perlasm_scheme => "31",
712 shared_ldflag => "-m31",
713 multilib => "/highgprs",
716 #### SPARC Linux setups
717 # Ray Miller <ray.miller@computing-services.oxford.ac.uk> has
718 # patiently assisted with debugging of following two configs.
720 inherit_from => [ "linux-generic32", asm("sparcv8_asm") ],
721 cflags => add("-mcpu=v8 -DB_ENDIAN -DBN_DIV2W"),
724 # it's a real mess with -mcpu=ultrasparc option under Linux,
725 # but -Wa,-Av8plus should do the trick no matter what.
726 inherit_from => [ "linux-generic32", asm("sparcv9_asm") ],
727 cflags => add("-m32 -mcpu=ultrasparc -Wa,-Av8plus -DB_ENDIAN -DBN_DIV2W"),
728 shared_ldflag => "-m32",
730 "linux64-sparcv9" => {
731 # GCC 3.1 is a requirement
732 inherit_from => [ "linux-generic64", asm("sparcv9_asm") ],
733 cflags => add("-m64 -mcpu=ultrasparc -DB_ENDIAN"),
734 bn_ops => "BN_LLONG RC4_CHAR",
735 shared_ldflag => "-m64",
739 "linux-alpha-gcc" => {
740 inherit_from => [ "linux-generic64", asm("alpha_asm") ],
741 cflags => add("-DL_ENDIAN"),
742 bn_ops => "SIXTY_FOUR_BIT_LONG",
744 "linux-c64xplus" => {
745 inherit_from => [ "BASE_unix" ],
746 # TI_CGT_C6000_7.3.x is a requirement
748 cflags => combine("--linux -ea=.s -eo=.o -mv6400+ -o2 -ox -ms -pden -DOPENSSL_SMALL_FOOTPRINT",
749 threads("-D_REENTRANT")),
750 bn_ops => "BN_LLONG",
751 cpuid_asm_src => "c64xpluscpuid.s",
752 bn_asm_src => "asm/bn-c64xplus.asm c64xplus-gf2m.s",
753 aes_asm_src => "aes-c64xplus.s aes_cbc.c aes-ctr.fake",
754 sha1_asm_src => "sha1-c64xplus.s sha256-c64xplus.s sha512-c64xplus.s",
755 rc4_asm_src => "rc4-c64xplus.s",
756 modes_asm_src => "ghash-c64xplus.s",
757 chacha_asm_src => "chacha-c64xplus.s",
758 poly1305_asm_src => "poly1305-c64xplus.s",
759 thread_scheme => "pthreads",
760 perlasm_scheme => "void",
761 dso_scheme => "dlfcn",
762 shared_target => "linux-shared",
763 shared_cflag => "--pic",
764 shared_ldflag => "-z --sysv --shared",
765 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
769 #### Android: linux-* but without pointers to headers and libs.
771 # It takes pair of prior-set environment variables to make it work:
773 # CROSS_SYSROOT=/some/where/android-ndk-<ver>/platforms/android-<apiver>/arch-<
774 # CROSS_COMPILE=<prefix>
776 # As well as PATH adjusted to cover ${CROSS_COMPILE}gcc and company.
777 # For example to compile for ICS and ARM with NDK 10d, you'd:
779 # ANDROID_NDK=/some/where/android-ndk-10d
780 # CROSS_SYSROOT=$ANDROID_NDK/platforms/android-14/arch-arm
781 # CROSS_COMPILE=arm-linux-adroideabi-
782 # PATH=$ANDROID_NDK/toolchains/arm-linux-androideabi-4.8/prebuild/linux-x86_64/
785 inherit_from => [ "linux-generic32" ],
786 # Special note about unconditional -fPIC and -pie. The underlying
787 # reason is that Lollipop refuses to run non-PIE. But what about
788 # older systems and NDKs? -fPIC was never problem, so the only
789 # concern if -pie. Older toolchains, e.g. r4, appear to handle it
790 # and binaries turn mostly functional. "Mostly" means that oldest
791 # Androids, such as Froyo, fail to handle executable, but newer
792 # systems are perfectly capable of executing binaries targeting
793 # Froyo. Keep in mind that in the nutshell Android builds are
794 # about JNI, i.e. shared libraries, not applications.
795 cflags => picker(default => "-mandroid -fPIC --sysroot=\$(CROSS_SYSROOT) -Wa,--noexecstack -Wall",
802 inherit_from => [ "android", asm("x86_asm") ],
803 cflags => add(picker(release => "-fomit-frame-pointer")),
804 bn_ops => "BN_LLONG",
805 perlasm_scheme => "android",
807 ################################################################
808 # Contemporary Android applications can provide multiple JNI
809 # providers in .apk, targeting multiple architectures. Among
810 # them there is "place" for two ARM flavours: generic eabi and
811 # armv7-a/hard-float. However, it should be noted that OpenSSL's
812 # ability to engage NEON is not constrained by ABI choice, nor
813 # is your ability to call OpenSSL from your application code
814 # compiled with floating-point ABI other than default 'soft'.
815 # [Latter thanks to __attribute__((pcs("aapcs"))) declaration.]
816 # This means that choice of ARM libraries you provide in .apk
817 # is driven by application needs. For example if application
818 # itself benefits from NEON or is floating-point intensive, then
819 # it might be appropriate to provide both libraries. Otherwise
820 # just generic eabi would do. But in latter case it would be
823 # ./Configure android-armeabi -D__ARM_MAX_ARCH__=8
825 # in order to build "universal" binary and allow OpenSSL take
826 # advantage of NEON when it's available.
828 "android-armeabi" => {
829 inherit_from => [ "android", asm("armv4_asm") ],
832 inherit_from => [ "android", asm("mips32_asm") ],
833 perlasm_scheme => "o32",
837 inherit_from => [ "linux-generic64" ],
838 cflags => picker(default => "-mandroid -fPIC --sysroot=\$(CROSS_SYSROOT) -Wa,--noexecstack -Wall",
844 "android64-aarch64" => {
845 inherit_from => [ "android64", asm("aarch64_asm") ],
846 perlasm_scheme => "linux64",
851 # As for thread cflag. Idea is to maintain "collective" set of
852 # flags, which would cover all BSD flavors. -pthread applies
853 # to them all, but is treated differently. OpenBSD expands is
854 # as -D_POSIX_THREAD -lc_r, which is sufficient. FreeBSD 4.x
855 # expands it as -lc_r, which has to be accompanied by explicit
856 # -D_THREAD_SAFE and sometimes -D_REENTRANT. FreeBSD 5.x
857 # expands it as -lc_r, which seems to be sufficient?
858 inherit_from => [ "BASE_unix" ],
860 cflags => combine(picker(default => "-Wall",
863 threads("-pthread -D_THREAD_SAFE -D_REENTRANT")),
864 bn_ops => "BN_LLONG",
865 thread_scheme => "pthreads",
866 dso_scheme => "dlfcn",
867 shared_target => "bsd-gcc-shared",
868 shared_cflag => "-fPIC",
869 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
872 inherit_from => [ "BSD-generic32" ],
873 bn_ops => "SIXTY_FOUR_BIT_LONG",
877 inherit_from => [ "BSD-generic32", asm("x86_asm") ],
878 cflags => add(picker(default => "-DL_ENDIAN",
879 release => "-fomit-frame-pointer")),
880 bn_ops => "BN_LLONG",
881 shared_target => "bsd-shared",
882 perlasm_scheme => "a.out",
885 inherit_from => [ "BSD-x86" ],
886 perlasm_scheme => "elf",
890 inherit_from => [ "BSD-generic32", asm("sparcv8_asm") ],
891 cflags => add("-mcpu=v8 -DB_ENDIAN"),
894 # -DMD32_REG_T=int doesn't actually belong in sparc64 target, it
895 # simply *happens* to work around a compiler bug in gcc 3.3.3,
896 # triggered by RIPEMD160 code.
897 inherit_from => [ "BSD-generic64", asm("sparcv9_asm") ],
898 cflags => add("-DB_ENDIAN -DMD32_REG_T=int"),
899 bn_ops => "BN_LLONG",
903 inherit_from => [ "BSD-generic64", asm("ia64_asm") ],
904 cflags => add_before("-DL_ENDIAN"),
905 bn_ops => "SIXTY_FOUR_BIT_LONG",
909 inherit_from => [ "BSD-generic64", asm("x86_64_asm") ],
910 cflags => add_before("-DL_ENDIAN"),
911 bn_ops => "SIXTY_FOUR_BIT_LONG",
912 perlasm_scheme => "elf",
916 inherit_from => [ "BASE_unix", asm("x86_elf_asm") ],
918 cflags => "-DPERL5 -DL_ENDIAN -fomit-frame-pointer -O3 -Wall",
919 ex_libs => add("-ldl"),
920 bn_ops => "BN_LLONG",
921 thread_scheme => "(unknown)",
922 dso_scheme => "dlfcn",
923 shared_target => "bsd-gcc-shared",
924 shared_cflag => "-fPIC",
925 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
929 inherit_from => [ "BASE_unix" ],
931 cflags => "-O -Wall",
932 unistd => "<libc.h>",
933 bn_ops => "BN_LLONG",
934 thread_scheme => "(unknown)",
937 inherit_from => [ "BASE_unix" ],
939 cflags => "-O3 -Wall",
940 unistd => "<libc.h>",
941 bn_ops => "BN_LLONG",
942 thread_scheme => "(unknown)",
947 inherit_from => [ "BASE_unix" ],
949 cflags => "-DL_ENDIAN -DTERMIO",
950 thread_scheme => "(unknown)",
953 inherit_from => [ "BASE_unix" ],
955 ex_libs => add("-lsocket"),
956 dso_scheme => "dlfcn",
957 shared_target => "bsd-gcc-shared",
958 shared_cflag => "-fPIC",
959 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
962 inherit_from => [ "BASE_unix", asm("x86_elf_asm") ],
964 cflags => "-DL_ENDIAN -O2 -Wall",
965 ex_libs => add("-lsocket"),
966 dso_scheme => "dlfcn",
967 shared_target => "bsd-gcc-shared",
968 shared_cflag => "-fPIC",
969 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
972 #### SCO/Caldera targets.
974 # Originally we had like unixware-*, unixware-*-pentium, unixware-*-p6, etc.
975 # Now we only have blended unixware-* as it's the only one used by ./config.
976 # If you want to optimize for particular microarchitecture, bypass ./config
977 # and './Configure unixware-7 -Kpentium_pro' or whatever appropriate.
978 # Note that not all targets include assembler support. Mostly because of
979 # lack of motivation to support out-of-date platforms with out-of-date
980 # compiler drivers and assemblers. Tim Rice <tim@multitalents.net> has
981 # patiently assisted to debug most of it.
983 # UnixWare 2.0x fails destest with -O.
985 inherit_from => [ "BASE_unix" ],
987 cflags => combine("-DFILIO_H -DNO_STRINGS_H",
988 threads("-Kthread")),
989 ex_libs => add("-lsocket -lnsl -lresolv -lx"),
990 thread_scheme => "uithreads",
993 inherit_from => [ "BASE_unix" ],
995 cflags => combine("-O -DFILIO_H",
996 threads("-Kthread")),
997 ex_libs => add("-lsocket -lnsl -lresolv -lx"),
998 thread_scheme => "uithreads",
1001 inherit_from => [ "BASE_unix", asm("x86_elf_asm") ],
1003 cflags => combine("-O -DFILIO_H -Kalloca",
1004 threads("-Kthread")),
1005 ex_libs => add("-lsocket -lnsl"),
1006 thread_scheme => "uithreads",
1007 bn_ops => "BN_LLONG",
1008 perlasm_scheme => "elf-1",
1009 dso_scheme => "dlfcn",
1010 shared_target => "svr5-shared",
1011 shared_cflag => "-Kpic",
1012 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
1014 "unixware-7-gcc" => {
1015 inherit_from => [ "BASE_unix", asm("x86_elf_asm") ],
1017 cflags => combine("-DL_ENDIAN -DFILIO_H -O3 -fomit-frame-pointer -Wall",
1018 threads("-D_REENTRANT")),
1019 ex_libs => add("-lsocket -lnsl"),
1020 bn_ops => "BN_LLONG",
1021 thread_scheme => "pthreads",
1022 perlasm_scheme => "elf-1",
1023 dso_scheme => "dlfcn",
1024 shared_target => "gnu-shared",
1025 shared_cflag => "-fPIC",
1026 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
1028 # SCO 5 - Ben Laurie <ben@algroup.co.uk> says the -O breaks the SCO cc.
1030 inherit_from => [ "BASE_unix", asm("x86_elf_asm") ],
1033 ex_libs => add("-lsocket -lnsl"),
1034 thread_scheme => "(unknown)",
1035 perlasm_scheme => "elf-1",
1036 dso_scheme => "dlfcn",
1037 shared_target => "svr3-shared",
1038 shared_cflag => "-Kpic",
1039 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
1042 inherit_from => [ "BASE_unix", asm("x86_elf_asm") ],
1044 cflags => "-O3 -fomit-frame-pointer",
1045 ex_libs => add("-lsocket -lnsl"),
1046 bn_ops => "BN_LLONG",
1047 thread_scheme => "(unknown)",
1048 perlasm_scheme => "elf-1",
1049 dso_scheme => "dlfcn",
1050 shared_target => "svr3-shared",
1051 shared_cflag => "-fPIC",
1052 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
1057 inherit_from => [ "BASE_unix", asm("ppc32_asm") ],
1059 cflags => combine(picker(default => "-DB_ENDIAN",
1062 threads("-pthread")),
1064 bn_ops => "BN_LLONG RC4_CHAR",
1065 thread_scheme => "pthreads",
1066 perlasm_scheme => "aix32",
1067 dso_scheme => "dlfcn",
1068 shared_target => "aix-shared",
1069 shared_ldflag => "-shared -Wl,-G",
1070 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
1074 inherit_from => [ "BASE_unix", asm("ppc64_asm") ],
1076 cflags => combine(picker(default => "-maix64 -DB_ENDIAN",
1079 threads("-pthread")),
1081 bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
1082 thread_scheme => "pthreads",
1083 perlasm_scheme => "aix64",
1084 dso_scheme => "dlfcn",
1085 shared_target => "aix-shared",
1086 shared_ldflag => "-maix64 -shared -Wl,-G",
1087 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
1090 # Below targets assume AIX 5. Idea is to effectively disregard
1091 # $OBJECT_MODE at build time. $OBJECT_MODE is respected at
1094 inherit_from => [ "BASE_unix", asm("ppc32_asm") ],
1096 cflags => combine(picker(default => "-q32 -DB_ENDIAN -qmaxmem=16384 -qro -qroconst",
1099 threads("-qthreaded -D_THREAD_SAFE")),
1101 bn_ops => "BN_LLONG RC4_CHAR",
1102 thread_scheme => "pthreads",
1103 perlasm_scheme => "aix32",
1104 dso_scheme => "dlfcn",
1105 shared_target => "aix-shared",
1106 shared_ldflag => "-q32 -G",
1107 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
1111 inherit_from => [ "BASE_unix", asm("ppc64_asm") ],
1113 cflags => combine(picker(default => "-q64 -DB_ENDIAN -qmaxmem=16384 -qro -qroconst",
1116 threads("-qthreaded -D_THREAD_SAFE")),
1118 bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
1119 thread_scheme => "pthreads",
1120 perlasm_scheme => "aix64",
1121 dso_scheme => "dlfcn",
1122 shared_target => "aix-shared",
1123 shared_ldflag => "-q64 -G",
1124 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
1128 # SIEMENS BS2000/OSD: an EBCDIC-based mainframe
1130 inherit_from => [ "BASE_unix" ],
1132 cflags => "-O -XLLML -XLLMK -XL -DB_ENDIAN -DCHARSET_EBCDIC",
1133 ex_libs => add("-lsocket -lnsl"),
1134 bn_ops => "THIRTY_TWO_BIT RC4_CHAR",
1135 thread_scheme => "(unknown)",
1138 # OS/390 Unix an EBCDIC-based Unix system on IBM mainframe
1139 # You need to compile using the c89.sh wrapper in the tools directory, because the
1140 # IBM compiler does not like the -L switch after any object modules.
1143 inherit_from => [ "BASE_unix" ],
1145 cflags => "-O -DB_ENDIAN -DCHARSET_EBCDIC -DNO_SYS_PARAM_H -D_ALL_SOURCE",
1146 bn_ops => "THIRTY_TWO_BIT RC4_CHAR",
1147 thread_scheme => "(unknown)",
1150 #### Visual C targets
1152 # Win64 targets, WIN64I denotes IA-64 and WIN64A - AMD64
1154 # Note about -wd4090, disable warning C4090. This warning returns false
1155 # positives in some situations. Disabling it altogether masks both
1156 # legitimate and false cases, but as we compile on multiple platforms,
1157 # we rely on other compilers to catch legitimate cases.
1159 inherit_from => [ "BASE_Windows" ],
1162 cflags => "-W3 -wd4090 -Gs0 -GF -Gy -nologo -DOPENSSL_SYS_WIN32 -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -D_CRT_SECURE_NO_DEPRECATE",
1163 shared_target => "win-shared", # meaningless except it gives Configure a hint
1164 dso_scheme => "win32",
1167 inherit_from => [ "VC-common", asm("ia64_asm") ],
1168 cflags => add("-DUNICODE -D_UNICODE"),
1170 bn_ops => "SIXTY_FOUR_BIT EXPORT_VAR_AS_FN",
1171 bn_obj => sub { my $r=join(" ",@_); $r=~s/bn\-//; $r; },
1173 perlasm_scheme => "ias",
1174 build_scheme => add("VC-W64", { separator => undef }),
1177 inherit_from => [ "VC-common", asm("x86_64_asm") ],
1178 cflags => add("-DUNICODE -D_UNICODE"),
1180 bn_ops => "SIXTY_FOUR_BIT EXPORT_VAR_AS_FN",
1181 bn_obj => sub { my $r=join(" ",@_); $r=~s/x86_64\-gcc/bn_asm/; $r; },
1182 perlasm_scheme => "auto",
1183 build_scheme => add("VC-W64", { separator => undef }),
1186 # x86 Win32 target defaults to ANSI API, if you want UNICODE,
1187 # configure with 'perl Configure VC-WIN32 -DUNICODE -D_UNICODE'
1188 inherit_from => [ "VC-common", asm("x86_asm") ],
1190 bn_ops => "BN_LLONG EXPORT_VAR_AS_FN",
1191 perlasm_scheme => "win32n",
1192 build_scheme => add("VC-W32", { separator => undef }),
1195 inherit_from => [ "BASE_Windows" ],
1198 bn_ops => "BN_LLONG EXPORT_VAR_AS_FN",
1199 dso_scheme => "win32",
1200 build_scheme => add("VC-WCE", { separator => undef }),
1203 #### Borland C++ 4.5
1205 inherit_from => [ "BASE_Windows" ],
1208 bn_ops => "BN_LLONG EXPORT_VAR_AS_FN",
1209 dso_scheme => "win32",
1210 build_scheme => add("BC", { separator => undef }),
1215 inherit_from => [ "BASE_unix", asm("x86_asm"),
1216 sub { $disabled{shared} ? () : "x86_uplink" } ],
1218 cflags => combine(picker(default => "-DL_ENDIAN -DWIN32_LEAN_AND_MEAN -DUNICODE -D_UNICODE -m32 -Wall",
1220 release => "-O3 -fomit-frame-pointer"),
1222 sys_id => "MINGW32",
1223 ex_libs => add("-lws2_32 -lgdi32 -lcrypt32"),
1224 bn_ops => "BN_LLONG EXPORT_VAR_AS_FN",
1225 thread_scheme => "winthreads",
1226 perlasm_scheme => "coff",
1227 dso_scheme => "win32",
1228 shared_target => "mingw-shared",
1229 shared_cflag => add("-D_WINDLL"),
1230 shared_ldflag => "-static-libgcc",
1231 shared_rcflag => "--target=pe-i386",
1232 shared_extension => ".dll",
1236 # As for OPENSSL_USE_APPLINK. Applink makes it possible to use
1237 # .dll compiled with one compiler with application compiled with
1238 # another compiler. It's possible to engage Applink support in
1239 # mingw64 build, but it's not done, because till mingw64
1240 # supports structured exception handling, one can't seriously
1241 # consider its binaries for using with non-mingw64 run-time
1242 # environment. And as mingw64 is always consistent with itself,
1243 # Applink is never engaged and can as well be omitted.
1244 inherit_from => [ "BASE_unix", asm("x86_64_asm") ],
1246 cflags => combine(picker(default => "-DL_ENDIAN -DWIN32_LEAN_AND_MEAN -DUNICODE -D_UNICODE -m64 -Wall",
1250 sys_id => "MINGW64",
1251 ex_libs => add("-lws2_32 -lgdi32 -lcrypt32"),
1252 bn_ops => "SIXTY_FOUR_BIT EXPORT_VAR_AS_FN",
1253 thread_scheme => "winthreads",
1254 perlasm_scheme => "mingw64",
1255 dso_scheme => "win32",
1256 shared_target => "mingw-shared",
1257 shared_cflag => add("-D_WINDLL"),
1258 shared_ldflag => "-static-libgcc",
1259 shared_rcflag => "--target=pe-x86-64",
1260 shared_extension => ".dll",
1266 inherit_from => [ "BASE_unix" ],
1268 cflags => "-DL_ENDIAN -O",
1274 inherit_from => [ "BASE_unix" ],
1276 cflags => "-DTERMIOS -DL_ENDIAN -O -Wall",
1278 bn_ops => "BN_LLONG",
1279 dso_scheme => "win32",
1284 inherit_from => [ "BASE_unix", asm("x86_asm") ],
1286 cflags => picker(default => "-DTERMIOS -DL_ENDIAN -Wall",
1288 release => "-O3 -fomit-frame-pointer"),
1290 bn_ops => "BN_LLONG",
1291 perlasm_scheme => "coff",
1292 dso_scheme => "dlfcn",
1293 shared_target => "cygwin-shared",
1294 shared_cflag => "-D_WINDLL",
1295 shared_ldflag => "-shared",
1296 shared_extension => ".dll",
1298 "Cygwin-x86_64" => {
1299 inherit_from => [ "BASE_unix", asm("x86_64_asm") ],
1301 cflags => picker(default => "-DTERMIOS -DL_ENDIAN -Wall",
1305 bn_ops => "SIXTY_FOUR_BIT_LONG",
1306 perlasm_scheme => "mingw64",
1307 dso_scheme => "dlfcn",
1308 shared_target => "cygwin-shared",
1309 shared_cflag => "-D_WINDLL",
1310 shared_ldflag => "-shared",
1311 shared_extension => ".dll",
1313 # Backward compatibility for those using this target
1315 inherit_from => [ "Cygwin-x86" ]
1317 # In case someone constructs the Cygwin target name themself
1319 inherit_from => [ "Cygwin-x86" ]
1322 inherit_from => [ "Cygwin-x86" ]
1325 inherit_from => [ "Cygwin-x86" ]
1328 inherit_from => [ "Cygwin-x86" ]
1331 #### NetWare from David Ward (dsward@novell.com)
1332 # requires either MetroWerks NLM development tools, or gcc / nlmconv
1333 # NetWare defaults socket bio to WinSock sockets. However,
1334 # the builds can be configured to use BSD sockets instead.
1335 # netware-clib => legacy CLib c-runtime support
1337 inherit_from => [ "BASE_Windows" ],
1339 build_scheme => add("netware", { separator => undef }),
1341 "netware-clib-bsdsock" => {
1342 inherit_from => [ "BASE_Windows" ],
1344 build_scheme => add("netware", { separator => undef }),
1346 "netware-clib-gcc" => {
1347 inherit_from => [ "BASE_unix" ],
1348 cc => "i586-netware-gcc",
1349 cflags => "-nostdinc -I/ndk/nwsdk/include/nlm -I/ndk/ws295sdk/include -DL_ENDIAN -DNETWARE_CLIB -DOPENSSL_SYS_NETWARE -O2 -Wall",
1351 "netware-clib-bsdsock-gcc" => {
1352 inherit_from => [ "BASE_unix" ],
1353 cc => "i586-netware-gcc",
1354 cflags => "-nostdinc -I/ndk/nwsdk/include/nlm -DNETWARE_BSDSOCK -DNETDB_USE_INTERNET -DL_ENDIAN -DNETWARE_CLIB -DOPENSSL_SYS_NETWARE -O2 -Wall",
1356 # netware-libc => LibC/NKS support
1358 inherit_from => [ "BASE_Windows" ],
1360 bn_ops => "BN_LLONG",
1361 build_scheme => add("netware", { separator => undef }),
1363 "netware-libc-bsdsock" => {
1364 inherit_from => [ "BASE_Windows" ],
1366 bn_ops => "BN_LLONG",
1367 build_scheme => add("netware", { separator => undef }),
1369 "netware-libc-gcc" => {
1370 inherit_from => [ "BASE_unix" ],
1371 cc => "i586-netware-gcc",
1372 cflags => "-nostdinc -I/ndk/libc/include -I/ndk/libc/include/winsock -DL_ENDIAN -DNETWARE_LIBC -DOPENSSL_SYS_NETWARE -DTERMIO -O2 -Wall",
1373 bn_ops => "BN_LLONG",
1375 "netware-libc-bsdsock-gcc" => {
1376 inherit_from => [ "BASE_unix" ],
1377 cc => "i586-netware-gcc",
1378 cflags => "-nostdinc -I/ndk/libc/include -DNETWARE_BSDSOCK -DL_ENDIAN -DNETWARE_LIBC -DOPENSSL_SYS_NETWARE -DTERMIO -O2 -Wall",
1379 bn_ops => "BN_LLONG",
1384 inherit_from => [ asm("x86_asm") ],
1386 cflags => "-I/dev/env/WATT_ROOT/inc -DTERMIO -DL_ENDIAN -fomit-frame-pointer -O2 -Wall",
1388 ex_libs => add("-L/dev/env/WATT_ROOT/lib -lwatt"),
1389 bn_ops => "BN_LLONG",
1390 perlasm_scheme => "a.out",
1393 #### Ultrix from Bernhard Simon <simon@zid.tuwien.ac.at>
1395 inherit_from => [ "BASE_unix" ],
1397 cflags => "-std1 -O -Olimit 2500 -DL_ENDIAN",
1398 thread_scheme => "(unknown)",
1401 inherit_from => [ "BASE_unix" ],
1403 cflags => "-O3 -DL_ENDIAN",
1404 bn_ops => "BN_LLONG",
1405 thread_scheme => "(unknown)",
1407 # K&R C is no longer supported; you need gcc on old Ultrix installations
1408 ##"ultrix","cc:-O2 -DNOPROTO -DNOCONST -DL_ENDIAN::(unknown):::::::",
1410 ##### MacOS X (a.k.a. Darwin) setup
1411 "darwin-common" => {
1412 inherit_from => [ "BASE_unix" ],
1415 cflags => combine(picker(default => "",
1418 threads("-D_REENTRANT")),
1420 plib_lflags => "-Wl,-search_paths_first",
1421 bn_ops => "BN_LLONG RC4_CHAR",
1422 thread_scheme => "pthreads",
1423 perlasm_scheme => "osx32",
1424 dso_scheme => "dlfcn",
1425 ranlib => "ranlib -c",
1426 shared_target => "darwin-shared",
1427 shared_cflag => "-fPIC",
1428 shared_ldflag => "-dynamiclib",
1429 shared_extension => ".\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
1431 "darwin-ppc-cc" => {
1432 inherit_from => [ "darwin-common", asm("ppc32_asm") ],
1433 cflags => add("-arch ppc -DB_ENDIAN -Wa,-force_cpusubtype_ALL"),
1434 perlasm_scheme => "osx32",
1435 shared_ldflag => "-arch ppc -dynamiclib",
1437 "darwin64-ppc-cc" => {
1438 inherit_from => [ "darwin-common", asm("ppc64_asm") ],
1439 cflags => add("-arch ppc64 -DB_ENDIAN"),
1440 bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
1441 perlasm_scheme => "osx64",
1442 shared_ldflag => "-arch ppc64 -dynamiclib",
1444 "darwin-i386-cc" => {
1445 inherit_from => [ "darwin-common", asm("x86_asm") ],
1446 cflags => add(picker(default => "-arch i386 -DL_ENDIAN",
1447 release => "-fomit-frame-pointer")),
1448 bn_ops => "BN_LLONG RC4_INT",
1449 perlasm_scheme => "macosx",
1450 shared_ldflag => "-arch i386 -dynamiclib",
1452 "darwin64-x86_64-cc" => {
1453 inherit_from => [ "darwin-common", asm("x86_64_asm") ],
1454 cflags => add("-arch x86_64 -DL_ENDIAN -Wall"),
1455 bn_ops => "SIXTY_FOUR_BIT_LONG",
1456 perlasm_scheme => "macosx",
1457 shared_ldflag => "-arch x86_64 -dynamiclib",
1462 # It takes three prior-set environment variables to make it work:
1464 # CROSS_COMPILE=/where/toolchain/is/usr/bin/ [note ending slash]
1465 # CROSS_TOP=/where/SDKs/are
1466 # CROSS_SDK=iPhoneOSx.y.sdk
1468 # Exact paths vary with Xcode releases, but for couple of last ones
1469 # they would look like this:
1471 # CROSS_COMPILE=`xcode-select --print-path`/Toolchains/XcodeDefault.xctoolchain/usr/bin/
1472 # CROSS_TOP=`xcode-select --print-path`/Platforms/iPhoneOS.platform/Developer
1473 # CROSS_SDK=iPhoneOS.sdk
1475 "iphoneos-cross" => {
1476 inherit_from => [ "darwin-common" ],
1477 cflags => add("-isysroot \$(CROSS_TOP)/SDKs/\$(CROSS_SDK) -fno-common"),
1481 inherit_from => [ "darwin-common", asm("armv4_asm") ],
1482 # It should be possible to go below iOS 6 and even add -arch armv6,
1483 # thus targeting iPhone pre-3GS, but it's assumed to be irrelevant
1485 cflags => add("-arch armv7 -mios-version-min=6.0.0 -isysroot \$(CROSS_TOP)/SDKs/\$(CROSS_SDK) -fno-common"),
1487 perlasm_scheme => "ios32",
1490 inherit_from => [ "darwin-common", asm("aarch64_asm") ],
1491 cflags => add("-arch arm64 -mios-version-min=7.0.0 -isysroot \$(CROSS_TOP)/SDKs/\$(CROSS_SDK) -fno-common"),
1493 bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
1494 perlasm_scheme => "ios64",
1499 inherit_from => [ "BASE_unix" ],
1500 inherit_from => [ asm("x86_elf_asm") ],
1502 cflags => combine("-DL_ENDIAN -O3 -fomit-frame-pointer -Wall",
1503 threads("-pthread")),
1504 ex_libs => add("-ldl"),
1505 bn_ops => "BN_LLONG",
1506 thread_scheme => "pthreads",
1507 dso_scheme => "dlfcn",
1508 shared_target => "linux-shared",
1509 shared_cflag => "-fPIC",
1514 inherit_from => [ "BASE_unix" ],
1518 ##### VxWorks for various targets
1519 "vxworks-ppc60x" => {
1520 inherit_from => [ "BASE_unix" ],
1522 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",
1523 sys_id => "VXWORKS",
1524 ex_libs => add("-Wl,--defsym,__wrs_rtp_base=0xe0000000 -L \$(WIND_BASE)/target/usr/lib/ppc/PPC32/common"),
1526 "vxworks-ppcgen" => {
1527 inherit_from => [ "BASE_unix" ],
1529 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",
1530 sys_id => "VXWORKS",
1531 ex_libs => add("-Wl,--defsym,__wrs_rtp_base=0xe0000000 -L \$(WIND_BASE)/target/usr/lib/ppc/PPC32/sfcommon"),
1533 "vxworks-ppc405" => {
1534 inherit_from => [ "BASE_unix" ],
1536 cflags => "-g -msoft-float -mlongcall -DCPU=PPC405 -I\$(WIND_BASE)/target/h",
1537 sys_id => "VXWORKS",
1540 "vxworks-ppc750" => {
1541 inherit_from => [ "BASE_unix" ],
1543 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)",
1544 sys_id => "VXWORKS",
1547 "vxworks-ppc750-debug" => {
1548 inherit_from => [ "BASE_unix" ],
1550 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",
1551 sys_id => "VXWORKS",
1554 "vxworks-ppc860" => {
1555 inherit_from => [ "BASE_unix" ],
1557 cflags => "-nostdinc -msoft-float -DCPU=PPC860 -DNO_STRINGS_H -I\$(WIND_BASE)/target/h",
1558 sys_id => "VXWORKS",
1561 "vxworks-simlinux" => {
1562 inherit_from => [ "BASE_unix" ],
1564 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",
1565 sys_id => "VXWORKS",
1567 ranlib => "ranlibpentium",
1570 inherit_from => [ "BASE_unix", asm("mips32_asm") ],
1572 cflags => combine("-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",
1573 threads("-D_REENTRANT")),
1574 sys_id => "VXWORKS",
1575 ex_libs => add("-Wl,--defsym,__wrs_rtp_base=0xe0000000 -L \$(WIND_BASE)/target/usr/lib/mips/MIPSI32/sfcommon"),
1576 thread_scheme => "pthreads",
1577 perlasm_scheme => "o32",
1578 ranlib => "ranlibmips",
1583 inherit_from => [ "BASE_unix" ],
1585 cflags => combine("\$(CFLAGS)",
1586 threads("-D_REENTRANT")),
1587 plib_lflags => "\$(LDFLAGS)",
1588 ex_libs => add("\$(LDLIBS)"),
1589 bn_ops => "BN_LLONG",
1590 thread_scheme => "pthreads",
1591 dso_scheme => "$ENV{'LIBSSL_dlfcn'}",
1592 shared_target => "linux-shared",
1593 shared_cflag => "-fPIC",
1594 shared_ldflag => "-shared",
1595 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
1596 ranlib => "$ENV{'RANLIB'}",
1598 "uClinux-dist64" => {
1599 inherit_from => [ "BASE_unix" ],
1601 cflags => combine("\$(CFLAGS)",
1602 threads("-D_REENTRANT")),
1603 plib_lflags => "\$(LDFLAGS)",
1604 ex_libs => add("\$(LDLIBS)"),
1605 bn_ops => "SIXTY_FOUR_BIT_LONG",
1606 thread_scheme => "pthreads",
1607 dso_scheme => "$ENV{'LIBSSL_dlfcn'}",
1608 shared_target => "linux-shared",
1609 shared_cflag => "-fPIC",
1610 shared_ldflag => "-shared",
1611 shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
1612 ranlib => "$ENV{'RANLIB'}",
1617 inherit_from => [ "BASE_VMS" ],
1620 cflags => picker(default => "/STANDARD=RELAXED/NOLIST/PREFIX=ALL/NAMES=(AS_IS,SHORTENED)",
1621 debug => "/NOOPTIMIZE/DEBUG",
1622 release => "/OPTIMIZE/NODEBUG"),
1623 lflags => picker(default => "/MAP",
1624 debug => "/DEBUG/TRACEBACK",
1625 release => "/NODEBUG/NOTRACEBACK"),
1626 shared_target => "vms-shared",
1627 thread_scheme => "pthreads",
1629 apps_aux_src => "vms_decc_init.c",
1632 # VMS on VAX is *unsupported*
1635 # bn_obj => "[.asm]vms.obj vms-helper.obj"
1638 # inherit_from => [ "vms-generic", asm("vms-asm") ],
1640 # debug_aflags => "/NOOPTIMIZE/DEBUG",
1641 # release_aflags => "/OPTIMIZE/NODEBUG",
1642 # bn_opts => "THIRTY_TWO_BIT RC4_CHAR RC4_CHUNK DES_PTR BF_PTR",
1645 inherit_from => [ "vms-generic" ],
1647 #debug_aflags => "/NOOPTIMIZE/DEBUG",
1648 #release_aflags => "/OPTIMIZE/NODEBUG",
1649 bn_opts => "SIXTY_FOUR_BIT RC4_INT RC4_CHUNK_LL DES_PTR BF_PTR",
1651 "vms-alpha-P32" => {
1652 inherit_from => [ "vms-alpha" ],
1653 cflags => add("/POINTER_SIZE=32"),
1654 ex_libs => sub { join(",", map { s|SHR([\./])|SHR32$1|g; $_ } @_) },
1656 "vms-alpha-P64" => {
1657 inherit_from => [ "vms-alpha" ],
1658 cflags => add("/POINTER_SIZE=64"),
1659 ex_libs => sub { join(",", map { s|SHR([\./])|SHR64$1|g; $_ } @_) },
1662 inherit_from => [ "vms-generic" ],
1664 #debug_aflags => "/NOOPTIMIZE/DEBUG",
1665 #release_aflags => "/OPTIMIZE/NODEBUG",
1666 bn_opts => "SIXTY_FOUR_BIT RC4_INT RC4_CHUNK_LL DES_PTR BF_PTR",
1669 inherit_from => [ "vms-ia64" ],
1670 cflags => add("/POINTER_SIZE=32"),
1671 ex_libs => sub { join(",", map { s|SHR([\./])|SHR32$1|g; $_ } @_) },
1674 inherit_from => [ "vms-ia64" ],
1675 cflags => add("/POINTER_SIZE=64"),
1676 ex_libs => sub { join(",", map { s|SHR([\./])|SHR64$1|g; $_ } @_) },