10-main.conf 79 KB

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