10-main.conf 88 KB

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