10-main.conf 79 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813
  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 - please read INSTALL and NOTES.WIN for further details\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 - please read INSTALL and NOTES.WIN for further details\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 todays
  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-mips3-gcc" => {
  339. inherit_from => [ "BASE_unix", asm("mips64_asm") ],
  340. CC => "gcc",
  341. CFLAGS => picker(debug => "-g -O0",
  342. release => "-O3"),
  343. cflags => "-mabi=n32",
  344. cppflags => combine("-DB_ENDIAN -DBN_DIV3W",
  345. threads("-D_SGI_MP_SOURCE")),
  346. cppflags => threads("-D_SGI_MP_SOURCE"),
  347. lib_cppflags => "-DB_ENDIAN -DBN_DIV3W",
  348. ex_libs => add(threads("-lpthread")),
  349. bn_ops => "RC4_CHAR SIXTY_FOUR_BIT",
  350. thread_scheme => "pthreads",
  351. perlasm_scheme => "n32",
  352. dso_scheme => "dlfcn",
  353. shared_target => "irix-shared",
  354. shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
  355. multilib => "32",
  356. },
  357. "irix-mips3-cc" => {
  358. inherit_from => [ "BASE_unix", asm("mips64_asm") ],
  359. CC => "cc",
  360. CFLAGS => picker(debug => "-g -O0",
  361. release => "-O2"),
  362. cflags => "-n32 -mips3 -use_readonly_const -G0 -rdata_shared",
  363. cppflags => threads("-D_SGI_MP_SOURCE"),
  364. lib_cppflags => "-DB_ENDIAN -DBN_DIV3W",
  365. ex_libs => add(threads("-lpthread")),
  366. bn_ops => "RC4_CHAR SIXTY_FOUR_BIT",
  367. thread_scheme => "pthreads",
  368. perlasm_scheme => "n32",
  369. dso_scheme => "dlfcn",
  370. shared_target => "irix-shared",
  371. shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
  372. multilib => "32",
  373. },
  374. # N64 ABI builds.
  375. "irix64-mips4-gcc" => {
  376. inherit_from => [ "BASE_unix", asm("mips64_asm") ],
  377. CC => "gcc",
  378. CFLAGS => picker(debug => "-g -O0",
  379. release => "-O3"),
  380. cflags => "-mabi=64 -mips4",
  381. cppflags => threads("-D_SGI_MP_SOURCE"),
  382. lib_cppflags => "-DB_ENDIAN -DBN_DIV3W",
  383. ex_libs => add(threads("-lpthread")),
  384. bn_ops => "RC4_CHAR SIXTY_FOUR_BIT_LONG",
  385. thread_scheme => "pthreads",
  386. perlasm_scheme => "64",
  387. dso_scheme => "dlfcn",
  388. shared_target => "irix-shared",
  389. shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
  390. multilib => "64",
  391. },
  392. "irix64-mips4-cc" => {
  393. inherit_from => [ "BASE_unix", asm("mips64_asm") ],
  394. CC => "cc",
  395. CFLAGS => picker(debug => "-g -O0",
  396. release => "-O2"),
  397. cflags => "-64 -mips4 -use_readonly_const -G0 -rdata_shared",
  398. cppflags => threads("-D_SGI_MP_SOURCE"),
  399. lib_cppflags => "-DB_ENDIAN -DBN_DIV3W",
  400. ex_libs => threads("-lpthread"),
  401. bn_ops => "RC4_CHAR SIXTY_FOUR_BIT_LONG",
  402. thread_scheme => "pthreads",
  403. perlasm_scheme => "64",
  404. dso_scheme => "dlfcn",
  405. shared_target => "irix-shared",
  406. shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
  407. multilib => "64",
  408. },
  409. #### Unified HP-UX ANSI C configs.
  410. # Special notes:
  411. # - Originally we were optimizing at +O4 level. It should be noted
  412. # that the only difference between +O3 and +O4 is global inter-
  413. # procedural analysis. As it has to be performed during the link
  414. # stage the compiler leaves behind certain pseudo-code in lib*.a
  415. # which might be release or even patch level specific. Generating
  416. # the machine code for and analyzing the *whole* program appears
  417. # to be *extremely* memory demanding while the performance gain is
  418. # actually questionable. The situation is intensified by the default
  419. # HP-UX data set size limit (infamous 'maxdsiz' tunable) of 64MB
  420. # which is way too low for +O4. In other words, doesn't +O3 make
  421. # more sense?
  422. # - Keep in mind that the HP compiler by default generates code
  423. # suitable for execution on the host you're currently compiling at.
  424. # If the toolkit is meant to be used on various PA-RISC processors
  425. # consider './Configure hpux-parisc-[g]cc +DAportable'.
  426. # - -DMD32_XARRAY triggers workaround for compiler bug we ran into in
  427. # 32-bit message digests. (For the moment of this writing) HP C
  428. # doesn't seem to "digest" too many local variables (they make "him"
  429. # chew forever:-). For more details look-up MD32_XARRAY comment in
  430. # crypto/sha/sha_lcl.h.
  431. # - originally there were 32-bit hpux-parisc2-* targets. They were
  432. # scrapped, because a) they were not interchangeable with other 32-bit
  433. # targets; b) performance-critical 32-bit assembly modules implement
  434. # even PA-RISC 2.0-specific code paths, which are chosen at run-time,
  435. # thus adequate performance is provided even with PA-RISC 1.1 build.
  436. "hpux-common" => {
  437. inherit_from => [ "BASE_unix" ],
  438. template => 1,
  439. defines => add("_XOPEN_SOURCE", "_XOPEN_SOURCE_EXTENDED",
  440. "_HPUX_ALT_XOPEN_SOCKET_API"),
  441. lib_cppflags => "-DB_ENDIAN",
  442. thread_scheme => "pthreads",
  443. dso_scheme => "dlfcn", # overridden in 32-bit PA-RISC builds
  444. shared_target => "self",
  445. bin_lflags => "-Wl,+s,+cdp,../:,+cdp,./:",
  446. shared_ldflag => "-Wl,-B,symbolic,+vnocompatwarnings,-z,+s,+cdp,../:,+cdp,./:",
  447. shared_sonameflag=> "-Wl,+h,",
  448. },
  449. "hpux-parisc-gcc" => {
  450. inherit_from => [ "hpux-common" ],
  451. CC => "gcc",
  452. CFLAGS => picker(debug => "-O0 -g",
  453. release => "-O3"),
  454. cflags => add(threads("-pthread")),
  455. lib_cppflags => add("-DBN_DIV2W"),
  456. ex_libs => add("-ldld", threads("-pthread")),
  457. bn_ops => "BN_LLONG RC4_CHAR",
  458. dso_scheme => "dl",
  459. shared_cflag => "-fPIC",
  460. shared_ldflag => add_before("-shared"),
  461. shared_extension => ".sl.\$(SHLIB_VERSION_NUMBER)",
  462. },
  463. "hpux-parisc1_1-gcc" => {
  464. inherit_from => [ "hpux-parisc-gcc", asm("parisc11_asm") ],
  465. multilib => "/pa1.1",
  466. },
  467. "hpux64-parisc2-gcc" => {
  468. inherit_from => [ "hpux-common", asm("parisc20_64_asm") ],
  469. CC => "gcc",
  470. CFLAGS => combine(picker(debug => "-O0 -g",
  471. release => "-O3")),
  472. cflags => add(threads("-pthread")),
  473. ex_libs => add("-ldl", threads("-pthread")),
  474. bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
  475. shared_cflag => "-fpic",
  476. shared_ldflag => add_before("-shared"),
  477. shared_extension => ".sl.\$(SHLIB_VERSION_NUMBER)",
  478. multilib => "/pa20_64",
  479. },
  480. # More attempts at unified 10.X and 11.X targets for HP C compiler.
  481. "hpux-parisc-cc" => {
  482. inherit_from => [ "hpux-common" ],
  483. CC => "cc",
  484. CFLAGS => picker(debug => "+O0 +d -g",
  485. release => "+O3"),
  486. cflags => "+Optrs_strongly_typed -Ae +ESlit",
  487. cppflags => threads("-D_REENTRANT"),
  488. lib_cppflags => add("-DBN_DIV2W -DMD32_XARRAY"),
  489. ex_libs => add("-ldld", threads("-lpthread")),
  490. bn_ops => "RC4_CHAR",
  491. dso_scheme => "dl",
  492. shared_cflag => "+Z",
  493. shared_ldflag => add_before("-b"),
  494. shared_extension => ".sl.\$(SHLIB_VERSION_NUMBER)",
  495. },
  496. "hpux-parisc1_1-cc" => {
  497. inherit_from => [ "hpux-parisc-cc", asm("parisc11_asm") ],
  498. cflags => add_before("+DA1.1"),
  499. multilib => "/pa1.1",
  500. },
  501. "hpux64-parisc2-cc" => {
  502. inherit_from => [ "hpux-common", asm("parisc20_64_asm") ],
  503. CC => "cc",
  504. CFLAGS => picker(debug => "+O0 +d -g",
  505. release => "+O3") ,
  506. cflags => "+DD64 +Optrs_strongly_typed -Ae +ESlit",
  507. cppflags => threads("-D_REENTRANT") ,
  508. lib_cppflags => add("-DMD32_XARRAY"),
  509. ex_libs => add("-ldl", threads("-lpthread")),
  510. bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
  511. shared_cflag => "+Z",
  512. shared_ldflag => add_before("-b"),
  513. shared_extension => ".sl.\$(SHLIB_VERSION_NUMBER)",
  514. multilib => "/pa20_64",
  515. },
  516. # HP/UX IA-64 targets
  517. "hpux-ia64-cc" => {
  518. inherit_from => [ "hpux-common", asm("ia64_asm") ],
  519. CC => "cc",
  520. CFLAGS => picker(debug => "+O0 +d -g",
  521. release => "+O2"),
  522. cflags => "-Ae +DD32 +Olit=all -z",
  523. cppflags => add(threads("-D_REENTRANT")),
  524. ex_libs => add("-ldl", threads("-lpthread")),
  525. bn_ops => "SIXTY_FOUR_BIT",
  526. shared_cflag => "+Z",
  527. shared_ldflag => add_before("-b"),
  528. shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
  529. multilib => "/hpux32",
  530. },
  531. "hpux64-ia64-cc" => {
  532. inherit_from => [ "hpux-common", asm("ia64_asm") ],
  533. CC => "cc",
  534. CFLAGS => picker(debug => "+O0 +d -g",
  535. release => "+O3"),
  536. cflags => "-Ae +DD64 +Olit=all -z",
  537. cppflags => threads("-D_REENTRANT"),
  538. ex_libs => add("-ldl", threads("-lpthread")),
  539. bn_ops => "SIXTY_FOUR_BIT_LONG",
  540. shared_cflag => "+Z",
  541. shared_ldflag => add_before("-b"),
  542. shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
  543. multilib => "/hpux64",
  544. },
  545. # GCC builds...
  546. "hpux-ia64-gcc" => {
  547. inherit_from => [ "hpux-common", asm("ia64_asm") ],
  548. CC => "gcc",
  549. CFLAGS => picker(debug => "-O0 -g",
  550. release => "-O3"),
  551. cflags => add(threads("-pthread")),
  552. ex_libs => add("-ldl", threads("-pthread")),
  553. bn_ops => "SIXTY_FOUR_BIT",
  554. shared_cflag => "-fpic",
  555. shared_ldflag => add_before("-shared"),
  556. shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
  557. multilib => "/hpux32",
  558. },
  559. "hpux64-ia64-gcc" => {
  560. inherit_from => [ "hpux-common", asm("ia64_asm") ],
  561. CC => "gcc",
  562. CFLAGS => picker(debug => "-O0 -g",
  563. release => "-O3"),
  564. cflags => combine("-mlp64", threads("-pthread")),
  565. ex_libs => add("-ldl", threads("-pthread")),
  566. bn_ops => "SIXTY_FOUR_BIT_LONG",
  567. shared_cflag => "-fpic",
  568. shared_ldflag => add_before("-shared"),
  569. shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
  570. multilib => "/hpux64",
  571. },
  572. #### HP MPE/iX http://jazz.external.hp.com/src/openssl/
  573. "MPE/iX-gcc" => {
  574. inherit_from => [ "BASE_unix" ],
  575. CC => "gcc",
  576. CFLAGS => "-O3",
  577. cppflags => "-D_POSIX_SOURCE -D_SOCKET_SOURCE",
  578. includes => [ "/SYSLOG/PUB" ],
  579. lib_cppflags => "-DBN_DIV2W",
  580. sys_id => "MPE",
  581. lflags => add("-L/SYSLOG/PUB"),
  582. ex_libs => add("-lsyslog -lsocket -lcurses"),
  583. thread_scheme => "(unknown)",
  584. bn_ops => "BN_LLONG",
  585. },
  586. #### DEC Alpha Tru64 targets. Tru64 is marketing name for OSF/1 version 4
  587. #### and forward. In reality 'uname -s' still returns "OSF1". Originally
  588. #### there were even osf1-* configs targeting prior versions provided,
  589. #### but not anymore...
  590. "tru64-alpha-gcc" => {
  591. inherit_from => [ "BASE_unix", asm("alpha_asm") ],
  592. CC => "gcc",
  593. CFLAGS => "-O3",
  594. cflags => add("-std=c9x", threads("-pthread")),
  595. cppflags => "-D_XOPEN_SOURCE=500 -D_OSF_SOURCE",
  596. ex_libs => add("-lrt", threads("-pthread")), # for mlock(2)
  597. bn_ops => "SIXTY_FOUR_BIT_LONG",
  598. thread_scheme => "pthreads",
  599. dso_scheme => "dlfcn",
  600. shared_target => "alpha-osf1-shared",
  601. shared_extension => ".so",
  602. },
  603. "tru64-alpha-cc" => {
  604. inherit_from => [ "BASE_unix", asm("alpha_asm") ],
  605. CC => "cc",
  606. CFLAGS => "-tune host -fast",
  607. cflags => add("-std1 -readonly_strings",
  608. threads("-pthread")),
  609. cppflags => "-D_XOPEN_SOURCE=500 -D_OSF_SOURCE",
  610. ex_libs => add("-lrt", threads("-pthread")), # for mlock(2)
  611. bn_ops => "SIXTY_FOUR_BIT_LONG",
  612. thread_scheme => "pthreads",
  613. dso_scheme => "dlfcn",
  614. shared_target => "alpha-osf1-shared",
  615. shared_ldflag => "-msym",
  616. shared_extension => ".so",
  617. },
  618. ####
  619. #### Variety of LINUX:-)
  620. ####
  621. # *-generic* is endian-neutral target, but ./config is free to
  622. # throw in -D[BL]_ENDIAN, whichever appropriate...
  623. "linux-generic32" => {
  624. inherit_from => [ "BASE_unix" ],
  625. CC => "gcc",
  626. CXX => "g++",
  627. CFLAGS => picker(default => "-Wall",
  628. debug => "-O0 -g",
  629. release => "-O3"),
  630. CXXFLAGS => picker(default => "-Wall",
  631. debug => "-O0 -g",
  632. release => "-O3"),
  633. cflags => threads("-pthread"),
  634. cxxflags => combine("-std=c++11", threads("-pthread")),
  635. lib_cppflags => "-DOPENSSL_USE_NODELETE",
  636. ex_libs => add("-ldl", threads("-pthread")),
  637. bn_ops => "BN_LLONG RC4_CHAR",
  638. thread_scheme => "pthreads",
  639. dso_scheme => "dlfcn",
  640. shared_target => "linux-shared",
  641. shared_cflag => "-fPIC",
  642. shared_ldflag => "-Wl,-znodelete",
  643. shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
  644. enable => [ "afalgeng" ],
  645. },
  646. "linux-generic64" => {
  647. inherit_from => [ "linux-generic32" ],
  648. bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
  649. },
  650. "linux-ppc" => {
  651. inherit_from => [ "linux-generic32", asm("ppc32_asm") ],
  652. perlasm_scheme => "linux32",
  653. },
  654. "linux-ppc64" => {
  655. inherit_from => [ "linux-generic64", asm("ppc64_asm") ],
  656. cflags => add("-m64"),
  657. cxxflags => add("-m64"),
  658. lib_cppflags => add("-DB_ENDIAN"),
  659. perlasm_scheme => "linux64",
  660. multilib => "64",
  661. },
  662. "linux-ppc64le" => {
  663. inherit_from => [ "linux-generic64", asm("ppc64_asm") ],
  664. cflags => add("-m64"),
  665. cxxflags => add("-m64"),
  666. lib_cppflags => add("-DL_ENDIAN"),
  667. perlasm_scheme => "linux64le",
  668. },
  669. "linux-armv4" => {
  670. ################################################################
  671. # Note that -march is not among compiler options in linux-armv4
  672. # target description. Not specifying one is intentional to give
  673. # you choice to:
  674. #
  675. # a) rely on your compiler default by not specifying one;
  676. # b) specify your target platform explicitly for optimal
  677. # performance, e.g. -march=armv6 or -march=armv7-a;
  678. # c) build "universal" binary that targets *range* of platforms
  679. # by specifying minimum and maximum supported architecture;
  680. #
  681. # As for c) option. It actually makes no sense to specify
  682. # maximum to be less than ARMv7, because it's the least
  683. # requirement for run-time switch between platform-specific
  684. # code paths. And without run-time switch performance would be
  685. # equivalent to one for minimum. Secondly, there are some
  686. # natural limitations that you'd have to accept and respect.
  687. # Most notably you can *not* build "universal" binary for
  688. # big-endian platform. This is because ARMv7 processor always
  689. # picks instructions in little-endian order. Another similar
  690. # limitation is that -mthumb can't "cross" -march=armv6t2
  691. # boundary, because that's where it became Thumb-2. Well, this
  692. # limitation is a bit artificial, because it's not really
  693. # impossible, but it's deemed too tricky to support. And of
  694. # course you have to be sure that your binutils are actually
  695. # up to the task of handling maximum target platform. With all
  696. # this in mind here is an example of how to configure
  697. # "universal" build:
  698. #
  699. # ./Configure linux-armv4 -march=armv6 -D__ARM_MAX_ARCH__=8
  700. #
  701. inherit_from => [ "linux-generic32", asm("armv4_asm") ],
  702. perlasm_scheme => "linux32",
  703. },
  704. "linux-aarch64" => {
  705. inherit_from => [ "linux-generic64", asm("aarch64_asm") ],
  706. perlasm_scheme => "linux64",
  707. },
  708. "linux-arm64ilp32" => { # https://wiki.linaro.org/Platform/arm64-ilp32
  709. inherit_from => [ "linux-generic32", asm("aarch64_asm") ],
  710. cflags => add("-mabi=ilp32"),
  711. cxxflags => add("-mabi=ilp32"),
  712. bn_ops => "SIXTY_FOUR_BIT RC4_CHAR",
  713. perlasm_scheme => "linux64",
  714. },
  715. "linux-mips32" => {
  716. # Configure script adds minimally required -march for assembly
  717. # support, if no -march was specified at command line.
  718. inherit_from => [ "linux-generic32", asm("mips32_asm") ],
  719. cflags => add("-mabi=32"),
  720. cxxflags => add("-mabi=32"),
  721. lib_cppflags => add("-DBN_DIV3W"),
  722. perlasm_scheme => "o32",
  723. },
  724. # mips32 and mips64 below refer to contemporary MIPS Architecture
  725. # specifications, MIPS32 and MIPS64, rather than to kernel bitness.
  726. "linux-mips64" => {
  727. inherit_from => [ "linux-generic32", asm("mips64_asm") ],
  728. cflags => add("-mabi=n32"),
  729. cxxflags => add("-mabi=n32"),
  730. lib_cppflags => add("-DBN_DIV3W"),
  731. bn_ops => "SIXTY_FOUR_BIT RC4_CHAR",
  732. perlasm_scheme => "n32",
  733. multilib => "32",
  734. },
  735. "linux64-mips64" => {
  736. inherit_from => [ "linux-generic64", asm("mips64_asm") ],
  737. cflags => add("-mabi=64"),
  738. cxxflags => add("-mabi=64"),
  739. lib_cppflags => add("-DBN_DIV3W"),
  740. perlasm_scheme => "64",
  741. multilib => "64",
  742. },
  743. #### IA-32 targets...
  744. #### These two targets are a bit aged and are to be used on older Linux
  745. #### machines where gcc doesn't understand -m32 and -m64
  746. "linux-elf" => {
  747. inherit_from => [ "linux-generic32", asm("x86_elf_asm") ],
  748. CFLAGS => add(picker(release => "-fomit-frame-pointer")),
  749. lib_cppflags => add("-DL_ENDIAN"),
  750. bn_ops => "BN_LLONG",
  751. },
  752. "linux-aout" => {
  753. inherit_from => [ "BASE_unix", asm("x86_asm") ],
  754. CC => "gcc",
  755. CFLAGS => add(picker(default => "-Wall",
  756. debug => "-O0 -g",
  757. release => "-O3 -fomit-frame-pointer")),
  758. lib_cppflags => add("-DL_ENDIAN"),
  759. bn_ops => "BN_LLONG",
  760. thread_scheme => "(unknown)",
  761. perlasm_scheme => "a.out",
  762. },
  763. #### X86 / X86_64 targets
  764. "linux-x86" => {
  765. inherit_from => [ "linux-generic32", asm("x86_asm") ],
  766. CFLAGS => add(picker(release => "-fomit-frame-pointer")),
  767. cflags => add("-m32"),
  768. cxxflags => add("-m32"),
  769. lib_cppflags => add("-DL_ENDIAN"),
  770. bn_ops => "BN_LLONG",
  771. perlasm_scheme => "elf",
  772. },
  773. "linux-x86-clang" => {
  774. inherit_from => [ "linux-x86" ],
  775. CC => "clang",
  776. CXX => "clang++",
  777. },
  778. "linux-x86_64" => {
  779. inherit_from => [ "linux-generic64", asm("x86_64_asm") ],
  780. cflags => add("-m64"),
  781. cxxflags => add("-m64"),
  782. lib_cppflags => add("-DL_ENDIAN"),
  783. bn_ops => "SIXTY_FOUR_BIT_LONG",
  784. perlasm_scheme => "elf",
  785. multilib => "64",
  786. },
  787. "linux-x86_64-clang" => {
  788. inherit_from => [ "linux-x86_64" ],
  789. CC => "clang",
  790. CXX => "clang++",
  791. },
  792. "linux-x32" => {
  793. inherit_from => [ "linux-generic32", asm("x86_64_asm") ],
  794. cflags => add("-mx32"),
  795. cxxflags => add("-mx32"),
  796. lib_cppflags => add("-DL_ENDIAN"),
  797. bn_ops => "SIXTY_FOUR_BIT",
  798. perlasm_scheme => "elf32",
  799. multilib => "x32",
  800. },
  801. "linux-ia64" => {
  802. inherit_from => [ "linux-generic64", asm("ia64_asm") ],
  803. bn_ops => "SIXTY_FOUR_BIT_LONG",
  804. },
  805. "linux64-s390x" => {
  806. inherit_from => [ "linux-generic64", asm("s390x_asm") ],
  807. cflags => add("-m64"),
  808. cxxflags => add("-m64"),
  809. lib_cppflags => add("-DB_ENDIAN"),
  810. perlasm_scheme => "64",
  811. multilib => "64",
  812. },
  813. "linux32-s390x" => {
  814. #### So called "highgprs" target for z/Architecture CPUs
  815. # "Highgprs" is kernel feature first implemented in Linux
  816. # 2.6.32, see /proc/cpuinfo. The idea is to preserve most
  817. # significant bits of general purpose registers not only
  818. # upon 32-bit process context switch, but even on
  819. # asynchronous signal delivery to such process. This makes
  820. # it possible to deploy 64-bit instructions even in legacy
  821. # application context and achieve better [or should we say
  822. # adequate] performance. The build is binary compatible with
  823. # linux-generic32, and the idea is to be able to install the
  824. # resulting libcrypto.so alongside generic one, e.g. as
  825. # /lib/highgprs/libcrypto.so.x.y, for ldconfig and run-time
  826. # linker to autodiscover. Unfortunately it doesn't work just
  827. # yet, because of couple of bugs in glibc
  828. # sysdeps/s390/dl-procinfo.c affecting ldconfig and ld.so.1...
  829. #
  830. inherit_from => [ "linux-generic32", asm("s390x_asm") ],
  831. cflags => add("-m31 -Wa,-mzarch"),
  832. cxxflags => add("-m31 -Wa,-mzarch"),
  833. lib_cppflags => add("-DB_ENDIAN"),
  834. bn_asm_src => sub { my $r=join(" ",@_); $r=~s|asm/s390x\.S|bn_asm.c|; $r; },
  835. perlasm_scheme => "31",
  836. multilib => "/highgprs",
  837. },
  838. #### SPARC Linux setups
  839. "linux-sparcv8" => {
  840. inherit_from => [ "linux-generic32", asm("sparcv8_asm") ],
  841. cflags => add("-mcpu=v8"),
  842. cxxflags => add("-mcpu=v8"),
  843. lib_cppflags => add("-DB_ENDIAN -DBN_DIV2W"),
  844. },
  845. "linux-sparcv9" => {
  846. # it's a real mess with -mcpu=ultrasparc option under Linux,
  847. # but -Wa,-Av8plus should do the trick no matter what.
  848. inherit_from => [ "linux-generic32", asm("sparcv9_asm") ],
  849. cflags => add("-m32 -mcpu=ultrasparc -Wa,-Av8plus"),
  850. cxxflags => add("-m32 -mcpu=ultrasparc -Wa,-Av8plus"),
  851. lib_cppflags => add("-DB_ENDIAN -DBN_DIV2W"),
  852. },
  853. "linux64-sparcv9" => {
  854. # GCC 3.1 is a requirement
  855. inherit_from => [ "linux-generic64", asm("sparcv9_asm") ],
  856. cflags => add("-m64 -mcpu=ultrasparc"),
  857. cxxflags => add("-m64 -mcpu=ultrasparc"),
  858. lib_cppflags => add("-DB_ENDIAN"),
  859. bn_ops => "BN_LLONG RC4_CHAR",
  860. multilib => "64",
  861. },
  862. "linux-alpha-gcc" => {
  863. inherit_from => [ "linux-generic64", asm("alpha_asm") ],
  864. lib_cppflags => add("-DL_ENDIAN"),
  865. bn_ops => "SIXTY_FOUR_BIT_LONG",
  866. },
  867. "linux-c64xplus" => {
  868. inherit_from => [ "BASE_unix" ],
  869. # TI_CGT_C6000_7.3.x is a requirement
  870. CC => "cl6x",
  871. CFLAGS => "-o2 -ox -ms",
  872. cflags => "--linux -ea=.s -eo=.o -mv6400+ -pden",
  873. cxxflags => "--linux -ea=.s -eo=.o -mv6400+ -pden",
  874. cppflags => combine("-DOPENSSL_SMALL_FOOTPRINT",
  875. threads("-D_REENTRANT")),
  876. bn_ops => "BN_LLONG",
  877. cpuid_asm_src => "c64xpluscpuid.s",
  878. bn_asm_src => "asm/bn-c64xplus.asm c64xplus-gf2m.s",
  879. aes_asm_src => "aes-c64xplus.s aes_cbc.c aes-ctr.fake",
  880. sha1_asm_src => "sha1-c64xplus.s sha256-c64xplus.s sha512-c64xplus.s",
  881. rc4_asm_src => "rc4-c64xplus.s",
  882. modes_asm_src => "ghash-c64xplus.s",
  883. chacha_asm_src => "chacha-c64xplus.s",
  884. poly1305_asm_src => "poly1305-c64xplus.s",
  885. thread_scheme => "pthreads",
  886. perlasm_scheme => "void",
  887. dso_scheme => "dlfcn",
  888. shared_target => "linux-shared",
  889. shared_cflag => "--pic",
  890. shared_ldflag => add("-z --sysv --shared"),
  891. shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
  892. ranlib => "true",
  893. },
  894. #### *BSD
  895. "BSD-generic32" => {
  896. # As for thread cflag. Idea is to maintain "collective" set of
  897. # flags, which would cover all BSD flavors. -pthread applies
  898. # to them all, but is treated differently. OpenBSD expands is
  899. # as -D_POSIX_THREAD -lc_r, which is sufficient. FreeBSD 4.x
  900. # expands it as -lc_r, which has to be accompanied by explicit
  901. # -D_THREAD_SAFE and sometimes -D_REENTRANT. FreeBSD 5.x
  902. # expands it as -lc_r, which seems to be sufficient?
  903. inherit_from => [ "BASE_unix" ],
  904. CC => "cc",
  905. CFLAGS => picker(default => "-Wall",
  906. debug => "-O0 -g",
  907. release => "-O3"),
  908. cflags => threads("-pthread"),
  909. cppflags => threads("-D_THREAD_SAFE -D_REENTRANT"),
  910. ex_libs => add(threads("-pthread")),
  911. enable => add("devcryptoeng"),
  912. bn_ops => "BN_LLONG",
  913. thread_scheme => "pthreads",
  914. dso_scheme => "dlfcn",
  915. shared_target => "bsd-gcc-shared",
  916. shared_cflag => "-fPIC",
  917. shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
  918. },
  919. "BSD-generic64" => {
  920. inherit_from => [ "BSD-generic32" ],
  921. bn_ops => "SIXTY_FOUR_BIT_LONG",
  922. },
  923. "BSD-x86" => {
  924. inherit_from => [ "BSD-generic32", asm("x86_asm") ],
  925. CFLAGS => add(picker(release => "-fomit-frame-pointer")),
  926. lib_cppflags => add("-DL_ENDIAN"),
  927. bn_ops => "BN_LLONG",
  928. shared_target => "bsd-shared",
  929. perlasm_scheme => "a.out",
  930. },
  931. "BSD-x86-elf" => {
  932. inherit_from => [ "BSD-x86" ],
  933. perlasm_scheme => "elf",
  934. },
  935. "BSD-sparcv8" => {
  936. inherit_from => [ "BSD-generic32", asm("sparcv8_asm") ],
  937. cflags => add("-mcpu=v8"),
  938. lib_cppflags => add("-DB_ENDIAN"),
  939. },
  940. "BSD-sparc64" => {
  941. # -DMD32_REG_T=int doesn't actually belong in sparc64 target, it
  942. # simply *happens* to work around a compiler bug in gcc 3.3.3,
  943. # triggered by RIPEMD160 code.
  944. inherit_from => [ "BSD-generic64", asm("sparcv9_asm") ],
  945. lib_cppflags => add("-DB_ENDIAN -DMD32_REG_T=int"),
  946. bn_ops => "BN_LLONG",
  947. },
  948. "BSD-ia64" => {
  949. inherit_from => [ "BSD-generic64", asm("ia64_asm") ],
  950. lib_cppflags => add("-DL_ENDIAN"),
  951. bn_ops => "SIXTY_FOUR_BIT_LONG",
  952. },
  953. "BSD-x86_64" => {
  954. inherit_from => [ "BSD-generic64", asm("x86_64_asm") ],
  955. lib_cppflags => add("-DL_ENDIAN"),
  956. bn_ops => "SIXTY_FOUR_BIT_LONG",
  957. perlasm_scheme => "elf",
  958. },
  959. "bsdi-elf-gcc" => {
  960. inherit_from => [ "BASE_unix", asm("x86_elf_asm") ],
  961. CC => "gcc",
  962. CFLAGS => "-fomit-frame-pointer -O3 -Wall",
  963. lib_cppflags => "-DPERL5 -DL_ENDIAN",
  964. ex_libs => add("-ldl"),
  965. bn_ops => "BN_LLONG",
  966. thread_scheme => "(unknown)",
  967. dso_scheme => "dlfcn",
  968. shared_target => "bsd-gcc-shared",
  969. shared_cflag => "-fPIC",
  970. shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
  971. },
  972. "nextstep" => {
  973. inherit_from => [ "BASE_unix" ],
  974. CC => "cc",
  975. CFLAGS => "-O -Wall",
  976. unistd => "<libc.h>",
  977. bn_ops => "BN_LLONG",
  978. thread_scheme => "(unknown)",
  979. },
  980. "nextstep3.3" => {
  981. inherit_from => [ "BASE_unix" ],
  982. CC => "cc",
  983. CFLAGS => "-O3 -Wall",
  984. unistd => "<libc.h>",
  985. bn_ops => "BN_LLONG",
  986. thread_scheme => "(unknown)",
  987. },
  988. #### SCO/Caldera targets.
  989. #
  990. # Originally we had like unixware-*, unixware-*-pentium, unixware-*-p6, etc.
  991. # Now we only have blended unixware-* as it's the only one used by ./config.
  992. # If you want to optimize for particular microarchitecture, bypass ./config
  993. # and './Configure unixware-7 -Kpentium_pro' or whatever appropriate.
  994. # Note that not all targets include assembler support. Mostly because of
  995. # lack of motivation to support out-of-date platforms with out-of-date
  996. # compiler drivers and assemblers.
  997. #
  998. # UnixWare 2.0x fails destest with -O.
  999. "unixware-2.0" => {
  1000. inherit_from => [ "BASE_unix" ],
  1001. CC => "cc",
  1002. cflags => threads("-Kthread"),
  1003. lib_cppflags => "-DFILIO_H -DNO_STRINGS_H",
  1004. ex_libs => add("-lsocket -lnsl -lresolv -lx"),
  1005. thread_scheme => "uithreads",
  1006. },
  1007. "unixware-2.1" => {
  1008. inherit_from => [ "BASE_unix" ],
  1009. CC => "cc",
  1010. CFLAGS => "-O",
  1011. cflags => threads("-Kthread"),
  1012. lib_cppflags => "-DFILIO_H",
  1013. ex_libs => add("-lsocket -lnsl -lresolv -lx"),
  1014. thread_scheme => "uithreads",
  1015. },
  1016. "unixware-7" => {
  1017. inherit_from => [ "BASE_unix", asm("x86_elf_asm") ],
  1018. CC => "cc",
  1019. CFLAGS => "-O",
  1020. cflags => combine("-Kalloca", threads("-Kthread")),
  1021. lib_cppflags => "-DFILIO_H",
  1022. ex_libs => add("-lsocket -lnsl"),
  1023. thread_scheme => "uithreads",
  1024. bn_ops => "BN_LLONG",
  1025. perlasm_scheme => "elf-1",
  1026. dso_scheme => "dlfcn",
  1027. shared_target => "svr5-shared",
  1028. shared_cflag => "-Kpic",
  1029. shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
  1030. },
  1031. "unixware-7-gcc" => {
  1032. inherit_from => [ "BASE_unix", asm("x86_elf_asm") ],
  1033. CC => "gcc",
  1034. CFLAGS => "-O3 -fomit-frame-pointer -Wall",
  1035. cppflags => add(threads("-D_REENTRANT")),
  1036. lib_cppflags => add("-DL_ENDIAN -DFILIO_H"),
  1037. ex_libs => add("-lsocket -lnsl"),
  1038. bn_ops => "BN_LLONG",
  1039. thread_scheme => "pthreads",
  1040. perlasm_scheme => "elf-1",
  1041. dso_scheme => "dlfcn",
  1042. shared_target => "gnu-shared",
  1043. shared_cflag => "-fPIC",
  1044. shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
  1045. },
  1046. # SCO 5 - Ben Laurie says the -O breaks the SCO cc.
  1047. "sco5-cc" => {
  1048. inherit_from => [ "BASE_unix", asm("x86_elf_asm") ],
  1049. cc => "cc",
  1050. cflags => "-belf",
  1051. ex_libs => add("-lsocket -lnsl"),
  1052. thread_scheme => "(unknown)",
  1053. perlasm_scheme => "elf-1",
  1054. dso_scheme => "dlfcn",
  1055. shared_target => "svr3-shared",
  1056. shared_cflag => "-Kpic",
  1057. shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
  1058. },
  1059. "sco5-gcc" => {
  1060. inherit_from => [ "BASE_unix", asm("x86_elf_asm") ],
  1061. cc => "gcc",
  1062. cflags => "-O3 -fomit-frame-pointer",
  1063. ex_libs => add("-lsocket -lnsl"),
  1064. bn_ops => "BN_LLONG",
  1065. thread_scheme => "(unknown)",
  1066. perlasm_scheme => "elf-1",
  1067. dso_scheme => "dlfcn",
  1068. shared_target => "svr3-shared",
  1069. shared_cflag => "-fPIC",
  1070. shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
  1071. },
  1072. #### IBM's AIX.
  1073. # Below targets assume AIX >=5. Caveat lector. If you are accustomed
  1074. # to control compilation "bitness" by setting $OBJECT_MODE environment
  1075. # variable, then you should know that in OpenSSL case it's considered
  1076. # only in ./config. Once configured, build procedure remains "deaf" to
  1077. # current value of $OBJECT_MODE.
  1078. "aix-common" => {
  1079. inherit_from => [ "BASE_unix" ],
  1080. template => 1,
  1081. sys_id => "AIX",
  1082. lib_cppflags => "-DB_ENDIAN",
  1083. thread_scheme => "pthreads",
  1084. dso_scheme => "dlfcn",
  1085. shared_target => "self",
  1086. shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
  1087. bin_lflags => shared("-Wl,-bsvr4"),
  1088. module_ldflags => "-Wl,-G,-bsymbolic,-bexpall,-bnolibpath",
  1089. shared_ldflag => "-Wl,-G,-bsymbolic,-bnolibpath",
  1090. shared_defflag => "-Wl,-bE:",
  1091. },
  1092. "aix-gcc" => {
  1093. inherit_from => [ "aix-common", asm("ppc32_asm") ],
  1094. CC => "gcc",
  1095. CFLAGS => picker(debug => "-O0 -g",
  1096. release => "-O"),
  1097. cflags => add(threads("-pthread")),
  1098. ex_libs => threads("-pthread"),
  1099. bn_ops => "BN_LLONG RC4_CHAR",
  1100. perlasm_scheme => "aix32",
  1101. shared_ldflag => add_before("-shared -static-libgcc"),
  1102. AR => add("-X32"),
  1103. RANLIB => add("-X32"),
  1104. },
  1105. "aix64-gcc" => {
  1106. inherit_from => [ "aix-common", asm("ppc64_asm") ],
  1107. CC => "gcc",
  1108. CFLAGS => picker(debug => "-O0 -g",
  1109. release => "-O"),
  1110. cflags => combine("-maix64", threads("-pthread")),
  1111. ex_libs => threads("-pthread"),
  1112. bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
  1113. perlasm_scheme => "aix64",
  1114. shared_ldflag => add_before("-shared -static-libgcc"),
  1115. AR => add("-X64"),
  1116. RANLIB => add("-X64"),
  1117. },
  1118. "aix-cc" => {
  1119. inherit_from => [ "aix-common", asm("ppc32_asm") ],
  1120. CC => "cc",
  1121. CFLAGS => picker(debug => "-O0 -g",
  1122. release => "-O"),
  1123. cflags => combine("-q32 -qmaxmem=16384 -qro -qroconst",
  1124. threads("-qthreaded")),
  1125. cppflags => threads("-D_THREAD_SAFE"),
  1126. ex_libs => threads("-lpthreads"),
  1127. bn_ops => "BN_LLONG RC4_CHAR",
  1128. perlasm_scheme => "aix32",
  1129. shared_cflag => "-qpic",
  1130. AR => add("-X32"),
  1131. RANLIB => add("-X32"),
  1132. },
  1133. "aix64-cc" => {
  1134. inherit_from => [ "aix-common", asm("ppc64_asm") ],
  1135. CC => "cc",
  1136. CFLAGS => picker(debug => "-O0 -g",
  1137. release => "-O"),
  1138. cflags => combine("-q64 -qmaxmem=16384 -qro -qroconst",
  1139. threads("-qthreaded")),
  1140. cppflags => threads("-D_THREAD_SAFE"),
  1141. ex_libs => threads("-lpthreads"),
  1142. bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
  1143. perlasm_scheme => "aix64",
  1144. dso_scheme => "dlfcn",
  1145. shared_cflag => "-qpic",
  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. CFLAGS => add("/WX"),
  1282. AS => sub { vc_win32_info()->{AS} },
  1283. ASFLAGS => sub { vc_win32_info()->{ASFLAGS} },
  1284. asoutflag => sub { vc_win32_info()->{asoutflag} },
  1285. asflags => sub { vc_win32_info()->{asflags} },
  1286. sys_id => "WIN32",
  1287. bn_ops => add("BN_LLONG"),
  1288. perlasm_scheme => sub { vc_win32_info()->{perlasm_scheme} },
  1289. # "WOW" stands for "Windows on Windows", and "VC-WOW" engages
  1290. # some installation path heuristics in windows-makefile.tmpl...
  1291. build_scheme => add("VC-WOW", { separator => undef }),
  1292. },
  1293. "VC-CE" => {
  1294. inherit_from => [ "VC-common" ],
  1295. CFLAGS => add(picker(debug => "/Od",
  1296. release => "/O1i")),
  1297. CPPDEFINES => picker(debug => [ "DEBUG", "_DEBUG" ]),
  1298. LDFLAGS => add("/nologo /opt:ref"),
  1299. cflags =>
  1300. combine('/GF /Gy',
  1301. sub { vc_wince_info()->{cflags}; },
  1302. sub { `cl 2>&1` =~ /Version ([0-9]+)\./ && $1>=14
  1303. ? ($disabled{shared} ? " /MT" : " /MD")
  1304. : " /MC"; }),
  1305. cppflags => sub { vc_wince_info()->{cppflags}; },
  1306. lib_defines => add("NO_CHMOD", "OPENSSL_SMALL_FOOTPRINT"),
  1307. lib_cppflags => sub { vc_wince_info()->{cppflags}; },
  1308. includes =>
  1309. add(combine(sub { defined(env('WCECOMPAT'))
  1310. ? '$(WCECOMPAT)/include' : (); },
  1311. sub { defined(env('PORTSDK_LIBPATH'))
  1312. ? '$(PORTSDK_LIBPATH)/../../include'
  1313. : (); })),
  1314. lflags => add(combine(sub { vc_wince_info()->{lflags}; },
  1315. sub { defined(env('PORTSDK_LIBPATH'))
  1316. ? "/entry:mainCRTstartup" : (); })),
  1317. sys_id => "WINCE",
  1318. bn_ops => add("BN_LLONG"),
  1319. ex_libs => add(sub {
  1320. my @ex_libs = ();
  1321. push @ex_libs, 'ws2.lib' unless $disabled{sock};
  1322. push @ex_libs, 'crypt32.lib';
  1323. if (defined(env('WCECOMPAT'))) {
  1324. my $x = '$(WCECOMPAT)/lib';
  1325. if (-f "$x/env('TARGETCPU')/wcecompatex.lib") {
  1326. $x .= '/$(TARGETCPU)/wcecompatex.lib';
  1327. } else {
  1328. $x .= '/wcecompatex.lib';
  1329. }
  1330. push @ex_libs, $x;
  1331. }
  1332. push @ex_libs, '$(PORTSDK_LIBPATH)/portlib.lib'
  1333. if (defined(env('PORTSDK_LIBPATH')));
  1334. push @ex_libs, ' /nodefaultlib coredll.lib corelibc.lib'
  1335. if (env('TARGETCPU') eq "X86");
  1336. return @ex_libs;
  1337. }),
  1338. },
  1339. #### MinGW
  1340. "mingw" => {
  1341. inherit_from => [ "BASE_unix", asm("x86_asm"),
  1342. sub { $disabled{shared} ? () : "x86_uplink" } ],
  1343. CC => "gcc",
  1344. CFLAGS => picker(default => "-Wall",
  1345. debug => "-g -O0",
  1346. release => "-O3 -fomit-frame-pointer"),
  1347. cflags => "-m32",
  1348. cppflags => combine("-DUNICODE -D_UNICODE -DWIN32_LEAN_AND_MEAN",
  1349. threads("-D_MT")),
  1350. lib_cppflags => "-DL_ENDIAN",
  1351. sys_id => "MINGW32",
  1352. ex_libs => add("-lws2_32 -lgdi32 -lcrypt32"),
  1353. bn_ops => "BN_LLONG EXPORT_VAR_AS_FN",
  1354. thread_scheme => "winthreads",
  1355. perlasm_scheme => "coff",
  1356. dso_scheme => "win32",
  1357. shared_target => "mingw-shared",
  1358. shared_cppflags => add("_WINDLL"),
  1359. shared_ldflag => "-static-libgcc",
  1360. shared_rcflag => "--target=pe-i386",
  1361. shared_extension => ".dll",
  1362. multilib => "",
  1363. apps_aux_src => add("win32_init.c"),
  1364. },
  1365. "mingw64" => {
  1366. # As for OPENSSL_USE_APPLINK. Applink makes it possible to use
  1367. # .dll compiled with one compiler with application compiled with
  1368. # another compiler. It's possible to engage Applink support in
  1369. # mingw64 build, but it's not done, because till mingw64
  1370. # supports structured exception handling, one can't seriously
  1371. # consider its binaries for using with non-mingw64 run-time
  1372. # environment. And as mingw64 is always consistent with itself,
  1373. # Applink is never engaged and can as well be omitted.
  1374. inherit_from => [ "BASE_unix", asm("x86_64_asm") ],
  1375. CC => "gcc",
  1376. CFLAGS => picker(default => "-Wall",
  1377. debug => "-g -O0",
  1378. release => "-O3"),
  1379. cflags => "-m64",
  1380. cppflags => combine("-DUNICODE -D_UNICODE -DWIN32_LEAN_AND_MEAN",
  1381. threads("-D_MT")),
  1382. lib_cppflags => "-DL_ENDIAN",
  1383. sys_id => "MINGW64",
  1384. ex_libs => add("-lws2_32 -lgdi32 -lcrypt32"),
  1385. bn_ops => "SIXTY_FOUR_BIT EXPORT_VAR_AS_FN",
  1386. thread_scheme => "winthreads",
  1387. perlasm_scheme => "mingw64",
  1388. dso_scheme => "win32",
  1389. shared_target => "mingw-shared",
  1390. shared_cppflags => add("_WINDLL"),
  1391. shared_ldflag => "-static-libgcc",
  1392. shared_rcflag => "--target=pe-x86-64",
  1393. shared_extension => ".dll",
  1394. multilib => "64",
  1395. apps_aux_src => add("win32_init.c"),
  1396. },
  1397. #### UEFI
  1398. "UEFI" => {
  1399. inherit_from => [ "BASE_unix" ],
  1400. CC => "cc",
  1401. CFLAGS => "-O",
  1402. lib_cppflags => "-DL_ENDIAN",
  1403. sys_id => "UEFI",
  1404. },
  1405. #### UWIN
  1406. "UWIN" => {
  1407. inherit_from => [ "BASE_unix" ],
  1408. CC => "cc",
  1409. CFLAGS => "-O -Wall",
  1410. lib_cppflags => "-DTERMIOS -DL_ENDIAN",
  1411. sys_id => "UWIN",
  1412. bn_ops => "BN_LLONG",
  1413. dso_scheme => "win32",
  1414. },
  1415. #### Cygwin
  1416. "Cygwin-x86" => {
  1417. inherit_from => [ "BASE_unix", asm("x86_asm") ],
  1418. CC => "gcc",
  1419. CFLAGS => picker(default => "-Wall",
  1420. debug => "-g -O0",
  1421. release => "-O3 -fomit-frame-pointer"),
  1422. lib_cppflags => "-DTERMIOS -DL_ENDIAN",
  1423. sys_id => "CYGWIN",
  1424. bn_ops => "BN_LLONG",
  1425. thread_scheme => "pthread",
  1426. perlasm_scheme => "coff",
  1427. dso_scheme => "dlfcn",
  1428. shared_target => "cygwin-shared",
  1429. shared_cppflags => "-D_WINDLL",
  1430. shared_extension => ".dll",
  1431. },
  1432. "Cygwin-x86_64" => {
  1433. inherit_from => [ "BASE_unix", asm("x86_64_asm") ],
  1434. CC => "gcc",
  1435. CFLAGS => picker(default => "-Wall",
  1436. debug => "-g -O0",
  1437. release => "-O3"),
  1438. lib_cppflags => "-DTERMIOS -DL_ENDIAN",
  1439. sys_id => "CYGWIN",
  1440. bn_ops => "SIXTY_FOUR_BIT_LONG",
  1441. thread_scheme => "pthread",
  1442. perlasm_scheme => "mingw64",
  1443. dso_scheme => "dlfcn",
  1444. shared_target => "cygwin-shared",
  1445. shared_cppflags => "-D_WINDLL",
  1446. shared_extension => ".dll",
  1447. },
  1448. # Backward compatibility for those using this target
  1449. "Cygwin" => {
  1450. inherit_from => [ "Cygwin-x86" ]
  1451. },
  1452. # In case someone constructs the Cygwin target name themself
  1453. "Cygwin-i386" => {
  1454. inherit_from => [ "Cygwin-x86" ]
  1455. },
  1456. "Cygwin-i486" => {
  1457. inherit_from => [ "Cygwin-x86" ]
  1458. },
  1459. "Cygwin-i586" => {
  1460. inherit_from => [ "Cygwin-x86" ]
  1461. },
  1462. "Cygwin-i686" => {
  1463. inherit_from => [ "Cygwin-x86" ]
  1464. },
  1465. ##### MacOS X (a.k.a. Darwin) setup
  1466. "darwin-common" => {
  1467. inherit_from => [ "BASE_unix" ],
  1468. template => 1,
  1469. CC => "cc",
  1470. CFLAGS => picker(debug => "-g -O0",
  1471. release => "-O3"),
  1472. cppflags => threads("-D_REENTRANT"),
  1473. lflags => "-Wl,-search_paths_first",
  1474. sys_id => "MACOSX",
  1475. bn_ops => "BN_LLONG RC4_CHAR",
  1476. thread_scheme => "pthreads",
  1477. perlasm_scheme => "osx32",
  1478. dso_scheme => "dlfcn",
  1479. ranlib => "ranlib -c",
  1480. shared_target => "darwin-shared",
  1481. shared_cflag => "-fPIC",
  1482. shared_extension => ".\$(SHLIB_VERSION_NUMBER).dylib",
  1483. },
  1484. # Option "freeze" such as -std=gnu9x can't negatively interfere
  1485. # with future defaults for below two targets, because MacOS X
  1486. # for PPC has no future, it was discontinued by vendor in 2009.
  1487. "darwin-ppc-cc" => {
  1488. inherit_from => [ "darwin-common", asm("ppc32_asm") ],
  1489. cflags => add("-arch ppc -std=gnu9x -Wa,-force_cpusubtype_ALL"),
  1490. lib_cppflags => add("-DB_ENDIAN"),
  1491. shared_cflag => add("-fno-common"),
  1492. perlasm_scheme => "osx32",
  1493. },
  1494. "darwin64-ppc-cc" => {
  1495. inherit_from => [ "darwin-common", asm("ppc64_asm") ],
  1496. cflags => add("-arch ppc64 -std=gnu9x"),
  1497. lib_cppflags => add("-DB_ENDIAN"),
  1498. bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
  1499. perlasm_scheme => "osx64",
  1500. },
  1501. "darwin-i386-cc" => {
  1502. inherit_from => [ "darwin-common", asm("x86_asm") ],
  1503. CFLAGS => add(picker(release => "-fomit-frame-pointer")),
  1504. cflags => add("-arch i386"),
  1505. lib_cppflags => add("-DL_ENDIAN"),
  1506. bn_ops => "BN_LLONG RC4_INT",
  1507. perlasm_scheme => "macosx",
  1508. },
  1509. "darwin64-x86_64-cc" => {
  1510. inherit_from => [ "darwin-common", asm("x86_64_asm") ],
  1511. CFLAGS => add("-Wall"),
  1512. cflags => add("-arch x86_64"),
  1513. lib_cppflags => add("-DL_ENDIAN"),
  1514. bn_ops => "SIXTY_FOUR_BIT_LONG",
  1515. perlasm_scheme => "macosx",
  1516. },
  1517. ##### GNU Hurd
  1518. "hurd-x86" => {
  1519. inherit_from => [ "BASE_unix" ],
  1520. inherit_from => [ asm("x86_elf_asm") ],
  1521. CC => "gcc",
  1522. CFLAGS => "-O3 -fomit-frame-pointer -Wall",
  1523. cflags => threads("-pthread"),
  1524. lib_cppflags => "-DL_ENDIAN",
  1525. ex_libs => add("-ldl", threads("-pthread")),
  1526. bn_ops => "BN_LLONG",
  1527. thread_scheme => "pthreads",
  1528. dso_scheme => "dlfcn",
  1529. shared_target => "linux-shared",
  1530. shared_cflag => "-fPIC",
  1531. shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
  1532. },
  1533. ##### VxWorks for various targets
  1534. "vxworks-ppc60x" => {
  1535. inherit_from => [ "BASE_unix" ],
  1536. CC => "ccppc",
  1537. CFLAGS => "-O2 -Wall -fstrength-reduce",
  1538. cflags => "-mrtp -mhard-float -mstrict-align -fno-implicit-fp -fno-builtin -fno-strict-aliasing",
  1539. cppflags => combine("-D_REENTRANT -DPPC32_fp60x -DCPU=PPC32",
  1540. "_DTOOL_FAMILY=gnu -DTOOL=gnu",
  1541. "-I\$(WIND_BASE)/target/usr/h",
  1542. "-I\$(WIND_BASE)/target/usr/h/wrn/coreip"),
  1543. sys_id => "VXWORKS",
  1544. lflags => add("-L \$(WIND_BASE)/target/usr/lib/ppc/PPC32/common"),
  1545. ex_libs => add("-Wl,--defsym,__wrs_rtp_base=0xe0000000"),
  1546. },
  1547. "vxworks-ppcgen" => {
  1548. inherit_from => [ "BASE_unix" ],
  1549. CC => "ccppc",
  1550. CFLAGS => "-O1 -Wall",
  1551. cflags => "-mrtp -msoft-float -mstrict-align -fno-builtin -fno-strict-aliasing",
  1552. cppflags => combine("-D_REENTRANT -DPPC32 -DCPU=PPC32",
  1553. "-DTOOL_FAMILY=gnu -DTOOL=gnu",
  1554. "-I\$(WIND_BASE)/target/usr/h",
  1555. "-I\$(WIND_BASE)/target/usr/h/wrn/coreip"),
  1556. sys_id => "VXWORKS",
  1557. lflags => add("-L \$(WIND_BASE)/target/usr/lib/ppc/PPC32/sfcommon"),
  1558. ex_libs => add("-Wl,--defsym,__wrs_rtp_base=0xe0000000"),
  1559. },
  1560. "vxworks-ppc405" => {
  1561. inherit_from => [ "BASE_unix" ],
  1562. CC => "ccppc",
  1563. CFLAGS => "-g",
  1564. cflags => "-msoft-float -mlongcall",
  1565. cppflags => combine("-D_REENTRANT -DPPC32 -DCPU=PPC405",
  1566. "-DTOOL_FAMILY=gnu -DTOOL=gnu",
  1567. "-I\$(WIND_BASE)/target/h"),
  1568. sys_id => "VXWORKS",
  1569. lflags => add("-r"),
  1570. },
  1571. "vxworks-ppc750" => {
  1572. inherit_from => [ "BASE_unix" ],
  1573. CC => "ccppc",
  1574. CFLAGS => "-ansi -fvolatile -Wall \$(DEBUG_FLAG)",
  1575. cflags => "-nostdinc -fno-builtin -fno-for-scope -fsigned-char -msoft-float -mlongcall",
  1576. cppflags => combine("-DPPC750 -D_REENTRANT -DCPU=PPC604",
  1577. "-I\$(WIND_BASE)/target/h"),
  1578. sys_id => "VXWORKS",
  1579. lflags => add("-r"),
  1580. },
  1581. "vxworks-ppc750-debug" => {
  1582. inherit_from => [ "BASE_unix" ],
  1583. CC => "ccppc",
  1584. CFLAGS => "-ansi -fvolatile -Wall -g",
  1585. cflags => "-nostdinc -fno-builtin -fno-for-scope -fsigned-char -msoft-float -mlongcall",
  1586. cppflags => combine("-DPPC750 -D_REENTRANT -DCPU=PPC604",
  1587. "-DPEDANTIC -DDEBUG",
  1588. "-I\$(WIND_BASE)/target/h"),
  1589. sys_id => "VXWORKS",
  1590. lflags => add("-r"),
  1591. },
  1592. "vxworks-ppc860" => {
  1593. inherit_from => [ "BASE_unix" ],
  1594. CC => "ccppc",
  1595. cflags => "-nostdinc -msoft-float",
  1596. cppflags => combine("-DCPU=PPC860 -DNO_STRINGS_H",
  1597. "-I\$(WIND_BASE)/target/h"),
  1598. sys_id => "VXWORKS",
  1599. lflags => add("-r"),
  1600. },
  1601. "vxworks-simlinux" => {
  1602. inherit_from => [ "BASE_unix" ],
  1603. CC => "ccpentium",
  1604. cflags => "-B\$(WIND_BASE)/host/\$(WIND_HOST_TYPE)/lib/gcc-lib/ -fno-builtin -fno-defer-pop",
  1605. cppflags => combine("-D_VSB_CONFIG_FILE=\"\$(WIND_BASE)/target/lib/h/config/vsbConfig.h\"",
  1606. "-DL_ENDIAN -DCPU=SIMLINUX -DNO_STRINGS_H",
  1607. "-DTOOL_FAMILY=gnu -DTOOL=gnu",
  1608. "-DOPENSSL_NO_HW_PADLOCK",
  1609. "-I\$(WIND_BASE)/target/h",
  1610. "-I\$(WIND_BASE)/target/h/wrn/coreip"),
  1611. sys_id => "VXWORKS",
  1612. lflags => add("-r"),
  1613. ranlib => "ranlibpentium",
  1614. },
  1615. "vxworks-mips" => {
  1616. inherit_from => [ "BASE_unix", asm("mips32_asm") ],
  1617. CC => "ccmips",
  1618. CFLAGS => "-O -G 0",
  1619. cflags => "-mrtp -mips2 -B\$(WIND_BASE)/host/\$(WIND_HOST_TYPE)/lib/gcc-lib/ -msoft-float -mno-branch-likely -fno-builtin -fno-defer-pop",
  1620. cppflags => combine("-D_VSB_CONFIG_FILE=\"\$(WIND_BASE)/target/lib/h/config/vsbConfig.h\"",
  1621. "-DCPU=MIPS32 -DNO_STRINGS_H",
  1622. "-DTOOL_FAMILY=gnu -DTOOL=gnu",
  1623. "-DOPENSSL_NO_HW_PADLOCK",
  1624. threads("-D_REENTRANT"),
  1625. "-I\$(WIND_BASE)/target/h",
  1626. "-I\$(WIND_BASE)/target/h/wrn/coreip"),
  1627. sys_id => "VXWORKS",
  1628. lflags => add("-L \$(WIND_BASE)/target/usr/lib/mips/MIPSI32/sfcommon"),
  1629. ex_libs => add("-Wl,--defsym,__wrs_rtp_base=0xe0000000"),
  1630. thread_scheme => "pthreads",
  1631. perlasm_scheme => "o32",
  1632. ranlib => "ranlibmips",
  1633. },
  1634. #### uClinux
  1635. "uClinux-dist" => {
  1636. inherit_from => [ "BASE_unix" ],
  1637. CC => sub { env('CC') },
  1638. cppflags => threads("-D_REENTRANT"),
  1639. ex_libs => add("\$(LDLIBS)"),
  1640. bn_ops => "BN_LLONG",
  1641. thread_scheme => "pthreads",
  1642. dso_scheme => sub { env('LIBSSL_dlfcn') },
  1643. shared_target => "linux-shared",
  1644. shared_cflag => "-fPIC",
  1645. shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
  1646. ranlib => sub { env('RANLIB') },
  1647. },
  1648. "uClinux-dist64" => {
  1649. inherit_from => [ "BASE_unix" ],
  1650. CC => sub { env('CC') },
  1651. cppflags => threads("-D_REENTRANT"),
  1652. ex_libs => add("\$(LDLIBS)"),
  1653. bn_ops => "SIXTY_FOUR_BIT_LONG",
  1654. thread_scheme => "pthreads",
  1655. dso_scheme => sub { env('LIBSSL_dlfcn') },
  1656. shared_target => "linux-shared",
  1657. shared_cflag => "-fPIC",
  1658. shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
  1659. ranlib => sub { env('RANLIB') },
  1660. },
  1661. ##### VMS
  1662. # Most things happen in vms-generic.
  1663. # Note that vms_info extracts the pointer size from the end of
  1664. # the target name, and will assume that anything matching /-p\d+$/
  1665. # indicates the pointer size setting for the desired target.
  1666. "vms-generic" => {
  1667. inherit_from => [ "BASE_VMS" ],
  1668. template => 1,
  1669. CC => "CC/DECC",
  1670. CPP => '$(CC)/PREPROCESS_ONLY=SYS$OUTPUT:',
  1671. CFLAGS =>
  1672. combine(picker(default => "/STANDARD=(ISOC94,RELAXED)/NOLIST/PREFIX=ALL",
  1673. debug => "/NOOPTIMIZE/DEBUG",
  1674. release => "/OPTIMIZE/NODEBUG"),
  1675. sub { my @warnings =
  1676. @{vms_info()->{disable_warns}};
  1677. @warnings
  1678. ? "/WARNINGS=DISABLE=(".join(",",@warnings).")" : (); }),
  1679. lib_defines =>
  1680. add("OPENSSL_USE_NODELETE",
  1681. sub {
  1682. return vms_info()->{def_zlib}
  1683. ? "LIBZ=\"\"\"".vms_info()->{def_zlib}."\"\"\"" : ();
  1684. }),
  1685. lflags => picker(default => "/MAP='F\$PARSE(\".MAP\",\"\$\@\")'",
  1686. debug => "/DEBUG/TRACEBACK",
  1687. release => "/NODEBUG/NOTRACEBACK"),
  1688. lib_cflags => add("/NAMES=(AS_IS,SHORTENED)/EXTERN_MODEL=STRICT_REFDEF"),
  1689. # no_inst_lib_cflags is used instead of lib_cflags by descrip.mms.tmpl
  1690. # for object files belonging to selected internal libraries
  1691. no_inst_lib_cflags => "",
  1692. ex_libs => add(sub { return vms_info()->{zlib} || (); }),
  1693. shared_target => "vms-shared",
  1694. dso_scheme => "vms",
  1695. thread_scheme => "pthreads",
  1696. AS => sub { vms_info()->{AS} },
  1697. ASFLAGS => sub { vms_info()->{ASFLAGS} },
  1698. asoutflag => sub { vms_info()->{asoutflag} },
  1699. asflags => sub { vms_info()->{asflags} },
  1700. perlasm_scheme => sub { vms_info()->{perlasm_scheme} },
  1701. apps_aux_src => "vms_term_sock.c",
  1702. apps_init_src => "vms_decc_init.c",
  1703. },
  1704. # From HELP CC/POINTER_SIZE:
  1705. #
  1706. # ----------
  1707. # LONG[=ARGV] The compiler assumes 64-bit pointers. If the ARGV option to
  1708. # LONG or 64 is present, the main argument argv will be an
  1709. # array of long pointers instead of an array of short pointers.
  1710. #
  1711. # 64[=ARGV] Same as LONG.
  1712. # ----------
  1713. #
  1714. # We don't want the hassle of dealing with 32-bit pointers with argv, so
  1715. # we force it to have 64-bit pointers, see the added cflags in the -p64
  1716. # config targets below.
  1717. "vms-alpha" => {
  1718. inherit_from => [ "vms-generic" ],
  1719. bn_ops => "SIXTY_FOUR_BIT RC4_INT",
  1720. pointer_size => "",
  1721. },
  1722. "vms-alpha-p32" => {
  1723. inherit_from => [ "vms-alpha" ],
  1724. cflags => add("/POINTER_SIZE=32"),
  1725. pointer_size => "32",
  1726. },
  1727. "vms-alpha-p64" => {
  1728. inherit_from => [ "vms-alpha" ],
  1729. cflags => add("/POINTER_SIZE=64=ARGV"),
  1730. pointer_size => "64",
  1731. },
  1732. "vms-ia64" => {
  1733. inherit_from => [ "vms-generic",
  1734. sub { vms_info()->{as}
  1735. ? asm("ia64_asm")->() : () } ],
  1736. bn_ops => "SIXTY_FOUR_BIT RC4_INT",
  1737. pointer_size => "",
  1738. modes_asm_src => "", # Because ghash-ia64.s doesn't work on VMS
  1739. },
  1740. "vms-ia64-p32" => {
  1741. inherit_from => [ "vms-ia64" ],
  1742. cflags => add("/POINTER_SIZE=32"),
  1743. pointer_size => "32",
  1744. },
  1745. "vms-ia64-p64" => {
  1746. inherit_from => [ "vms-ia64" ],
  1747. cflags => add("/POINTER_SIZE=64=ARGV"),
  1748. pointer_size => "64",
  1749. },
  1750. );