10-main.conf 84 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875
  1. ## -*- mode: perl; -*-
  2. ## Standard openssl configuration targets.
  3. # Helper functions for the Windows configs
  4. my $vc_win64a_info = {};
  5. sub vc_win64a_info {
  6. unless (%$vc_win64a_info) {
  7. if (`nasm -v 2>NUL` =~ /NASM version ([0-9]+\.[0-9]+)/ && $1 >= 2.0) {
  8. $vc_win64a_info = { as => "nasm",
  9. asflags => "-f win64 -DNEAR -Ox -g",
  10. asoutflag => "-o" };
  11. } elsif ($disabled{asm}) {
  12. $vc_win64a_info = { as => "ml64",
  13. asflags => "/c /Cp /Cx /Zi",
  14. asoutflag => "/Fo" };
  15. } else {
  16. $die->("NASM not found - make sure it's installed and available on %PATH%\n");
  17. $vc_win64a_info = { as => "{unknown}",
  18. asflags => "",
  19. asoutflag => "" };
  20. }
  21. }
  22. return $vc_win64a_info;
  23. }
  24. my $vc_win32_info = {};
  25. sub vc_win32_info {
  26. unless (%$vc_win32_info) {
  27. my $ver=`nasm -v 2>NUL`;
  28. my $vew=`nasmw -v 2>NUL`;
  29. if ($ver ne "" || $vew ne "") {
  30. $vc_win32_info = { as => $ver ge $vew ? "nasm" : "nasmw",
  31. asflags => "-f win32",
  32. asoutflag => "-o",
  33. perlasm_scheme => "win32n" };
  34. } elsif ($disabled{asm}) {
  35. $vc_win32_info = { as => "ml",
  36. asflags => "/nologo /Cp /coff /c /Cx /Zi",
  37. asoutflag => "/Fo",
  38. perlasm_scheme => "win32" };
  39. } else {
  40. $die->("NASM not found - make sure it's installed and available on %PATH%\n");
  41. $vc_win32_info = { as => "{unknown}",
  42. asflags => "",
  43. asoutflag => "",
  44. perlasm_scheme => "win32" };
  45. }
  46. }
  47. return $vc_win32_info;
  48. }
  49. my $vc_wince_info = {};
  50. sub vc_wince_info {
  51. unless (%$vc_wince_info) {
  52. # sanity check
  53. $die->('%OSVERSION% is not defined') if (!defined($ENV{'OSVERSION'}));
  54. $die->('%PLATFORM% is not defined') if (!defined($ENV{'PLATFORM'}));
  55. $die->('%TARGETCPU% is not defined') if (!defined($ENV{'TARGETCPU'}));
  56. #
  57. # Idea behind this is to mimic flags set by eVC++ IDE...
  58. #
  59. my $wcevers = $ENV{'OSVERSION'}; # WCENNN
  60. my $wcevernum;
  61. my $wceverdotnum;
  62. if ($wcevers =~ /^WCE([1-9])([0-9]{2})$/) {
  63. $wcevernum = "$1$2";
  64. $wceverdotnum = "$1.$2";
  65. } else {
  66. $die->('%OSVERSION% value is insane');
  67. $wcevernum = "{unknown}";
  68. $wceverdotnum = "{unknown}";
  69. }
  70. my $wcecdefs = "-D_WIN32_WCE=$wcevernum -DUNDER_CE=$wcevernum"; # -D_WIN32_WCE=NNN
  71. my $wcelflag = "/subsystem:windowsce,$wceverdotnum"; # ...,N.NN
  72. my $wceplatf = $ENV{'PLATFORM'};
  73. $wceplatf =~ tr/a-z0-9 /A-Z0-9_/;
  74. $wcecdefs .= " -DWCE_PLATFORM_$wceplatf";
  75. my $wcetgt = $ENV{'TARGETCPU'}; # just shorter name...
  76. SWITCH: for($wcetgt) {
  77. /^X86/ && do { $wcecdefs.=" -Dx86 -D_X86_ -D_i386_ -Di_386_";
  78. $wcelflag.=" /machine:X86"; last; };
  79. /^ARMV4[IT]/ && do { $wcecdefs.=" -DARM -D_ARM_ -D$wcetgt";
  80. $wcecdefs.=" -DTHUMB -D_THUMB_" if($wcetgt=~/T$/);
  81. $wcecdefs.=" -QRarch4T -QRinterwork-return";
  82. $wcelflag.=" /machine:THUMB"; last; };
  83. /^ARM/ && do { $wcecdefs.=" -DARM -D_ARM_ -D$wcetgt";
  84. $wcelflag.=" /machine:ARM"; last; };
  85. /^MIPSIV/ && do { $wcecdefs.=" -DMIPS -D_MIPS_ -DR4000 -D$wcetgt";
  86. $wcecdefs.=" -D_MIPS64 -QMmips4 -QMn32";
  87. $wcelflag.=" /machine:MIPSFPU"; last; };
  88. /^MIPS16/ && do { $wcecdefs.=" -DMIPS -D_MIPS_ -DR4000 -D$wcetgt";
  89. $wcecdefs.=" -DMIPSII -QMmips16";
  90. $wcelflag.=" /machine:MIPS16"; last; };
  91. /^MIPSII/ && do { $wcecdefs.=" -DMIPS -D_MIPS_ -DR4000 -D$wcetgt";
  92. $wcecdefs.=" -QMmips2";
  93. $wcelflag.=" /machine:MIPS"; last; };
  94. /^R4[0-9]{3}/ && do { $wcecdefs.=" -DMIPS -D_MIPS_ -DR4000";
  95. $wcelflag.=" /machine:MIPS"; last; };
  96. /^SH[0-9]/ && do { $wcecdefs.=" -D$wcetgt -D_${wcetgt}_ -DSHx";
  97. $wcecdefs.=" -Qsh4" if ($wcetgt =~ /^SH4/);
  98. $wcelflag.=" /machine:$wcetgt"; last; };
  99. { $wcecdefs.=" -D$wcetgt -D_${wcetgt}_";
  100. $wcelflag.=" /machine:$wcetgt"; last; };
  101. }
  102. $vc_wince_info = { cflags => $wcecdefs,
  103. lflags => $wcelflag };
  104. }
  105. return $vc_wince_info;
  106. }
  107. # Helper functions for the VMS configs
  108. my $vms_info = {};
  109. sub vms_info {
  110. unless (%$vms_info) {
  111. my $pointer_size = shift;
  112. my $pointer_size_str = $pointer_size == 0 ? "" : "$pointer_size";
  113. $vms_info->{disable_warns} = [ ];
  114. $vms_info->{pointer_size} = $pointer_size_str;
  115. if ($pointer_size == 64) {
  116. `PIPE CC /NOCROSS_REFERENCE /NOLIST /NOOBJECT /WARNINGS = DISABLE = ( MAYLOSEDATA3, EMPTYFILE ) NL: 2> NL:`;
  117. if ($? == 0) {
  118. push @{$vms_info->{disable_warns}}, "MAYLOSEDATA3";
  119. }
  120. }
  121. unless ($disabled{zlib}) {
  122. my $default_zlib = 'GNV$LIBZSHR' . $pointer_size_str;
  123. if (defined($disabled{"zlib-dynamic"})) {
  124. $vms_info->{zlib} = $withargs{zlib_lib} || "$default_zlib/SHARE";
  125. } else {
  126. $vms_info->{def_zlib} = $withargs{zlib_lib} || $default_zlib;
  127. # In case the --with-zlib-lib value contains something like
  128. # /SHARE or /LIB or so at the end, remove it.
  129. $vms_info->{def_zlib} =~ s|/.*$||g;
  130. }
  131. }
  132. }
  133. return $vms_info;
  134. }
  135. %targets = (
  136. #### Basic configs that should work on any 32-bit box
  137. "gcc" => {
  138. cc => "gcc",
  139. cflags => picker(debug => "-O0 -g",
  140. release => "-O3"),
  141. thread_scheme => "(unknown)",
  142. bn_ops => "BN_LLONG",
  143. },
  144. "cc" => {
  145. cc => "cc",
  146. cflags => "-O",
  147. thread_scheme => "(unknown)",
  148. },
  149. #### VOS Configurations
  150. "vos-gcc" => {
  151. inherit_from => [ "BASE_unix" ],
  152. cc => "gcc",
  153. cflags => picker(default => "-Wall -DOPENSSL_SYS_VOS -D_POSIX_C_SOURCE=200112L -D_BSD -D_VOS_EXTENDED_NAMES -DB_ENDIAN",
  154. debug => "-O0 -g",
  155. release => "-O3"),
  156. thread_scheme => "(unknown)",
  157. sys_id => "VOS",
  158. lflags => "-Wl,-map",
  159. bn_ops => "BN_LLONG",
  160. shared_extension => ".so",
  161. },
  162. #### Solaris configurations
  163. "solaris-common" => {
  164. inherit_from => [ "BASE_unix" ],
  165. template => 1,
  166. cflags => "-DFILIO_H",
  167. ex_libs => add("-lsocket -lnsl -ldl"),
  168. dso_scheme => "dlfcn",
  169. thread_scheme => "pthreads",
  170. shared_target => "solaris-shared",
  171. shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
  172. },
  173. #### Solaris x86 with GNU C setups
  174. "solaris-x86-gcc" => {
  175. # NB. GNU C has to be configured to use GNU assembler, and not
  176. # /usr/ccs/bin/as. Failure to comply will result in compile
  177. # failures [at least] in 32-bit build.
  178. # [Above statement is in direct contradition with one below.
  179. # Latter is kept, because it's formally inappropriate to
  180. # modify compile flags in letter release.]
  181. # -DOPENSSL_NO_INLINE_ASM switches off inline assembler. We have
  182. # to do it here because whenever GNU C instantiates an assembler
  183. # template it surrounds it with #APP #NO_APP comment pair which
  184. # (at least Solaris 7_x86) /usr/ccs/bin/as fails to assemble
  185. # with "Illegal mnemonic" error message.
  186. inherit_from => [ "solaris-common", asm("x86_elf_asm") ],
  187. cc => "gcc",
  188. cflags => add_before(picker(default => "-Wall -DL_ENDIAN -DOPENSSL_NO_INLINE_ASM",
  189. debug => "-O0 -g",
  190. release => "-O3 -fomit-frame-pointer"),
  191. threads("-pthread")),
  192. ex_libs => add(threads("-pthread")),
  193. bn_ops => "BN_LLONG",
  194. shared_cflag => "-fPIC",
  195. shared_ldflag => "-shared -static-libgcc",
  196. },
  197. "solaris64-x86_64-gcc" => {
  198. # -shared -static-libgcc might appear controversial, but modules
  199. # taken from static libgcc do not have relocations and linking
  200. # them into our shared objects doesn't have any negative side
  201. # effects. On the contrary, doing so makes it possible to use
  202. # gcc shared build with Sun C. Given that gcc generates faster
  203. # code [thanks to inline assembler], I would actually recommend
  204. # to consider using gcc shared build even with vendor compiler:-)
  205. # <appro@fy.chalmers.se>
  206. inherit_from => [ "solaris-common", asm("x86_64_asm") ],
  207. cc => "gcc",
  208. cflags => add_before(picker(default => "-m64 -Wall -DL_ENDIAN",
  209. debug => "-O0 -g",
  210. release => "-O3"),
  211. threads("-pthread")),
  212. ex_libs => add(threads("-pthread")),
  213. bn_ops => "SIXTY_FOUR_BIT_LONG",
  214. perlasm_scheme => "elf",
  215. shared_cflag => "-fPIC",
  216. shared_ldflag => "-m64 -shared -static-libgcc",
  217. multilib => "/64",
  218. },
  219. #### Solaris x86 with Sun C setups
  220. # There used to be solaris-x86-cc target, but it was removed,
  221. # primarily because vendor assembler can't assemble our modules
  222. # with -KPIC flag. As result it, assembly support, was not even
  223. # available as option. But its lack means lack of side-channel
  224. # resistant code, which is incompatible with security by todays
  225. # standards. Fortunately gcc is readily available prepackaged
  226. # option, which we can firmly point at...
  227. #
  228. # On related note, solaris64-x86_64-cc target won't compile code
  229. # paths utilizing AVX and post-Haswell instruction extensions.
  230. # Consider switching to solaris64-x86_64-gcc even here...
  231. #
  232. "solaris64-x86_64-cc" => {
  233. inherit_from => [ "solaris-common", asm("x86_64_asm") ],
  234. cc => "cc",
  235. cflags => add_before(picker(default => "-xarch=generic64 -xstrconst -Xa -DL_ENDIAN",
  236. debug => "-g",
  237. release => "-xO5 -xdepend -xbuiltin"),
  238. threads("-D_REENTRANT")),
  239. thread_scheme => "pthreads",
  240. lflags => add("-xarch=generic64",threads("-mt")),
  241. ex_libs => add(threads("-lpthread")),
  242. bn_ops => "SIXTY_FOUR_BIT_LONG",
  243. perlasm_scheme => "elf",
  244. shared_cflag => "-KPIC",
  245. shared_ldflag => "-xarch=generic64 -G -dy -z text",
  246. multilib => "/64",
  247. },
  248. #### SPARC Solaris with GNU C setups
  249. "solaris-sparcv7-gcc" => {
  250. inherit_from => [ "solaris-common" ],
  251. cc => "gcc",
  252. cflags => add_before(picker(default => "-Wall -DB_ENDIAN -DBN_DIV2W",
  253. debug => "-O0 -g",
  254. release => "-O3"),
  255. threads("-pthread")),
  256. ex_libs => add(threads("-pthread")),
  257. bn_ops => "BN_LLONG RC4_CHAR",
  258. shared_cflag => "-fPIC",
  259. shared_ldflag => "-shared",
  260. },
  261. "solaris-sparcv8-gcc" => {
  262. inherit_from => [ "solaris-sparcv7-gcc", asm("sparcv8_asm") ],
  263. cflags => add_before("-mcpu=v8"),
  264. },
  265. "solaris-sparcv9-gcc" => {
  266. # -m32 should be safe to add as long as driver recognizes
  267. # -mcpu=ultrasparc
  268. inherit_from => [ "solaris-sparcv7-gcc", asm("sparcv9_asm") ],
  269. cflags => add_before("-m32 -mcpu=ultrasparc"),
  270. },
  271. "solaris64-sparcv9-gcc" => {
  272. inherit_from => [ "solaris-sparcv9-gcc" ],
  273. cflags => sub { my $f=join(" ",@_); $f =~ s/\-m32/-m64/; $f; },
  274. bn_ops => "BN_LLONG RC4_CHAR",
  275. shared_ldflag => "-m64 -shared",
  276. multilib => "/64",
  277. },
  278. #### SPARC Solaris with Sun C setups
  279. # SC4.0 doesn't pass 'make test', upgrade to SC5.0 or SC4.2.
  280. # SC4.2 is ok, better than gcc even on bn as long as you tell it -xarch=v8
  281. # SC5.0 note: Compiler common patch 107357-01 or later is required!
  282. "solaris-sparcv7-cc" => {
  283. inherit_from => [ "solaris-common" ],
  284. cc => "cc",
  285. cflags => add_before(picker(default => "-xstrconst -Xa -DB_ENDIAN -DBN_DIV2W",
  286. debug => "-g",
  287. release => "-xO5 -xdepend"),
  288. threads("-D_REENTRANT")),
  289. lflags => add(threads("-mt")),
  290. ex_libs => add(threads("-lpthread")),
  291. bn_ops => "BN_LLONG RC4_CHAR",
  292. shared_cflag => "-KPIC",
  293. shared_ldflag => "-G -dy -z text",
  294. },
  295. ####
  296. "solaris-sparcv8-cc" => {
  297. inherit_from => [ "solaris-sparcv7-cc", asm("sparcv8_asm") ],
  298. cflags => add_before("-xarch=v8"),
  299. },
  300. "solaris-sparcv9-cc" => {
  301. inherit_from => [ "solaris-sparcv7-cc", asm("sparcv9_asm") ],
  302. cflags => add_before("-xarch=v8plus"),
  303. },
  304. "solaris64-sparcv9-cc" => {
  305. inherit_from => [ "solaris-sparcv7-cc", asm("sparcv9_asm") ],
  306. cflags => add_before("-xarch=v9"),
  307. lflags => add_before("-xarch=v9"),
  308. bn_ops => "BN_LLONG RC4_CHAR",
  309. shared_ldflag => "-xarch=v9 -G -dy -z text",
  310. multilib => "/64",
  311. },
  312. #### IRIX 6.x configs
  313. # Only N32 and N64 ABIs are supported.
  314. "irix-mips3-gcc" => {
  315. inherit_from => [ "BASE_unix", asm("mips64_asm") ],
  316. cc => "gcc",
  317. cflags => combine(picker(default => "-mabi=n32 -DB_ENDIAN -DBN_DIV3W",
  318. debug => "-g -O0",
  319. release => "-O3"),
  320. threads("-D_SGI_MP_SOURCE")),
  321. ex_libs => add(threads("-lpthread")),
  322. bn_ops => "RC4_CHAR SIXTY_FOUR_BIT",
  323. thread_scheme => "pthreads",
  324. perlasm_scheme => "n32",
  325. dso_scheme => "dlfcn",
  326. shared_target => "irix-shared",
  327. shared_ldflag => "-mabi=n32",
  328. shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
  329. multilib => "32",
  330. },
  331. "irix-mips3-cc" => {
  332. inherit_from => [ "BASE_unix", asm("mips64_asm") ],
  333. cc => "cc",
  334. cflags => combine(picker(default => "-n32 -mips3 -use_readonly_const -G0 -rdata_shared -DB_ENDIAN -DBN_DIV3W",
  335. debug => "-g -O0",
  336. release => "-O2"),
  337. threads("-D_SGI_MP_SOURCE")),
  338. ex_libs => add(threads("-lpthread")),
  339. bn_ops => "RC4_CHAR SIXTY_FOUR_BIT",
  340. thread_scheme => "pthreads",
  341. perlasm_scheme => "n32",
  342. dso_scheme => "dlfcn",
  343. shared_target => "irix-shared",
  344. shared_ldflag => "-n32",
  345. shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
  346. multilib => "32",
  347. },
  348. # N64 ABI builds.
  349. "irix64-mips4-gcc" => {
  350. inherit_from => [ "BASE_unix", asm("mips64_asm") ],
  351. cc => "gcc",
  352. cflags => combine(picker(default => "-mabi=64 -mips4 -DB_ENDIAN -DBN_DIV3W",
  353. debug => "-g -O0",
  354. release => "-O3"),
  355. threads("-D_SGI_MP_SOURCE")),
  356. ex_libs => add(threads("-lpthread")),
  357. bn_ops => "RC4_CHAR SIXTY_FOUR_BIT_LONG",
  358. thread_scheme => "pthreads",
  359. perlasm_scheme => "64",
  360. dso_scheme => "dlfcn",
  361. shared_target => "irix-shared",
  362. shared_ldflag => "-mabi=64",
  363. shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
  364. multilib => "64",
  365. },
  366. "irix64-mips4-cc" => {
  367. inherit_from => [ "BASE_unix", asm("mips64_asm") ],
  368. cc => "cc",
  369. cflags => combine(picker(default => "-64 -mips4 -use_readonly_const -G0 -rdata_shared -DB_ENDIAN -DBN_DIV3W",
  370. debug => "-g -O0",
  371. release => "-O2"),
  372. threads("-D_SGI_MP_SOURCE")),
  373. ex_libs => add(threads("-lpthread")),
  374. bn_ops => "RC4_CHAR SIXTY_FOUR_BIT_LONG",
  375. thread_scheme => "pthreads",
  376. perlasm_scheme => "64",
  377. dso_scheme => "dlfcn",
  378. shared_target => "irix-shared",
  379. shared_ldflag => "-64",
  380. shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
  381. multilib => "64",
  382. },
  383. #### Unified HP-UX ANSI C configs.
  384. # Special notes:
  385. # - Originally we were optimizing at +O4 level. It should be noted
  386. # that the only difference between +O3 and +O4 is global inter-
  387. # procedural analysis. As it has to be performed during the link
  388. # stage the compiler leaves behind certain pseudo-code in lib*.a
  389. # which might be release or even patch level specific. Generating
  390. # the machine code for and analyzing the *whole* program appears
  391. # to be *extremely* memory demanding while the performance gain is
  392. # actually questionable. The situation is intensified by the default
  393. # HP-UX data set size limit (infamous 'maxdsiz' tunable) of 64MB
  394. # which is way too low for +O4. In other words, doesn't +O3 make
  395. # more sense?
  396. # - Keep in mind that the HP compiler by default generates code
  397. # suitable for execution on the host you're currently compiling at.
  398. # If the toolkit is meant to be used on various PA-RISC processors
  399. # consider './Configure hpux-parisc-[g]cc +DAportable'.
  400. # - -DMD32_XARRAY triggers workaround for compiler bug we ran into in
  401. # 32-bit message digests. (For the moment of this writing) HP C
  402. # doesn't seem to "digest" too many local variables (they make "him"
  403. # chew forever:-). For more details look-up MD32_XARRAY comment in
  404. # crypto/sha/sha_lcl.h.
  405. # - originally there were 32-bit hpux-parisc2-* targets. They were
  406. # scrapped, because a) they were not interchangeable with other 32-bit
  407. # targets; b) performance-critical 32-bit assembly modules implement
  408. # even PA-RISC 2.0-specific code paths, which are chosen at run-time,
  409. # thus adequate performance is provided even with PA-RISC 1.1 build.
  410. # <appro@fy.chalmers.se>
  411. "hpux-common" => {
  412. inherit_from => [ "BASE_unix" ],
  413. template => 1,
  414. defines => add("_XOPEN_SOURCE", "_XOPEN_SOURCE_EXTENDED",
  415. "_HPUX_ALT_XOPEN_SOCKET_API"),
  416. thread_scheme => "pthreads",
  417. dso_scheme => "dlfcn", # overridden in 32-bit PA-RISC builds
  418. shared_target => "hpux-shared",
  419. },
  420. "hpux-parisc-gcc" => {
  421. inherit_from => [ "hpux-common" ],
  422. cc => "gcc",
  423. cflags => combine(picker(default => "-DB_ENDIAN -DBN_DIV2W",
  424. debug => "-O0 -g",
  425. release => "-O3"),
  426. threads("-pthread")),
  427. ex_libs => add("-Wl,+s -ldld", threads("-pthread")),
  428. bn_ops => "BN_LLONG",
  429. dso_scheme => "dl",
  430. shared_cflag => "-fPIC",
  431. shared_ldflag => "-shared",
  432. shared_extension => ".sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
  433. },
  434. "hpux-parisc1_1-gcc" => {
  435. inherit_from => [ "hpux-parisc-gcc", asm("parisc11_asm") ],
  436. multilib => "/pa1.1",
  437. },
  438. "hpux64-parisc2-gcc" => {
  439. inherit_from => [ "hpux-common", asm("parisc20_64_asm") ],
  440. cc => "gcc",
  441. cflags => combine(picker(default => "-DB_ENDIAN",
  442. debug => "-O0 -g",
  443. release => "-O3"),
  444. threads("-D_REENTRANT")),
  445. ex_libs => add("-ldl"),
  446. bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
  447. shared_cflag => "-fpic",
  448. shared_ldflag => "-shared",
  449. shared_extension => ".sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
  450. multilib => "/pa20_64",
  451. },
  452. # More attempts at unified 10.X and 11.X targets for HP C compiler.
  453. #
  454. # Chris Ruemmler <ruemmler@cup.hp.com>
  455. # Kevin Steves <ks@hp.se>
  456. "hpux-parisc-cc" => {
  457. inherit_from => [ "hpux-common" ],
  458. cc => "cc",
  459. cflags => combine(picker(default => "+Optrs_strongly_typed -Ae +ESlit -DB_ENDIAN -DBN_DIV2W -DMD32_XARRAY",
  460. debug => "+O0 +d -g",
  461. release => "+O3"),
  462. threads("-D_REENTRANT")),
  463. ex_libs => add("-Wl,+s -ldld",threads("-lpthread")),
  464. bn_ops => "RC4_CHAR",
  465. dso_scheme => "dl",
  466. shared_cflag => "+Z",
  467. shared_ldflag => "-b",
  468. shared_extension => ".sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
  469. },
  470. "hpux-parisc1_1-cc" => {
  471. inherit_from => [ "hpux-parisc-cc", asm("parisc11_asm") ],
  472. cflags => add_before("+DA1.1"),
  473. multilib => "/pa1.1",
  474. },
  475. "hpux64-parisc2-cc" => {
  476. inherit_from => [ "hpux-common", asm("parisc20_64_asm") ],
  477. cc => "cc",
  478. cflags => combine(picker(default => "+DD64 +Optrs_strongly_typed -Ae +ESlit -DB_ENDIAN -DMD32_XARRAY",
  479. debug => "+O0 +d -g",
  480. release => "+O3"),
  481. threads("-D_REENTRANT")),
  482. ex_libs => add("-ldl",threads("-lpthread")),
  483. bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
  484. shared_cflag => "+Z",
  485. shared_ldflag => "+DD64 -b",
  486. shared_extension => ".sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
  487. multilib => "/pa20_64",
  488. },
  489. # HP/UX IA-64 targets
  490. "hpux-ia64-cc" => {
  491. inherit_from => [ "hpux-common", asm("ia64_asm") ],
  492. cc => "cc",
  493. cflags => combine(picker(default => "-Ae +DD32 +Olit=all -z -DB_ENDIAN",
  494. debug => "+O0 +d -g",
  495. release => "+O2"),
  496. threads("-D_REENTRANT")),
  497. ex_libs => add("-ldl",threads("-lpthread")),
  498. bn_ops => "SIXTY_FOUR_BIT",
  499. shared_cflag => "+Z",
  500. shared_ldflag => "+DD32 -b",
  501. shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
  502. multilib => "/hpux32",
  503. },
  504. # Frank Geurts <frank.geurts@nl.abnamro.com> has patiently assisted
  505. # with debugging of the following config.
  506. "hpux64-ia64-cc" => {
  507. inherit_from => [ "hpux-common", asm("ia64_asm") ],
  508. cc => "cc",
  509. cflags => combine(picker(default => "-Ae +DD64 +Olit=all -z -DB_ENDIAN",
  510. debug => "+O0 +d -g",
  511. release => "+O3"),
  512. threads("-D_REENTRANT")),
  513. ex_libs => add("-ldl", threads("-lpthread")),
  514. bn_ops => "SIXTY_FOUR_BIT_LONG",
  515. shared_cflag => "+Z",
  516. shared_ldflag => "+DD64 -b",
  517. shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
  518. multilib => "/hpux64",
  519. },
  520. # GCC builds...
  521. "hpux-ia64-gcc" => {
  522. inherit_from => [ "hpux-common", asm("ia64_asm") ],
  523. cc => "gcc",
  524. cflags => combine(picker(default => "-DB_ENDIAN",
  525. debug => "-O0 -g",
  526. release => "-O3"),
  527. threads("-pthread")),
  528. ex_libs => add("-ldl", threads("-pthread")),
  529. bn_ops => "SIXTY_FOUR_BIT",
  530. shared_cflag => "-fpic",
  531. shared_ldflag => "-shared",
  532. shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
  533. multilib => "/hpux32",
  534. },
  535. "hpux64-ia64-gcc" => {
  536. inherit_from => [ "hpux-common", asm("ia64_asm") ],
  537. cc => "gcc",
  538. cflags => combine(picker(default => "-mlp64 -DB_ENDIAN",
  539. debug => "-O0 -g",
  540. release => "-O3"),
  541. threads("-pthread")),
  542. ex_libs => add("-ldl", threads("-pthread")),
  543. bn_ops => "SIXTY_FOUR_BIT_LONG",
  544. shared_cflag => "-fpic",
  545. shared_ldflag => "-mlp64 -shared",
  546. shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
  547. multilib => "/hpux64",
  548. },
  549. #### HP MPE/iX http://jazz.external.hp.com/src/openssl/
  550. "MPE/iX-gcc" => {
  551. inherit_from => [ "BASE_unix" ],
  552. cc => "gcc",
  553. cflags => "-DBN_DIV2W -O3 -D_POSIX_SOURCE -D_SOCKET_SOURCE -I/SYSLOG/PUB",
  554. sys_id => "MPE",
  555. ex_libs => add("-L/SYSLOG/PUB -lsyslog -lsocket -lcurses"),
  556. thread_scheme => "(unknown)",
  557. bn_ops => "BN_LLONG",
  558. },
  559. #### DEC Alpha Tru64 targets. Tru64 is marketing name for OSF/1 version 4
  560. #### and forward. In reality 'uname -s' still returns "OSF1". Originally
  561. #### there were even osf1-* configs targeting prior versions provided,
  562. #### but not anymore...
  563. "tru64-alpha-gcc" => {
  564. inherit_from => [ "BASE_unix", asm("alpha_asm") ],
  565. cc => "gcc",
  566. cflags => combine("-std=c9x -D_XOPEN_SOURCE=500 -D_OSF_SOURCE -O3",
  567. threads("-pthread")),
  568. ex_libs => add("-lrt", threads("-pthread")), # for mlock(2)
  569. bn_ops => "SIXTY_FOUR_BIT_LONG",
  570. thread_scheme => "pthreads",
  571. dso_scheme => "dlfcn",
  572. shared_target => "alpha-osf1-shared",
  573. shared_extension => ".so",
  574. },
  575. "tru64-alpha-cc" => {
  576. inherit_from => [ "BASE_unix", asm("alpha_asm") ],
  577. cc => "cc",
  578. cflags => combine("-std1 -D_XOPEN_SOURCE=500 -D_OSF_SOURCE -tune host -fast -readonly_strings",
  579. threads("-pthread")),
  580. ex_libs => add("-lrt", threads("-pthread")), # for mlock(2)
  581. bn_ops => "SIXTY_FOUR_BIT_LONG",
  582. thread_scheme => "pthreads",
  583. dso_scheme => "dlfcn",
  584. shared_target => "alpha-osf1-shared",
  585. shared_ldflag => "-msym",
  586. shared_extension => ".so",
  587. },
  588. ####
  589. #### Variety of LINUX:-)
  590. ####
  591. # *-generic* is endian-neutral target, but ./config is free to
  592. # throw in -D[BL]_ENDIAN, whichever appropriate...
  593. "linux-generic32" => {
  594. inherit_from => [ "BASE_unix" ],
  595. cc => "gcc",
  596. cflags => combine(picker(default => "-Wall",
  597. debug => "-O0 -g",
  598. release => "-O3"),
  599. threads("-pthread")),
  600. ex_libs => add("-ldl", threads("-pthread")),
  601. bn_ops => "BN_LLONG RC4_CHAR",
  602. thread_scheme => "pthreads",
  603. dso_scheme => "dlfcn",
  604. shared_target => "linux-shared",
  605. shared_cflag => "-fPIC -DOPENSSL_USE_NODELETE",
  606. shared_ldflag => "-Wl,-znodelete",
  607. shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
  608. },
  609. "linux-generic64" => {
  610. inherit_from => [ "linux-generic32" ],
  611. bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
  612. },
  613. "linux-ppc" => {
  614. inherit_from => [ "linux-generic32", asm("ppc32_asm") ],
  615. perlasm_scheme => "linux32",
  616. },
  617. "linux-ppc64" => {
  618. inherit_from => [ "linux-generic64", asm("ppc64_asm") ],
  619. cflags => add("-m64 -DB_ENDIAN"),
  620. perlasm_scheme => "linux64",
  621. shared_ldflag => add("-m64"),
  622. multilib => "64",
  623. },
  624. "linux-ppc64le" => {
  625. inherit_from => [ "linux-generic64", asm("ppc64_asm") ],
  626. cflags => add("-m64 -DL_ENDIAN"),
  627. perlasm_scheme => "linux64le",
  628. shared_ldflag => add("-m64"),
  629. },
  630. "linux-armv4" => {
  631. ################################################################
  632. # Note that -march is not among compiler options in linux-armv4
  633. # target description. Not specifying one is intentional to give
  634. # you choice to:
  635. #
  636. # a) rely on your compiler default by not specifying one;
  637. # b) specify your target platform explicitly for optimal
  638. # performance, e.g. -march=armv6 or -march=armv7-a;
  639. # c) build "universal" binary that targets *range* of platforms
  640. # by specifying minimum and maximum supported architecture;
  641. #
  642. # As for c) option. It actually makes no sense to specify
  643. # maximum to be less than ARMv7, because it's the least
  644. # requirement for run-time switch between platform-specific
  645. # code paths. And without run-time switch performance would be
  646. # equivalent to one for minimum. Secondly, there are some
  647. # natural limitations that you'd have to accept and respect.
  648. # Most notably you can *not* build "universal" binary for
  649. # big-endian platform. This is because ARMv7 processor always
  650. # picks instructions in little-endian order. Another similar
  651. # limitation is that -mthumb can't "cross" -march=armv6t2
  652. # boundary, because that's where it became Thumb-2. Well, this
  653. # limitation is a bit artificial, because it's not really
  654. # impossible, but it's deemed too tricky to support. And of
  655. # course you have to be sure that your binutils are actually
  656. # up to the task of handling maximum target platform. With all
  657. # this in mind here is an example of how to configure
  658. # "universal" build:
  659. #
  660. # ./Configure linux-armv4 -march=armv6 -D__ARM_MAX_ARCH__=8
  661. #
  662. inherit_from => [ "linux-generic32", asm("armv4_asm") ],
  663. perlasm_scheme => "linux32",
  664. },
  665. "linux-aarch64" => {
  666. inherit_from => [ "linux-generic64", asm("aarch64_asm") ],
  667. perlasm_scheme => "linux64",
  668. },
  669. "linux-arm64ilp32" => { # https://wiki.linaro.org/Platform/arm64-ilp32
  670. inherit_from => [ "linux-generic32", asm("aarch64_asm") ],
  671. cflags => add("-mabi=ilp32"),
  672. bn_ops => "SIXTY_FOUR_BIT RC4_CHAR",
  673. perlasm_scheme => "linux64",
  674. shared_ldflag => add("-mabi=ilp32"),
  675. },
  676. "linux-mips32" => {
  677. # Configure script adds minimally required -march for assembly
  678. # support, if no -march was specified at command line.
  679. inherit_from => [ "linux-generic32", asm("mips32_asm") ],
  680. cflags => add("-mabi=32 -DBN_DIV3W"),
  681. perlasm_scheme => "o32",
  682. shared_ldflag => add("-mabi=32"),
  683. },
  684. # mips32 and mips64 below refer to contemporary MIPS Architecture
  685. # specifications, MIPS32 and MIPS64, rather than to kernel bitness.
  686. "linux-mips64" => {
  687. inherit_from => [ "linux-generic32", asm("mips64_asm") ],
  688. cflags => add("-mabi=n32 -DBN_DIV3W"),
  689. bn_ops => "SIXTY_FOUR_BIT RC4_CHAR",
  690. perlasm_scheme => "n32",
  691. shared_ldflag => add("-mabi=n32"),
  692. multilib => "32",
  693. },
  694. "linux64-mips64" => {
  695. inherit_from => [ "linux-generic64", asm("mips64_asm") ],
  696. cflags => add("-mabi=64 -DBN_DIV3W"),
  697. perlasm_scheme => "64",
  698. shared_ldflag => add("-mabi=64"),
  699. multilib => "64",
  700. },
  701. #### IA-32 targets...
  702. #### These two targets are a bit aged and are to be used on older Linux
  703. #### machines where gcc doesn't understand -m32 and -m64
  704. "linux-elf" => {
  705. inherit_from => [ "linux-generic32", asm("x86_elf_asm") ],
  706. cflags => add(picker(default => "-DL_ENDIAN",
  707. release => "-fomit-frame-pointer")),
  708. bn_ops => "BN_LLONG",
  709. },
  710. "linux-aout" => {
  711. inherit_from => [ "BASE_unix", asm("x86_asm") ],
  712. cc => "gcc",
  713. cflags => add(picker(default => "-DL_ENDIAN -Wall",
  714. debug => "-O0 -g",
  715. release => "-O3 -fomit-frame-pointer")),
  716. bn_ops => "BN_LLONG",
  717. thread_scheme => "(unknown)",
  718. perlasm_scheme => "a.out",
  719. },
  720. #### X86 / X86_64 targets
  721. "linux-x86" => {
  722. inherit_from => [ "linux-generic32", asm("x86_asm") ],
  723. cflags => add(picker(default => "-m32 -DL_ENDIAN",
  724. release => "-fomit-frame-pointer")),
  725. bn_ops => "BN_LLONG",
  726. perlasm_scheme => "elf",
  727. shared_ldflag => add("-m32"),
  728. },
  729. "linux-x86-clang" => {
  730. inherit_from => [ "linux-x86" ],
  731. cc => "clang",
  732. cxx => "clang++",
  733. cflags => add("-Wextra -Qunused-arguments"),
  734. },
  735. "linux-x86_64" => {
  736. inherit_from => [ "linux-generic64", asm("x86_64_asm") ],
  737. cflags => add("-m64 -DL_ENDIAN"),
  738. bn_ops => "SIXTY_FOUR_BIT_LONG",
  739. perlasm_scheme => "elf",
  740. shared_ldflag => add("-m64"),
  741. multilib => "64",
  742. },
  743. "linux-x86_64-clang" => {
  744. inherit_from => [ "linux-x86_64" ],
  745. cc => "clang",
  746. cflags => add("-Wextra -Qunused-arguments"),
  747. },
  748. "linux-x32" => {
  749. inherit_from => [ "linux-generic32", asm("x86_64_asm") ],
  750. cflags => add("-mx32 -DL_ENDIAN"),
  751. bn_ops => "SIXTY_FOUR_BIT",
  752. perlasm_scheme => "elf32",
  753. shared_ldflag => add("-mx32"),
  754. multilib => "x32",
  755. },
  756. "linux-ia64" => {
  757. inherit_from => [ "linux-generic64", asm("ia64_asm") ],
  758. bn_ops => "SIXTY_FOUR_BIT_LONG",
  759. },
  760. "linux64-s390x" => {
  761. inherit_from => [ "linux-generic64", asm("s390x_asm") ],
  762. cflags => add("-m64 -DB_ENDIAN"),
  763. perlasm_scheme => "64",
  764. shared_ldflag => add("-m64"),
  765. multilib => "64",
  766. },
  767. "linux32-s390x" => {
  768. #### So called "highgprs" target for z/Architecture CPUs
  769. # "Highgprs" is kernel feature first implemented in Linux
  770. # 2.6.32, see /proc/cpuinfo. The idea is to preserve most
  771. # significant bits of general purpose registers not only
  772. # upon 32-bit process context switch, but even on
  773. # asynchronous signal delivery to such process. This makes
  774. # it possible to deploy 64-bit instructions even in legacy
  775. # application context and achieve better [or should we say
  776. # adequate] performance. The build is binary compatible with
  777. # linux-generic32, and the idea is to be able to install the
  778. # resulting libcrypto.so alongside generic one, e.g. as
  779. # /lib/highgprs/libcrypto.so.x.y, for ldconfig and run-time
  780. # linker to autodiscover. Unfortunately it doesn't work just
  781. # yet, because of couple of bugs in glibc
  782. # sysdeps/s390/dl-procinfo.c affecting ldconfig and ld.so.1...
  783. #
  784. inherit_from => [ "linux-generic32", asm("s390x_asm") ],
  785. cflags => add("-m31 -Wa,-mzarch -DB_ENDIAN"),
  786. bn_asm_src => sub { my $r=join(" ",@_); $r=~s|asm/s390x\.S|bn_asm.c|; $r; },
  787. perlasm_scheme => "31",
  788. shared_ldflag => add("-m31"),
  789. multilib => "/highgprs",
  790. },
  791. #### SPARC Linux setups
  792. # Ray Miller <ray.miller@computing-services.oxford.ac.uk> has
  793. # patiently assisted with debugging of following two configs.
  794. "linux-sparcv8" => {
  795. inherit_from => [ "linux-generic32", asm("sparcv8_asm") ],
  796. cflags => add("-mcpu=v8 -DB_ENDIAN -DBN_DIV2W"),
  797. },
  798. "linux-sparcv9" => {
  799. # it's a real mess with -mcpu=ultrasparc option under Linux,
  800. # but -Wa,-Av8plus should do the trick no matter what.
  801. inherit_from => [ "linux-generic32", asm("sparcv9_asm") ],
  802. cflags => add("-m32 -mcpu=ultrasparc -Wa,-Av8plus -DB_ENDIAN -DBN_DIV2W"),
  803. shared_ldflag => add("-m32"),
  804. },
  805. "linux64-sparcv9" => {
  806. # GCC 3.1 is a requirement
  807. inherit_from => [ "linux-generic64", asm("sparcv9_asm") ],
  808. cflags => add("-m64 -mcpu=ultrasparc -DB_ENDIAN"),
  809. bn_ops => "BN_LLONG RC4_CHAR",
  810. shared_ldflag => add("-m64"),
  811. multilib => "64",
  812. },
  813. "linux-alpha-gcc" => {
  814. inherit_from => [ "linux-generic64", asm("alpha_asm") ],
  815. cflags => add("-DL_ENDIAN"),
  816. bn_ops => "SIXTY_FOUR_BIT_LONG",
  817. },
  818. "linux-c64xplus" => {
  819. inherit_from => [ "BASE_unix" ],
  820. # TI_CGT_C6000_7.3.x is a requirement
  821. cc => "cl6x",
  822. cflags => combine("--linux -ea=.s -eo=.o -mv6400+ -o2 -ox -ms -pden -DOPENSSL_SMALL_FOOTPRINT",
  823. threads("-D_REENTRANT")),
  824. bn_ops => "BN_LLONG",
  825. cpuid_asm_src => "c64xpluscpuid.s",
  826. bn_asm_src => "asm/bn-c64xplus.asm c64xplus-gf2m.s",
  827. aes_asm_src => "aes-c64xplus.s aes_cbc.c aes-ctr.fake",
  828. sha1_asm_src => "sha1-c64xplus.s sha256-c64xplus.s sha512-c64xplus.s",
  829. rc4_asm_src => "rc4-c64xplus.s",
  830. modes_asm_src => "ghash-c64xplus.s",
  831. chacha_asm_src => "chacha-c64xplus.s",
  832. poly1305_asm_src => "poly1305-c64xplus.s",
  833. thread_scheme => "pthreads",
  834. perlasm_scheme => "void",
  835. dso_scheme => "dlfcn",
  836. shared_target => "linux-shared",
  837. shared_cflag => "--pic",
  838. shared_ldflag => add("-z --sysv --shared"),
  839. shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
  840. ranlib => "true",
  841. },
  842. #### Android: linux-* but without pointers to headers and libs.
  843. #
  844. # It takes pair of prior-set environment variables to make it work:
  845. #
  846. # CROSS_SYSROOT=/some/where/android-ndk-<ver>/platforms/android-<apiver>/arch-<arch>
  847. # CROSS_COMPILE=<prefix>
  848. #
  849. # As well as PATH adjusted to cover ${CROSS_COMPILE}gcc and company.
  850. # For example to compile for ICS and ARM with NDK 10d, you'd:
  851. #
  852. # ANDROID_NDK=/some/where/android-ndk-10d
  853. # CROSS_SYSROOT=$ANDROID_NDK/platforms/android-14/arch-arm
  854. # CROSS_COMPILE=arm-linux-androideabi-
  855. # PATH=$ANDROID_NDK/toolchains/arm-linux-androideabi-4.8/prebuild/linux-x86_64/bin
  856. #
  857. "android" => {
  858. inherit_from => [ "linux-generic32" ],
  859. # Special note about unconditional -fPIC and -pie. The underlying
  860. # reason is that Lollipop refuses to run non-PIE. But what about
  861. # older systems and NDKs? -fPIC was never problem, so the only
  862. # concern is -pie. Older toolchains, e.g. r4, appear to handle it
  863. # and binaries turn mostly functional. "Mostly" means that oldest
  864. # Androids, such as Froyo, fail to handle executable, but newer
  865. # systems are perfectly capable of executing binaries targeting
  866. # Froyo. Keep in mind that in the nutshell Android builds are
  867. # about JNI, i.e. shared libraries, not applications.
  868. cflags => add(picker(default => "-mandroid -fPIC --sysroot=\$(CROSS_SYSROOT) -Wa,--noexecstack")),
  869. bin_cflags => "-pie",
  870. },
  871. "android-x86" => {
  872. inherit_from => [ "android", asm("x86_asm") ],
  873. cflags => add(picker(release => "-fomit-frame-pointer")),
  874. bn_ops => "BN_LLONG",
  875. perlasm_scheme => "android",
  876. },
  877. ################################################################
  878. # Contemporary Android applications can provide multiple JNI
  879. # providers in .apk, targeting multiple architectures. Among
  880. # them there is "place" for two ARM flavours: generic eabi and
  881. # armv7-a/hard-float. However, it should be noted that OpenSSL's
  882. # ability to engage NEON is not constrained by ABI choice, nor
  883. # is your ability to call OpenSSL from your application code
  884. # compiled with floating-point ABI other than default 'soft'.
  885. # [Latter thanks to __attribute__((pcs("aapcs"))) declaration.]
  886. # This means that choice of ARM libraries you provide in .apk
  887. # is driven by application needs. For example if application
  888. # itself benefits from NEON or is floating-point intensive, then
  889. # it might be appropriate to provide both libraries. Otherwise
  890. # just generic eabi would do. But in latter case it would be
  891. # appropriate to
  892. #
  893. # ./Configure android-armeabi -D__ARM_MAX_ARCH__=8
  894. #
  895. # in order to build "universal" binary and allow OpenSSL take
  896. # advantage of NEON when it's available.
  897. #
  898. "android-armeabi" => {
  899. inherit_from => [ "android", asm("armv4_asm") ],
  900. },
  901. "android-mips" => {
  902. inherit_from => [ "android", asm("mips32_asm") ],
  903. perlasm_scheme => "o32",
  904. },
  905. "android64" => {
  906. inherit_from => [ "linux-generic64" ],
  907. cflags => add(picker(default => "-mandroid -fPIC --sysroot=\$(CROSS_SYSROOT) -Wa,--noexecstack")),
  908. bin_cflags => "-pie",
  909. },
  910. "android64-aarch64" => {
  911. inherit_from => [ "android64", asm("aarch64_asm") ],
  912. perlasm_scheme => "linux64",
  913. },
  914. #### *BSD
  915. "BSD-generic32" => {
  916. # As for thread cflag. Idea is to maintain "collective" set of
  917. # flags, which would cover all BSD flavors. -pthread applies
  918. # to them all, but is treated differently. OpenBSD expands is
  919. # as -D_POSIX_THREAD -lc_r, which is sufficient. FreeBSD 4.x
  920. # expands it as -lc_r, which has to be accompanied by explicit
  921. # -D_THREAD_SAFE and sometimes -D_REENTRANT. FreeBSD 5.x
  922. # expands it as -lc_r, which seems to be sufficient?
  923. inherit_from => [ "BASE_unix" ],
  924. cc => "cc",
  925. cflags => combine(picker(default => "-Wall",
  926. debug => "-O0 -g",
  927. release => "-O3"),
  928. threads("-pthread -D_THREAD_SAFE -D_REENTRANT")),
  929. bn_ops => "BN_LLONG",
  930. thread_scheme => "pthreads",
  931. dso_scheme => "dlfcn",
  932. shared_target => "bsd-gcc-shared",
  933. shared_cflag => "-fPIC",
  934. shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
  935. },
  936. "BSD-generic64" => {
  937. inherit_from => [ "BSD-generic32" ],
  938. bn_ops => "SIXTY_FOUR_BIT_LONG",
  939. },
  940. "BSD-x86" => {
  941. inherit_from => [ "BSD-generic32", asm("x86_asm") ],
  942. cflags => add(picker(default => "-DL_ENDIAN",
  943. release => "-fomit-frame-pointer")),
  944. bn_ops => "BN_LLONG",
  945. shared_target => "bsd-shared",
  946. perlasm_scheme => "a.out",
  947. },
  948. "BSD-x86-elf" => {
  949. inherit_from => [ "BSD-x86" ],
  950. perlasm_scheme => "elf",
  951. },
  952. "BSD-sparcv8" => {
  953. inherit_from => [ "BSD-generic32", asm("sparcv8_asm") ],
  954. cflags => add("-mcpu=v8 -DB_ENDIAN"),
  955. },
  956. "BSD-sparc64" => {
  957. # -DMD32_REG_T=int doesn't actually belong in sparc64 target, it
  958. # simply *happens* to work around a compiler bug in gcc 3.3.3,
  959. # triggered by RIPEMD160 code.
  960. inherit_from => [ "BSD-generic64", asm("sparcv9_asm") ],
  961. cflags => add("-DB_ENDIAN -DMD32_REG_T=int"),
  962. bn_ops => "BN_LLONG",
  963. },
  964. "BSD-ia64" => {
  965. inherit_from => [ "BSD-generic64", asm("ia64_asm") ],
  966. cflags => add_before("-DL_ENDIAN"),
  967. bn_ops => "SIXTY_FOUR_BIT_LONG",
  968. },
  969. "BSD-x86_64" => {
  970. inherit_from => [ "BSD-generic64", asm("x86_64_asm") ],
  971. cflags => add_before("-DL_ENDIAN"),
  972. bn_ops => "SIXTY_FOUR_BIT_LONG",
  973. perlasm_scheme => "elf",
  974. },
  975. "bsdi-elf-gcc" => {
  976. inherit_from => [ "BASE_unix", asm("x86_elf_asm") ],
  977. cc => "gcc",
  978. cflags => "-DPERL5 -DL_ENDIAN -fomit-frame-pointer -O3 -Wall",
  979. ex_libs => add("-ldl"),
  980. bn_ops => "BN_LLONG",
  981. thread_scheme => "(unknown)",
  982. dso_scheme => "dlfcn",
  983. shared_target => "bsd-gcc-shared",
  984. shared_cflag => "-fPIC",
  985. shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
  986. },
  987. "nextstep" => {
  988. inherit_from => [ "BASE_unix" ],
  989. cc => "cc",
  990. cflags => "-O -Wall",
  991. unistd => "<libc.h>",
  992. bn_ops => "BN_LLONG",
  993. thread_scheme => "(unknown)",
  994. },
  995. "nextstep3.3" => {
  996. inherit_from => [ "BASE_unix" ],
  997. cc => "cc",
  998. cflags => "-O3 -Wall",
  999. unistd => "<libc.h>",
  1000. bn_ops => "BN_LLONG",
  1001. thread_scheme => "(unknown)",
  1002. },
  1003. # QNX
  1004. "qnx4" => {
  1005. inherit_from => [ "BASE_unix" ],
  1006. cc => "cc",
  1007. cflags => "-DL_ENDIAN -DTERMIO",
  1008. thread_scheme => "(unknown)",
  1009. },
  1010. "QNX6" => {
  1011. inherit_from => [ "BASE_unix" ],
  1012. cc => "gcc",
  1013. ex_libs => add("-lsocket"),
  1014. dso_scheme => "dlfcn",
  1015. shared_target => "bsd-gcc-shared",
  1016. shared_cflag => "-fPIC",
  1017. shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
  1018. },
  1019. "QNX6-i386" => {
  1020. inherit_from => [ "BASE_unix", asm("x86_elf_asm") ],
  1021. cc => "gcc",
  1022. cflags => "-DL_ENDIAN -O2 -Wall",
  1023. ex_libs => add("-lsocket"),
  1024. dso_scheme => "dlfcn",
  1025. shared_target => "bsd-gcc-shared",
  1026. shared_cflag => "-fPIC",
  1027. shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
  1028. },
  1029. #### SCO/Caldera targets.
  1030. #
  1031. # Originally we had like unixware-*, unixware-*-pentium, unixware-*-p6, etc.
  1032. # Now we only have blended unixware-* as it's the only one used by ./config.
  1033. # If you want to optimize for particular microarchitecture, bypass ./config
  1034. # and './Configure unixware-7 -Kpentium_pro' or whatever appropriate.
  1035. # Note that not all targets include assembler support. Mostly because of
  1036. # lack of motivation to support out-of-date platforms with out-of-date
  1037. # compiler drivers and assemblers. Tim Rice <tim@multitalents.net> has
  1038. # patiently assisted to debug most of it.
  1039. #
  1040. # UnixWare 2.0x fails destest with -O.
  1041. "unixware-2.0" => {
  1042. inherit_from => [ "BASE_unix" ],
  1043. cc => "cc",
  1044. cflags => combine("-DFILIO_H -DNO_STRINGS_H",
  1045. threads("-Kthread")),
  1046. ex_libs => add("-lsocket -lnsl -lresolv -lx"),
  1047. thread_scheme => "uithreads",
  1048. },
  1049. "unixware-2.1" => {
  1050. inherit_from => [ "BASE_unix" ],
  1051. cc => "cc",
  1052. cflags => combine("-O -DFILIO_H",
  1053. threads("-Kthread")),
  1054. ex_libs => add("-lsocket -lnsl -lresolv -lx"),
  1055. thread_scheme => "uithreads",
  1056. },
  1057. "unixware-7" => {
  1058. inherit_from => [ "BASE_unix", asm("x86_elf_asm") ],
  1059. cc => "cc",
  1060. cflags => combine("-O -DFILIO_H -Kalloca",
  1061. threads("-Kthread")),
  1062. ex_libs => add("-lsocket -lnsl"),
  1063. thread_scheme => "uithreads",
  1064. bn_ops => "BN_LLONG",
  1065. perlasm_scheme => "elf-1",
  1066. dso_scheme => "dlfcn",
  1067. shared_target => "svr5-shared",
  1068. shared_cflag => "-Kpic",
  1069. shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
  1070. },
  1071. "unixware-7-gcc" => {
  1072. inherit_from => [ "BASE_unix", asm("x86_elf_asm") ],
  1073. cc => "gcc",
  1074. cflags => combine("-DL_ENDIAN -DFILIO_H -O3 -fomit-frame-pointer -Wall",
  1075. threads("-D_REENTRANT")),
  1076. ex_libs => add("-lsocket -lnsl"),
  1077. bn_ops => "BN_LLONG",
  1078. thread_scheme => "pthreads",
  1079. perlasm_scheme => "elf-1",
  1080. dso_scheme => "dlfcn",
  1081. shared_target => "gnu-shared",
  1082. shared_cflag => "-fPIC",
  1083. shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
  1084. },
  1085. # SCO 5 - Ben Laurie <ben@algroup.co.uk> says the -O breaks the SCO cc.
  1086. "sco5-cc" => {
  1087. inherit_from => [ "BASE_unix", asm("x86_elf_asm") ],
  1088. cc => "cc",
  1089. cflags => "-belf",
  1090. ex_libs => add("-lsocket -lnsl"),
  1091. thread_scheme => "(unknown)",
  1092. perlasm_scheme => "elf-1",
  1093. dso_scheme => "dlfcn",
  1094. shared_target => "svr3-shared",
  1095. shared_cflag => "-Kpic",
  1096. shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
  1097. },
  1098. "sco5-gcc" => {
  1099. inherit_from => [ "BASE_unix", asm("x86_elf_asm") ],
  1100. cc => "gcc",
  1101. cflags => "-O3 -fomit-frame-pointer",
  1102. ex_libs => add("-lsocket -lnsl"),
  1103. bn_ops => "BN_LLONG",
  1104. thread_scheme => "(unknown)",
  1105. perlasm_scheme => "elf-1",
  1106. dso_scheme => "dlfcn",
  1107. shared_target => "svr3-shared",
  1108. shared_cflag => "-fPIC",
  1109. shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
  1110. },
  1111. #### IBM's AIX.
  1112. # Below targets assume AIX >=5. Caveat lector. If you are accustomed
  1113. # to control compilation "bitness" by setting $OBJECT_MODE environment
  1114. # variable, then you should know that in OpenSSL case it's considered
  1115. # only in ./config. Once configured, build procedure remains "deaf" to
  1116. # current value of $OBJECT_MODE.
  1117. "aix-gcc" => {
  1118. inherit_from => [ "BASE_unix", asm("ppc32_asm") ],
  1119. cc => "gcc",
  1120. cflags => combine(picker(default => "-DB_ENDIAN",
  1121. debug => "-O0 -g",
  1122. release => "-O"),
  1123. threads("-pthread")),
  1124. ex_libs => add(threads("-pthread")),
  1125. sys_id => "AIX",
  1126. bn_ops => "BN_LLONG RC4_CHAR",
  1127. thread_scheme => "pthreads",
  1128. perlasm_scheme => "aix32",
  1129. dso_scheme => "dlfcn",
  1130. shared_target => "aix-shared",
  1131. shared_ldflag => "-shared -static-libgcc -Wl,-G",
  1132. shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
  1133. arflags => "-X32",
  1134. },
  1135. "aix64-gcc" => {
  1136. inherit_from => [ "BASE_unix", asm("ppc64_asm") ],
  1137. cc => "gcc",
  1138. cflags => combine(picker(default => "-maix64 -DB_ENDIAN",
  1139. debug => "-O0 -g",
  1140. release => "-O"),
  1141. threads("-pthread")),
  1142. ex_libs => add(threads("-pthread")),
  1143. sys_id => "AIX",
  1144. bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
  1145. thread_scheme => "pthreads",
  1146. perlasm_scheme => "aix64",
  1147. dso_scheme => "dlfcn",
  1148. shared_target => "aix-shared",
  1149. shared_ldflag => "-maix64 -shared -static-libgcc -Wl,-G",
  1150. shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
  1151. arflags => "-X64",
  1152. },
  1153. "aix-cc" => {
  1154. inherit_from => [ "BASE_unix", asm("ppc32_asm") ],
  1155. cc => "cc",
  1156. cflags => combine(picker(default => "-q32 -DB_ENDIAN -qmaxmem=16384 -qro -qroconst",
  1157. debug => "-O0 -g",
  1158. release => "-O"),
  1159. threads("-qthreaded -D_THREAD_SAFE")),
  1160. sys_id => "AIX",
  1161. bn_ops => "BN_LLONG RC4_CHAR",
  1162. thread_scheme => "pthreads",
  1163. ex_libs => threads("-lpthreads"),
  1164. perlasm_scheme => "aix32",
  1165. dso_scheme => "dlfcn",
  1166. shared_target => "aix-shared",
  1167. shared_cflag => "-qpic",
  1168. shared_ldflag => "-q32 -G",
  1169. shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
  1170. arflags => "-X 32",
  1171. },
  1172. "aix64-cc" => {
  1173. inherit_from => [ "BASE_unix", asm("ppc64_asm") ],
  1174. cc => "cc",
  1175. cflags => combine(picker(default => "-q64 -DB_ENDIAN -qmaxmem=16384 -qro -qroconst",
  1176. debug => "-O0 -g",
  1177. release => "-O"),
  1178. threads("-qthreaded -D_THREAD_SAFE")),
  1179. sys_id => "AIX",
  1180. bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
  1181. thread_scheme => "pthreads",
  1182. ex_libs => threads("-lpthreads"),
  1183. perlasm_scheme => "aix64",
  1184. dso_scheme => "dlfcn",
  1185. shared_target => "aix-shared",
  1186. shared_cflag => "-qpic",
  1187. shared_ldflag => "-q64 -G",
  1188. shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
  1189. arflags => "-X 64",
  1190. },
  1191. # SIEMENS BS2000/OSD: an EBCDIC-based mainframe
  1192. "BS2000-OSD" => {
  1193. inherit_from => [ "BASE_unix" ],
  1194. cc => "c89",
  1195. cflags => "-O -XLLML -XLLMK -XL -DB_ENDIAN -DCHARSET_EBCDIC",
  1196. ex_libs => add("-lsocket -lnsl"),
  1197. bn_ops => "THIRTY_TWO_BIT RC4_CHAR",
  1198. thread_scheme => "(unknown)",
  1199. },
  1200. #### Visual C targets
  1201. #
  1202. # Win64 targets, WIN64I denotes IA-64 and WIN64A - AMD64
  1203. #
  1204. # Note about -wd4090, disable warning C4090. This warning returns false
  1205. # positives in some situations. Disabling it altogether masks both
  1206. # legitimate and false cases, but as we compile on multiple platforms,
  1207. # we rely on other compilers to catch legitimate cases.
  1208. #
  1209. # Also note that we force threads no matter what. Configuring "no-threads"
  1210. # is ignored.
  1211. "VC-common" => {
  1212. inherit_from => [ "BASE_Windows" ],
  1213. template => 1,
  1214. cc => "cl",
  1215. cflags => "-W3 -wd4090 -Gs0 -GF -Gy -nologo -DOPENSSL_SYS_WIN32 -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -D_CRT_SECURE_NO_DEPRECATE",
  1216. defines => add(sub { my @defs = ();
  1217. unless ($disabled{"zlib-dynamic"}) {
  1218. my $zlib =
  1219. $withargs{zlib_lib} // "ZLIB1";
  1220. push @defs,
  1221. quotify("perl",
  1222. 'LIBZ="' . $zlib . '"');
  1223. }
  1224. return [ @defs ];
  1225. }),
  1226. coutflag => "/Fo",
  1227. lib_cflags => add("/Zi /Fdossl_static"),
  1228. dso_cflags => "/Zi /Fddso",
  1229. bin_cflags => "/Zi /Fdapp",
  1230. lflags => add("/debug"),
  1231. shared_ldflag => "/dll",
  1232. shared_target => "win-shared", # meaningless except it gives Configure a hint
  1233. thread_scheme => "winthreads",
  1234. dso_scheme => "win32",
  1235. apps_aux_src => add("win32_init.c"),
  1236. },
  1237. "VC-noCE-common" => {
  1238. inherit_from => [ "VC-common" ],
  1239. template => 1,
  1240. cflags => add(picker(default => "-DUNICODE -D_UNICODE",
  1241. debug =>
  1242. sub {
  1243. ($disabled{shared} ? "" : "/MDd")
  1244. ." /Od -DDEBUG -D_DEBUG";
  1245. },
  1246. release =>
  1247. sub {
  1248. ($disabled{shared} ? "" : "/MD")
  1249. ." /O2";
  1250. })),
  1251. lib_cflags => add(sub { $disabled{shared} ? "/MT /Zl" : () }),
  1252. # Following might/should appears controversial, i.e. defining
  1253. # /MDd without evaluating $disabled{shared}. It works in
  1254. # non-shared build because static library is compiled with /Zl
  1255. # and bares no reference to specific RTL. And it works in
  1256. # shared build because multiple /MDd options are not prohibited.
  1257. # But why /MDd in static build? Well, basically this is just a
  1258. # reference point, which allows to catch eventual errors that
  1259. # would prevent those who want to wrap OpenSSL into own .DLL.
  1260. # Why not /MD in release build then? Well, some are likely to
  1261. # prefer [non-debug] openssl.exe to be free from Micorosoft RTL
  1262. # redistributable.
  1263. bin_cflags => add(picker(debug => "/MDd",
  1264. release => sub { $disabled{shared} ? "/MT" : () },
  1265. )),
  1266. bin_lflags => add("/subsystem:console /opt:ref"),
  1267. ex_libs => add(sub {
  1268. my @ex_libs = ();
  1269. push @ex_libs, 'ws2_32.lib' unless $disabled{sock};
  1270. push @ex_libs, 'gdi32.lib advapi32.lib crypt32.lib user32.lib';
  1271. return join(" ", @ex_libs);
  1272. }),
  1273. },
  1274. "VC-WIN64-common" => {
  1275. inherit_from => [ "VC-noCE-common" ],
  1276. template => 1,
  1277. ex_libs => add(sub {
  1278. my @ex_libs = ();
  1279. push @ex_libs, 'bufferoverflowu.lib' if (`cl 2>&1` =~ /14\.00\.4[0-9]{4}\./);
  1280. return join(" ", @_, @ex_libs);
  1281. }),
  1282. bn_ops => "SIXTY_FOUR_BIT EXPORT_VAR_AS_FN",
  1283. build_scheme => add("VC-W64", { separator => undef }),
  1284. },
  1285. "VC-WIN64I" => {
  1286. inherit_from => [ "VC-WIN64-common", asm("ia64_asm"),
  1287. sub { $disabled{shared} ? () : "ia64_uplink" } ],
  1288. as => "ias",
  1289. asflags => "-d debug",
  1290. asoutflag => "-o",
  1291. sys_id => "WIN64I",
  1292. bn_asm_src => sub { return undef unless @_;
  1293. my $r=join(" ",@_); $r=~s|bn-ia64.s|bn_asm.c|; $r; },
  1294. perlasm_scheme => "ias",
  1295. multilib => "-ia64",
  1296. },
  1297. "VC-WIN64A" => {
  1298. inherit_from => [ "VC-WIN64-common", asm("x86_64_asm"),
  1299. sub { $disabled{shared} ? () : "x86_64_uplink" } ],
  1300. as => sub { vc_win64a_info()->{as} },
  1301. asflags => sub { vc_win64a_info()->{asflags} },
  1302. asoutflag => sub { vc_win64a_info()->{asoutflag} },
  1303. sys_id => "WIN64A",
  1304. bn_asm_src => sub { return undef unless @_;
  1305. my $r=join(" ",@_); $r=~s|asm/x86_64-gcc|bn_asm|; $r; },
  1306. perlasm_scheme => "auto",
  1307. multilib => "-x64",
  1308. },
  1309. "VC-WIN32" => {
  1310. # x86 Win32 target defaults to ANSI API, if you want UNICODE,
  1311. # configure with 'perl Configure VC-WIN32 -DUNICODE -D_UNICODE'
  1312. inherit_from => [ "VC-noCE-common", asm("x86_asm"),
  1313. sub { $disabled{shared} ? () : "uplink_common" } ],
  1314. as => sub { vc_win32_info()->{as} },
  1315. asflags => sub { vc_win32_info()->{asflags} },
  1316. asoutflag => sub { vc_win32_info()->{asoutflag} },
  1317. ex_libs => add(sub {
  1318. my @ex_libs = ();
  1319. # WIN32 UNICODE build gets linked with unicows.lib for
  1320. # backward compatibility with Win9x.
  1321. push @ex_libs, 'unicows.lib'
  1322. if (grep { $_ eq "UNICODE" } @user_defines);
  1323. return join(" ", @ex_libs, @_);
  1324. }),
  1325. sys_id => "WIN32",
  1326. bn_ops => "BN_LLONG EXPORT_VAR_AS_FN",
  1327. perlasm_scheme => sub { vc_win32_info()->{perlasm_scheme} },
  1328. build_scheme => add("VC-W32", { separator => undef }),
  1329. },
  1330. "VC-CE" => {
  1331. inherit_from => [ "VC-common" ],
  1332. as => "ml",
  1333. asflags => "/nologo /Cp /coff /c /Cx /Zi",
  1334. asoutflag => "/Fo",
  1335. cc => "cl",
  1336. cflags =>
  1337. picker(default =>
  1338. combine('/W3 /WX /GF /Gy /nologo -DUNICODE -D_UNICODE -DOPENSSL_SYS_WINCE -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -DDSO_WIN32 -DNO_CHMOD -DOPENSSL_SMALL_FOOTPRINT',
  1339. sub { vc_wince_info()->{cflags}; },
  1340. sub { defined($ENV{'WCECOMPAT'})
  1341. ? '-I$(WCECOMPAT)/include' : (); },
  1342. sub { defined($ENV{'PORTSDK_LIBPATH'})
  1343. ? '-I$(PORTSDK_LIBPATH)/../../include' : (); },
  1344. sub { `cl 2>&1` =~ /Version ([0-9]+)\./ && $1>=14
  1345. ? ($disabled{shared} ? " /MT" : " /MD")
  1346. : " /MC"; }),
  1347. debug => "/Od -DDEBUG -D_DEBUG",
  1348. release => "/O1i"),
  1349. lflags => combine("/nologo /opt:ref",
  1350. sub { vc_wince_info()->{lflags}; },
  1351. sub { defined($ENV{PORTSDK_LIBPATH})
  1352. ? "/entry:mainCRTstartup" : (); }),
  1353. sys_id => "WINCE",
  1354. bn_ops => "BN_LLONG EXPORT_VAR_AS_FN",
  1355. ex_libs => add(sub {
  1356. my @ex_libs = ();
  1357. push @ex_libs, 'ws2.lib' unless $disabled{sock};
  1358. push @ex_libs, 'crypt32.lib';
  1359. if (defined($ENV{WCECOMPAT})) {
  1360. my $x = '$(WCECOMPAT)/lib';
  1361. if (-f "$x/$ENV{TARGETCPU}/wcecompatex.lib") {
  1362. $x .= '/$(TARGETCPU)/wcecompatex.lib';
  1363. } else {
  1364. $x .= '/wcecompatex.lib';
  1365. }
  1366. push @ex_libs, $x;
  1367. }
  1368. push @ex_libs, '$(PORTSDK_LIBPATH)/portlib.lib'
  1369. if (defined($ENV{'PORTSDK_LIBPATH'}));
  1370. push @ex_libs, ' /nodefaultlib coredll.lib corelibc.lib'
  1371. if ($ENV{'TARGETCPU'} eq "X86");
  1372. return @ex_libs;
  1373. }),
  1374. build_scheme => add("VC-WCE", { separator => undef }),
  1375. },
  1376. #### MinGW
  1377. "mingw" => {
  1378. inherit_from => [ "BASE_unix", asm("x86_asm"),
  1379. sub { $disabled{shared} ? () : "x86_uplink" } ],
  1380. cc => "gcc",
  1381. cflags => combine(picker(default => "-DL_ENDIAN -DWIN32_LEAN_AND_MEAN -DUNICODE -D_UNICODE -m32 -Wall",
  1382. debug => "-g -O0",
  1383. release => "-O3 -fomit-frame-pointer"),
  1384. threads("-D_MT")),
  1385. sys_id => "MINGW32",
  1386. ex_libs => add("-lws2_32 -lgdi32 -lcrypt32"),
  1387. bn_ops => "BN_LLONG EXPORT_VAR_AS_FN",
  1388. thread_scheme => "winthreads",
  1389. perlasm_scheme => "coff",
  1390. dso_scheme => "win32",
  1391. shared_target => "mingw-shared",
  1392. shared_cflag => add("-D_WINDLL"),
  1393. shared_ldflag => "-static-libgcc",
  1394. shared_rcflag => "--target=pe-i386",
  1395. shared_extension => ".dll",
  1396. multilib => "",
  1397. apps_aux_src => add("win32_init.c"),
  1398. build_scheme => add("mingw", { separator => undef }),
  1399. },
  1400. "mingw64" => {
  1401. # As for OPENSSL_USE_APPLINK. Applink makes it possible to use
  1402. # .dll compiled with one compiler with application compiled with
  1403. # another compiler. It's possible to engage Applink support in
  1404. # mingw64 build, but it's not done, because till mingw64
  1405. # supports structured exception handling, one can't seriously
  1406. # consider its binaries for using with non-mingw64 run-time
  1407. # environment. And as mingw64 is always consistent with itself,
  1408. # Applink is never engaged and can as well be omitted.
  1409. inherit_from => [ "BASE_unix", asm("x86_64_asm") ],
  1410. cc => "gcc",
  1411. cflags => combine(picker(default => "-DL_ENDIAN -DWIN32_LEAN_AND_MEAN -DUNICODE -D_UNICODE -m64 -Wall",
  1412. debug => "-g -O0",
  1413. release => "-O3"),
  1414. threads("-D_MT")),
  1415. sys_id => "MINGW64",
  1416. ex_libs => add("-lws2_32 -lgdi32 -lcrypt32"),
  1417. bn_ops => "SIXTY_FOUR_BIT EXPORT_VAR_AS_FN",
  1418. thread_scheme => "winthreads",
  1419. perlasm_scheme => "mingw64",
  1420. dso_scheme => "win32",
  1421. shared_target => "mingw-shared",
  1422. shared_cflag => add("-D_WINDLL"),
  1423. shared_ldflag => "-static-libgcc",
  1424. shared_rcflag => "--target=pe-x86-64",
  1425. shared_extension => ".dll",
  1426. multilib => "64",
  1427. apps_aux_src => add("win32_init.c"),
  1428. build_scheme => add("mingw64", { separator => undef }),
  1429. },
  1430. #### UEFI
  1431. "UEFI" => {
  1432. inherit_from => [ "BASE_unix" ],
  1433. cc => "cc",
  1434. cflags => "-DL_ENDIAN -O",
  1435. sys_id => "UEFI",
  1436. },
  1437. #### UWIN
  1438. "UWIN" => {
  1439. inherit_from => [ "BASE_unix" ],
  1440. cc => "cc",
  1441. cflags => "-DTERMIOS -DL_ENDIAN -O -Wall",
  1442. sys_id => "UWIN",
  1443. bn_ops => "BN_LLONG",
  1444. dso_scheme => "win32",
  1445. },
  1446. #### Cygwin
  1447. "Cygwin-x86" => {
  1448. inherit_from => [ "BASE_unix", asm("x86_asm") ],
  1449. cc => "gcc",
  1450. cflags => picker(default => "-DTERMIOS -DL_ENDIAN -Wall",
  1451. debug => "-g -O0",
  1452. release => "-O3 -fomit-frame-pointer"),
  1453. sys_id => "CYGWIN",
  1454. bn_ops => "BN_LLONG",
  1455. thread_scheme => "pthread",
  1456. perlasm_scheme => "coff",
  1457. dso_scheme => "dlfcn",
  1458. shared_target => "cygwin-shared",
  1459. shared_cflag => "-D_WINDLL",
  1460. shared_ldflag => "-shared",
  1461. shared_extension => ".dll",
  1462. },
  1463. "Cygwin-x86_64" => {
  1464. inherit_from => [ "BASE_unix", asm("x86_64_asm") ],
  1465. cc => "gcc",
  1466. cflags => picker(default => "-DTERMIOS -DL_ENDIAN -Wall",
  1467. debug => "-g -O0",
  1468. release => "-O3"),
  1469. sys_id => "CYGWIN",
  1470. bn_ops => "SIXTY_FOUR_BIT_LONG",
  1471. thread_scheme => "pthread",
  1472. perlasm_scheme => "mingw64",
  1473. dso_scheme => "dlfcn",
  1474. shared_target => "cygwin-shared",
  1475. shared_cflag => "-D_WINDLL",
  1476. shared_ldflag => "-shared",
  1477. shared_extension => ".dll",
  1478. },
  1479. # Backward compatibility for those using this target
  1480. "Cygwin" => {
  1481. inherit_from => [ "Cygwin-x86" ]
  1482. },
  1483. # In case someone constructs the Cygwin target name themself
  1484. "Cygwin-i386" => {
  1485. inherit_from => [ "Cygwin-x86" ]
  1486. },
  1487. "Cygwin-i486" => {
  1488. inherit_from => [ "Cygwin-x86" ]
  1489. },
  1490. "Cygwin-i586" => {
  1491. inherit_from => [ "Cygwin-x86" ]
  1492. },
  1493. "Cygwin-i686" => {
  1494. inherit_from => [ "Cygwin-x86" ]
  1495. },
  1496. ##### MacOS X (a.k.a. Darwin) setup
  1497. "darwin-common" => {
  1498. inherit_from => [ "BASE_unix" ],
  1499. template => 1,
  1500. cc => "cc",
  1501. cflags => combine(picker(default => "",
  1502. debug => "-g -O0",
  1503. release => "-O3"),
  1504. threads("-D_REENTRANT")),
  1505. sys_id => "MACOSX",
  1506. plib_lflags => "-Wl,-search_paths_first",
  1507. bn_ops => "BN_LLONG RC4_CHAR",
  1508. thread_scheme => "pthreads",
  1509. perlasm_scheme => "osx32",
  1510. dso_scheme => "dlfcn",
  1511. ranlib => "ranlib -c",
  1512. shared_target => "darwin-shared",
  1513. shared_cflag => "-fPIC",
  1514. shared_ldflag => "-dynamiclib",
  1515. shared_extension => ".\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
  1516. },
  1517. # Option "freeze" such as -std=gnu9x can't negatively interfere
  1518. # with future defaults for below two targets, because MacOS X
  1519. # for PPC has no future, it was discontinued by vendor in 2009.
  1520. "darwin-ppc-cc" => {
  1521. inherit_from => [ "darwin-common", asm("ppc32_asm") ],
  1522. cflags => add("-arch ppc -std=gnu9x -DB_ENDIAN -Wa,-force_cpusubtype_ALL"),
  1523. perlasm_scheme => "osx32",
  1524. shared_cflag => add("-fno-common"),
  1525. shared_ldflag => "-arch ppc -dynamiclib",
  1526. },
  1527. "darwin64-ppc-cc" => {
  1528. inherit_from => [ "darwin-common", asm("ppc64_asm") ],
  1529. cflags => add("-arch ppc64 -std=gnu9x -DB_ENDIAN"),
  1530. bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
  1531. perlasm_scheme => "osx64",
  1532. shared_ldflag => "-arch ppc64 -dynamiclib",
  1533. },
  1534. "darwin-i386-cc" => {
  1535. inherit_from => [ "darwin-common", asm("x86_asm") ],
  1536. cflags => add(picker(default => "-arch i386 -DL_ENDIAN",
  1537. release => "-fomit-frame-pointer")),
  1538. bn_ops => "BN_LLONG RC4_INT",
  1539. perlasm_scheme => "macosx",
  1540. shared_ldflag => "-arch i386 -dynamiclib",
  1541. },
  1542. "darwin64-x86_64-cc" => {
  1543. inherit_from => [ "darwin-common", asm("x86_64_asm") ],
  1544. cflags => add("-arch x86_64 -DL_ENDIAN -Wall"),
  1545. bn_ops => "SIXTY_FOUR_BIT_LONG",
  1546. perlasm_scheme => "macosx",
  1547. shared_ldflag => "-arch x86_64 -dynamiclib",
  1548. },
  1549. #### iPhoneOS/iOS
  1550. #
  1551. # It takes three prior-set environment variables to make it work:
  1552. #
  1553. # CROSS_COMPILE=/where/toolchain/is/usr/bin/ [note ending slash]
  1554. # CROSS_TOP=/where/SDKs/are
  1555. # CROSS_SDK=iPhoneOSx.y.sdk
  1556. #
  1557. # Exact paths vary with Xcode releases, but for couple of last ones
  1558. # they would look like this:
  1559. #
  1560. # CROSS_COMPILE=`xcode-select --print-path`/Toolchains/XcodeDefault.xctoolchain/usr/bin/
  1561. # CROSS_TOP=`xcode-select --print-path`/Platforms/iPhoneOS.platform/Developer
  1562. # CROSS_SDK=iPhoneOS.sdk
  1563. #
  1564. "iphoneos-cross" => {
  1565. inherit_from => [ "darwin-common" ],
  1566. cflags => add("-isysroot \$(CROSS_TOP)/SDKs/\$(CROSS_SDK) -fno-common"),
  1567. sys_id => "iOS",
  1568. },
  1569. "ios-cross" => {
  1570. inherit_from => [ "darwin-common", asm("armv4_asm") ],
  1571. # It should be possible to go below iOS 6 and even add -arch armv6,
  1572. # thus targeting iPhone pre-3GS, but it's assumed to be irrelevant
  1573. # at this point.
  1574. cflags => add("-arch armv7 -mios-version-min=6.0.0 -isysroot \$(CROSS_TOP)/SDKs/\$(CROSS_SDK) -fno-common"),
  1575. sys_id => "iOS",
  1576. perlasm_scheme => "ios32",
  1577. },
  1578. "ios64-cross" => {
  1579. inherit_from => [ "darwin-common", asm("aarch64_asm") ],
  1580. cflags => add("-arch arm64 -mios-version-min=7.0.0 -isysroot \$(CROSS_TOP)/SDKs/\$(CROSS_SDK) -fno-common"),
  1581. sys_id => "iOS",
  1582. bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
  1583. perlasm_scheme => "ios64",
  1584. },
  1585. ##### GNU Hurd
  1586. "hurd-x86" => {
  1587. inherit_from => [ "BASE_unix" ],
  1588. inherit_from => [ asm("x86_elf_asm") ],
  1589. cc => "gcc",
  1590. cflags => combine("-DL_ENDIAN -O3 -fomit-frame-pointer -Wall",
  1591. threads("-pthread")),
  1592. ex_libs => add("-ldl", threads("-pthread")),
  1593. bn_ops => "BN_LLONG",
  1594. thread_scheme => "pthreads",
  1595. dso_scheme => "dlfcn",
  1596. shared_target => "linux-shared",
  1597. shared_cflag => "-fPIC",
  1598. shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
  1599. },
  1600. ##### VxWorks for various targets
  1601. "vxworks-ppc60x" => {
  1602. inherit_from => [ "BASE_unix" ],
  1603. cc => "ccppc",
  1604. 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",
  1605. sys_id => "VXWORKS",
  1606. ex_libs => add("-Wl,--defsym,__wrs_rtp_base=0xe0000000 -L \$(WIND_BASE)/target/usr/lib/ppc/PPC32/common"),
  1607. },
  1608. "vxworks-ppcgen" => {
  1609. inherit_from => [ "BASE_unix" ],
  1610. cc => "ccppc",
  1611. 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",
  1612. sys_id => "VXWORKS",
  1613. ex_libs => add("-Wl,--defsym,__wrs_rtp_base=0xe0000000 -L \$(WIND_BASE)/target/usr/lib/ppc/PPC32/sfcommon"),
  1614. },
  1615. "vxworks-ppc405" => {
  1616. inherit_from => [ "BASE_unix" ],
  1617. cc => "ccppc",
  1618. cflags => "-g -msoft-float -mlongcall -DCPU=PPC405 -I\$(WIND_BASE)/target/h",
  1619. sys_id => "VXWORKS",
  1620. lflags => "-r",
  1621. },
  1622. "vxworks-ppc750" => {
  1623. inherit_from => [ "BASE_unix" ],
  1624. cc => "ccppc",
  1625. 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)",
  1626. sys_id => "VXWORKS",
  1627. lflags => "-r",
  1628. },
  1629. "vxworks-ppc750-debug" => {
  1630. inherit_from => [ "BASE_unix" ],
  1631. cc => "ccppc",
  1632. 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 -DPEDANTIC -DDEBUG -g",
  1633. sys_id => "VXWORKS",
  1634. lflags => "-r",
  1635. },
  1636. "vxworks-ppc860" => {
  1637. inherit_from => [ "BASE_unix" ],
  1638. cc => "ccppc",
  1639. cflags => "-nostdinc -msoft-float -DCPU=PPC860 -DNO_STRINGS_H -I\$(WIND_BASE)/target/h",
  1640. sys_id => "VXWORKS",
  1641. lflags => "-r",
  1642. },
  1643. "vxworks-simlinux" => {
  1644. inherit_from => [ "BASE_unix" ],
  1645. cc => "ccpentium",
  1646. 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",
  1647. sys_id => "VXWORKS",
  1648. lflags => "-r",
  1649. ranlib => "ranlibpentium",
  1650. },
  1651. "vxworks-mips" => {
  1652. inherit_from => [ "BASE_unix", asm("mips32_asm") ],
  1653. cc => "ccmips",
  1654. 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",
  1655. threads("-D_REENTRANT")),
  1656. sys_id => "VXWORKS",
  1657. ex_libs => add("-Wl,--defsym,__wrs_rtp_base=0xe0000000 -L \$(WIND_BASE)/target/usr/lib/mips/MIPSI32/sfcommon"),
  1658. thread_scheme => "pthreads",
  1659. perlasm_scheme => "o32",
  1660. ranlib => "ranlibmips",
  1661. },
  1662. #### uClinux
  1663. "uClinux-dist" => {
  1664. inherit_from => [ "BASE_unix" ],
  1665. cc => "$ENV{'CC'}",
  1666. cflags => combine(threads("-D_REENTRANT")),
  1667. ex_libs => add("\$(LDLIBS)"),
  1668. bn_ops => "BN_LLONG",
  1669. thread_scheme => "pthreads",
  1670. dso_scheme => "$ENV{'LIBSSL_dlfcn'}",
  1671. shared_target => "linux-shared",
  1672. shared_cflag => "-fPIC",
  1673. shared_ldflag => "-shared",
  1674. shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
  1675. ranlib => "$ENV{'RANLIB'}",
  1676. },
  1677. "uClinux-dist64" => {
  1678. inherit_from => [ "BASE_unix" ],
  1679. cc => "$ENV{'CC'}",
  1680. cflags => combine(threads("-D_REENTRANT")),
  1681. ex_libs => add("\$(LDLIBS)"),
  1682. bn_ops => "SIXTY_FOUR_BIT_LONG",
  1683. thread_scheme => "pthreads",
  1684. dso_scheme => "$ENV{'LIBSSL_dlfcn'}",
  1685. shared_target => "linux-shared",
  1686. shared_cflag => "-fPIC",
  1687. shared_ldflag => "-shared",
  1688. shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
  1689. ranlib => "$ENV{'RANLIB'}",
  1690. },
  1691. ##### VMS
  1692. "vms-generic" => {
  1693. inherit_from => [ "BASE_VMS" ],
  1694. template => 1,
  1695. cc => "CC/DECC",
  1696. cflags => picker(default => "/STANDARD=(ISOC94,RELAXED)/NOLIST/PREFIX=ALL",
  1697. debug => "/NOOPTIMIZE/DEBUG",
  1698. release => "/OPTIMIZE/NODEBUG"),
  1699. defines => add("OPENSSL_USE_NODELETE"),
  1700. lflags => picker(default => "/MAP",
  1701. debug => "/DEBUG/TRACEBACK",
  1702. release => "/NODEBUG/NOTRACEBACK"),
  1703. lib_cflags => add("/NAMES=(AS_IS,SHORTENED)/EXTERN_MODEL=STRICT_REFDEF"),
  1704. dso_cflags => add("/NAMES=(AS_IS,SHORTENED)"),
  1705. shared_target => "vms-shared",
  1706. dso_scheme => "vms",
  1707. thread_scheme => "pthreads",
  1708. apps_aux_src => "vms_decc_init.c vms_term_sock.c",
  1709. },
  1710. "vms-alpha" => {
  1711. inherit_from => [ "vms-generic" ],
  1712. cflags => add(sub { my @warnings =
  1713. @{vms_info(0)->{disable_warns}};
  1714. @warnings
  1715. ? "/WARNINGS=DISABLE=(".join(",",@warnings).")" : (); }),
  1716. defines =>
  1717. add(sub {
  1718. return vms_info(0)->{def_zlib}
  1719. ? "LIBZ=\"\"\"".vms_info(0)->{def_zlib}."\"\"\"" : ();
  1720. }),
  1721. ex_libs => add(sub { return vms_info(0)->{zlib} || (); }),
  1722. pointer_size => sub { return vms_info(0)->{pointer_size} },
  1723. #as => "???",
  1724. #debug_aflags => "/NOOPTIMIZE/DEBUG",
  1725. #release_aflags => "/OPTIMIZE/NODEBUG",
  1726. bn_opts => "SIXTY_FOUR_BIT RC4_INT",
  1727. },
  1728. "vms-alpha-p32" => {
  1729. inherit_from => [ "vms-generic" ],
  1730. cflags =>
  1731. add("/POINTER_SIZE=32",
  1732. sub { my @warnings =
  1733. @{vms_info(32)->{disable_warns}};
  1734. @warnings
  1735. ? "/WARNINGS=DISABLE=(".join(",",@warnings).")" : ();
  1736. } ),
  1737. defines =>
  1738. add(sub {
  1739. return vms_info(32)->{def_zlib}
  1740. ? "LIBZ=\"\"\"".vms_info(32)->{def_zlib}."\"\"\"" : ();
  1741. }),
  1742. ex_libs => add(sub { return vms_info(32)->{zlib} || (); }),
  1743. pointer_size => sub { return vms_info(32)->{pointer_size} },
  1744. },
  1745. "vms-alpha-p64" => {
  1746. inherit_from => [ "vms-generic" ],
  1747. cflags =>
  1748. add("/POINTER_SIZE=64=ARGV",
  1749. sub { my @warnings =
  1750. @{vms_info(64)->{disable_warns}};
  1751. @warnings
  1752. ? "/WARNINGS=DISABLE=(".join(",",@warnings).")" : ();
  1753. } ),
  1754. defines =>
  1755. add(sub {
  1756. return vms_info(64)->{def_zlib}
  1757. ? "LIBZ=\"\"\"".vms_info(64)->{def_zlib}."\"\"\"" : ();
  1758. }),
  1759. ex_libs => add(sub { return vms_info(64)->{zlib} || (); }),
  1760. pointer_size => sub { return vms_info(64)->{pointer_size} },
  1761. },
  1762. "vms-ia64" => {
  1763. inherit_from => [ "vms-generic" ],
  1764. cflags => add(sub { my @warnings =
  1765. @{vms_info(0)->{disable_warns}};
  1766. @warnings
  1767. ? "/WARNINGS=DISABLE=(".join(",",@warnings).")" : (); }),
  1768. defines =>
  1769. add(sub {
  1770. return vms_info(0)->{def_zlib}
  1771. ? "LIBZ=\"\"\"".vms_info(0)->{def_zlib}."\"\"\"" : ();
  1772. }),
  1773. ex_libs => add(sub { return vms_info(0)->{zlib} || (); }),
  1774. pointer_size => sub { return vms_info(0)->{pointer_size} },
  1775. #as => "I4S",
  1776. #debug_aflags => "/NOOPTIMIZE/DEBUG",
  1777. #release_aflags => "/OPTIMIZE/NODEBUG",
  1778. bn_opts => "SIXTY_FOUR_BIT RC4_INT",
  1779. },
  1780. "vms-ia64-p32" => {
  1781. inherit_from => [ "vms-generic" ],
  1782. cflags =>
  1783. add("/POINTER_SIZE=32",
  1784. sub { my @warnings =
  1785. @{vms_info(32)->{disable_warns}};
  1786. @warnings
  1787. ? "/WARNINGS=DISABLE=(".join(",",@warnings).")" : ();
  1788. } ),
  1789. defines =>
  1790. add(sub {
  1791. return vms_info(32)->{def_zlib}
  1792. ? "LIBZ=\"\"\"".vms_info(32)->{def_zlib}."\"\"\"" : ();
  1793. }),
  1794. ex_libs => add(sub { return vms_info(32)->{zlib} || (); }),
  1795. pointer_size => sub { return vms_info(32)->{pointer_size} },
  1796. },
  1797. "vms-ia64-p64" => {
  1798. inherit_from => [ "vms-generic" ],
  1799. cflags =>
  1800. add("/POINTER_SIZE=64=ARGV",
  1801. sub { my @warnings =
  1802. @{vms_info(64)->{disable_warns}};
  1803. @warnings
  1804. ? "/WARNINGS=DISABLE=(".join(",",@warnings).")" : ();
  1805. } ),
  1806. defines =>
  1807. add(sub {
  1808. return vms_info(64)->{def_zlib}
  1809. ? "LIBZ=\"\"\"".vms_info(64)->{def_zlib}."\"\"\"" : ();
  1810. }),
  1811. ex_libs => add(sub { return vms_info(64)->{zlib} || (); }),
  1812. pointer_size => sub { return vms_info(64)->{pointer_size} },
  1813. },
  1814. );