10-main.conf 77 KB

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