10-main.conf 88 KB

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