10-main.conf 78 KB

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