10-main.conf 78 KB

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