10-main.conf 77 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861
  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_lcl.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. "nextstep" => {
  1012. inherit_from => [ "BASE_unix" ],
  1013. CC => "cc",
  1014. CFLAGS => "-O -Wall",
  1015. unistd => "<libc.h>",
  1016. bn_ops => "BN_LLONG",
  1017. thread_scheme => "(unknown)",
  1018. },
  1019. "nextstep3.3" => {
  1020. inherit_from => [ "BASE_unix" ],
  1021. CC => "cc",
  1022. CFLAGS => "-O3 -Wall",
  1023. unistd => "<libc.h>",
  1024. bn_ops => "BN_LLONG",
  1025. thread_scheme => "(unknown)",
  1026. },
  1027. #### SCO/Caldera targets.
  1028. #
  1029. # Originally we had like unixware-*, unixware-*-pentium, unixware-*-p6, etc.
  1030. # Now we only have blended unixware-* as it's the only one used by ./config.
  1031. # If you want to optimize for particular microarchitecture, bypass ./config
  1032. # and './Configure unixware-7 -Kpentium_pro' or whatever appropriate.
  1033. # Note that not all targets include assembler support. Mostly because of
  1034. # lack of motivation to support out-of-date platforms with out-of-date
  1035. # compiler drivers and assemblers.
  1036. #
  1037. # UnixWare 2.0x fails destest with -O.
  1038. "unixware-2.0" => {
  1039. inherit_from => [ "BASE_unix" ],
  1040. CC => "cc",
  1041. cflags => threads("-Kthread"),
  1042. lib_cppflags => "-DFILIO_H -DNO_STRINGS_H",
  1043. ex_libs => add("-lsocket -lnsl -lresolv -lx"),
  1044. thread_scheme => "uithreads",
  1045. },
  1046. "unixware-2.1" => {
  1047. inherit_from => [ "BASE_unix" ],
  1048. CC => "cc",
  1049. CFLAGS => "-O",
  1050. cflags => threads("-Kthread"),
  1051. lib_cppflags => "-DFILIO_H",
  1052. ex_libs => add("-lsocket -lnsl -lresolv -lx"),
  1053. thread_scheme => "uithreads",
  1054. },
  1055. "unixware-7" => {
  1056. inherit_from => [ "BASE_unix" ],
  1057. CC => "cc",
  1058. CFLAGS => "-O",
  1059. cflags => combine("-Kalloca", threads("-Kthread")),
  1060. lib_cppflags => "-DFILIO_H",
  1061. ex_libs => add("-lsocket -lnsl"),
  1062. thread_scheme => "uithreads",
  1063. bn_ops => "BN_LLONG",
  1064. asm_arch => 'x86',
  1065. perlasm_scheme => "elf-1",
  1066. dso_scheme => "dlfcn",
  1067. shared_target => "svr5-shared",
  1068. shared_cflag => "-Kpic",
  1069. },
  1070. "unixware-7-gcc" => {
  1071. inherit_from => [ "BASE_unix" ],
  1072. CC => "gcc",
  1073. CFLAGS => "-O3 -fomit-frame-pointer -Wall",
  1074. cppflags => add(threads("-D_REENTRANT")),
  1075. lib_cppflags => add("-DL_ENDIAN -DFILIO_H"),
  1076. ex_libs => add("-lsocket -lnsl"),
  1077. bn_ops => "BN_LLONG",
  1078. thread_scheme => "pthreads",
  1079. asm_arch => 'x86',
  1080. perlasm_scheme => "elf-1",
  1081. dso_scheme => "dlfcn",
  1082. shared_target => "gnu-shared",
  1083. shared_cflag => "-fPIC",
  1084. },
  1085. # SCO 5 - Ben Laurie says the -O breaks the SCO cc.
  1086. "sco5-cc" => {
  1087. inherit_from => [ "BASE_unix" ],
  1088. cc => "cc",
  1089. cflags => "-belf",
  1090. ex_libs => add("-lsocket -lnsl"),
  1091. thread_scheme => "(unknown)",
  1092. asm_arch => 'x86',
  1093. perlasm_scheme => "elf-1",
  1094. dso_scheme => "dlfcn",
  1095. shared_target => "svr3-shared",
  1096. shared_cflag => "-Kpic",
  1097. },
  1098. "sco5-gcc" => {
  1099. inherit_from => [ "BASE_unix" ],
  1100. cc => "gcc",
  1101. cflags => "-O3 -fomit-frame-pointer",
  1102. ex_libs => add("-lsocket -lnsl"),
  1103. bn_ops => "BN_LLONG",
  1104. thread_scheme => "(unknown)",
  1105. asm_arch => 'x86',
  1106. perlasm_scheme => "elf-1",
  1107. dso_scheme => "dlfcn",
  1108. shared_target => "svr3-shared",
  1109. shared_cflag => "-fPIC",
  1110. },
  1111. #### IBM's AIX.
  1112. # Below targets assume AIX >=5. Caveat lector. If you are accustomed
  1113. # to control compilation "bitness" by setting $OBJECT_MODE environment
  1114. # variable, then you should know that in OpenSSL case it's considered
  1115. # only in ./config. Once configured, build procedure remains "deaf" to
  1116. # current value of $OBJECT_MODE.
  1117. "aix-common" => {
  1118. inherit_from => [ "BASE_unix" ],
  1119. template => 1,
  1120. sys_id => "AIX",
  1121. lib_cppflags => "-DB_ENDIAN",
  1122. lflags => "-Wl,-bsvr4",
  1123. thread_scheme => "pthreads",
  1124. dso_scheme => "dlfcn",
  1125. shared_target => "aix",
  1126. module_ldflags => "-Wl,-G,-bsymbolic,-bnoentry",
  1127. shared_ldflag => "-Wl,-G,-bsymbolic,-bnoentry",
  1128. shared_defflag => "-Wl,-bE:",
  1129. perl_platform => 'AIX',
  1130. },
  1131. "aix-gcc" => {
  1132. inherit_from => [ "aix-common" ],
  1133. CC => "gcc",
  1134. CFLAGS => picker(debug => "-O0 -g",
  1135. release => "-O"),
  1136. cflags => add(threads("-pthread")),
  1137. ex_libs => threads("-pthread"),
  1138. bn_ops => "BN_LLONG RC4_CHAR",
  1139. asm_arch => 'ppc32',
  1140. perlasm_scheme => "aix32",
  1141. shared_ldflag => add_before("-shared -static-libgcc"),
  1142. AR => add("-X32"),
  1143. RANLIB => add("-X32"),
  1144. },
  1145. "aix64-gcc" => {
  1146. inherit_from => [ "aix-common" ],
  1147. CC => "gcc",
  1148. CFLAGS => picker(debug => "-O0 -g",
  1149. release => "-O"),
  1150. cflags => combine("-maix64", threads("-pthread")),
  1151. ex_libs => threads("-pthread"),
  1152. bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
  1153. asm_arch => 'ppc64',
  1154. perlasm_scheme => "aix64",
  1155. shared_ldflag => add_before("-shared -static-libgcc"),
  1156. shared_extension => "64.so.\$(SHLIB_VERSION_NUMBER)",
  1157. AR => add("-X64"),
  1158. RANLIB => add("-X64"),
  1159. },
  1160. "aix-cc" => {
  1161. inherit_from => [ "aix-common" ],
  1162. CC => "cc",
  1163. CFLAGS => picker(debug => "-O0 -g",
  1164. release => "-O"),
  1165. cflags => combine("-q32 -qmaxmem=16384 -qro -qroconst",
  1166. threads("-qthreaded")),
  1167. cppflags => threads("-D_THREAD_SAFE"),
  1168. ex_libs => threads("-lpthreads"),
  1169. bn_ops => "BN_LLONG RC4_CHAR",
  1170. asm_arch => 'ppc32',
  1171. perlasm_scheme => "aix32",
  1172. shared_cflag => "-qpic",
  1173. AR => add("-X32"),
  1174. RANLIB => add("-X32"),
  1175. },
  1176. "aix64-cc" => {
  1177. inherit_from => [ "aix-common" ],
  1178. CC => "cc",
  1179. CFLAGS => picker(debug => "-O0 -g",
  1180. release => "-O"),
  1181. cflags => combine("-q64 -qmaxmem=16384 -qro -qroconst",
  1182. threads("-qthreaded")),
  1183. cppflags => threads("-D_THREAD_SAFE"),
  1184. ex_libs => threads("-lpthreads"),
  1185. bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
  1186. asm_arch => 'ppc64',
  1187. perlasm_scheme => "aix64",
  1188. dso_scheme => "dlfcn",
  1189. shared_cflag => "-qpic",
  1190. shared_extension => "64.so.\$(SHLIB_VERSION_NUMBER)",
  1191. AR => add("-X64"),
  1192. RANLIB => add("-X64"),
  1193. },
  1194. # SIEMENS BS2000/OSD: an EBCDIC-based mainframe
  1195. "BS2000-OSD" => {
  1196. inherit_from => [ "BASE_unix" ],
  1197. CC => "c89",
  1198. CFLAGS => "-O",
  1199. cflags => "-XLLML -XLLMK -XL",
  1200. cppflags => "-DCHARSET_EBCDIC",
  1201. lib_cppflags => "-DB_ENDIAN",
  1202. ex_libs => add("-lsocket -lnsl"),
  1203. bn_ops => "THIRTY_TWO_BIT RC4_CHAR",
  1204. thread_scheme => "(unknown)",
  1205. },
  1206. #### Visual C targets
  1207. #
  1208. # Win64 targets, WIN64I denotes IA-64/Itanium and WIN64A - AMD64
  1209. #
  1210. # Note about /wd4090, disable warning C4090. This warning returns false
  1211. # positives in some situations. Disabling it altogether masks both
  1212. # legitimate and false cases, but as we compile on multiple platforms,
  1213. # we rely on other compilers to catch legitimate cases.
  1214. #
  1215. # Also note that we force threads no matter what. Configuring "no-threads"
  1216. # is ignored.
  1217. #
  1218. # UNICODE is defined in VC-common and applies to all targets. It used to
  1219. # be an opt-in option for VC-WIN32, but not anymore. The original reason
  1220. # was because ANSI API was *native* system interface for no longer
  1221. # supported Windows 9x. Keep in mind that UNICODE only affects how
  1222. # OpenSSL libraries interact with underlying OS, it doesn't affect API
  1223. # that OpenSSL presents to application.
  1224. "VC-common" => {
  1225. inherit_from => [ "BASE_Windows" ],
  1226. template => 1,
  1227. CC => "cl",
  1228. CPP => '$(CC) /EP /C',
  1229. CFLAGS => "/W3 /wd4090 /nologo",
  1230. LDFLAGS => add("/debug"),
  1231. coutflag => "/Fo",
  1232. defines => add("OPENSSL_SYS_WIN32", "WIN32_LEAN_AND_MEAN",
  1233. "UNICODE", "_UNICODE",
  1234. "_CRT_SECURE_NO_DEPRECATE",
  1235. "_WINSOCK_DEPRECATED_NO_WARNINGS"),
  1236. lib_cflags => add("/Zi /Fdossl_static.pdb"),
  1237. lib_defines => add("L_ENDIAN"),
  1238. dso_cflags => "/Zi /Fddso.pdb",
  1239. bin_cflags => "/Zi /Fdapp.pdb",
  1240. # def_flag made to empty string so a .def file gets generated
  1241. shared_defflag => '',
  1242. shared_ldflag => "/dll",
  1243. shared_target => "win-shared", # meaningless except it gives Configure a hint
  1244. thread_scheme => "winthreads",
  1245. dso_scheme => "win32",
  1246. bn_ops => "EXPORT_VAR_AS_FN",
  1247. perl_platform => 'Windows::MSVC',
  1248. # additional parameter to build_scheme denotes install-path "flavour"
  1249. build_scheme => add("VC-common", { separator => undef }),
  1250. },
  1251. "VC-noCE-common" => {
  1252. inherit_from => [ "VC-common" ],
  1253. template => 1,
  1254. CFLAGS => add(picker(debug => '/Od',
  1255. release => '/O2')),
  1256. cflags => add(picker(default => '/Gs0 /GF /Gy',
  1257. debug =>
  1258. sub {
  1259. ($disabled{shared} ? "" : "/MDd");
  1260. },
  1261. release =>
  1262. sub {
  1263. ($disabled{shared} ? "" : "/MD");
  1264. })),
  1265. defines => add(picker(default => [], # works as type cast
  1266. debug => [ "DEBUG", "_DEBUG" ])),
  1267. lib_cflags => add(sub { $disabled{shared} ? "/MT /Zl" : () }),
  1268. # Following might/should appears controversial, i.e. defining
  1269. # /MDd without evaluating $disabled{shared}. It works in
  1270. # non-shared build because static library is compiled with /Zl
  1271. # and bares no reference to specific RTL. And it works in
  1272. # shared build because multiple /MDd options are not prohibited.
  1273. # But why /MDd in static build? Well, basically this is just a
  1274. # reference point, which allows to catch eventual errors that
  1275. # would prevent those who want to wrap OpenSSL into own .DLL.
  1276. # Why not /MD in release build then? Well, some are likely to
  1277. # prefer [non-debug] openssl.exe to be free from Micorosoft RTL
  1278. # redistributable.
  1279. bin_cflags => add(picker(debug => "/MDd",
  1280. release => sub { $disabled{shared} ? "/MT" : () },
  1281. )),
  1282. bin_lflags => add("/subsystem:console /opt:ref"),
  1283. ex_libs => add(sub {
  1284. my @ex_libs = ();
  1285. push @ex_libs, 'ws2_32.lib' unless $disabled{sock};
  1286. push @ex_libs, 'gdi32.lib advapi32.lib crypt32.lib user32.lib';
  1287. return join(" ", @ex_libs);
  1288. }),
  1289. },
  1290. "VC-WIN64-common" => {
  1291. inherit_from => [ "VC-noCE-common" ],
  1292. template => 1,
  1293. ex_libs => add(sub {
  1294. my @ex_libs = ();
  1295. push @ex_libs, 'bufferoverflowu.lib' if (`cl 2>&1` =~ /14\.00\.4[0-9]{4}\./);
  1296. return join(" ", @_, @ex_libs);
  1297. }),
  1298. bn_ops => add("SIXTY_FOUR_BIT"),
  1299. },
  1300. "VC-WIN64I" => {
  1301. inherit_from => [ "VC-WIN64-common" ],
  1302. AS => "ias",
  1303. ASFLAGS => "-d debug",
  1304. asoutflag => "-o ",
  1305. sys_id => "WIN64I",
  1306. uplink_arch => 'ia64',
  1307. asm_arch => 'ia64',
  1308. perlasm_scheme => "ias",
  1309. multilib => "-ia64",
  1310. },
  1311. "VC-WIN64A" => {
  1312. inherit_from => [ "VC-WIN64-common" ],
  1313. AS => sub { vc_win64a_info()->{AS} },
  1314. ASFLAGS => sub { vc_win64a_info()->{ASFLAGS} },
  1315. asoutflag => sub { vc_win64a_info()->{asoutflag} },
  1316. asflags => sub { vc_win64a_info()->{asflags} },
  1317. sys_id => "WIN64A",
  1318. uplink_arch => 'x86_64',
  1319. asm_arch => 'x86_64',
  1320. perlasm_scheme => "auto",
  1321. multilib => "-x64",
  1322. },
  1323. "VC-WIN32" => {
  1324. inherit_from => [ "VC-noCE-common" ],
  1325. CFLAGS => add("/WX"),
  1326. AS => sub { vc_win32_info()->{AS} },
  1327. ASFLAGS => sub { vc_win32_info()->{ASFLAGS} },
  1328. asoutflag => sub { vc_win32_info()->{asoutflag} },
  1329. asflags => sub { vc_win32_info()->{asflags} },
  1330. sys_id => "WIN32",
  1331. bn_ops => add("BN_LLONG"),
  1332. uplink_arch => 'common',
  1333. asm_arch => 'x86',
  1334. perlasm_scheme => sub { vc_win32_info()->{perlasm_scheme} },
  1335. # "WOW" stands for "Windows on Windows", and "VC-WOW" engages
  1336. # some installation path heuristics in windows-makefile.tmpl...
  1337. build_scheme => add("VC-WOW", { separator => undef }),
  1338. },
  1339. "VC-CE" => {
  1340. inherit_from => [ "VC-common" ],
  1341. CFLAGS => add(picker(debug => "/Od",
  1342. release => "/O1i")),
  1343. CPPDEFINES => picker(debug => [ "DEBUG", "_DEBUG" ]),
  1344. LDFLAGS => add("/nologo /opt:ref"),
  1345. cflags =>
  1346. combine('/GF /Gy',
  1347. sub { vc_wince_info()->{cflags}; },
  1348. sub { `cl 2>&1` =~ /Version ([0-9]+)\./ && $1>=14
  1349. ? ($disabled{shared} ? " /MT" : " /MD")
  1350. : " /MC"; }),
  1351. cppflags => sub { vc_wince_info()->{cppflags}; },
  1352. lib_defines => add("NO_CHMOD", "OPENSSL_SMALL_FOOTPRINT"),
  1353. lib_cppflags => sub { vc_wince_info()->{cppflags}; },
  1354. includes =>
  1355. add(combine(sub { defined(env('WCECOMPAT'))
  1356. ? '$(WCECOMPAT)/include' : (); },
  1357. sub { defined(env('PORTSDK_LIBPATH'))
  1358. ? '$(PORTSDK_LIBPATH)/../../include'
  1359. : (); })),
  1360. lflags => add(combine(sub { vc_wince_info()->{lflags}; },
  1361. sub { defined(env('PORTSDK_LIBPATH'))
  1362. ? "/entry:mainCRTstartup" : (); })),
  1363. sys_id => "WINCE",
  1364. bn_ops => add("BN_LLONG"),
  1365. ex_libs => add(sub {
  1366. my @ex_libs = ();
  1367. push @ex_libs, 'ws2.lib' unless $disabled{sock};
  1368. push @ex_libs, 'crypt32.lib';
  1369. if (defined(env('WCECOMPAT'))) {
  1370. my $x = '$(WCECOMPAT)/lib';
  1371. if (-f "$x/env('TARGETCPU')/wcecompatex.lib") {
  1372. $x .= '/$(TARGETCPU)/wcecompatex.lib';
  1373. } else {
  1374. $x .= '/wcecompatex.lib';
  1375. }
  1376. push @ex_libs, $x;
  1377. }
  1378. push @ex_libs, '$(PORTSDK_LIBPATH)/portlib.lib'
  1379. if (defined(env('PORTSDK_LIBPATH')));
  1380. push @ex_libs, ' /nodefaultlib coredll.lib corelibc.lib'
  1381. if (env('TARGETCPU') eq "X86");
  1382. return @ex_libs;
  1383. }),
  1384. },
  1385. #### MinGW
  1386. "mingw-common" => {
  1387. inherit_from => [ 'BASE_unix' ],
  1388. template => 1,
  1389. CC => "gcc",
  1390. CFLAGS => picker(default => "-Wall",
  1391. debug => "-g -O0",
  1392. release => "-O3"),
  1393. cppflags => combine("-DUNICODE -D_UNICODE -DWIN32_LEAN_AND_MEAN",
  1394. threads("-D_MT")),
  1395. lib_cppflags => "-DL_ENDIAN",
  1396. ex_libs => add("-lws2_32 -lgdi32 -lcrypt32"),
  1397. bn_ops => "EXPORT_VAR_AS_FN",
  1398. thread_scheme => "winthreads",
  1399. dso_scheme => "win32",
  1400. shared_target => "mingw-shared",
  1401. shared_cppflags => add("_WINDLL"),
  1402. shared_ldflag => "-static-libgcc",
  1403. perl_platform => 'mingw',
  1404. },
  1405. "mingw" => {
  1406. inherit_from => [ "mingw-common" ],
  1407. CFLAGS => add(picker(release => "-fomit-frame-pointer")),
  1408. cflags => "-m32",
  1409. sys_id => "MINGW32",
  1410. bn_ops => add("BN_LLONG"),
  1411. asm_arch => 'x86',
  1412. uplink_arch => 'x86',
  1413. perlasm_scheme => "coff",
  1414. shared_rcflag => "--target=pe-i386",
  1415. multilib => "",
  1416. },
  1417. "mingw64" => {
  1418. # As for uplink_arch. Applink makes it possible to use
  1419. # .dll compiled with one compiler with application compiled with
  1420. # another compiler. It's possible to engage Applink support in
  1421. # mingw64 build, but it's not done, because until mingw64
  1422. # supports structured exception handling, one can't seriously
  1423. # consider its binaries for using with non-mingw64 run-time
  1424. # environment. And as mingw64 is always consistent with itself,
  1425. # Applink is never engaged and can as well be omitted.
  1426. inherit_from => [ "mingw-common" ],
  1427. cflags => "-m64",
  1428. sys_id => "MINGW64",
  1429. bn_ops => add("SIXTY_FOUR_BIT"),
  1430. asm_arch => 'x86_64',
  1431. uplink_arch => undef,
  1432. perlasm_scheme => "mingw64",
  1433. shared_rcflag => "--target=pe-x86-64",
  1434. multilib => "64",
  1435. },
  1436. #### UEFI
  1437. "UEFI" => {
  1438. inherit_from => [ "BASE_unix" ],
  1439. CC => "cc",
  1440. CFLAGS => "-O",
  1441. lib_cppflags => "-DL_ENDIAN",
  1442. sys_id => "UEFI",
  1443. },
  1444. #### UWIN
  1445. "UWIN" => {
  1446. inherit_from => [ "BASE_unix" ],
  1447. CC => "cc",
  1448. CFLAGS => "-O -Wall",
  1449. lib_cppflags => "-DTERMIOS -DL_ENDIAN",
  1450. sys_id => "UWIN",
  1451. bn_ops => "BN_LLONG",
  1452. dso_scheme => "win32",
  1453. },
  1454. #### Cygwin
  1455. "Cygwin-common" => {
  1456. inherit_from => [ "BASE_unix" ],
  1457. template => 1,
  1458. CC => "gcc",
  1459. CFLAGS => picker(default => "-Wall",
  1460. debug => "-g -O0",
  1461. release => "-O3"),
  1462. lib_cppflags => "-DTERMIOS -DL_ENDIAN",
  1463. sys_id => "CYGWIN",
  1464. thread_scheme => "pthread",
  1465. dso_scheme => "dlfcn",
  1466. shared_target => "cygwin-shared",
  1467. shared_cppflags => "-D_WINDLL",
  1468. perl_platform => 'Cygwin',
  1469. },
  1470. "Cygwin-x86" => {
  1471. inherit_from => [ "Cygwin-common" ],
  1472. CFLAGS => add(picker(release => "-O3 -fomit-frame-pointer")),
  1473. bn_ops => "BN_LLONG",
  1474. asm_arch => 'x86',
  1475. perlasm_scheme => "coff",
  1476. },
  1477. "Cygwin-x86_64" => {
  1478. inherit_from => [ "Cygwin-common" ],
  1479. CC => "gcc",
  1480. bn_ops => "SIXTY_FOUR_BIT_LONG",
  1481. asm_arch => 'x86_64',
  1482. perlasm_scheme => "mingw64",
  1483. },
  1484. # Backward compatibility for those using this target
  1485. "Cygwin" => {
  1486. inherit_from => [ "Cygwin-x86" ]
  1487. },
  1488. # In case someone constructs the Cygwin target name themself
  1489. "Cygwin-i386" => {
  1490. inherit_from => [ "Cygwin-x86" ]
  1491. },
  1492. "Cygwin-i486" => {
  1493. inherit_from => [ "Cygwin-x86" ]
  1494. },
  1495. "Cygwin-i586" => {
  1496. inherit_from => [ "Cygwin-x86" ]
  1497. },
  1498. "Cygwin-i686" => {
  1499. inherit_from => [ "Cygwin-x86" ]
  1500. },
  1501. ##### MacOS X (a.k.a. Darwin) setup
  1502. "darwin-common" => {
  1503. inherit_from => [ "BASE_unix" ],
  1504. template => 1,
  1505. CC => "cc",
  1506. CFLAGS => picker(debug => "-g -O0",
  1507. release => "-O3"),
  1508. cppflags => threads("-D_REENTRANT"),
  1509. lflags => "-Wl,-search_paths_first",
  1510. sys_id => "MACOSX",
  1511. bn_ops => "BN_LLONG RC4_CHAR",
  1512. thread_scheme => "pthreads",
  1513. perlasm_scheme => "osx32",
  1514. dso_scheme => "dlfcn",
  1515. ranlib => "ranlib -c",
  1516. shared_target => "darwin-shared",
  1517. shared_cflag => "-fPIC",
  1518. shared_extension => ".\$(SHLIB_VERSION_NUMBER).dylib",
  1519. },
  1520. # Option "freeze" such as -std=gnu9x can't negatively interfere
  1521. # with future defaults for below two targets, because MacOS X
  1522. # for PPC has no future, it was discontinued by vendor in 2009.
  1523. "darwin-ppc-cc" => {
  1524. inherit_from => [ "darwin-common" ],
  1525. cflags => add("-arch ppc -std=gnu9x -Wa,-force_cpusubtype_ALL"),
  1526. lib_cppflags => add("-DB_ENDIAN"),
  1527. shared_cflag => add("-fno-common"),
  1528. asm_arch => 'ppc32',
  1529. perlasm_scheme => "osx32",
  1530. },
  1531. "darwin64-ppc-cc" => {
  1532. inherit_from => [ "darwin-common" ],
  1533. cflags => add("-arch ppc64 -std=gnu9x"),
  1534. lib_cppflags => add("-DB_ENDIAN"),
  1535. bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
  1536. asm_arch => 'ppc64',
  1537. perlasm_scheme => "osx64",
  1538. },
  1539. "darwin-i386-cc" => {
  1540. inherit_from => [ "darwin-common" ],
  1541. CFLAGS => add(picker(release => "-fomit-frame-pointer")),
  1542. cflags => add("-arch i386"),
  1543. lib_cppflags => add("-DL_ENDIAN"),
  1544. bn_ops => "BN_LLONG RC4_INT",
  1545. asm_arch => 'x86',
  1546. perlasm_scheme => "macosx",
  1547. },
  1548. "darwin64-x86_64-cc" => {
  1549. inherit_from => [ "darwin-common" ],
  1550. CFLAGS => add("-Wall"),
  1551. cflags => add("-arch x86_64"),
  1552. lib_cppflags => add("-DL_ENDIAN"),
  1553. bn_ops => "SIXTY_FOUR_BIT_LONG",
  1554. asm_arch => 'x86_64',
  1555. perlasm_scheme => "macosx",
  1556. },
  1557. ##### GNU Hurd
  1558. "hurd-x86" => {
  1559. inherit_from => [ "BASE_unix" ],
  1560. CC => "gcc",
  1561. CFLAGS => "-O3 -fomit-frame-pointer -Wall",
  1562. cflags => threads("-pthread"),
  1563. lib_cppflags => "-DL_ENDIAN",
  1564. ex_libs => add("-ldl", threads("-pthread")),
  1565. bn_ops => "BN_LLONG",
  1566. asm_arch => 'x86',
  1567. perlasm_scheme => 'elf',
  1568. thread_scheme => "pthreads",
  1569. dso_scheme => "dlfcn",
  1570. shared_target => "linux-shared",
  1571. shared_cflag => "-fPIC",
  1572. },
  1573. ##### VxWorks for various targets
  1574. "vxworks-ppc60x" => {
  1575. inherit_from => [ "BASE_unix" ],
  1576. CC => "ccppc",
  1577. CFLAGS => "-O2 -Wall -fstrength-reduce",
  1578. cflags => "-mrtp -mhard-float -mstrict-align -fno-implicit-fp -fno-builtin -fno-strict-aliasing",
  1579. cppflags => combine("-D_REENTRANT -DPPC32_fp60x -DCPU=PPC32",
  1580. "_DTOOL_FAMILY=gnu -DTOOL=gnu",
  1581. "-I\$(WIND_BASE)/target/usr/h",
  1582. "-I\$(WIND_BASE)/target/usr/h/wrn/coreip"),
  1583. sys_id => "VXWORKS",
  1584. lflags => add("-L \$(WIND_BASE)/target/usr/lib/ppc/PPC32/common"),
  1585. ex_libs => add("-Wl,--defsym,__wrs_rtp_base=0xe0000000"),
  1586. },
  1587. "vxworks-ppcgen" => {
  1588. inherit_from => [ "BASE_unix" ],
  1589. CC => "ccppc",
  1590. CFLAGS => "-O1 -Wall",
  1591. cflags => "-mrtp -msoft-float -mstrict-align -fno-builtin -fno-strict-aliasing",
  1592. cppflags => combine("-D_REENTRANT -DPPC32 -DCPU=PPC32",
  1593. "-DTOOL_FAMILY=gnu -DTOOL=gnu",
  1594. "-I\$(WIND_BASE)/target/usr/h",
  1595. "-I\$(WIND_BASE)/target/usr/h/wrn/coreip"),
  1596. sys_id => "VXWORKS",
  1597. lflags => add("-L \$(WIND_BASE)/target/usr/lib/ppc/PPC32/sfcommon"),
  1598. ex_libs => add("-Wl,--defsym,__wrs_rtp_base=0xe0000000"),
  1599. },
  1600. "vxworks-ppc405" => {
  1601. inherit_from => [ "BASE_unix" ],
  1602. CC => "ccppc",
  1603. CFLAGS => "-g",
  1604. cflags => "-msoft-float -mlongcall",
  1605. cppflags => combine("-D_REENTRANT -DPPC32 -DCPU=PPC405",
  1606. "-DTOOL_FAMILY=gnu -DTOOL=gnu",
  1607. "-I\$(WIND_BASE)/target/h"),
  1608. sys_id => "VXWORKS",
  1609. lflags => add("-r"),
  1610. },
  1611. "vxworks-ppc750" => {
  1612. inherit_from => [ "BASE_unix" ],
  1613. CC => "ccppc",
  1614. CFLAGS => "-ansi -fvolatile -Wall \$(DEBUG_FLAG)",
  1615. cflags => "-nostdinc -fno-builtin -fno-for-scope -fsigned-char -msoft-float -mlongcall",
  1616. cppflags => combine("-DPPC750 -D_REENTRANT -DCPU=PPC604",
  1617. "-I\$(WIND_BASE)/target/h"),
  1618. sys_id => "VXWORKS",
  1619. lflags => add("-r"),
  1620. },
  1621. "vxworks-ppc750-debug" => {
  1622. inherit_from => [ "BASE_unix" ],
  1623. CC => "ccppc",
  1624. CFLAGS => "-ansi -fvolatile -Wall -g",
  1625. cflags => "-nostdinc -fno-builtin -fno-for-scope -fsigned-char -msoft-float -mlongcall",
  1626. cppflags => combine("-DPPC750 -D_REENTRANT -DCPU=PPC604",
  1627. "-DPEDANTIC -DDEBUG",
  1628. "-I\$(WIND_BASE)/target/h"),
  1629. sys_id => "VXWORKS",
  1630. lflags => add("-r"),
  1631. },
  1632. "vxworks-ppc860" => {
  1633. inherit_from => [ "BASE_unix" ],
  1634. CC => "ccppc",
  1635. cflags => "-nostdinc -msoft-float",
  1636. cppflags => combine("-DCPU=PPC860 -DNO_STRINGS_H",
  1637. "-I\$(WIND_BASE)/target/h"),
  1638. sys_id => "VXWORKS",
  1639. lflags => add("-r"),
  1640. },
  1641. "vxworks-simlinux" => {
  1642. inherit_from => [ "BASE_unix" ],
  1643. CC => "ccpentium",
  1644. cflags => "-B\$(WIND_BASE)/host/\$(WIND_HOST_TYPE)/lib/gcc-lib/ -fno-builtin -fno-defer-pop",
  1645. cppflags => combine("-D_VSB_CONFIG_FILE=\"\$(WIND_BASE)/target/lib/h/config/vsbConfig.h\"",
  1646. "-DL_ENDIAN -DCPU=SIMLINUX -DNO_STRINGS_H",
  1647. "-DTOOL_FAMILY=gnu -DTOOL=gnu",
  1648. "-DOPENSSL_NO_HW_PADLOCK",
  1649. "-I\$(WIND_BASE)/target/h",
  1650. "-I\$(WIND_BASE)/target/h/wrn/coreip"),
  1651. sys_id => "VXWORKS",
  1652. lflags => add("-r"),
  1653. ranlib => "ranlibpentium",
  1654. },
  1655. "vxworks-mips" => {
  1656. inherit_from => [ "BASE_unix" ],
  1657. CC => "ccmips",
  1658. CFLAGS => "-O -G 0",
  1659. cflags => "-mrtp -mips2 -B\$(WIND_BASE)/host/\$(WIND_HOST_TYPE)/lib/gcc-lib/ -msoft-float -mno-branch-likely -fno-builtin -fno-defer-pop",
  1660. cppflags => combine("-D_VSB_CONFIG_FILE=\"\$(WIND_BASE)/target/lib/h/config/vsbConfig.h\"",
  1661. "-DCPU=MIPS32 -DNO_STRINGS_H",
  1662. "-DTOOL_FAMILY=gnu -DTOOL=gnu",
  1663. "-DOPENSSL_NO_HW_PADLOCK",
  1664. threads("-D_REENTRANT"),
  1665. "-I\$(WIND_BASE)/target/h",
  1666. "-I\$(WIND_BASE)/target/h/wrn/coreip"),
  1667. sys_id => "VXWORKS",
  1668. lflags => add("-L \$(WIND_BASE)/target/usr/lib/mips/MIPSI32/sfcommon"),
  1669. ex_libs => add("-Wl,--defsym,__wrs_rtp_base=0xe0000000"),
  1670. thread_scheme => "pthreads",
  1671. asm_arch => 'mips32',
  1672. perlasm_scheme => "o32",
  1673. ranlib => "ranlibmips",
  1674. },
  1675. #### uClinux
  1676. "uClinux-dist" => {
  1677. inherit_from => [ "BASE_unix" ],
  1678. CC => sub { env('CC') },
  1679. cppflags => threads("-D_REENTRANT"),
  1680. ex_libs => add("\$(LDLIBS)"),
  1681. bn_ops => "BN_LLONG",
  1682. thread_scheme => "pthreads",
  1683. dso_scheme => sub { env('LIBSSL_dlfcn') },
  1684. shared_target => "linux-shared",
  1685. shared_cflag => "-fPIC",
  1686. ranlib => sub { env('RANLIB') },
  1687. },
  1688. "uClinux-dist64" => {
  1689. inherit_from => [ "BASE_unix" ],
  1690. CC => sub { env('CC') },
  1691. cppflags => threads("-D_REENTRANT"),
  1692. ex_libs => add("\$(LDLIBS)"),
  1693. bn_ops => "SIXTY_FOUR_BIT_LONG",
  1694. thread_scheme => "pthreads",
  1695. dso_scheme => sub { env('LIBSSL_dlfcn') },
  1696. shared_target => "linux-shared",
  1697. shared_cflag => "-fPIC",
  1698. ranlib => sub { env('RANLIB') },
  1699. },
  1700. ##### VMS
  1701. # Most things happen in vms-generic.
  1702. # Note that vms_info extracts the pointer size from the end of
  1703. # the target name, and will assume that anything matching /-p\d+$/
  1704. # indicates the pointer size setting for the desired target.
  1705. "vms-generic" => {
  1706. inherit_from => [ "BASE_VMS" ],
  1707. template => 1,
  1708. CC => "CC/DECC",
  1709. CPP => '$(CC)/PREPROCESS_ONLY=SYS$OUTPUT:',
  1710. CFLAGS =>
  1711. combine(picker(default => "/STANDARD=(ISOC94,RELAXED)/NOLIST/PREFIX=ALL",
  1712. debug => "/NOOPTIMIZE/DEBUG",
  1713. release => "/OPTIMIZE/NODEBUG"),
  1714. sub { my @warnings =
  1715. @{vms_info()->{disable_warns}};
  1716. @warnings
  1717. ? "/WARNINGS=DISABLE=(".join(",",@warnings).")" : (); }),
  1718. lib_defines =>
  1719. add("OPENSSL_USE_NODELETE",
  1720. sub {
  1721. return vms_info()->{def_zlib}
  1722. ? "LIBZ=\"\"\"".vms_info()->{def_zlib}."\"\"\"" : ();
  1723. }),
  1724. lflags => picker(default => "/MAP='F\$PARSE(\".MAP\",\"\$\@\")'",
  1725. debug => "/DEBUG/TRACEBACK",
  1726. release => "/NODEBUG/NOTRACEBACK"),
  1727. # Because of dso_cflags below, we can't set the generic |cflags| here,
  1728. # as it can't be overriden, so we set separate C flags for libraries
  1729. # and binaries instead.
  1730. bin_cflags => add("/NAMES=(AS_IS,SHORTENED)/EXTERN_MODEL=STRICT_REFDEF"),
  1731. lib_cflags => add("/NAMES=(AS_IS,SHORTENED)/EXTERN_MODEL=STRICT_REFDEF"),
  1732. # For modules specifically, we assume that they only use public
  1733. # OpenSSL symbols, and therefore don't need to mangle names on
  1734. # their own.
  1735. dso_cflags => "",
  1736. ex_libs => add(sub { return vms_info()->{zlib} || (); }),
  1737. shared_target => "vms-shared",
  1738. # def_flag made to empty string so a .opt file gets generated
  1739. shared_defflag => '',
  1740. dso_scheme => "vms",
  1741. thread_scheme => "pthreads",
  1742. AS => sub { vms_info()->{AS} },
  1743. ASFLAGS => sub { vms_info()->{ASFLAGS} },
  1744. asoutflag => sub { vms_info()->{asoutflag} },
  1745. asflags => sub { vms_info()->{asflags} },
  1746. perlasm_scheme => sub { vms_info()->{perlasm_scheme} },
  1747. disable => add('pinshared'),
  1748. },
  1749. # From HELP CC/POINTER_SIZE:
  1750. #
  1751. # ----------
  1752. # LONG[=ARGV] The compiler assumes 64-bit pointers. If the ARGV option to
  1753. # LONG or 64 is present, the main argument argv will be an
  1754. # array of long pointers instead of an array of short pointers.
  1755. #
  1756. # 64[=ARGV] Same as LONG.
  1757. # ----------
  1758. #
  1759. # We don't want the hassle of dealing with 32-bit pointers with argv, so
  1760. # we force it to have 64-bit pointers, see the added cflags in the -p64
  1761. # config targets below.
  1762. "vms-alpha" => {
  1763. inherit_from => [ "vms-generic" ],
  1764. bn_ops => "SIXTY_FOUR_BIT RC4_INT",
  1765. pointer_size => "",
  1766. },
  1767. "vms-alpha-p32" => {
  1768. inherit_from => [ "vms-alpha" ],
  1769. cflags => add("/POINTER_SIZE=32"),
  1770. pointer_size => "32",
  1771. },
  1772. "vms-alpha-p64" => {
  1773. inherit_from => [ "vms-alpha" ],
  1774. cflags => add("/POINTER_SIZE=64=ARGV"),
  1775. pointer_size => "64",
  1776. },
  1777. "vms-ia64" => {
  1778. inherit_from => [ "vms-generic" ],
  1779. bn_ops => "SIXTY_FOUR_BIT RC4_INT",
  1780. asm_arch => sub { vms_info()->{AS} ? 'ia64' : undef },
  1781. perlasm_scheme => 'ias',
  1782. pointer_size => "",
  1783. },
  1784. "vms-ia64-p32" => {
  1785. inherit_from => [ "vms-ia64" ],
  1786. cflags => add("/POINTER_SIZE=32"),
  1787. pointer_size => "32",
  1788. },
  1789. "vms-ia64-p64" => {
  1790. inherit_from => [ "vms-ia64" ],
  1791. cflags => add("/POINTER_SIZE=64=ARGV"),
  1792. pointer_size => "64",
  1793. },
  1794. );