10-main.conf 80 KB

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