00-base-templates.conf 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271
  1. # -*- Mode: perl -*-
  2. my %targets=(
  3. DEFAULTS => {
  4. template => 1,
  5. cflags => "",
  6. cppflags => "",
  7. lflags => "",
  8. defines => [],
  9. includes => [],
  10. lib_cflags => "",
  11. lib_cppflags => "",
  12. lib_defines => [],
  13. thread_scheme => "(unknown)", # Assume we don't know
  14. thread_defines => [],
  15. cast_asm_src => "c_enc.c",
  16. rc4_asm_src => "rc4_enc.c rc4_skey.c",
  17. rmd160_asm_src => "",
  18. rc5_asm_src => "rc5_enc.c",
  19. wp_asm_src => "wp_block.c",
  20. cmll_asm_src => "camellia.c cmll_misc.c cmll_cbc.c",
  21. modes_asm_src => "",
  22. padlock_asm_src => "",
  23. chacha_asm_src => "chacha_enc.c",
  24. poly1305_asm_src => "",
  25. keccak1600_asm_src => "keccak1600.c",
  26. unistd => "<unistd.h>",
  27. shared_target => "",
  28. shared_cflag => "",
  29. shared_defines => [],
  30. shared_ldflag => "",
  31. shared_rcflag => "",
  32. #### Defaults for the benefit of the config targets who don't inherit
  33. #### a BASE and assume Unix defaults
  34. #### THESE WILL DISAPPEAR IN OpenSSL 1.2
  35. build_scheme => [ "unified", "unix" ],
  36. build_file => "Makefile",
  37. AR => "ar",
  38. ARFLAGS => "r",
  39. CC => "cc",
  40. HASHBANGPERL => "/usr/bin/env perl",
  41. RANLIB => sub { which("$config{cross_compile_prefix}ranlib")
  42. ? "ranlib" : "" },
  43. RC => "windres",
  44. #### THESE WILL BE ENABLED IN OpenSSL 1.2
  45. #HASHBANGPERL => "PERL", # Only Unix actually cares
  46. },
  47. BASE_common => {
  48. template => 1,
  49. enable => [],
  50. disable => [],
  51. defines =>
  52. sub {
  53. my @defs = ();
  54. push @defs, "ZLIB" unless $disabled{zlib};
  55. push @defs, "ZLIB_SHARED" unless $disabled{"zlib-dynamic"};
  56. return [ @defs ];
  57. },
  58. includes =>
  59. sub {
  60. my @incs = ();
  61. push @incs, $withargs{zlib_include}
  62. if !$disabled{zlib} && $withargs{zlib_include};
  63. return [ @incs ];
  64. },
  65. },
  66. BASE_unix => {
  67. inherit_from => [ "BASE_common" ],
  68. template => 1,
  69. AR => "ar",
  70. ARFLAGS => "r",
  71. CC => "cc",
  72. lflags =>
  73. sub { $withargs{zlib_lib} ? "-L".$withargs{zlib_lib} : () },
  74. ex_libs =>
  75. sub { !defined($disabled{zlib})
  76. && defined($disabled{"zlib-dynamic"})
  77. ? "-lz" : () },
  78. HASHBANGPERL => "/usr/bin/env perl", # Only Unix actually cares
  79. RANLIB => sub { which("$config{cross_compile_prefix}ranlib")
  80. ? "ranlib" : "" },
  81. RC => "windres",
  82. build_scheme => [ "unified", "unix" ],
  83. build_file => "Makefile",
  84. perl_platform => 'Unix',
  85. },
  86. BASE_Windows => {
  87. inherit_from => [ "BASE_common" ],
  88. template => 1,
  89. lib_defines =>
  90. sub {
  91. my @defs = ();
  92. unless ($disabled{"zlib-dynamic"}) {
  93. my $zlib = $withargs{zlib_lib} // "ZLIB1";
  94. push @defs, 'LIBZ=' . (quotify("perl", $zlib))[0];
  95. }
  96. return [ @defs ];
  97. },
  98. ex_libs =>
  99. sub {
  100. unless ($disabled{zlib}) {
  101. if (defined($disabled{"zlib-dynamic"})) {
  102. return $withargs{zlib_lib} // "ZLIB1";
  103. }
  104. }
  105. return ();
  106. },
  107. LD => "link",
  108. LDFLAGS => "/nologo",
  109. ldoutflag => "/out:",
  110. AR => "lib",
  111. ARFLAGS => "/nologo",
  112. aroutflag => "/out:",
  113. RC => "rc",
  114. rcoutflag => "/fo",
  115. MT => "mt",
  116. MTFLAGS => "-nologo",
  117. mtinflag => "-manifest ",
  118. mtoutflag => "-outputresource:",
  119. build_file => "makefile",
  120. build_scheme => [ "unified", "windows" ],
  121. perl_platform => 'Windows',
  122. },
  123. BASE_VMS => {
  124. inherit_from => [ "BASE_common" ],
  125. template => 1,
  126. includes =>
  127. add(sub {
  128. my @incs = ();
  129. # GNV$ZLIB_INCLUDE is the standard logical name for later
  130. # zlib incarnations.
  131. push @incs, 'GNV$ZLIB_INCLUDE:'
  132. if !$disabled{zlib} && !$withargs{zlib_include};
  133. return [ @incs ];
  134. }),
  135. build_file => "descrip.mms",
  136. build_scheme => [ "unified", "VMS" ],
  137. perl_platform => 'VMS',
  138. },
  139. x86_asm => {
  140. template => 1,
  141. cast_asm_src => "cast-586.s",
  142. sha1_asm_src => "sha1-586.s sha256-586.s sha512-586.s",
  143. rc4_asm_src => "rc4-586.s",
  144. rmd160_asm_src => "rmd-586.s",
  145. rc5_asm_src => "rc5-586.s",
  146. wp_asm_src => "wp_block.c wp-mmx.s",
  147. cmll_asm_src => "cmll-x86.s",
  148. modes_asm_src => "ghash-x86.s",
  149. padlock_asm_src => "e_padlock-x86.s",
  150. chacha_asm_src => "chacha-x86.s",
  151. poly1305_asm_src=> "poly1305-x86.s",
  152. },
  153. x86_elf_asm => {
  154. template => 1,
  155. inherit_from => [ "x86_asm" ],
  156. },
  157. x86_64_asm => {
  158. template => 1,
  159. sha1_asm_src => "sha1-x86_64.s sha256-x86_64.s sha512-x86_64.s sha1-mb-x86_64.s sha256-mb-x86_64.s",
  160. rc4_asm_src => "rc4-x86_64.s rc4-md5-x86_64.s",
  161. wp_asm_src => "wp-x86_64.s",
  162. cmll_asm_src => "cmll-x86_64.s cmll_misc.c",
  163. modes_asm_src => "ghash-x86_64.s aesni-gcm-x86_64.s",
  164. padlock_asm_src => "e_padlock-x86_64.s",
  165. chacha_asm_src => "chacha-x86_64.s",
  166. poly1305_asm_src=> "poly1305-x86_64.s",
  167. keccak1600_asm_src => "keccak1600-x86_64.s",
  168. },
  169. ia64_asm => {
  170. template => 1,
  171. sha1_asm_src => "sha1-ia64.s sha256-ia64.s sha512-ia64.s",
  172. modes_asm_src => "ghash-ia64.s",
  173. chacha_asm_src => "chacha-ia64.S",
  174. poly1305_asm_src=> "asm/poly1305-ia64.S",
  175. },
  176. sparcv9_asm => {
  177. template => 1,
  178. sha1_asm_src => "sha1-sparcv9.S sha256-sparcv9.S sha512-sparcv9.S",
  179. cmll_asm_src => "camellia.c cmll_misc.c cmll_cbc.c cmllt4-sparcv9.S",
  180. modes_asm_src => "ghash-sparcv9.S",
  181. poly1305_asm_src=> "poly1305-sparcv9.S",
  182. },
  183. sparcv8_asm => {
  184. template => 1,
  185. },
  186. alpha_asm => {
  187. template => 1,
  188. sha1_asm_src => "sha1-alpha.S",
  189. modes_asm_src => "ghash-alpha.S",
  190. },
  191. mips32_asm => {
  192. template => 1,
  193. sha1_asm_src => "sha1-mips.S sha256-mips.S",
  194. },
  195. mips64_asm => {
  196. inherit_from => [ "mips32_asm" ],
  197. template => 1,
  198. sha1_asm_src => add("sha512-mips.S"),
  199. poly1305_asm_src=> "poly1305-mips.S",
  200. },
  201. s390x_asm => {
  202. template => 1,
  203. sha1_asm_src => "sha1-s390x.S sha256-s390x.S sha512-s390x.S",
  204. rc4_asm_src => "rc4-s390x.s",
  205. modes_asm_src => "ghash-s390x.S",
  206. chacha_asm_src => "chacha-s390x.S",
  207. poly1305_asm_src=> "poly1305-s390x.S",
  208. keccak1600_asm_src => "keccak1600-s390x.S",
  209. },
  210. armv4_asm => {
  211. template => 1,
  212. sha1_asm_src => "sha1-armv4-large.S sha256-armv4.S sha512-armv4.S",
  213. modes_asm_src => "ghash-armv4.S ghashv8-armx.S",
  214. chacha_asm_src => "chacha-armv4.S",
  215. poly1305_asm_src=> "poly1305-armv4.S",
  216. keccak1600_asm_src => "keccak1600-armv4.S",
  217. },
  218. aarch64_asm => {
  219. template => 1,
  220. sha1_asm_src => "sha1-armv8.S sha256-armv8.S sha512-armv8.S",
  221. modes_asm_src => "ghashv8-armx.S",
  222. chacha_asm_src => "chacha-armv8.S",
  223. poly1305_asm_src=> "poly1305-armv8.S",
  224. keccak1600_asm_src => "keccak1600-armv8.S",
  225. },
  226. parisc11_asm => {
  227. template => 1,
  228. sha1_asm_src => "sha1-parisc.s sha256-parisc.s sha512-parisc.s",
  229. rc4_asm_src => "rc4-parisc.s",
  230. modes_asm_src => "ghash-parisc.s",
  231. },
  232. parisc20_64_asm => {
  233. template => 1,
  234. inherit_from => [ "parisc11_asm" ],
  235. },
  236. ppc32_asm => {
  237. template => 1,
  238. sha1_asm_src => "sha1-ppc.s sha256-ppc.s sha512-ppc.s sha256p8-ppc.s sha512p8-ppc.s",
  239. modes_asm_src => "ghashp8-ppc.s",
  240. chacha_asm_src => "chacha-ppc.s",
  241. poly1305_asm_src=> "poly1305-ppc.s poly1305-ppcfp.s",
  242. },
  243. ppc64_asm => {
  244. inherit_from => [ "ppc32_asm" ],
  245. template => 1,
  246. keccak1600_asm_src => "keccak1600-ppc64.s",
  247. },
  248. );