10-main.conf 89 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156
  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. lib_cppflags => add("-DL_ENDIAN"),
  798. },
  799. #### IA-32 targets...
  800. #### These two targets are a bit aged and are to be used on older Linux
  801. #### machines where gcc doesn't understand -m32 and -m64
  802. "linux-elf" => {
  803. inherit_from => [ "linux-generic32" ],
  804. CFLAGS => add(picker(release => "-fomit-frame-pointer")),
  805. lib_cppflags => add("-DL_ENDIAN"),
  806. bn_ops => "BN_LLONG",
  807. asm_arch => 'x86',
  808. perlasm_scheme => "elf",
  809. },
  810. "linux-aout" => {
  811. inherit_from => [ "BASE_unix" ],
  812. CC => "gcc",
  813. CFLAGS => add(picker(default => "-Wall",
  814. debug => "-O0 -g",
  815. release => "-O3 -fomit-frame-pointer")),
  816. lib_cppflags => add("-DL_ENDIAN"),
  817. bn_ops => "BN_LLONG",
  818. thread_scheme => "(unknown)",
  819. asm_arch => 'x86',
  820. perlasm_scheme => "a.out",
  821. },
  822. #### X86 / X86_64 targets
  823. "linux-x86" => {
  824. inherit_from => [ "linux-generic32" ],
  825. CFLAGS => add(picker(release => "-fomit-frame-pointer")),
  826. cflags => add("-m32"),
  827. cxxflags => add("-m32"),
  828. lib_cppflags => add("-DL_ENDIAN"),
  829. bn_ops => "BN_LLONG",
  830. asm_arch => 'x86',
  831. perlasm_scheme => "elf",
  832. },
  833. "linux-x86-latomic" => {
  834. inherit_from => [ "linux-x86" ],
  835. ex_libs => add(threads("-latomic")),
  836. },
  837. "linux-x86-clang" => {
  838. inherit_from => [ "linux-x86" ],
  839. CC => "clang",
  840. CXX => "clang++",
  841. ex_libs => add(threads("-latomic")),
  842. },
  843. "linux-x86_64" => {
  844. inherit_from => [ "linux-generic64" ],
  845. cflags => add("-m64"),
  846. cxxflags => add("-m64"),
  847. lib_cppflags => add("-DL_ENDIAN"),
  848. bn_ops => "SIXTY_FOUR_BIT_LONG",
  849. asm_arch => 'x86_64',
  850. perlasm_scheme => "elf",
  851. multilib => "64",
  852. },
  853. "linux-x86_64-clang" => {
  854. inherit_from => [ "linux-x86_64" ],
  855. CC => "clang",
  856. CXX => "clang++",
  857. },
  858. "linux-x32" => {
  859. inherit_from => [ "linux-generic32" ],
  860. cflags => add("-mx32"),
  861. cxxflags => add("-mx32"),
  862. lib_cppflags => add("-DL_ENDIAN"),
  863. bn_ops => "SIXTY_FOUR_BIT",
  864. asm_arch => 'x86_64',
  865. perlasm_scheme => "elf32",
  866. multilib => "x32",
  867. },
  868. "linux-ia64" => {
  869. inherit_from => [ "linux-generic64" ],
  870. bn_ops => "SIXTY_FOUR_BIT_LONG",
  871. asm_arch => 'ia64',
  872. perlasm_scheme => 'void',
  873. },
  874. "linux64-s390x" => {
  875. inherit_from => [ "linux-generic64" ],
  876. cflags => add("-m64"),
  877. cxxflags => add("-m64"),
  878. lib_cppflags => add("-DB_ENDIAN"),
  879. asm_arch => 's390x',
  880. perlasm_scheme => "64",
  881. multilib => "64",
  882. },
  883. "linux32-s390x" => {
  884. #### So called "highgprs" target for z/Architecture CPUs
  885. # "Highgprs" is kernel feature first implemented in Linux
  886. # 2.6.32, see /proc/cpuinfo. The idea is to preserve most
  887. # significant bits of general purpose registers not only
  888. # upon 32-bit process context switch, but even on
  889. # asynchronous signal delivery to such process. This makes
  890. # it possible to deploy 64-bit instructions even in legacy
  891. # application context and achieve better [or should we say
  892. # adequate] performance. The build is binary compatible with
  893. # linux-generic32, and the idea is to be able to install the
  894. # resulting libcrypto.so alongside generic one, e.g. as
  895. # /lib/highgprs/libcrypto.so.x.y, for ldconfig and run-time
  896. # linker to autodiscover. Unfortunately it doesn't work just
  897. # yet, because of couple of bugs in glibc
  898. # sysdeps/s390/dl-procinfo.c affecting ldconfig and ld.so.1...
  899. #
  900. inherit_from => [ "linux-generic32" ],
  901. cflags => add("-m31 -Wa,-mzarch"),
  902. cxxflags => add("-m31 -Wa,-mzarch"),
  903. lib_cppflags => add("-DB_ENDIAN"),
  904. asm_arch => 's390x',
  905. perlasm_scheme => "31",
  906. multilib => "/highgprs",
  907. },
  908. #### SPARC Linux setups
  909. "linux-sparcv8" => {
  910. inherit_from => [ "linux-latomic" ],
  911. cflags => add("-mcpu=v8"),
  912. cxxflags => add("-mcpu=v8"),
  913. lib_cppflags => add("-DB_ENDIAN -DBN_DIV2W"),
  914. asm_arch => 'sparcv8',
  915. perlasm_scheme => 'void',
  916. },
  917. "linux-sparcv9" => {
  918. # it's a real mess with -mcpu=ultrasparc option under Linux,
  919. # but -Wa,-Av8plus should do the trick no matter what.
  920. inherit_from => [ "linux-latomic" ],
  921. cflags => add("-m32 -mcpu=ultrasparc -Wa,-Av8plus"),
  922. cxxflags => add("-m32 -mcpu=ultrasparc -Wa,-Av8plus"),
  923. lib_cppflags => add("-DB_ENDIAN -DBN_DIV2W"),
  924. asm_arch => 'sparcv9',
  925. perlasm_scheme => 'void',
  926. },
  927. "linux64-sparcv9" => {
  928. # GCC 3.1 is a requirement
  929. inherit_from => [ "linux-generic64" ],
  930. cflags => add("-m64 -mcpu=ultrasparc"),
  931. cxxflags => add("-m64 -mcpu=ultrasparc"),
  932. lib_cppflags => add("-DB_ENDIAN"),
  933. ex_libs => add(threads("-latomic")),
  934. bn_ops => "BN_LLONG RC4_CHAR",
  935. asm_arch => 'sparcv9',
  936. perlasm_scheme => 'void',
  937. multilib => "64",
  938. },
  939. "linux-alpha-gcc" => {
  940. inherit_from => [ "linux-generic64" ],
  941. lib_cppflags => add("-DL_ENDIAN"),
  942. bn_ops => "SIXTY_FOUR_BIT_LONG",
  943. asm_arch => 'alpha',
  944. perlasm_scheme => "void",
  945. },
  946. "linux-c64xplus" => {
  947. inherit_from => [ "BASE_unix" ],
  948. # TI_CGT_C6000_7.3.x is a requirement
  949. CC => "cl6x",
  950. CFLAGS => "-o2 -ox -ms",
  951. cflags => "--linux -ea=.s -eo=.o -mv6400+ -pden",
  952. cxxflags => "--linux -ea=.s -eo=.o -mv6400+ -pden",
  953. cppflags => combine("-DOPENSSL_SMALL_FOOTPRINT",
  954. threads("-D_REENTRANT")),
  955. bn_ops => "BN_LLONG",
  956. thread_scheme => "pthreads",
  957. asm_arch => 'c64xplus',
  958. perlasm_scheme => "void",
  959. dso_scheme => "dlfcn",
  960. shared_target => "linux-shared",
  961. shared_cflag => "--pic",
  962. shared_ldflag => add("-z --sysv --shared"),
  963. ranlib => "true",
  964. },
  965. #### *BSD
  966. "BSD-generic32" => {
  967. # As for thread cflag. Idea is to maintain "collective" set of
  968. # flags, which would cover all BSD flavors. -pthread applies
  969. # to them all, but is treated differently. OpenBSD expands is
  970. # as -D_POSIX_THREAD -lc_r, which is sufficient. FreeBSD 4.x
  971. # expands it as -lc_r, which has to be accompanied by explicit
  972. # -D_THREAD_SAFE and sometimes -D_REENTRANT. FreeBSD 5.x
  973. # expands it as -lc_r, which seems to be sufficient?
  974. inherit_from => [ "BASE_unix" ],
  975. CC => "cc",
  976. CFLAGS => picker(default => "-Wall",
  977. debug => "-O0 -g",
  978. release => "-O3"),
  979. cflags => threads("-pthread"),
  980. cppflags => threads("-D_THREAD_SAFE -D_REENTRANT"),
  981. ex_libs => add(threads("-pthread")),
  982. enable => add("devcryptoeng"),
  983. bn_ops => "BN_LLONG",
  984. thread_scheme => "pthreads",
  985. dso_scheme => "dlfcn",
  986. shared_target => "bsd-gcc-shared",
  987. shared_cflag => "-fPIC",
  988. },
  989. "BSD-generic64" => {
  990. inherit_from => [ "BSD-generic32" ],
  991. bn_ops => "SIXTY_FOUR_BIT_LONG",
  992. },
  993. "BSD-x86" => {
  994. inherit_from => [ "BSD-generic32" ],
  995. CFLAGS => add(picker(release => "-fomit-frame-pointer")),
  996. lib_cppflags => add("-DL_ENDIAN"),
  997. bn_ops => "BN_LLONG",
  998. asm_arch => 'x86',
  999. perlasm_scheme => "a.out",
  1000. },
  1001. "BSD-x86-elf" => {
  1002. inherit_from => [ "BSD-x86" ],
  1003. perlasm_scheme => "elf",
  1004. },
  1005. "BSD-sparcv8" => {
  1006. inherit_from => [ "BSD-generic32" ],
  1007. cflags => add("-mcpu=v8"),
  1008. lib_cppflags => add("-DB_ENDIAN"),
  1009. asm_arch => 'sparcv8',
  1010. perlasm_scheme => 'void',
  1011. },
  1012. "BSD-sparc64" => {
  1013. # -DMD32_REG_T=int doesn't actually belong in sparc64 target, it
  1014. # simply *happens* to work around a compiler bug in gcc 3.3.3,
  1015. # triggered by RIPEMD160 code.
  1016. inherit_from => [ "BSD-generic64" ],
  1017. lib_cppflags => add("-DB_ENDIAN -DMD32_REG_T=int"),
  1018. bn_ops => "BN_LLONG",
  1019. asm_arch => 'sparcv9',
  1020. perlasm_scheme => 'void',
  1021. },
  1022. "BSD-ia64" => {
  1023. inherit_from => [ "BSD-generic64" ],
  1024. lib_cppflags => add("-DL_ENDIAN"),
  1025. bn_ops => "SIXTY_FOUR_BIT_LONG",
  1026. asm_arch => 'ia64',
  1027. perlasm_scheme => 'void',
  1028. },
  1029. "BSD-x86_64" => {
  1030. inherit_from => [ "BSD-generic64" ],
  1031. lib_cppflags => add("-DL_ENDIAN"),
  1032. bn_ops => "SIXTY_FOUR_BIT_LONG",
  1033. asm_arch => 'x86_64',
  1034. perlasm_scheme => "elf",
  1035. },
  1036. "BSD-aarch64" => {
  1037. inherit_from => [ "BSD-generic64" ],
  1038. lib_cppflags => add("-DL_ENDIAN"),
  1039. bn_ops => "SIXTY_FOUR_BIT_LONG",
  1040. asm_arch => 'aarch64',
  1041. perlasm_scheme => "linux64",
  1042. },
  1043. "BSD-ppc" => {
  1044. inherit_from => [ "BSD-generic32" ],
  1045. asm_arch => 'ppc32',
  1046. perlasm_scheme => "linux32",
  1047. lib_cppflags => add("-DB_ENDIAN"),
  1048. },
  1049. "BSD-ppc64" => {
  1050. inherit_from => [ "BSD-generic64" ],
  1051. cflags => add("-m64"),
  1052. cxxflags => add("-m64"),
  1053. lib_cppflags => add("-DB_ENDIAN"),
  1054. asm_arch => 'ppc64',
  1055. perlasm_scheme => "linux64",
  1056. },
  1057. "BSD-ppc64le" => {
  1058. inherit_from => [ "BSD-generic64" ],
  1059. cflags => add("-m64"),
  1060. cxxflags => add("-m64"),
  1061. lib_cppflags => add("-DL_ENDIAN"),
  1062. asm_arch => 'ppc64',
  1063. perlasm_scheme => "linux64le",
  1064. },
  1065. # riscv below refers to contemporary RISCV Architecture
  1066. # specifications,
  1067. "BSD-riscv64" => {
  1068. inherit_from => [ "BSD-generic64"],
  1069. perlasm_scheme => "linux64",
  1070. asm_arch => 'riscv64',
  1071. },
  1072. "BSD-riscv32" => {
  1073. inherit_from => [ "BSD-generic32"],
  1074. perlasm_scheme => "linux32",
  1075. asm_arch => 'riscv32',
  1076. },
  1077. "BSD-armv4" => {
  1078. ################################################################
  1079. # Note that -march is not among compiler options in linux-armv4
  1080. # target description. Not specifying one is intentional to give
  1081. # you choice to:
  1082. #
  1083. # a) rely on your compiler default by not specifying one;
  1084. # b) specify your target platform explicitly for optimal
  1085. # performance, e.g. -march=armv6 or -march=armv7-a;
  1086. # c) build "universal" binary that targets *range* of platforms
  1087. # by specifying minimum and maximum supported architecture;
  1088. #
  1089. # As for c) option. It actually makes no sense to specify
  1090. # maximum to be less than ARMv7, because it's the least
  1091. # requirement for run-time switch between platform-specific
  1092. # code paths. And without run-time switch performance would be
  1093. # equivalent to one for minimum. Secondly, there are some
  1094. # natural limitations that you'd have to accept and respect.
  1095. # Most notably you can *not* build "universal" binary for
  1096. # big-endian platform. This is because ARMv7 processor always
  1097. # picks instructions in little-endian order. Another similar
  1098. # limitation is that -mthumb can't "cross" -march=armv6t2
  1099. # boundary, because that's where it became Thumb-2. Well, this
  1100. # limitation is a bit artificial, because it's not really
  1101. # impossible, but it's deemed too tricky to support. And of
  1102. # course you have to be sure that your binutils are actually
  1103. # up to the task of handling maximum target platform. With all
  1104. # this in mind here is an example of how to configure
  1105. # "universal" build:
  1106. #
  1107. # ./Configure BSD-armv4 -march=armv6 -D__ARM_MAX_ARCH__=8
  1108. #
  1109. inherit_from => [ "BSD-generic32" ],
  1110. asm_arch => 'armv4',
  1111. perlasm_scheme => "linux32",
  1112. },
  1113. "bsdi-elf-gcc" => {
  1114. inherit_from => [ "BASE_unix" ],
  1115. CC => "gcc",
  1116. CFLAGS => "-fomit-frame-pointer -O3 -Wall",
  1117. lib_cppflags => "-DPERL5 -DL_ENDIAN",
  1118. ex_libs => add("-ldl"),
  1119. bn_ops => "BN_LLONG",
  1120. asm_arch => 'x86',
  1121. perlasm_scheme => "elf",
  1122. thread_scheme => "(unknown)",
  1123. dso_scheme => "dlfcn",
  1124. shared_target => "bsd-gcc-shared",
  1125. shared_cflag => "-fPIC",
  1126. },
  1127. #### *BSD-nodef
  1128. "BSD-nodef-generic32" => {
  1129. # As for thread cflag. Idea is to maintain "collective" set of
  1130. # flags, which would cover all BSD flavors. -pthread applies
  1131. # to them all, but is treated differently. OpenBSD expands is
  1132. # as -D_POSIX_THREAD -lc_r, which is sufficient. FreeBSD 4.x
  1133. # expands it as -lc_r, which has to be accompanied by explicit
  1134. # -D_THREAD_SAFE and sometimes -D_REENTRANT. FreeBSD 5.x
  1135. # expands it as -lc_r, which seems to be sufficient?
  1136. inherit_from => [ "BASE_unix" ],
  1137. CC => "cc",
  1138. CFLAGS => picker(default => "-Wall",
  1139. debug => "-O0 -g",
  1140. release => "-O3"),
  1141. cflags => threads("-pthread"),
  1142. cppflags => threads("-D_THREAD_SAFE -D_REENTRANT"),
  1143. ex_libs => add(threads("-pthread")),
  1144. enable => add("devcryptoeng"),
  1145. bn_ops => "BN_LLONG",
  1146. thread_scheme => "pthreads",
  1147. dso_scheme => "dlfcn",
  1148. shared_target => "bsd-gcc-nodef-shared",
  1149. shared_cflag => "-fPIC",
  1150. },
  1151. "BSD-nodef-generic64" => {
  1152. inherit_from => [ "BSD-nodef-generic32" ],
  1153. bn_ops => "SIXTY_FOUR_BIT_LONG",
  1154. },
  1155. "BSD-nodef-x86" => {
  1156. inherit_from => [ "BSD-nodef-generic32" ],
  1157. CFLAGS => add(picker(release => "-fomit-frame-pointer")),
  1158. lib_cppflags => add("-DL_ENDIAN"),
  1159. bn_ops => "BN_LLONG",
  1160. asm_arch => 'x86',
  1161. perlasm_scheme => "a.out",
  1162. },
  1163. "BSD-nodef-x86-elf" => {
  1164. inherit_from => [ "BSD-nodef-x86" ],
  1165. perlasm_scheme => "elf",
  1166. },
  1167. "BSD-nodef-sparcv8" => {
  1168. inherit_from => [ "BSD-nodef-generic32" ],
  1169. cflags => add("-mcpu=v8"),
  1170. lib_cppflags => add("-DB_ENDIAN"),
  1171. asm_arch => 'sparcv8',
  1172. perlasm_scheme => 'void',
  1173. },
  1174. "BSD-nodef-sparc64" => {
  1175. # -DMD32_REG_T=int doesn't actually belong in sparc64 target, it
  1176. # simply *happens* to work around a compiler bug in gcc 3.3.3,
  1177. # triggered by RIPEMD160 code.
  1178. inherit_from => [ "BSD-nodef-generic64" ],
  1179. lib_cppflags => add("-DB_ENDIAN -DMD32_REG_T=int"),
  1180. bn_ops => "BN_LLONG",
  1181. asm_arch => 'sparcv9',
  1182. perlasm_scheme => 'void',
  1183. },
  1184. "BSD-nodef-ia64" => {
  1185. inherit_from => [ "BSD-nodef-generic64" ],
  1186. lib_cppflags => add("-DL_ENDIAN"),
  1187. bn_ops => "SIXTY_FOUR_BIT_LONG",
  1188. asm_arch => 'ia64',
  1189. perlasm_scheme => 'void',
  1190. },
  1191. "BSD-nodef-x86_64" => {
  1192. inherit_from => [ "BSD-nodef-generic64" ],
  1193. lib_cppflags => add("-DL_ENDIAN"),
  1194. bn_ops => "SIXTY_FOUR_BIT_LONG",
  1195. asm_arch => 'x86_64',
  1196. perlasm_scheme => "elf",
  1197. },
  1198. #### SCO/Caldera targets.
  1199. #
  1200. # Originally we had like unixware-*, unixware-*-pentium, unixware-*-p6, etc.
  1201. # Now we only have blended unixware-* as it's the only one used by ./config.
  1202. # If you want to optimize for particular microarchitecture, bypass ./config
  1203. # and './Configure unixware-7 -Kpentium_pro' or whatever appropriate.
  1204. # Note that not all targets include assembler support. Mostly because of
  1205. # lack of motivation to support out-of-date platforms with out-of-date
  1206. # compiler drivers and assemblers.
  1207. #
  1208. # UnixWare 2.0x fails destest with -O.
  1209. "unixware-2.0" => {
  1210. inherit_from => [ "BASE_unix" ],
  1211. CC => "cc",
  1212. cflags => threads("-Kthread"),
  1213. lib_cppflags => "-DFILIO_H -DNO_STRINGS_H",
  1214. ex_libs => add("-lsocket -lnsl -lresolv -lx"),
  1215. thread_scheme => "uithreads",
  1216. },
  1217. "unixware-2.1" => {
  1218. inherit_from => [ "BASE_unix" ],
  1219. CC => "cc",
  1220. CFLAGS => "-O",
  1221. cflags => threads("-Kthread"),
  1222. lib_cppflags => "-DFILIO_H",
  1223. ex_libs => add("-lsocket -lnsl -lresolv -lx"),
  1224. thread_scheme => "uithreads",
  1225. },
  1226. "unixware-7" => {
  1227. inherit_from => [ "BASE_unix" ],
  1228. CC => "cc",
  1229. CFLAGS => "-O",
  1230. cflags => combine("-Kalloca", threads("-Kthread")),
  1231. lib_cppflags => "-DFILIO_H",
  1232. ex_libs => add("-lsocket -lnsl"),
  1233. thread_scheme => "uithreads",
  1234. bn_ops => "BN_LLONG",
  1235. asm_arch => 'x86',
  1236. perlasm_scheme => "elf-1",
  1237. dso_scheme => "dlfcn",
  1238. shared_target => "svr5-shared",
  1239. shared_cflag => "-Kpic",
  1240. },
  1241. "unixware-7-gcc" => {
  1242. inherit_from => [ "BASE_unix" ],
  1243. CC => "gcc",
  1244. CFLAGS => "-O3 -fomit-frame-pointer -Wall",
  1245. cppflags => add(threads("-D_REENTRANT")),
  1246. lib_cppflags => add("-DL_ENDIAN -DFILIO_H"),
  1247. ex_libs => add("-lsocket -lnsl"),
  1248. bn_ops => "BN_LLONG",
  1249. thread_scheme => "pthreads",
  1250. asm_arch => 'x86',
  1251. perlasm_scheme => "elf-1",
  1252. dso_scheme => "dlfcn",
  1253. shared_target => "gnu-shared",
  1254. shared_cflag => "-fPIC",
  1255. },
  1256. # SCO 5 - Ben Laurie says the -O breaks the SCO cc.
  1257. "sco5-cc" => {
  1258. inherit_from => [ "BASE_unix" ],
  1259. cc => "cc",
  1260. cflags => "-belf",
  1261. ex_libs => add("-lsocket -lnsl"),
  1262. thread_scheme => "(unknown)",
  1263. asm_arch => 'x86',
  1264. perlasm_scheme => "elf-1",
  1265. dso_scheme => "dlfcn",
  1266. shared_target => "svr3-shared",
  1267. shared_cflag => "-Kpic",
  1268. },
  1269. "sco5-gcc" => {
  1270. inherit_from => [ "BASE_unix" ],
  1271. cc => "gcc",
  1272. cflags => "-O3 -fomit-frame-pointer",
  1273. ex_libs => add("-lsocket -lnsl"),
  1274. bn_ops => "BN_LLONG",
  1275. thread_scheme => "(unknown)",
  1276. asm_arch => 'x86',
  1277. perlasm_scheme => "elf-1",
  1278. dso_scheme => "dlfcn",
  1279. shared_target => "svr3-shared",
  1280. shared_cflag => "-fPIC",
  1281. },
  1282. #### IBM's AIX.
  1283. # Below targets assume AIX >=5. Caveat lector. If you are accustomed
  1284. # to control compilation "bitness" by setting $OBJECT_MODE environment
  1285. # variable, then you should know that in OpenSSL case it's considered
  1286. # only in ./config. Once configured, build procedure remains "deaf" to
  1287. # current value of $OBJECT_MODE.
  1288. "aix-common" => {
  1289. inherit_from => [ "BASE_unix" ],
  1290. template => 1,
  1291. sys_id => "AIX",
  1292. lib_cppflags => "-DB_ENDIAN",
  1293. lflags => "-Wl,-bsvr4",
  1294. thread_scheme => "pthreads",
  1295. dso_scheme => "dlfcn",
  1296. shared_target => "aix",
  1297. module_ldflags => "-Wl,-G,-bsymbolic,-bnoentry",
  1298. shared_ldflag => "-Wl,-G,-bsymbolic,-bnoentry",
  1299. shared_defflag => "-Wl,-bE:",
  1300. shared_fipsflag => "-Wl,-binitfini:_init:_cleanup",
  1301. perl_platform => 'AIX',
  1302. },
  1303. "aix-gcc" => {
  1304. inherit_from => [ "aix-common" ],
  1305. CC => "gcc",
  1306. CFLAGS => picker(debug => "-O0 -g",
  1307. release => "-O"),
  1308. cflags => add(threads("-pthread")),
  1309. ex_libs => add(threads("-pthread")),
  1310. bn_ops => "BN_LLONG RC4_CHAR",
  1311. asm_arch => 'ppc32',
  1312. perlasm_scheme => "aix32",
  1313. shared_ldflag => add_before("-shared -static-libgcc"),
  1314. AR => add("-X32"),
  1315. RANLIB => add("-X32"),
  1316. },
  1317. "aix64-gcc" => {
  1318. inherit_from => [ "aix-common" ],
  1319. CC => "gcc",
  1320. CFLAGS => picker(debug => "-O0 -g",
  1321. release => "-O"),
  1322. cflags => combine("-maix64", threads("-pthread")),
  1323. ex_libs => add(threads("-pthread")),
  1324. bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
  1325. asm_arch => 'ppc64',
  1326. perlasm_scheme => "aix64",
  1327. shared_ldflag => add_before("-shared -static-libgcc"),
  1328. shared_extension => "64.so.\$(SHLIB_VERSION_NUMBER)",
  1329. AR => add("-X64"),
  1330. RANLIB => add("-X64"),
  1331. },
  1332. "aix64-gcc-as" => {
  1333. inherit_from => [ "aix64-gcc" ],
  1334. perlasm_scheme => "aix64-as",
  1335. },
  1336. "aix-cc" => {
  1337. inherit_from => [ "aix-common" ],
  1338. CC => "cc",
  1339. CFLAGS => picker(debug => "-O0 -g",
  1340. release => "-O"),
  1341. cflags => combine("-q32 -qmaxmem=16384 -qro -qroconst",
  1342. threads("-qthreaded")),
  1343. cppflags => threads("-D_THREAD_SAFE"),
  1344. ex_libs => add(threads("-lpthreads")),
  1345. bn_ops => "BN_LLONG RC4_CHAR",
  1346. asm_arch => 'ppc32',
  1347. perlasm_scheme => "aix32",
  1348. shared_cflag => "-qpic",
  1349. AR => add("-X32"),
  1350. RANLIB => add("-X32"),
  1351. },
  1352. # shared_target of "aix-solib" builds shared libraries packaged
  1353. # without archives. This improves the behavior of inter-library
  1354. # references (libssl depending on libcrypto) when building with
  1355. # shlib_variant.
  1356. # You'll get: libxxx.so (import library, used when linking applications)
  1357. # libxxx.so.ver (shared object)
  1358. # libxxx.a (static library archive)
  1359. # and for runtime, you only need libxxx.so.ver. libxxx.so and libxxx.a
  1360. # can be installed along with include files to make an SDK
  1361. "aix-cc-solib" => {
  1362. inherit_from => [ "aix-cc" ],
  1363. shared_target => "aix-solib",
  1364. },
  1365. "aix64-cc" => {
  1366. inherit_from => [ "aix-common" ],
  1367. CC => "cc",
  1368. CFLAGS => picker(debug => "-O0 -g",
  1369. release => "-O"),
  1370. cflags => combine("-q64 -qmaxmem=16384 -qro -qroconst",
  1371. threads("-qthreaded")),
  1372. cppflags => threads("-D_THREAD_SAFE"),
  1373. ex_libs => add(threads("-lpthreads")),
  1374. bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
  1375. asm_arch => 'ppc64',
  1376. perlasm_scheme => "aix64",
  1377. dso_scheme => "dlfcn",
  1378. shared_cflag => "-qpic",
  1379. shared_extension => "64.so.\$(SHLIB_VERSION_NUMBER)",
  1380. AR => add("-X64"),
  1381. RANLIB => add("-X64"),
  1382. },
  1383. "aix64-cc-solib" => {
  1384. inherit_from => [ "aix64-cc" ],
  1385. shared_target => "aix-solib",
  1386. },
  1387. # SIEMENS BS2000/OSD: an EBCDIC-based mainframe
  1388. "BS2000-OSD" => {
  1389. inherit_from => [ "BASE_unix" ],
  1390. CC => "c89",
  1391. CFLAGS => "-O",
  1392. cflags => "-XLLML -XLLMK -XL",
  1393. cppflags => "-DCHARSET_EBCDIC",
  1394. lib_cppflags => "-DB_ENDIAN",
  1395. ex_libs => add("-lsocket -lnsl"),
  1396. bn_ops => "THIRTY_TWO_BIT RC4_CHAR",
  1397. thread_scheme => "(unknown)",
  1398. },
  1399. #### Visual C targets
  1400. #
  1401. # Win64 targets, WIN64I denotes IA-64/Itanium and WIN64A - AMD64
  1402. #
  1403. # Note about /wd4090, disable warning C4090. This warning returns false
  1404. # positives in some situations. Disabling it altogether masks both
  1405. # legitimate and false cases, but as we compile on multiple platforms,
  1406. # we rely on other compilers to catch legitimate cases.
  1407. #
  1408. # Also note that we force threads no matter what. Configuring "no-threads"
  1409. # is ignored.
  1410. #
  1411. # UNICODE is defined in VC-common and applies to all targets. It used to
  1412. # be an opt-in option for VC-WIN32, but not anymore. The original reason
  1413. # was because ANSI API was *native* system interface for no longer
  1414. # supported Windows 9x. Keep in mind that UNICODE only affects how
  1415. # OpenSSL libraries interact with underlying OS, it doesn't affect API
  1416. # that OpenSSL presents to application.
  1417. "VC-common" => {
  1418. inherit_from => [ "BASE_Windows" ],
  1419. template => 1,
  1420. CC => "cl",
  1421. CPP => '$(CC) /EP /C',
  1422. CFLAGS => "/W3 /wd4090 /nologo",
  1423. coutflag => "/Fo",
  1424. LD => "link",
  1425. LDFLAGS => "/nologo /debug",
  1426. ldoutflag => "/out:",
  1427. ldpostoutflag => "",
  1428. ld_resp_delim => "\n",
  1429. bin_lflags => "setargv.obj",
  1430. makedepcmd => '$(CC) /Zs /showIncludes',
  1431. makedep_scheme => 'VC',
  1432. AR => "lib",
  1433. ARFLAGS => "/nologo",
  1434. aroutflag => "/out:",
  1435. ar_resp_delim => "\n",
  1436. RC => "rc",
  1437. rcoutflag => "/fo",
  1438. defines => add("OPENSSL_SYS_WIN32", "WIN32_LEAN_AND_MEAN",
  1439. "UNICODE", "_UNICODE",
  1440. "_CRT_SECURE_NO_DEPRECATE",
  1441. "_WINSOCK_DEPRECATED_NO_WARNINGS"),
  1442. lib_cflags => add("/Zi /Fdossl_static.pdb"),
  1443. lib_defines => add("L_ENDIAN"),
  1444. dso_cflags => "/Zi /Fddso.pdb",
  1445. bin_cflags => "/Zi /Fdapp.pdb",
  1446. # def_flag made to empty string so a .def file gets generated
  1447. shared_defflag => '',
  1448. shared_ldflag => "/dll",
  1449. shared_target => "win-shared", # meaningless except it gives Configure a hint
  1450. lddefflag => "/def:",
  1451. ldresflag => " ",
  1452. ld_implib_flag => "/implib:",
  1453. thread_scheme => "winthreads",
  1454. dso_scheme => "win32",
  1455. perl_platform => 'Windows::MSVC',
  1456. # additional parameter to build_scheme denotes install-path "flavour"
  1457. build_scheme => add("VC-common", { separator => undef }),
  1458. },
  1459. "VC-noCE-common" => {
  1460. inherit_from => [ "VC-common" ],
  1461. template => 1,
  1462. CFLAGS => add(picker(debug => '/Od',
  1463. release => '/O2')),
  1464. cflags => add(picker(default => '/Gs0 /GF /Gy',
  1465. debug =>
  1466. sub {
  1467. ($disabled{shared} ? "" : "/MDd");
  1468. },
  1469. release =>
  1470. sub {
  1471. ($disabled{shared} ? "" : "/MD");
  1472. })),
  1473. defines => add(picker(default => [], # works as type cast
  1474. debug => [ "DEBUG", "_DEBUG" ])),
  1475. lib_cflags => add(sub { $disabled{shared} ? "/MT /Zl" : () }),
  1476. # Following might/should appears controversial, i.e. defining
  1477. # /MDd without evaluating $disabled{shared}. It works in
  1478. # non-shared build because static library is compiled with /Zl
  1479. # and bares no reference to specific RTL. And it works in
  1480. # shared build because multiple /MDd options are not prohibited.
  1481. # But why /MDd in static build? Well, basically this is just a
  1482. # reference point, which allows to catch eventual errors that
  1483. # would prevent those who want to wrap OpenSSL into own .DLL.
  1484. # Why not /MD in release build then? Well, some are likely to
  1485. # prefer [non-debug] openssl.exe to be free from Micorosoft RTL
  1486. # redistributable.
  1487. bin_cflags => add(picker(debug => "/MDd",
  1488. release => sub { $disabled{shared} ? "/MT" : () },
  1489. )),
  1490. bin_lflags => add("/subsystem:console /opt:ref"),
  1491. ex_libs => add(sub {
  1492. my @ex_libs = ();
  1493. push @ex_libs, 'ws2_32.lib' unless $disabled{sock};
  1494. push @ex_libs, 'gdi32.lib advapi32.lib crypt32.lib user32.lib';
  1495. return join(" ", @ex_libs);
  1496. }),
  1497. },
  1498. "VC-WIN64-common" => {
  1499. inherit_from => [ "VC-noCE-common" ],
  1500. template => 1,
  1501. ex_libs => add(sub {
  1502. my @ex_libs = ();
  1503. push @ex_libs, 'bufferoverflowu.lib' if (`cl 2>&1` =~ /14\.00\.4[0-9]{4}\./);
  1504. return join(" ", @_, @ex_libs);
  1505. }),
  1506. bn_ops => add("SIXTY_FOUR_BIT"),
  1507. },
  1508. "VC-WIN64I" => {
  1509. inherit_from => [ "VC-WIN64-common" ],
  1510. AS => "ias",
  1511. ASFLAGS => "-d debug",
  1512. asoutflag => "-o ",
  1513. sys_id => "WIN64I",
  1514. uplink_arch => 'ia64',
  1515. asm_arch => 'ia64',
  1516. perlasm_scheme => "ias",
  1517. multilib => "-ia64",
  1518. },
  1519. "VC-WIN64A" => {
  1520. inherit_from => [ "VC-WIN64-common" ],
  1521. AS => sub { vc_win64a_info()->{AS} },
  1522. ASFLAGS => sub { vc_win64a_info()->{ASFLAGS} },
  1523. asoutflag => sub { vc_win64a_info()->{asoutflag} },
  1524. asflags => sub { vc_win64a_info()->{asflags} },
  1525. sys_id => "WIN64A",
  1526. uplink_arch => 'x86_64',
  1527. asm_arch => 'x86_64',
  1528. perlasm_scheme => sub { vc_win64a_info()->{perlasm_scheme} },
  1529. multilib => "-x64",
  1530. },
  1531. "VC-WIN32" => {
  1532. inherit_from => [ "VC-noCE-common" ],
  1533. AS => sub { vc_win32_info()->{AS} },
  1534. ASFLAGS => sub { vc_win32_info()->{ASFLAGS} },
  1535. asoutflag => sub { vc_win32_info()->{asoutflag} },
  1536. asflags => sub { vc_win32_info()->{asflags} },
  1537. sys_id => "WIN32",
  1538. bn_ops => add("BN_LLONG"),
  1539. uplink_arch => 'common',
  1540. asm_arch => 'x86',
  1541. perlasm_scheme => sub { vc_win32_info()->{perlasm_scheme} },
  1542. # "WOW" stands for "Windows on Windows", and "VC-WOW" engages
  1543. # some installation path heuristics in windows-makefile.tmpl...
  1544. build_scheme => add("VC-WOW", { separator => undef }),
  1545. },
  1546. "VC-CE" => {
  1547. inherit_from => [ "VC-common" ],
  1548. CFLAGS => add(picker(debug => "/Od",
  1549. release => "/O1i")),
  1550. CPPDEFINES => picker(debug => [ "DEBUG", "_DEBUG" ]),
  1551. LDFLAGS => add("/nologo /opt:ref"),
  1552. cflags =>
  1553. combine('/GF /Gy',
  1554. sub { vc_wince_info()->{cflags}; },
  1555. sub { `cl 2>&1` =~ /Version ([0-9]+)\./ && $1>=14
  1556. ? ($disabled{shared} ? " /MT" : " /MD")
  1557. : " /MC"; }),
  1558. cppflags => sub { vc_wince_info()->{cppflags}; },
  1559. lib_defines => add("NO_CHMOD", "OPENSSL_SMALL_FOOTPRINT"),
  1560. lib_cppflags => sub { vc_wince_info()->{cppflags}; },
  1561. includes =>
  1562. add(combine(sub { defined(env('WCECOMPAT'))
  1563. ? '$(WCECOMPAT)/include' : (); },
  1564. sub { defined(env('PORTSDK_LIBPATH'))
  1565. ? '$(PORTSDK_LIBPATH)/../../include'
  1566. : (); })),
  1567. lflags => add(combine(sub { vc_wince_info()->{lflags}; },
  1568. sub { defined(env('PORTSDK_LIBPATH'))
  1569. ? "/entry:mainCRTstartup" : (); })),
  1570. sys_id => "WINCE",
  1571. bn_ops => add("BN_LLONG"),
  1572. ex_libs => add(sub {
  1573. my @ex_libs = ();
  1574. push @ex_libs, 'ws2.lib' unless $disabled{sock};
  1575. push @ex_libs, 'crypt32.lib';
  1576. if (defined(env('WCECOMPAT'))) {
  1577. my $x = '$(WCECOMPAT)/lib';
  1578. if (-f "$x/env('TARGETCPU')/wcecompatex.lib") {
  1579. $x .= '/$(TARGETCPU)/wcecompatex.lib';
  1580. } else {
  1581. $x .= '/wcecompatex.lib';
  1582. }
  1583. push @ex_libs, $x;
  1584. }
  1585. push @ex_libs, '$(PORTSDK_LIBPATH)/portlib.lib'
  1586. if (defined(env('PORTSDK_LIBPATH')));
  1587. push @ex_libs, '/nodefaultlib coredll.lib corelibc.lib'
  1588. if (env('TARGETCPU') =~ /^X86|^ARMV4[IT]/);
  1589. return join(" ", @ex_libs);
  1590. }),
  1591. },
  1592. #### MinGW
  1593. "mingw-common" => {
  1594. inherit_from => [ 'BASE_unix' ],
  1595. template => 1,
  1596. CC => "gcc",
  1597. CFLAGS => picker(default => "-Wall",
  1598. debug => "-g -O0",
  1599. release => "-O3"),
  1600. cppflags => combine("-DUNICODE -D_UNICODE -DWIN32_LEAN_AND_MEAN",
  1601. threads("-D_MT")),
  1602. lib_cppflags => "-DL_ENDIAN",
  1603. ex_libs => add("-lws2_32 -lgdi32 -lcrypt32"),
  1604. thread_scheme => "winthreads",
  1605. dso_scheme => "win32",
  1606. shared_target => "mingw-shared",
  1607. shared_cppflags => add("_WINDLL"),
  1608. shared_ldflag => "-static-libgcc",
  1609. perl_platform => 'mingw',
  1610. },
  1611. "mingw" => {
  1612. inherit_from => [ "mingw-common" ],
  1613. CFLAGS => add(picker(release => "-fomit-frame-pointer")),
  1614. cflags => "-m32",
  1615. sys_id => "MINGW32",
  1616. bn_ops => add("BN_LLONG"),
  1617. asm_arch => 'x86',
  1618. uplink_arch => 'x86',
  1619. perlasm_scheme => "coff",
  1620. shared_rcflag => "--target=pe-i386",
  1621. multilib => "",
  1622. },
  1623. "mingw64" => {
  1624. # As for uplink_arch. Applink makes it possible to use
  1625. # .dll compiled with one compiler with application compiled with
  1626. # another compiler. It's possible to engage Applink support in
  1627. # mingw64 build, but it's not done, because until mingw64
  1628. # supports structured exception handling, one can't seriously
  1629. # consider its binaries for using with non-mingw64 run-time
  1630. # environment. And as mingw64 is always consistent with itself,
  1631. # Applink is never engaged and can as well be omitted.
  1632. inherit_from => [ "mingw-common" ],
  1633. cflags => "-m64",
  1634. sys_id => "MINGW64",
  1635. bn_ops => add("SIXTY_FOUR_BIT"),
  1636. asm_arch => 'x86_64',
  1637. uplink_arch => undef,
  1638. perlasm_scheme => "mingw64",
  1639. shared_rcflag => "--target=pe-x86-64",
  1640. multilib => "64",
  1641. },
  1642. #### UEFI
  1643. "UEFI" => {
  1644. inherit_from => [ "BASE_unix" ],
  1645. CC => "cc",
  1646. CFLAGS => "-O",
  1647. lib_cppflags => "-DL_ENDIAN",
  1648. sys_id => "UEFI",
  1649. },
  1650. "UEFI-x86" => {
  1651. inherit_from => [ "UEFI" ],
  1652. asm_arch => 'x86',
  1653. perlasm_scheme => "win32n",
  1654. },
  1655. "UEFI-x86_64" => {
  1656. inherit_from => [ "UEFI" ],
  1657. asm_arch => 'x86_64',
  1658. perlasm_scheme => "nasm",
  1659. },
  1660. #### UWIN
  1661. "UWIN" => {
  1662. inherit_from => [ "BASE_unix" ],
  1663. CC => "cc",
  1664. CFLAGS => "-O -Wall",
  1665. lib_cppflags => "-DTERMIOS -DL_ENDIAN",
  1666. sys_id => "UWIN",
  1667. bn_ops => "BN_LLONG",
  1668. dso_scheme => "win32",
  1669. },
  1670. #### Cygwin
  1671. "Cygwin-common" => {
  1672. inherit_from => [ "BASE_unix" ],
  1673. template => 1,
  1674. CC => "gcc",
  1675. CFLAGS => picker(default => "-Wall",
  1676. debug => "-g -O0",
  1677. release => "-O3"),
  1678. ex_libs => add("-lcrypt32"),
  1679. lib_cppflags => "-DTERMIOS -DL_ENDIAN",
  1680. sys_id => "CYGWIN",
  1681. thread_scheme => "pthread",
  1682. dso_scheme => "dlfcn",
  1683. shared_target => "cygwin-shared",
  1684. shared_cppflags => "-D_WINDLL",
  1685. perl_platform => 'Cygwin',
  1686. },
  1687. "Cygwin-x86" => {
  1688. inherit_from => [ "Cygwin-common" ],
  1689. CFLAGS => add(picker(release => "-O3 -fomit-frame-pointer")),
  1690. bn_ops => "BN_LLONG",
  1691. asm_arch => 'x86',
  1692. perlasm_scheme => "coff",
  1693. },
  1694. "Cygwin-x86_64" => {
  1695. inherit_from => [ "Cygwin-common" ],
  1696. CC => "gcc",
  1697. bn_ops => "SIXTY_FOUR_BIT_LONG",
  1698. asm_arch => 'x86_64',
  1699. perlasm_scheme => "mingw64",
  1700. },
  1701. # Backward compatibility for those using this target
  1702. "Cygwin" => {
  1703. inherit_from => [ "Cygwin-x86" ]
  1704. },
  1705. # In case someone constructs the Cygwin target name themself
  1706. "Cygwin-i386" => {
  1707. inherit_from => [ "Cygwin-x86" ]
  1708. },
  1709. "Cygwin-i486" => {
  1710. inherit_from => [ "Cygwin-x86" ]
  1711. },
  1712. "Cygwin-i586" => {
  1713. inherit_from => [ "Cygwin-x86" ]
  1714. },
  1715. "Cygwin-i686" => {
  1716. inherit_from => [ "Cygwin-x86" ]
  1717. },
  1718. ##### MacOS X (a.k.a. Darwin) setup
  1719. "darwin-common" => {
  1720. inherit_from => [ "BASE_unix" ],
  1721. template => 1,
  1722. CC => "cc",
  1723. CFLAGS => picker(debug => "-g -O0",
  1724. release => "-O3"),
  1725. cppflags => threads("-D_REENTRANT"),
  1726. lflags => add("-Wl,-search_paths_first"),
  1727. sys_id => "MACOSX",
  1728. bn_ops => "BN_LLONG RC4_CHAR",
  1729. thread_scheme => "pthreads",
  1730. perlasm_scheme => "osx32",
  1731. dso_scheme => "dlfcn",
  1732. ranlib => "ranlib -c",
  1733. shared_target => "darwin-shared",
  1734. shared_cflag => "-fPIC",
  1735. shared_extension => ".\$(SHLIB_VERSION_NUMBER).dylib",
  1736. },
  1737. # Option "freeze" such as -std=gnu9x can't negatively interfere
  1738. # with future defaults for below two targets, because MacOS X
  1739. # for PPC has no future, it was discontinued by vendor in 2009.
  1740. "darwin-ppc-cc" => { inherit_from => [ "darwin-ppc" ] }, # Historic alias
  1741. "darwin-ppc" => {
  1742. inherit_from => [ "darwin-common" ],
  1743. cflags => add("-arch ppc -std=gnu9x -Wa,-force_cpusubtype_ALL"),
  1744. lib_cppflags => add("-DB_ENDIAN"),
  1745. shared_cflag => add("-fno-common"),
  1746. asm_arch => 'ppc32',
  1747. perlasm_scheme => "osx32",
  1748. },
  1749. "darwin64-ppc-cc" => { inherit_from => [ "darwin64-ppc" ] }, # Historic alias
  1750. "darwin64-ppc" => {
  1751. inherit_from => [ "darwin-common" ],
  1752. cflags => add("-arch ppc64 -std=gnu9x"),
  1753. lib_cppflags => add("-DB_ENDIAN"),
  1754. bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
  1755. asm_arch => 'ppc64',
  1756. perlasm_scheme => "osx64",
  1757. },
  1758. "darwin-i386-cc" => { inherit_from => [ "darwin-i386" ] }, # Historic alias
  1759. "darwin-i386" => {
  1760. inherit_from => [ "darwin-common" ],
  1761. CFLAGS => add(picker(release => "-fomit-frame-pointer")),
  1762. cflags => add("-arch i386"),
  1763. lib_cppflags => add("-DL_ENDIAN"),
  1764. bn_ops => "BN_LLONG RC4_INT",
  1765. asm_arch => 'x86',
  1766. perlasm_scheme => "macosx",
  1767. },
  1768. "darwin64-x86_64-cc" => { inherit_from => [ "darwin64-x86_64" ] }, # Historic alias
  1769. "darwin64-x86_64" => {
  1770. inherit_from => [ "darwin-common" ],
  1771. CFLAGS => add("-Wall"),
  1772. cflags => add("-arch x86_64"),
  1773. lib_cppflags => add("-DL_ENDIAN"),
  1774. bn_ops => "SIXTY_FOUR_BIT_LONG",
  1775. asm_arch => 'x86_64',
  1776. perlasm_scheme => "macosx",
  1777. },
  1778. "darwin64-arm64-cc" => { inherit_from => [ "darwin64-arm64" ] }, # "Historic" alias
  1779. "darwin64-arm64" => {
  1780. inherit_from => [ "darwin-common" ],
  1781. CFLAGS => add("-Wall"),
  1782. cflags => add("-arch arm64"),
  1783. lib_cppflags => add("-DL_ENDIAN"),
  1784. bn_ops => "SIXTY_FOUR_BIT_LONG",
  1785. asm_arch => 'aarch64',
  1786. perlasm_scheme => "ios64",
  1787. },
  1788. ##### GNU Hurd
  1789. "hurd-generic32" => {
  1790. inherit_from => [ "BASE_unix" ],
  1791. CC => "gcc",
  1792. CXX => "g++",
  1793. CFLAGS => picker(default => "-Wall",
  1794. debug => "-O0 -g",
  1795. release => "-O3"),
  1796. CXXFLAGS => picker(default => "-Wall",
  1797. debug => "-O0 -g",
  1798. release => "-O3"),
  1799. cflags => threads("-pthread"),
  1800. cxxflags => combine("-std=c++11", threads("-pthread")),
  1801. ex_libs => add("-ldl", threads("-pthread")),
  1802. bn_ops => "BN_LLONG RC4_CHAR",
  1803. thread_scheme => "pthreads",
  1804. dso_scheme => "dlfcn",
  1805. shared_target => "linux-shared",
  1806. shared_cflag => "-fPIC",
  1807. shared_ldflag => sub { $disabled{pinshared} ? () : "-Wl,-znodelete" },
  1808. },
  1809. "hurd-generic64" => {
  1810. inherit_from => [ "hurd-generic32" ],
  1811. bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
  1812. },
  1813. #### X86 / X86_64 targets
  1814. "hurd-x86" => {
  1815. inherit_from => [ "hurd-generic32" ],
  1816. CFLAGS => add(picker(release => "-fomit-frame-pointer")),
  1817. cflags => add("-m32"),
  1818. cxxflags => add("-m32"),
  1819. lib_cppflags => add("-DL_ENDIAN"),
  1820. bn_ops => "BN_LLONG",
  1821. asm_arch => 'x86',
  1822. perlasm_scheme => 'elf',
  1823. },
  1824. "hurd-x86_64" => {
  1825. inherit_from => [ "hurd-generic64" ],
  1826. cflags => add("-m64"),
  1827. cxxflags => add("-m64"),
  1828. lib_cppflags => add("-DL_ENDIAN"),
  1829. bn_ops => "SIXTY_FOUR_BIT_LONG",
  1830. asm_arch => 'x86_64',
  1831. perlasm_scheme => 'elf',
  1832. multilib => "64",
  1833. },
  1834. ##### VxWorks for various targets
  1835. "vxworks-ppc60x" => {
  1836. inherit_from => [ "BASE_unix" ],
  1837. CC => "ccppc",
  1838. CFLAGS => "-O2 -Wall -fstrength-reduce",
  1839. cflags => "-mrtp -mhard-float -mstrict-align -fno-implicit-fp -fno-builtin -fno-strict-aliasing",
  1840. cppflags => combine("-D_REENTRANT -DPPC32_fp60x -DCPU=PPC32",
  1841. "_DTOOL_FAMILY=gnu -DTOOL=gnu",
  1842. "-I\$(WIND_BASE)/target/usr/h",
  1843. "-I\$(WIND_BASE)/target/usr/h/wrn/coreip"),
  1844. sys_id => "VXWORKS",
  1845. lflags => add("-L \$(WIND_BASE)/target/usr/lib/ppc/PPC32/common"),
  1846. ex_libs => add("-Wl,--defsym,__wrs_rtp_base=0xe0000000"),
  1847. },
  1848. "vxworks-ppcgen" => {
  1849. inherit_from => [ "BASE_unix" ],
  1850. CC => "ccppc",
  1851. CFLAGS => "-O1 -Wall",
  1852. cflags => "-mrtp -msoft-float -mstrict-align -fno-builtin -fno-strict-aliasing",
  1853. cppflags => combine("-D_REENTRANT -DPPC32 -DCPU=PPC32",
  1854. "-DTOOL_FAMILY=gnu -DTOOL=gnu",
  1855. "-I\$(WIND_BASE)/target/usr/h",
  1856. "-I\$(WIND_BASE)/target/usr/h/wrn/coreip"),
  1857. sys_id => "VXWORKS",
  1858. lflags => add("-L \$(WIND_BASE)/target/usr/lib/ppc/PPC32/sfcommon"),
  1859. ex_libs => add("-Wl,--defsym,__wrs_rtp_base=0xe0000000"),
  1860. },
  1861. "vxworks-ppc405" => {
  1862. inherit_from => [ "BASE_unix" ],
  1863. CC => "ccppc",
  1864. CFLAGS => "-g",
  1865. cflags => "-msoft-float -mlongcall",
  1866. cppflags => combine("-D_REENTRANT -DPPC32 -DCPU=PPC405",
  1867. "-DTOOL_FAMILY=gnu -DTOOL=gnu",
  1868. "-I\$(WIND_BASE)/target/h"),
  1869. sys_id => "VXWORKS",
  1870. lflags => add("-r"),
  1871. },
  1872. "vxworks-ppc750" => {
  1873. inherit_from => [ "BASE_unix" ],
  1874. CC => "ccppc",
  1875. CFLAGS => "-ansi -fvolatile -Wall \$(DEBUG_FLAG)",
  1876. cflags => "-nostdinc -fno-builtin -fno-for-scope -fsigned-char -msoft-float -mlongcall",
  1877. cppflags => combine("-DPPC750 -D_REENTRANT -DCPU=PPC604",
  1878. "-I\$(WIND_BASE)/target/h"),
  1879. sys_id => "VXWORKS",
  1880. lflags => add("-r"),
  1881. },
  1882. "vxworks-ppc750-debug" => {
  1883. inherit_from => [ "BASE_unix" ],
  1884. CC => "ccppc",
  1885. CFLAGS => "-ansi -fvolatile -Wall -g",
  1886. cflags => "-nostdinc -fno-builtin -fno-for-scope -fsigned-char -msoft-float -mlongcall",
  1887. cppflags => combine("-DPPC750 -D_REENTRANT -DCPU=PPC604",
  1888. "-DPEDANTIC -DDEBUG",
  1889. "-I\$(WIND_BASE)/target/h"),
  1890. sys_id => "VXWORKS",
  1891. lflags => add("-r"),
  1892. },
  1893. "vxworks-ppc860" => {
  1894. inherit_from => [ "BASE_unix" ],
  1895. CC => "ccppc",
  1896. cflags => "-nostdinc -msoft-float",
  1897. cppflags => combine("-DCPU=PPC860 -DNO_STRINGS_H",
  1898. "-I\$(WIND_BASE)/target/h"),
  1899. sys_id => "VXWORKS",
  1900. lflags => add("-r"),
  1901. },
  1902. "vxworks-simlinux" => {
  1903. inherit_from => [ "BASE_unix" ],
  1904. CC => "ccpentium",
  1905. cflags => "-B\$(WIND_BASE)/host/\$(WIND_HOST_TYPE)/lib/gcc-lib/ -fno-builtin -fno-defer-pop",
  1906. cppflags => combine("-D_VSB_CONFIG_FILE=\"\$(WIND_BASE)/target/lib/h/config/vsbConfig.h\"",
  1907. "-DL_ENDIAN -DCPU=SIMLINUX -DNO_STRINGS_H",
  1908. "-DTOOL_FAMILY=gnu -DTOOL=gnu",
  1909. "-DOPENSSL_NO_HW_PADLOCK",
  1910. "-I\$(WIND_BASE)/target/h",
  1911. "-I\$(WIND_BASE)/target/h/wrn/coreip"),
  1912. sys_id => "VXWORKS",
  1913. lflags => add("-r"),
  1914. ranlib => "ranlibpentium",
  1915. },
  1916. "vxworks-mips" => {
  1917. inherit_from => [ "BASE_unix" ],
  1918. CC => "ccmips",
  1919. CFLAGS => "-O -G 0",
  1920. cflags => "-mrtp -mips2 -B\$(WIND_BASE)/host/\$(WIND_HOST_TYPE)/lib/gcc-lib/ -msoft-float -mno-branch-likely -fno-builtin -fno-defer-pop",
  1921. cppflags => combine("-D_VSB_CONFIG_FILE=\"\$(WIND_BASE)/target/lib/h/config/vsbConfig.h\"",
  1922. "-DCPU=MIPS32 -DNO_STRINGS_H",
  1923. "-DTOOL_FAMILY=gnu -DTOOL=gnu",
  1924. "-DOPENSSL_NO_HW_PADLOCK",
  1925. threads("-D_REENTRANT"),
  1926. "-I\$(WIND_BASE)/target/h",
  1927. "-I\$(WIND_BASE)/target/h/wrn/coreip"),
  1928. sys_id => "VXWORKS",
  1929. lflags => add("-L \$(WIND_BASE)/target/usr/lib/mips/MIPSI32/sfcommon"),
  1930. ex_libs => add("-Wl,--defsym,__wrs_rtp_base=0xe0000000"),
  1931. thread_scheme => "pthreads",
  1932. asm_arch => 'mips32',
  1933. perlasm_scheme => "o32",
  1934. ranlib => "ranlibmips",
  1935. },
  1936. #### uClinux
  1937. "uClinux-dist" => {
  1938. inherit_from => [ "BASE_unix" ],
  1939. CC => sub { env('CC') },
  1940. cppflags => threads("-D_REENTRANT"),
  1941. ex_libs => add("\$(LDLIBS)"),
  1942. bn_ops => "BN_LLONG",
  1943. thread_scheme => "pthreads",
  1944. dso_scheme => sub { env('LIBSSL_dlfcn') },
  1945. shared_target => "linux-shared",
  1946. shared_cflag => "-fPIC",
  1947. ranlib => sub { env('RANLIB') },
  1948. },
  1949. "uClinux-dist64" => {
  1950. inherit_from => [ "BASE_unix" ],
  1951. CC => sub { env('CC') },
  1952. cppflags => threads("-D_REENTRANT"),
  1953. ex_libs => add("\$(LDLIBS)"),
  1954. bn_ops => "SIXTY_FOUR_BIT_LONG",
  1955. thread_scheme => "pthreads",
  1956. dso_scheme => sub { env('LIBSSL_dlfcn') },
  1957. shared_target => "linux-shared",
  1958. shared_cflag => "-fPIC",
  1959. ranlib => sub { env('RANLIB') },
  1960. },
  1961. ##### VMS
  1962. # Most things happen in vms-generic.
  1963. # Note that vms_info extracts the pointer size from the end of
  1964. # the target name, and will assume that anything matching /-p\d+$/
  1965. # indicates the pointer size setting for the desired target.
  1966. "vms-generic" => {
  1967. inherit_from => [ "BASE_VMS" ],
  1968. template => 1,
  1969. CC => "CC/DECC",
  1970. CPP => '$(CC)/PREPROCESS_ONLY=SYS$OUTPUT:',
  1971. CFLAGS =>
  1972. combine(picker(default => "/STANDARD=(ISOC94,RELAXED)/NOLIST/PREFIX=ALL",
  1973. debug => "/NOOPTIMIZE/DEBUG",
  1974. release => "/OPTIMIZE/NODEBUG"),
  1975. sub { my @warnings =
  1976. @{vms_info()->{disable_warns}};
  1977. @warnings
  1978. ? "/WARNINGS=DISABLE=(".join(",",@warnings).")" : (); }),
  1979. cflag_incfirst => '/FIRST_INCLUDE=',
  1980. lib_defines =>
  1981. add("OPENSSL_USE_NODELETE", "_XOPEN_SOURCE", "_XOPEN_SOURCE_EXTENDED",
  1982. sub {
  1983. return vms_info()->{def_zlib}
  1984. ? "LIBZ=\"\"\"".vms_info()->{def_zlib}."\"\"\"" : ();
  1985. }),
  1986. lflags => picker(default => "/MAP='F\$PARSE(\".MAP\",\"\$\@\")'",
  1987. debug => "/DEBUG/TRACEBACK",
  1988. release => "/NODEBUG/NOTRACEBACK"),
  1989. # Because of dso_cflags below, we can't set the generic |cflags| here,
  1990. # as it can't be overridden, so we set separate C flags for libraries
  1991. # and binaries instead.
  1992. bin_cflags => add("/NAMES=(AS_IS,SHORTENED)/EXTERN_MODEL=STRICT_REFDEF"),
  1993. lib_cflags => add("/NAMES=(AS_IS,SHORTENED)/EXTERN_MODEL=STRICT_REFDEF"),
  1994. # Strictly speaking, DSOs should not need to have name shortening,
  1995. # as all their exported symbols should be short enough to fit the
  1996. # linker's 31 character per symbol name limit. However, providers
  1997. # may be composed of more than one object file, and internal symbols
  1998. # may and do surpass the 31 character limit.
  1999. dso_cflags => add("/NAMES=(SHORTENED)"),
  2000. ex_libs => add(sub { return vms_info()->{zlib} || (); }),
  2001. shared_target => "vms-shared",
  2002. # def_flag made to empty string so a .opt file gets generated
  2003. shared_defflag => '',
  2004. dso_scheme => "vms",
  2005. thread_scheme => "pthreads",
  2006. makedep_scheme => 'VMS C',
  2007. AS => sub { vms_info()->{AS} },
  2008. ASFLAGS => sub { vms_info()->{ASFLAGS} },
  2009. asoutflag => sub { vms_info()->{asoutflag} },
  2010. asflags => sub { vms_info()->{asflags} },
  2011. perlasm_scheme => sub { vms_info()->{perlasm_scheme} },
  2012. disable => add('pinshared', 'loadereng'),
  2013. },
  2014. # From HELP CC/POINTER_SIZE:
  2015. #
  2016. # ----------
  2017. # LONG[=ARGV] The compiler assumes 64-bit pointers. If the ARGV option to
  2018. # LONG or 64 is present, the main argument argv will be an
  2019. # array of long pointers instead of an array of short pointers.
  2020. #
  2021. # 64[=ARGV] Same as LONG.
  2022. # ----------
  2023. #
  2024. # We don't want the hassle of dealing with 32-bit pointers with argv, so
  2025. # we force it to have 64-bit pointers, see the added cflags in the -p64
  2026. # config targets below.
  2027. "vms-alpha" => {
  2028. inherit_from => [ "vms-generic" ],
  2029. bn_ops => "SIXTY_FOUR_BIT RC4_INT",
  2030. pointer_size => "",
  2031. },
  2032. "vms-alpha-p32" => {
  2033. inherit_from => [ "vms-alpha" ],
  2034. cflags => add("/POINTER_SIZE=32"),
  2035. pointer_size => "32",
  2036. },
  2037. "vms-alpha-p64" => {
  2038. inherit_from => [ "vms-alpha" ],
  2039. cflags => add("/POINTER_SIZE=64=ARGV"),
  2040. pointer_size => "64",
  2041. },
  2042. "vms-ia64" => {
  2043. inherit_from => [ "vms-generic" ],
  2044. bn_ops => "SIXTY_FOUR_BIT RC4_INT",
  2045. asm_arch => sub { vms_info()->{AS} ? 'ia64' : undef },
  2046. perlasm_scheme => 'ias',
  2047. pointer_size => "",
  2048. },
  2049. "vms-ia64-p32" => {
  2050. inherit_from => [ "vms-ia64" ],
  2051. cflags => add("/POINTER_SIZE=32"),
  2052. pointer_size => "32",
  2053. },
  2054. "vms-ia64-p64" => {
  2055. inherit_from => [ "vms-ia64" ],
  2056. cflags => add("/POINTER_SIZE=64=ARGV"),
  2057. pointer_size => "64",
  2058. },
  2059. "vms-x86_64" => {
  2060. inherit_from => [ "vms-generic" ],
  2061. bn_ops => "SIXTY_FOUR_BIT",
  2062. pointer_size => "",
  2063. },
  2064. "vms-x86_64-p32" => {
  2065. inherit_from => [ "vms-x86_64" ],
  2066. cflags => add("/POINTER_SIZE=32"),
  2067. pointer_size => "32",
  2068. },
  2069. "vms-x86_64-p64" => {
  2070. inherit_from => [ "vms-x86_64" ],
  2071. cflags => add("/POINTER_SIZE=64=ARGV"),
  2072. pointer_size => "64",
  2073. }
  2074. );