10-main.conf 89 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163
  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-arm64ilp32-clang" => { # clang config abi by --target
  752. inherit_from => [ "linux-generic32" ],
  753. CC => "clang",
  754. CXX => "clang++",
  755. bn_ops => "SIXTY_FOUR_BIT RC4_CHAR",
  756. asm_arch => 'aarch64',
  757. perlasm_scheme => "linux64",
  758. },
  759. "linux-mips32" => {
  760. # Configure script adds minimally required -march for assembly
  761. # support, if no -march was specified at command line.
  762. inherit_from => [ "linux-latomic" ],
  763. cflags => add("-mabi=32"),
  764. cxxflags => add("-mabi=32"),
  765. asm_arch => 'mips32',
  766. perlasm_scheme => "o32",
  767. },
  768. # mips32 and mips64 below refer to contemporary MIPS Architecture
  769. # specifications, MIPS32 and MIPS64, rather than to kernel bitness.
  770. "linux-mips64" => {
  771. inherit_from => [ "linux-latomic" ],
  772. cflags => add("-mabi=n32"),
  773. cxxflags => add("-mabi=n32"),
  774. bn_ops => "RC4_CHAR SIXTY_FOUR_BIT",
  775. asm_arch => 'mips64',
  776. perlasm_scheme => "n32",
  777. multilib => "32",
  778. },
  779. "linux64-mips64" => {
  780. inherit_from => [ "linux-generic64" ],
  781. cflags => add("-mabi=64"),
  782. cxxflags => add("-mabi=64"),
  783. asm_arch => 'mips64',
  784. perlasm_scheme => "64",
  785. multilib => "64",
  786. },
  787. # riscv below refers to contemporary RISCV Architecture
  788. # specifications,
  789. "linux64-riscv64" => {
  790. inherit_from => [ "linux-generic64"],
  791. perlasm_scheme => "linux64",
  792. asm_arch => 'riscv64',
  793. },
  794. "linux32-riscv32" => {
  795. inherit_from => [ "linux-latomic" ],
  796. perlasm_scheme => "linux32",
  797. asm_arch => 'riscv32',
  798. },
  799. # loongarch64 below refers to contemporary LoongArch Architecture
  800. # specifications,
  801. "linux64-loongarch64" => {
  802. inherit_from => [ "linux-generic64"],
  803. perlasm_scheme => "linux64",
  804. asm_arch => 'loongarch64',
  805. lib_cppflags => add("-DL_ENDIAN"),
  806. },
  807. #### IA-32 targets...
  808. #### These two targets are a bit aged and are to be used on older Linux
  809. #### machines where gcc doesn't understand -m32 and -m64
  810. "linux-elf" => {
  811. inherit_from => [ "linux-generic32" ],
  812. CFLAGS => add(picker(release => "-fomit-frame-pointer")),
  813. lib_cppflags => add("-DL_ENDIAN"),
  814. bn_ops => "BN_LLONG",
  815. asm_arch => 'x86',
  816. perlasm_scheme => "elf",
  817. },
  818. "linux-aout" => {
  819. inherit_from => [ "BASE_unix" ],
  820. CC => "gcc",
  821. CFLAGS => add(picker(default => "-Wall",
  822. debug => "-O0 -g",
  823. release => "-O3 -fomit-frame-pointer")),
  824. lib_cppflags => add("-DL_ENDIAN"),
  825. bn_ops => "BN_LLONG",
  826. thread_scheme => "(unknown)",
  827. asm_arch => 'x86',
  828. perlasm_scheme => "a.out",
  829. },
  830. #### X86 / X86_64 targets
  831. "linux-x86" => {
  832. inherit_from => [ "linux-generic32" ],
  833. CFLAGS => add(picker(release => "-fomit-frame-pointer")),
  834. cflags => add("-m32"),
  835. cxxflags => add("-m32"),
  836. lib_cppflags => add("-DL_ENDIAN"),
  837. bn_ops => "BN_LLONG",
  838. asm_arch => 'x86',
  839. perlasm_scheme => "elf",
  840. },
  841. "linux-x86-latomic" => {
  842. inherit_from => [ "linux-x86" ],
  843. ex_libs => add(threads("-latomic")),
  844. },
  845. "linux-x86-clang" => {
  846. inherit_from => [ "linux-x86" ],
  847. CC => "clang",
  848. CXX => "clang++",
  849. ex_libs => add(threads("-latomic")),
  850. },
  851. "linux-x86_64" => {
  852. inherit_from => [ "linux-generic64" ],
  853. cflags => add("-m64"),
  854. cxxflags => add("-m64"),
  855. lib_cppflags => add("-DL_ENDIAN"),
  856. bn_ops => "SIXTY_FOUR_BIT_LONG",
  857. asm_arch => 'x86_64',
  858. perlasm_scheme => "elf",
  859. multilib => "64",
  860. },
  861. "linux-x86_64-clang" => {
  862. inherit_from => [ "linux-x86_64" ],
  863. CC => "clang",
  864. CXX => "clang++",
  865. },
  866. "linux-x32" => {
  867. inherit_from => [ "linux-generic32" ],
  868. cflags => add("-mx32"),
  869. cxxflags => add("-mx32"),
  870. lib_cppflags => add("-DL_ENDIAN"),
  871. bn_ops => "SIXTY_FOUR_BIT",
  872. asm_arch => 'x86_64',
  873. perlasm_scheme => "elf32",
  874. multilib => "x32",
  875. },
  876. "linux-ia64" => {
  877. inherit_from => [ "linux-generic64" ],
  878. bn_ops => "SIXTY_FOUR_BIT_LONG",
  879. asm_arch => 'ia64',
  880. perlasm_scheme => 'void',
  881. },
  882. "linux64-s390x" => {
  883. inherit_from => [ "linux-generic64" ],
  884. cflags => add("-m64"),
  885. cxxflags => add("-m64"),
  886. lib_cppflags => add("-DB_ENDIAN"),
  887. asm_arch => 's390x',
  888. perlasm_scheme => "64",
  889. multilib => "64",
  890. },
  891. "linux32-s390x" => {
  892. #### So called "highgprs" target for z/Architecture CPUs
  893. # "Highgprs" is kernel feature first implemented in Linux
  894. # 2.6.32, see /proc/cpuinfo. The idea is to preserve most
  895. # significant bits of general purpose registers not only
  896. # upon 32-bit process context switch, but even on
  897. # asynchronous signal delivery to such process. This makes
  898. # it possible to deploy 64-bit instructions even in legacy
  899. # application context and achieve better [or should we say
  900. # adequate] performance. The build is binary compatible with
  901. # linux-generic32, and the idea is to be able to install the
  902. # resulting libcrypto.so alongside generic one, e.g. as
  903. # /lib/highgprs/libcrypto.so.x.y, for ldconfig and run-time
  904. # linker to autodiscover. Unfortunately it doesn't work just
  905. # yet, because of couple of bugs in glibc
  906. # sysdeps/s390/dl-procinfo.c affecting ldconfig and ld.so.1...
  907. #
  908. inherit_from => [ "linux-generic32" ],
  909. cflags => add("-m31 -Wa,-mzarch"),
  910. cxxflags => add("-m31 -Wa,-mzarch"),
  911. lib_cppflags => add("-DB_ENDIAN"),
  912. asm_arch => 's390x',
  913. perlasm_scheme => "31",
  914. multilib => "/highgprs",
  915. },
  916. #### SPARC Linux setups
  917. "linux-sparcv8" => {
  918. inherit_from => [ "linux-latomic" ],
  919. cflags => add("-mcpu=v8"),
  920. cxxflags => add("-mcpu=v8"),
  921. lib_cppflags => add("-DB_ENDIAN -DBN_DIV2W"),
  922. asm_arch => 'sparcv8',
  923. perlasm_scheme => 'void',
  924. },
  925. "linux-sparcv9" => {
  926. # it's a real mess with -mcpu=ultrasparc option under Linux,
  927. # but -Wa,-Av8plus should do the trick no matter what.
  928. inherit_from => [ "linux-latomic" ],
  929. cflags => add("-m32 -mcpu=ultrasparc -Wa,-Av8plus"),
  930. cxxflags => add("-m32 -mcpu=ultrasparc -Wa,-Av8plus"),
  931. lib_cppflags => add("-DB_ENDIAN -DBN_DIV2W"),
  932. asm_arch => 'sparcv9',
  933. perlasm_scheme => 'void',
  934. },
  935. "linux64-sparcv9" => {
  936. # GCC 3.1 is a requirement
  937. inherit_from => [ "linux-generic64" ],
  938. cflags => add("-m64 -mcpu=ultrasparc"),
  939. cxxflags => add("-m64 -mcpu=ultrasparc"),
  940. lib_cppflags => add("-DB_ENDIAN"),
  941. ex_libs => add(threads("-latomic")),
  942. bn_ops => "BN_LLONG RC4_CHAR",
  943. asm_arch => 'sparcv9',
  944. perlasm_scheme => 'void',
  945. multilib => "64",
  946. },
  947. "linux-alpha-gcc" => {
  948. inherit_from => [ "linux-generic64" ],
  949. lib_cppflags => add("-DL_ENDIAN"),
  950. bn_ops => "SIXTY_FOUR_BIT_LONG",
  951. asm_arch => 'alpha',
  952. perlasm_scheme => "void",
  953. },
  954. "linux-c64xplus" => {
  955. inherit_from => [ "BASE_unix" ],
  956. # TI_CGT_C6000_7.3.x is a requirement
  957. CC => "cl6x",
  958. CFLAGS => "-o2 -ox -ms",
  959. cflags => "--linux -ea=.s -eo=.o -mv6400+ -pden",
  960. cxxflags => "--linux -ea=.s -eo=.o -mv6400+ -pden",
  961. cppflags => combine("-DOPENSSL_SMALL_FOOTPRINT",
  962. threads("-D_REENTRANT")),
  963. bn_ops => "BN_LLONG",
  964. thread_scheme => "pthreads",
  965. asm_arch => 'c64xplus',
  966. perlasm_scheme => "void",
  967. dso_scheme => "dlfcn",
  968. shared_target => "linux-shared",
  969. shared_cflag => "--pic",
  970. shared_ldflag => add("-z --sysv --shared"),
  971. ranlib => "true",
  972. },
  973. #### *BSD
  974. "BSD-generic32" => {
  975. # As for thread cflag. Idea is to maintain "collective" set of
  976. # flags, which would cover all BSD flavors. -pthread applies
  977. # to them all, but is treated differently. OpenBSD expands is
  978. # as -D_POSIX_THREAD -lc_r, which is sufficient. FreeBSD 4.x
  979. # expands it as -lc_r, which has to be accompanied by explicit
  980. # -D_THREAD_SAFE and sometimes -D_REENTRANT. FreeBSD 5.x
  981. # expands it as -lc_r, which seems to be sufficient?
  982. inherit_from => [ "BASE_unix" ],
  983. CC => "cc",
  984. CFLAGS => picker(default => "-Wall",
  985. debug => "-O0 -g",
  986. release => "-O3"),
  987. cflags => threads("-pthread"),
  988. cppflags => threads("-D_THREAD_SAFE -D_REENTRANT"),
  989. ex_libs => add(threads("-pthread")),
  990. enable => add("devcryptoeng"),
  991. bn_ops => "BN_LLONG",
  992. thread_scheme => "pthreads",
  993. dso_scheme => "dlfcn",
  994. shared_target => "bsd-gcc-shared",
  995. shared_cflag => "-fPIC",
  996. },
  997. "BSD-generic64" => {
  998. inherit_from => [ "BSD-generic32" ],
  999. bn_ops => "SIXTY_FOUR_BIT_LONG",
  1000. },
  1001. "BSD-x86" => {
  1002. inherit_from => [ "BSD-generic32" ],
  1003. CFLAGS => add(picker(release => "-fomit-frame-pointer")),
  1004. lib_cppflags => add("-DL_ENDIAN"),
  1005. bn_ops => "BN_LLONG",
  1006. asm_arch => 'x86',
  1007. perlasm_scheme => "a.out",
  1008. },
  1009. "BSD-x86-elf" => {
  1010. inherit_from => [ "BSD-x86" ],
  1011. perlasm_scheme => "elf",
  1012. },
  1013. "BSD-sparcv8" => {
  1014. inherit_from => [ "BSD-generic32" ],
  1015. cflags => add("-mcpu=v8"),
  1016. lib_cppflags => add("-DB_ENDIAN"),
  1017. asm_arch => 'sparcv8',
  1018. perlasm_scheme => 'void',
  1019. },
  1020. "BSD-sparc64" => {
  1021. # -DMD32_REG_T=int doesn't actually belong in sparc64 target, it
  1022. # simply *happens* to work around a compiler bug in gcc 3.3.3,
  1023. # triggered by RIPEMD160 code.
  1024. inherit_from => [ "BSD-generic64" ],
  1025. lib_cppflags => add("-DB_ENDIAN -DMD32_REG_T=int"),
  1026. bn_ops => "BN_LLONG",
  1027. asm_arch => 'sparcv9',
  1028. perlasm_scheme => 'void',
  1029. },
  1030. "BSD-ia64" => {
  1031. inherit_from => [ "BSD-generic64" ],
  1032. lib_cppflags => add("-DL_ENDIAN"),
  1033. bn_ops => "SIXTY_FOUR_BIT_LONG",
  1034. asm_arch => 'ia64',
  1035. perlasm_scheme => 'void',
  1036. },
  1037. "BSD-x86_64" => {
  1038. inherit_from => [ "BSD-generic64" ],
  1039. lib_cppflags => add("-DL_ENDIAN"),
  1040. bn_ops => "SIXTY_FOUR_BIT_LONG",
  1041. asm_arch => 'x86_64',
  1042. perlasm_scheme => "elf",
  1043. },
  1044. "BSD-aarch64" => {
  1045. inherit_from => [ "BSD-generic64" ],
  1046. lib_cppflags => add("-DL_ENDIAN"),
  1047. bn_ops => "SIXTY_FOUR_BIT_LONG",
  1048. asm_arch => 'aarch64',
  1049. perlasm_scheme => "linux64",
  1050. },
  1051. "BSD-ppc" => {
  1052. inherit_from => [ "BSD-generic32" ],
  1053. asm_arch => 'ppc32',
  1054. perlasm_scheme => "linux32",
  1055. lib_cppflags => add("-DB_ENDIAN"),
  1056. },
  1057. "BSD-ppc64" => {
  1058. inherit_from => [ "BSD-generic64" ],
  1059. cflags => add("-m64"),
  1060. cxxflags => add("-m64"),
  1061. lib_cppflags => add("-DB_ENDIAN"),
  1062. asm_arch => 'ppc64',
  1063. perlasm_scheme => "linux64",
  1064. },
  1065. "BSD-ppc64le" => {
  1066. inherit_from => [ "BSD-generic64" ],
  1067. cflags => add("-m64"),
  1068. cxxflags => add("-m64"),
  1069. lib_cppflags => add("-DL_ENDIAN"),
  1070. asm_arch => 'ppc64',
  1071. perlasm_scheme => "linux64le",
  1072. },
  1073. # riscv below refers to contemporary RISCV Architecture
  1074. # specifications,
  1075. "BSD-riscv64" => {
  1076. inherit_from => [ "BSD-generic64"],
  1077. perlasm_scheme => "linux64",
  1078. asm_arch => 'riscv64',
  1079. },
  1080. "BSD-riscv32" => {
  1081. inherit_from => [ "BSD-generic32"],
  1082. perlasm_scheme => "linux32",
  1083. asm_arch => 'riscv32',
  1084. },
  1085. "BSD-armv4" => {
  1086. ################################################################
  1087. # Note that -march is not among compiler options in linux-armv4
  1088. # target description. Not specifying one is intentional to give
  1089. # you choice to:
  1090. #
  1091. # a) rely on your compiler default by not specifying one;
  1092. # b) specify your target platform explicitly for optimal
  1093. # performance, e.g. -march=armv6 or -march=armv7-a;
  1094. # c) build "universal" binary that targets *range* of platforms
  1095. # by specifying minimum and maximum supported architecture;
  1096. #
  1097. # As for c) option. It actually makes no sense to specify
  1098. # maximum to be less than ARMv7, because it's the least
  1099. # requirement for run-time switch between platform-specific
  1100. # code paths. And without run-time switch performance would be
  1101. # equivalent to one for minimum. Secondly, there are some
  1102. # natural limitations that you'd have to accept and respect.
  1103. # Most notably you can *not* build "universal" binary for
  1104. # big-endian platform. This is because ARMv7 processor always
  1105. # picks instructions in little-endian order. Another similar
  1106. # limitation is that -mthumb can't "cross" -march=armv6t2
  1107. # boundary, because that's where it became Thumb-2. Well, this
  1108. # limitation is a bit artificial, because it's not really
  1109. # impossible, but it's deemed too tricky to support. And of
  1110. # course you have to be sure that your binutils are actually
  1111. # up to the task of handling maximum target platform. With all
  1112. # this in mind here is an example of how to configure
  1113. # "universal" build:
  1114. #
  1115. # ./Configure BSD-armv4 -march=armv6 -D__ARM_MAX_ARCH__=8
  1116. #
  1117. inherit_from => [ "BSD-generic32" ],
  1118. asm_arch => 'armv4',
  1119. perlasm_scheme => "linux32",
  1120. },
  1121. "bsdi-elf-gcc" => {
  1122. inherit_from => [ "BASE_unix" ],
  1123. CC => "gcc",
  1124. CFLAGS => "-fomit-frame-pointer -O3 -Wall",
  1125. lib_cppflags => "-DPERL5 -DL_ENDIAN",
  1126. ex_libs => add("-ldl"),
  1127. bn_ops => "BN_LLONG",
  1128. asm_arch => 'x86',
  1129. perlasm_scheme => "elf",
  1130. thread_scheme => "(unknown)",
  1131. dso_scheme => "dlfcn",
  1132. shared_target => "bsd-gcc-shared",
  1133. shared_cflag => "-fPIC",
  1134. },
  1135. #### *BSD-nodef
  1136. "BSD-nodef-generic32" => {
  1137. # As for thread cflag. Idea is to maintain "collective" set of
  1138. # flags, which would cover all BSD flavors. -pthread applies
  1139. # to them all, but is treated differently. OpenBSD expands is
  1140. # as -D_POSIX_THREAD -lc_r, which is sufficient. FreeBSD 4.x
  1141. # expands it as -lc_r, which has to be accompanied by explicit
  1142. # -D_THREAD_SAFE and sometimes -D_REENTRANT. FreeBSD 5.x
  1143. # expands it as -lc_r, which seems to be sufficient?
  1144. inherit_from => [ "BASE_unix" ],
  1145. CC => "cc",
  1146. CFLAGS => picker(default => "-Wall",
  1147. debug => "-O0 -g",
  1148. release => "-O3"),
  1149. cflags => threads("-pthread"),
  1150. cppflags => threads("-D_THREAD_SAFE -D_REENTRANT"),
  1151. ex_libs => add(threads("-pthread")),
  1152. enable => add("devcryptoeng"),
  1153. bn_ops => "BN_LLONG",
  1154. thread_scheme => "pthreads",
  1155. dso_scheme => "dlfcn",
  1156. shared_target => "bsd-gcc-nodef-shared",
  1157. shared_cflag => "-fPIC",
  1158. },
  1159. "BSD-nodef-generic64" => {
  1160. inherit_from => [ "BSD-nodef-generic32" ],
  1161. bn_ops => "SIXTY_FOUR_BIT_LONG",
  1162. },
  1163. "BSD-nodef-x86" => {
  1164. inherit_from => [ "BSD-nodef-generic32" ],
  1165. CFLAGS => add(picker(release => "-fomit-frame-pointer")),
  1166. lib_cppflags => add("-DL_ENDIAN"),
  1167. bn_ops => "BN_LLONG",
  1168. asm_arch => 'x86',
  1169. perlasm_scheme => "a.out",
  1170. },
  1171. "BSD-nodef-x86-elf" => {
  1172. inherit_from => [ "BSD-nodef-x86" ],
  1173. perlasm_scheme => "elf",
  1174. },
  1175. "BSD-nodef-sparcv8" => {
  1176. inherit_from => [ "BSD-nodef-generic32" ],
  1177. cflags => add("-mcpu=v8"),
  1178. lib_cppflags => add("-DB_ENDIAN"),
  1179. asm_arch => 'sparcv8',
  1180. perlasm_scheme => 'void',
  1181. },
  1182. "BSD-nodef-sparc64" => {
  1183. # -DMD32_REG_T=int doesn't actually belong in sparc64 target, it
  1184. # simply *happens* to work around a compiler bug in gcc 3.3.3,
  1185. # triggered by RIPEMD160 code.
  1186. inherit_from => [ "BSD-nodef-generic64" ],
  1187. lib_cppflags => add("-DB_ENDIAN -DMD32_REG_T=int"),
  1188. bn_ops => "BN_LLONG",
  1189. asm_arch => 'sparcv9',
  1190. perlasm_scheme => 'void',
  1191. },
  1192. "BSD-nodef-ia64" => {
  1193. inherit_from => [ "BSD-nodef-generic64" ],
  1194. lib_cppflags => add("-DL_ENDIAN"),
  1195. bn_ops => "SIXTY_FOUR_BIT_LONG",
  1196. asm_arch => 'ia64',
  1197. perlasm_scheme => 'void',
  1198. },
  1199. "BSD-nodef-x86_64" => {
  1200. inherit_from => [ "BSD-nodef-generic64" ],
  1201. lib_cppflags => add("-DL_ENDIAN"),
  1202. bn_ops => "SIXTY_FOUR_BIT_LONG",
  1203. asm_arch => 'x86_64',
  1204. perlasm_scheme => "elf",
  1205. },
  1206. #### SCO/Caldera targets.
  1207. #
  1208. # Originally we had like unixware-*, unixware-*-pentium, unixware-*-p6, etc.
  1209. # Now we only have blended unixware-* as it's the only one used by ./config.
  1210. # If you want to optimize for particular microarchitecture, bypass ./config
  1211. # and './Configure unixware-7 -Kpentium_pro' or whatever appropriate.
  1212. # Note that not all targets include assembler support. Mostly because of
  1213. # lack of motivation to support out-of-date platforms with out-of-date
  1214. # compiler drivers and assemblers.
  1215. #
  1216. # UnixWare 2.0x fails destest with -O.
  1217. "unixware-2.0" => {
  1218. inherit_from => [ "BASE_unix" ],
  1219. CC => "cc",
  1220. cflags => threads("-Kthread"),
  1221. lib_cppflags => "-DFILIO_H -DNO_STRINGS_H",
  1222. ex_libs => add("-lsocket -lnsl -lresolv -lx"),
  1223. thread_scheme => "uithreads",
  1224. },
  1225. "unixware-2.1" => {
  1226. inherit_from => [ "BASE_unix" ],
  1227. CC => "cc",
  1228. CFLAGS => "-O",
  1229. cflags => threads("-Kthread"),
  1230. lib_cppflags => "-DFILIO_H",
  1231. ex_libs => add("-lsocket -lnsl -lresolv -lx"),
  1232. thread_scheme => "uithreads",
  1233. },
  1234. "unixware-7" => {
  1235. inherit_from => [ "BASE_unix" ],
  1236. CC => "cc",
  1237. CFLAGS => "-O",
  1238. cflags => combine("-Kalloca", threads("-Kthread")),
  1239. lib_cppflags => "-DFILIO_H",
  1240. ex_libs => add("-lsocket -lnsl"),
  1241. thread_scheme => "uithreads",
  1242. bn_ops => "BN_LLONG",
  1243. asm_arch => 'x86',
  1244. perlasm_scheme => "elf-1",
  1245. dso_scheme => "dlfcn",
  1246. shared_target => "svr5-shared",
  1247. shared_cflag => "-Kpic",
  1248. },
  1249. "unixware-7-gcc" => {
  1250. inherit_from => [ "BASE_unix" ],
  1251. CC => "gcc",
  1252. CFLAGS => "-O3 -fomit-frame-pointer -Wall",
  1253. cppflags => add(threads("-D_REENTRANT")),
  1254. lib_cppflags => add("-DL_ENDIAN -DFILIO_H"),
  1255. ex_libs => add("-lsocket -lnsl"),
  1256. bn_ops => "BN_LLONG",
  1257. thread_scheme => "pthreads",
  1258. asm_arch => 'x86',
  1259. perlasm_scheme => "elf-1",
  1260. dso_scheme => "dlfcn",
  1261. shared_target => "gnu-shared",
  1262. shared_cflag => "-fPIC",
  1263. },
  1264. # SCO 5 - Ben Laurie says the -O breaks the SCO cc.
  1265. "sco5-cc" => {
  1266. inherit_from => [ "BASE_unix" ],
  1267. cc => "cc",
  1268. cflags => "-belf",
  1269. ex_libs => add("-lsocket -lnsl"),
  1270. thread_scheme => "(unknown)",
  1271. asm_arch => 'x86',
  1272. perlasm_scheme => "elf-1",
  1273. dso_scheme => "dlfcn",
  1274. shared_target => "svr3-shared",
  1275. shared_cflag => "-Kpic",
  1276. },
  1277. "sco5-gcc" => {
  1278. inherit_from => [ "BASE_unix" ],
  1279. cc => "gcc",
  1280. cflags => "-O3 -fomit-frame-pointer",
  1281. ex_libs => add("-lsocket -lnsl"),
  1282. bn_ops => "BN_LLONG",
  1283. thread_scheme => "(unknown)",
  1284. asm_arch => 'x86',
  1285. perlasm_scheme => "elf-1",
  1286. dso_scheme => "dlfcn",
  1287. shared_target => "svr3-shared",
  1288. shared_cflag => "-fPIC",
  1289. },
  1290. #### IBM's AIX.
  1291. # Below targets assume AIX >=5. Caveat lector. If you are accustomed
  1292. # to control compilation "bitness" by setting $OBJECT_MODE environment
  1293. # variable, then you should know that in OpenSSL case it's considered
  1294. # only in ./config. Once configured, build procedure remains "deaf" to
  1295. # current value of $OBJECT_MODE.
  1296. "aix-common" => {
  1297. inherit_from => [ "BASE_unix" ],
  1298. template => 1,
  1299. sys_id => "AIX",
  1300. lib_cppflags => "-DB_ENDIAN",
  1301. lflags => "-Wl,-bsvr4",
  1302. thread_scheme => "pthreads",
  1303. dso_scheme => "dlfcn",
  1304. shared_target => "aix",
  1305. module_ldflags => "-Wl,-G,-bsymbolic,-bnoentry",
  1306. shared_ldflag => "-Wl,-G,-bsymbolic,-bnoentry",
  1307. shared_defflag => "-Wl,-bE:",
  1308. shared_fipsflag => "-Wl,-binitfini:_init:_cleanup",
  1309. perl_platform => 'AIX',
  1310. },
  1311. "aix-gcc" => {
  1312. inherit_from => [ "aix-common" ],
  1313. CC => "gcc",
  1314. CFLAGS => picker(debug => "-O0 -g",
  1315. release => "-O"),
  1316. cflags => add(threads("-pthread")),
  1317. ex_libs => add(threads("-pthread")),
  1318. bn_ops => "BN_LLONG RC4_CHAR",
  1319. asm_arch => 'ppc32',
  1320. perlasm_scheme => "aix32",
  1321. shared_ldflag => add_before("-shared -static-libgcc"),
  1322. AR => add("-X32"),
  1323. RANLIB => add("-X32"),
  1324. },
  1325. "aix64-gcc" => {
  1326. inherit_from => [ "aix-common" ],
  1327. CC => "gcc",
  1328. CFLAGS => picker(debug => "-O0 -g",
  1329. release => "-O"),
  1330. cflags => combine("-maix64", threads("-pthread")),
  1331. ex_libs => add(threads("-pthread")),
  1332. bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
  1333. asm_arch => 'ppc64',
  1334. perlasm_scheme => "aix64",
  1335. shared_ldflag => add_before("-shared -static-libgcc"),
  1336. shared_extension => "64.so.\$(SHLIB_VERSION_NUMBER)",
  1337. AR => add("-X64"),
  1338. RANLIB => add("-X64"),
  1339. },
  1340. "aix64-gcc-as" => {
  1341. inherit_from => [ "aix64-gcc" ],
  1342. perlasm_scheme => "aix64-as",
  1343. },
  1344. "aix-cc" => {
  1345. inherit_from => [ "aix-common" ],
  1346. CC => "cc",
  1347. CFLAGS => picker(debug => "-O0 -g",
  1348. release => "-O"),
  1349. cflags => combine("-q32 -qmaxmem=16384 -qro -qroconst",
  1350. threads("-qthreaded")),
  1351. cppflags => threads("-D_THREAD_SAFE"),
  1352. ex_libs => add(threads("-lpthreads")),
  1353. bn_ops => "BN_LLONG RC4_CHAR",
  1354. asm_arch => 'ppc32',
  1355. perlasm_scheme => "aix32",
  1356. shared_cflag => "-qpic",
  1357. AR => add("-X32"),
  1358. RANLIB => add("-X32"),
  1359. },
  1360. # shared_target of "aix-solib" builds shared libraries packaged
  1361. # without archives. This improves the behavior of inter-library
  1362. # references (libssl depending on libcrypto) when building with
  1363. # shlib_variant.
  1364. # You'll get: libxxx.so (import library, used when linking applications)
  1365. # libxxx.so.ver (shared object)
  1366. # libxxx.a (static library archive)
  1367. # and for runtime, you only need libxxx.so.ver. libxxx.so and libxxx.a
  1368. # can be installed along with include files to make an SDK
  1369. "aix-cc-solib" => {
  1370. inherit_from => [ "aix-cc" ],
  1371. shared_target => "aix-solib",
  1372. },
  1373. "aix64-cc" => {
  1374. inherit_from => [ "aix-common" ],
  1375. CC => "cc",
  1376. CFLAGS => picker(debug => "-O0 -g",
  1377. release => "-O"),
  1378. cflags => combine("-q64 -qmaxmem=16384 -qro -qroconst",
  1379. threads("-qthreaded")),
  1380. cppflags => threads("-D_THREAD_SAFE"),
  1381. ex_libs => add(threads("-lpthreads")),
  1382. bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
  1383. asm_arch => 'ppc64',
  1384. perlasm_scheme => "aix64",
  1385. dso_scheme => "dlfcn",
  1386. shared_cflag => "-qpic",
  1387. shared_extension => "64.so.\$(SHLIB_VERSION_NUMBER)",
  1388. AR => add("-X64"),
  1389. RANLIB => add("-X64"),
  1390. },
  1391. "aix64-cc-solib" => {
  1392. inherit_from => [ "aix64-cc" ],
  1393. shared_target => "aix-solib",
  1394. },
  1395. # SIEMENS BS2000/OSD: an EBCDIC-based mainframe
  1396. "BS2000-OSD" => {
  1397. inherit_from => [ "BASE_unix" ],
  1398. CC => "c89",
  1399. CFLAGS => "-O",
  1400. cflags => "-XLLML -XLLMK -XL",
  1401. cppflags => "-DCHARSET_EBCDIC",
  1402. lib_cppflags => "-DB_ENDIAN",
  1403. ex_libs => add("-lsocket -lnsl"),
  1404. bn_ops => "THIRTY_TWO_BIT RC4_CHAR",
  1405. thread_scheme => "(unknown)",
  1406. },
  1407. #### Visual C targets
  1408. #
  1409. # Win64 targets, WIN64I denotes IA-64/Itanium and WIN64A - AMD64
  1410. #
  1411. # Note about /wd4090, disable warning C4090. This warning returns false
  1412. # positives in some situations. Disabling it altogether masks both
  1413. # legitimate and false cases, but as we compile on multiple platforms,
  1414. # we rely on other compilers to catch legitimate cases.
  1415. #
  1416. # Also note that we force threads no matter what. Configuring "no-threads"
  1417. # is ignored.
  1418. #
  1419. # UNICODE is defined in VC-common and applies to all targets. It used to
  1420. # be an opt-in option for VC-WIN32, but not anymore. The original reason
  1421. # was because ANSI API was *native* system interface for no longer
  1422. # supported Windows 9x. Keep in mind that UNICODE only affects how
  1423. # OpenSSL libraries interact with underlying OS, it doesn't affect API
  1424. # that OpenSSL presents to application.
  1425. "VC-common" => {
  1426. inherit_from => [ "BASE_Windows" ],
  1427. template => 1,
  1428. CC => "cl",
  1429. CPP => '$(CC) /EP /C',
  1430. CFLAGS => "/W3 /wd4090 /nologo",
  1431. coutflag => "/Fo",
  1432. LD => "link",
  1433. LDFLAGS => "/nologo /debug",
  1434. ldoutflag => "/out:",
  1435. ldpostoutflag => "",
  1436. ld_resp_delim => "\n",
  1437. bin_lflags => "setargv.obj",
  1438. makedepcmd => '$(CC) /Zs /showIncludes',
  1439. makedep_scheme => 'VC',
  1440. AR => "lib",
  1441. ARFLAGS => "/nologo",
  1442. aroutflag => "/out:",
  1443. ar_resp_delim => "\n",
  1444. RC => "rc",
  1445. rcoutflag => "/fo",
  1446. defines => add("OPENSSL_SYS_WIN32", "WIN32_LEAN_AND_MEAN",
  1447. "UNICODE", "_UNICODE",
  1448. "_CRT_SECURE_NO_DEPRECATE",
  1449. "_WINSOCK_DEPRECATED_NO_WARNINGS"),
  1450. lib_cflags => add("/Zi /Fdossl_static.pdb"),
  1451. lib_defines => add("L_ENDIAN"),
  1452. dso_cflags => "/Zi /Fddso.pdb",
  1453. bin_cflags => "/Zi /Fdapp.pdb",
  1454. # def_flag made to empty string so a .def file gets generated
  1455. shared_defflag => '',
  1456. shared_ldflag => "/dll",
  1457. shared_target => "win-shared", # meaningless except it gives Configure a hint
  1458. lddefflag => "/def:",
  1459. ldresflag => " ",
  1460. ld_implib_flag => "/implib:",
  1461. thread_scheme => "winthreads",
  1462. dso_scheme => "win32",
  1463. perl_platform => 'Windows::MSVC',
  1464. # additional parameter to build_scheme denotes install-path "flavour"
  1465. build_scheme => add("VC-common", { separator => undef }),
  1466. },
  1467. "VC-noCE-common" => {
  1468. inherit_from => [ "VC-common" ],
  1469. template => 1,
  1470. CFLAGS => add(picker(debug => '/Od',
  1471. release => '/O2')),
  1472. cflags => add(picker(default => '/Gs0 /GF /Gy',
  1473. debug =>
  1474. sub {
  1475. ($disabled{shared} ? "" : "/MDd");
  1476. },
  1477. release =>
  1478. sub {
  1479. ($disabled{shared} ? "" : "/MD");
  1480. })),
  1481. defines => add(picker(default => [], # works as type cast
  1482. debug => [ "DEBUG", "_DEBUG" ])),
  1483. lib_cflags => add(sub { $disabled{shared} ? "/MT /Zl" : () }),
  1484. # Following might/should appears controversial, i.e. defining
  1485. # /MDd without evaluating $disabled{shared}. It works in
  1486. # non-shared build because static library is compiled with /Zl
  1487. # and bares no reference to specific RTL. And it works in
  1488. # shared build because multiple /MDd options are not prohibited.
  1489. # But why /MDd in static build? Well, basically this is just a
  1490. # reference point, which allows to catch eventual errors that
  1491. # would prevent those who want to wrap OpenSSL into own .DLL.
  1492. # Why not /MD in release build then? Well, some are likely to
  1493. # prefer [non-debug] openssl.exe to be free from Micorosoft RTL
  1494. # redistributable.
  1495. bin_cflags => add(picker(debug => "/MDd",
  1496. release => sub { $disabled{shared} ? "/MT" : () },
  1497. )),
  1498. bin_lflags => add("/subsystem:console /opt:ref"),
  1499. ex_libs => add(sub {
  1500. my @ex_libs = ();
  1501. push @ex_libs, 'ws2_32.lib' unless $disabled{sock};
  1502. push @ex_libs, 'gdi32.lib advapi32.lib crypt32.lib user32.lib';
  1503. return join(" ", @ex_libs);
  1504. }),
  1505. },
  1506. "VC-WIN64-common" => {
  1507. inherit_from => [ "VC-noCE-common" ],
  1508. template => 1,
  1509. ex_libs => add(sub {
  1510. my @ex_libs = ();
  1511. push @ex_libs, 'bufferoverflowu.lib' if (`cl 2>&1` =~ /14\.00\.4[0-9]{4}\./);
  1512. return join(" ", @_, @ex_libs);
  1513. }),
  1514. bn_ops => add("SIXTY_FOUR_BIT"),
  1515. },
  1516. "VC-WIN64I" => {
  1517. inherit_from => [ "VC-WIN64-common" ],
  1518. AS => "ias",
  1519. ASFLAGS => "-d debug",
  1520. asoutflag => "-o ",
  1521. sys_id => "WIN64I",
  1522. uplink_arch => 'ia64',
  1523. asm_arch => 'ia64',
  1524. perlasm_scheme => "ias",
  1525. multilib => "-ia64",
  1526. },
  1527. "VC-WIN64A" => {
  1528. inherit_from => [ "VC-WIN64-common" ],
  1529. AS => sub { vc_win64a_info()->{AS} },
  1530. ASFLAGS => sub { vc_win64a_info()->{ASFLAGS} },
  1531. asoutflag => sub { vc_win64a_info()->{asoutflag} },
  1532. asflags => sub { vc_win64a_info()->{asflags} },
  1533. sys_id => "WIN64A",
  1534. uplink_arch => 'x86_64',
  1535. asm_arch => 'x86_64',
  1536. perlasm_scheme => sub { vc_win64a_info()->{perlasm_scheme} },
  1537. multilib => "-x64",
  1538. },
  1539. "VC-WIN32" => {
  1540. inherit_from => [ "VC-noCE-common" ],
  1541. AS => sub { vc_win32_info()->{AS} },
  1542. ASFLAGS => sub { vc_win32_info()->{ASFLAGS} },
  1543. asoutflag => sub { vc_win32_info()->{asoutflag} },
  1544. asflags => sub { vc_win32_info()->{asflags} },
  1545. sys_id => "WIN32",
  1546. bn_ops => add("BN_LLONG"),
  1547. uplink_arch => 'common',
  1548. asm_arch => 'x86',
  1549. perlasm_scheme => sub { vc_win32_info()->{perlasm_scheme} },
  1550. # "WOW" stands for "Windows on Windows", and "VC-WOW" engages
  1551. # some installation path heuristics in windows-makefile.tmpl...
  1552. build_scheme => add("VC-WOW", { separator => undef }),
  1553. },
  1554. "VC-CE" => {
  1555. inherit_from => [ "VC-common" ],
  1556. CFLAGS => add(picker(debug => "/Od",
  1557. release => "/O1i")),
  1558. CPPDEFINES => picker(debug => [ "DEBUG", "_DEBUG" ]),
  1559. LDFLAGS => add("/nologo /opt:ref"),
  1560. cflags =>
  1561. combine('/GF /Gy',
  1562. sub { vc_wince_info()->{cflags}; },
  1563. sub { `cl 2>&1` =~ /Version ([0-9]+)\./ && $1>=14
  1564. ? ($disabled{shared} ? " /MT" : " /MD")
  1565. : " /MC"; }),
  1566. cppflags => sub { vc_wince_info()->{cppflags}; },
  1567. lib_defines => add("NO_CHMOD", "OPENSSL_SMALL_FOOTPRINT"),
  1568. lib_cppflags => sub { vc_wince_info()->{cppflags}; },
  1569. includes =>
  1570. add(combine(sub { defined(env('WCECOMPAT'))
  1571. ? '$(WCECOMPAT)/include' : (); },
  1572. sub { defined(env('PORTSDK_LIBPATH'))
  1573. ? '$(PORTSDK_LIBPATH)/../../include'
  1574. : (); })),
  1575. lflags => add(combine(sub { vc_wince_info()->{lflags}; },
  1576. sub { defined(env('PORTSDK_LIBPATH'))
  1577. ? "/entry:mainCRTstartup" : (); })),
  1578. sys_id => "WINCE",
  1579. bn_ops => add("BN_LLONG"),
  1580. ex_libs => add(sub {
  1581. my @ex_libs = ();
  1582. push @ex_libs, 'ws2.lib' unless $disabled{sock};
  1583. push @ex_libs, 'crypt32.lib';
  1584. if (defined(env('WCECOMPAT'))) {
  1585. my $x = '$(WCECOMPAT)/lib';
  1586. if (-f "$x/env('TARGETCPU')/wcecompatex.lib") {
  1587. $x .= '/$(TARGETCPU)/wcecompatex.lib';
  1588. } else {
  1589. $x .= '/wcecompatex.lib';
  1590. }
  1591. push @ex_libs, $x;
  1592. }
  1593. push @ex_libs, '$(PORTSDK_LIBPATH)/portlib.lib'
  1594. if (defined(env('PORTSDK_LIBPATH')));
  1595. push @ex_libs, '/nodefaultlib coredll.lib corelibc.lib'
  1596. if (env('TARGETCPU') =~ /^X86|^ARMV4[IT]/);
  1597. return join(" ", @ex_libs);
  1598. }),
  1599. },
  1600. #### MinGW
  1601. "mingw-common" => {
  1602. inherit_from => [ 'BASE_unix' ],
  1603. template => 1,
  1604. CC => "gcc",
  1605. CFLAGS => picker(default => "-Wall",
  1606. debug => "-g -O0",
  1607. release => "-O3"),
  1608. cppflags => combine("-DUNICODE -D_UNICODE -DWIN32_LEAN_AND_MEAN",
  1609. threads("-D_MT")),
  1610. lib_cppflags => "-DL_ENDIAN",
  1611. ex_libs => add("-lws2_32 -lgdi32 -lcrypt32"),
  1612. thread_scheme => "winthreads",
  1613. dso_scheme => "win32",
  1614. shared_target => "mingw-shared",
  1615. shared_cppflags => add("_WINDLL"),
  1616. shared_ldflag => "-static-libgcc",
  1617. perl_platform => 'mingw',
  1618. },
  1619. "mingw" => {
  1620. inherit_from => [ "mingw-common" ],
  1621. CFLAGS => add(picker(release => "-fomit-frame-pointer")),
  1622. cflags => "-m32",
  1623. sys_id => "MINGW32",
  1624. bn_ops => add("BN_LLONG"),
  1625. asm_arch => 'x86',
  1626. uplink_arch => 'x86',
  1627. perlasm_scheme => "coff",
  1628. shared_rcflag => "--target=pe-i386",
  1629. multilib => "",
  1630. },
  1631. "mingw64" => {
  1632. # As for uplink_arch. Applink makes it possible to use
  1633. # .dll compiled with one compiler with application compiled with
  1634. # another compiler. It's possible to engage Applink support in
  1635. # mingw64 build, but it's not done, because until mingw64
  1636. # supports structured exception handling, one can't seriously
  1637. # consider its binaries for using with non-mingw64 run-time
  1638. # environment. And as mingw64 is always consistent with itself,
  1639. # Applink is never engaged and can as well be omitted.
  1640. inherit_from => [ "mingw-common" ],
  1641. cflags => "-m64",
  1642. sys_id => "MINGW64",
  1643. bn_ops => add("SIXTY_FOUR_BIT"),
  1644. asm_arch => 'x86_64',
  1645. uplink_arch => undef,
  1646. perlasm_scheme => "mingw64",
  1647. shared_rcflag => "--target=pe-x86-64",
  1648. multilib => "64",
  1649. },
  1650. #### UEFI
  1651. "UEFI" => {
  1652. inherit_from => [ "BASE_unix" ],
  1653. CC => "cc",
  1654. CFLAGS => "-O",
  1655. lib_cppflags => "-DL_ENDIAN",
  1656. sys_id => "UEFI",
  1657. },
  1658. "UEFI-x86" => {
  1659. inherit_from => [ "UEFI" ],
  1660. asm_arch => 'x86',
  1661. perlasm_scheme => "win32n",
  1662. },
  1663. "UEFI-x86_64" => {
  1664. inherit_from => [ "UEFI" ],
  1665. asm_arch => 'x86_64',
  1666. perlasm_scheme => "nasm",
  1667. },
  1668. #### UWIN
  1669. "UWIN" => {
  1670. inherit_from => [ "BASE_unix" ],
  1671. CC => "cc",
  1672. CFLAGS => "-O -Wall",
  1673. lib_cppflags => "-DTERMIOS -DL_ENDIAN",
  1674. sys_id => "UWIN",
  1675. bn_ops => "BN_LLONG",
  1676. dso_scheme => "win32",
  1677. },
  1678. #### Cygwin
  1679. "Cygwin-common" => {
  1680. inherit_from => [ "BASE_unix" ],
  1681. template => 1,
  1682. CC => "gcc",
  1683. CFLAGS => picker(default => "-Wall",
  1684. debug => "-g -O0",
  1685. release => "-O3"),
  1686. ex_libs => add("-lcrypt32"),
  1687. lib_cppflags => "-DTERMIOS -DL_ENDIAN",
  1688. sys_id => "CYGWIN",
  1689. thread_scheme => "pthread",
  1690. dso_scheme => "dlfcn",
  1691. shared_target => "cygwin-shared",
  1692. shared_cppflags => "-D_WINDLL",
  1693. perl_platform => 'Cygwin',
  1694. },
  1695. "Cygwin-x86" => {
  1696. inherit_from => [ "Cygwin-common" ],
  1697. CFLAGS => add(picker(release => "-O3 -fomit-frame-pointer")),
  1698. bn_ops => "BN_LLONG",
  1699. asm_arch => 'x86',
  1700. perlasm_scheme => "coff",
  1701. },
  1702. "Cygwin-x86_64" => {
  1703. inherit_from => [ "Cygwin-common" ],
  1704. CC => "gcc",
  1705. bn_ops => "SIXTY_FOUR_BIT_LONG",
  1706. asm_arch => 'x86_64',
  1707. perlasm_scheme => "mingw64",
  1708. },
  1709. # Backward compatibility for those using this target
  1710. "Cygwin" => {
  1711. inherit_from => [ "Cygwin-x86" ]
  1712. },
  1713. # In case someone constructs the Cygwin target name themself
  1714. "Cygwin-i386" => {
  1715. inherit_from => [ "Cygwin-x86" ]
  1716. },
  1717. "Cygwin-i486" => {
  1718. inherit_from => [ "Cygwin-x86" ]
  1719. },
  1720. "Cygwin-i586" => {
  1721. inherit_from => [ "Cygwin-x86" ]
  1722. },
  1723. "Cygwin-i686" => {
  1724. inherit_from => [ "Cygwin-x86" ]
  1725. },
  1726. ##### MacOS X (a.k.a. Darwin) setup
  1727. "darwin-common" => {
  1728. inherit_from => [ "BASE_unix" ],
  1729. template => 1,
  1730. CC => "cc",
  1731. CFLAGS => picker(debug => "-g -O0",
  1732. release => "-O3"),
  1733. cppflags => threads("-D_REENTRANT"),
  1734. lflags => add("-Wl,-search_paths_first"),
  1735. sys_id => "MACOSX",
  1736. bn_ops => "BN_LLONG RC4_CHAR",
  1737. thread_scheme => "pthreads",
  1738. perlasm_scheme => "osx32",
  1739. dso_scheme => "dlfcn",
  1740. ranlib => "ranlib -c",
  1741. shared_target => "darwin-shared",
  1742. shared_cflag => "-fPIC",
  1743. shared_extension => ".\$(SHLIB_VERSION_NUMBER).dylib",
  1744. },
  1745. # Option "freeze" such as -std=gnu9x can't negatively interfere
  1746. # with future defaults for below two targets, because MacOS X
  1747. # for PPC has no future, it was discontinued by vendor in 2009.
  1748. "darwin-ppc-cc" => { inherit_from => [ "darwin-ppc" ] }, # Historic alias
  1749. "darwin-ppc" => {
  1750. inherit_from => [ "darwin-common" ],
  1751. cflags => add("-arch ppc -std=gnu9x -Wa,-force_cpusubtype_ALL"),
  1752. lib_cppflags => add("-DB_ENDIAN"),
  1753. shared_cflag => add("-fno-common"),
  1754. asm_arch => 'ppc32',
  1755. perlasm_scheme => "osx32",
  1756. },
  1757. "darwin64-ppc-cc" => { inherit_from => [ "darwin64-ppc" ] }, # Historic alias
  1758. "darwin64-ppc" => {
  1759. inherit_from => [ "darwin-common" ],
  1760. cflags => add("-arch ppc64 -std=gnu9x"),
  1761. lib_cppflags => add("-DB_ENDIAN"),
  1762. bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
  1763. asm_arch => 'ppc64',
  1764. perlasm_scheme => "osx64",
  1765. },
  1766. "darwin-i386-cc" => { inherit_from => [ "darwin-i386" ] }, # Historic alias
  1767. "darwin-i386" => {
  1768. inherit_from => [ "darwin-common" ],
  1769. CFLAGS => add(picker(release => "-fomit-frame-pointer")),
  1770. cflags => add("-arch i386"),
  1771. lib_cppflags => add("-DL_ENDIAN"),
  1772. bn_ops => "BN_LLONG RC4_INT",
  1773. asm_arch => 'x86',
  1774. perlasm_scheme => "macosx",
  1775. },
  1776. "darwin64-x86_64-cc" => { inherit_from => [ "darwin64-x86_64" ] }, # Historic alias
  1777. "darwin64-x86_64" => {
  1778. inherit_from => [ "darwin-common" ],
  1779. CFLAGS => add("-Wall"),
  1780. cflags => add("-arch x86_64"),
  1781. lib_cppflags => add("-DL_ENDIAN"),
  1782. bn_ops => "SIXTY_FOUR_BIT_LONG",
  1783. asm_arch => 'x86_64',
  1784. perlasm_scheme => "macosx",
  1785. },
  1786. "darwin64-arm64-cc" => { inherit_from => [ "darwin64-arm64" ] }, # "Historic" alias
  1787. "darwin64-arm64" => {
  1788. inherit_from => [ "darwin-common" ],
  1789. CFLAGS => add("-Wall"),
  1790. cflags => add("-arch arm64"),
  1791. lib_cppflags => add("-DL_ENDIAN"),
  1792. bn_ops => "SIXTY_FOUR_BIT_LONG",
  1793. asm_arch => 'aarch64',
  1794. perlasm_scheme => "ios64",
  1795. },
  1796. ##### GNU Hurd
  1797. "hurd-generic32" => {
  1798. inherit_from => [ "BASE_unix" ],
  1799. CC => "gcc",
  1800. CXX => "g++",
  1801. CFLAGS => picker(default => "-Wall",
  1802. debug => "-O0 -g",
  1803. release => "-O3"),
  1804. CXXFLAGS => picker(default => "-Wall",
  1805. debug => "-O0 -g",
  1806. release => "-O3"),
  1807. cflags => threads("-pthread"),
  1808. cxxflags => combine("-std=c++11", threads("-pthread")),
  1809. ex_libs => add("-ldl", threads("-pthread")),
  1810. bn_ops => "BN_LLONG RC4_CHAR",
  1811. thread_scheme => "pthreads",
  1812. dso_scheme => "dlfcn",
  1813. shared_target => "linux-shared",
  1814. shared_cflag => "-fPIC",
  1815. shared_ldflag => sub { $disabled{pinshared} ? () : "-Wl,-znodelete" },
  1816. },
  1817. "hurd-generic64" => {
  1818. inherit_from => [ "hurd-generic32" ],
  1819. bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
  1820. },
  1821. #### X86 / X86_64 targets
  1822. "hurd-x86" => {
  1823. inherit_from => [ "hurd-generic32" ],
  1824. CFLAGS => add(picker(release => "-fomit-frame-pointer")),
  1825. cflags => add("-m32"),
  1826. cxxflags => add("-m32"),
  1827. lib_cppflags => add("-DL_ENDIAN"),
  1828. bn_ops => "BN_LLONG",
  1829. asm_arch => 'x86',
  1830. perlasm_scheme => 'elf',
  1831. },
  1832. "hurd-x86_64" => {
  1833. inherit_from => [ "hurd-generic64" ],
  1834. cflags => add("-m64"),
  1835. cxxflags => add("-m64"),
  1836. lib_cppflags => add("-DL_ENDIAN"),
  1837. bn_ops => "SIXTY_FOUR_BIT_LONG",
  1838. asm_arch => 'x86_64',
  1839. perlasm_scheme => 'elf',
  1840. multilib => "64",
  1841. },
  1842. ##### VxWorks for various targets
  1843. "vxworks-ppc60x" => {
  1844. inherit_from => [ "BASE_unix" ],
  1845. CC => "ccppc",
  1846. CFLAGS => "-O2 -Wall -fstrength-reduce",
  1847. cflags => "-mrtp -mhard-float -mstrict-align -fno-implicit-fp -fno-builtin -fno-strict-aliasing",
  1848. cppflags => combine("-D_REENTRANT -DPPC32_fp60x -DCPU=PPC32",
  1849. "_DTOOL_FAMILY=gnu -DTOOL=gnu",
  1850. "-I\$(WIND_BASE)/target/usr/h",
  1851. "-I\$(WIND_BASE)/target/usr/h/wrn/coreip"),
  1852. sys_id => "VXWORKS",
  1853. lflags => add("-L \$(WIND_BASE)/target/usr/lib/ppc/PPC32/common"),
  1854. ex_libs => add("-Wl,--defsym,__wrs_rtp_base=0xe0000000"),
  1855. },
  1856. "vxworks-ppcgen" => {
  1857. inherit_from => [ "BASE_unix" ],
  1858. CC => "ccppc",
  1859. CFLAGS => "-O1 -Wall",
  1860. cflags => "-mrtp -msoft-float -mstrict-align -fno-builtin -fno-strict-aliasing",
  1861. cppflags => combine("-D_REENTRANT -DPPC32 -DCPU=PPC32",
  1862. "-DTOOL_FAMILY=gnu -DTOOL=gnu",
  1863. "-I\$(WIND_BASE)/target/usr/h",
  1864. "-I\$(WIND_BASE)/target/usr/h/wrn/coreip"),
  1865. sys_id => "VXWORKS",
  1866. lflags => add("-L \$(WIND_BASE)/target/usr/lib/ppc/PPC32/sfcommon"),
  1867. ex_libs => add("-Wl,--defsym,__wrs_rtp_base=0xe0000000"),
  1868. },
  1869. "vxworks-ppc405" => {
  1870. inherit_from => [ "BASE_unix" ],
  1871. CC => "ccppc",
  1872. CFLAGS => "-g",
  1873. cflags => "-msoft-float -mlongcall",
  1874. cppflags => combine("-D_REENTRANT -DPPC32 -DCPU=PPC405",
  1875. "-DTOOL_FAMILY=gnu -DTOOL=gnu",
  1876. "-I\$(WIND_BASE)/target/h"),
  1877. sys_id => "VXWORKS",
  1878. lflags => add("-r"),
  1879. },
  1880. "vxworks-ppc750" => {
  1881. inherit_from => [ "BASE_unix" ],
  1882. CC => "ccppc",
  1883. CFLAGS => "-ansi -fvolatile -Wall \$(DEBUG_FLAG)",
  1884. cflags => "-nostdinc -fno-builtin -fno-for-scope -fsigned-char -msoft-float -mlongcall",
  1885. cppflags => combine("-DPPC750 -D_REENTRANT -DCPU=PPC604",
  1886. "-I\$(WIND_BASE)/target/h"),
  1887. sys_id => "VXWORKS",
  1888. lflags => add("-r"),
  1889. },
  1890. "vxworks-ppc750-debug" => {
  1891. inherit_from => [ "BASE_unix" ],
  1892. CC => "ccppc",
  1893. CFLAGS => "-ansi -fvolatile -Wall -g",
  1894. cflags => "-nostdinc -fno-builtin -fno-for-scope -fsigned-char -msoft-float -mlongcall",
  1895. cppflags => combine("-DPPC750 -D_REENTRANT -DCPU=PPC604",
  1896. "-DPEDANTIC -DDEBUG",
  1897. "-I\$(WIND_BASE)/target/h"),
  1898. sys_id => "VXWORKS",
  1899. lflags => add("-r"),
  1900. },
  1901. "vxworks-ppc860" => {
  1902. inherit_from => [ "BASE_unix" ],
  1903. CC => "ccppc",
  1904. cflags => "-nostdinc -msoft-float",
  1905. cppflags => combine("-DCPU=PPC860 -DNO_STRINGS_H",
  1906. "-I\$(WIND_BASE)/target/h"),
  1907. sys_id => "VXWORKS",
  1908. lflags => add("-r"),
  1909. },
  1910. "vxworks-simlinux" => {
  1911. inherit_from => [ "BASE_unix" ],
  1912. CC => "ccpentium",
  1913. cflags => "-B\$(WIND_BASE)/host/\$(WIND_HOST_TYPE)/lib/gcc-lib/ -fno-builtin -fno-defer-pop",
  1914. cppflags => combine("-D_VSB_CONFIG_FILE=\"\$(WIND_BASE)/target/lib/h/config/vsbConfig.h\"",
  1915. "-DL_ENDIAN -DCPU=SIMLINUX -DNO_STRINGS_H",
  1916. "-DTOOL_FAMILY=gnu -DTOOL=gnu",
  1917. "-DOPENSSL_NO_HW_PADLOCK",
  1918. "-I\$(WIND_BASE)/target/h",
  1919. "-I\$(WIND_BASE)/target/h/wrn/coreip"),
  1920. sys_id => "VXWORKS",
  1921. lflags => add("-r"),
  1922. ranlib => "ranlibpentium",
  1923. },
  1924. "vxworks-mips" => {
  1925. inherit_from => [ "BASE_unix" ],
  1926. CC => "ccmips",
  1927. CFLAGS => "-O -G 0",
  1928. cflags => "-mrtp -mips2 -B\$(WIND_BASE)/host/\$(WIND_HOST_TYPE)/lib/gcc-lib/ -msoft-float -mno-branch-likely -fno-builtin -fno-defer-pop",
  1929. cppflags => combine("-D_VSB_CONFIG_FILE=\"\$(WIND_BASE)/target/lib/h/config/vsbConfig.h\"",
  1930. "-DCPU=MIPS32 -DNO_STRINGS_H",
  1931. "-DTOOL_FAMILY=gnu -DTOOL=gnu",
  1932. "-DOPENSSL_NO_HW_PADLOCK",
  1933. threads("-D_REENTRANT"),
  1934. "-I\$(WIND_BASE)/target/h",
  1935. "-I\$(WIND_BASE)/target/h/wrn/coreip"),
  1936. sys_id => "VXWORKS",
  1937. lflags => add("-L \$(WIND_BASE)/target/usr/lib/mips/MIPSI32/sfcommon"),
  1938. ex_libs => add("-Wl,--defsym,__wrs_rtp_base=0xe0000000"),
  1939. thread_scheme => "pthreads",
  1940. asm_arch => 'mips32',
  1941. perlasm_scheme => "o32",
  1942. ranlib => "ranlibmips",
  1943. },
  1944. #### uClinux
  1945. "uClinux-dist" => {
  1946. inherit_from => [ "BASE_unix" ],
  1947. CC => sub { env('CC') },
  1948. cppflags => threads("-D_REENTRANT"),
  1949. ex_libs => add("\$(LDLIBS)"),
  1950. bn_ops => "BN_LLONG",
  1951. thread_scheme => "pthreads",
  1952. dso_scheme => sub { env('LIBSSL_dlfcn') },
  1953. shared_target => "linux-shared",
  1954. shared_cflag => "-fPIC",
  1955. ranlib => sub { env('RANLIB') },
  1956. },
  1957. "uClinux-dist64" => {
  1958. inherit_from => [ "BASE_unix" ],
  1959. CC => sub { env('CC') },
  1960. cppflags => threads("-D_REENTRANT"),
  1961. ex_libs => add("\$(LDLIBS)"),
  1962. bn_ops => "SIXTY_FOUR_BIT_LONG",
  1963. thread_scheme => "pthreads",
  1964. dso_scheme => sub { env('LIBSSL_dlfcn') },
  1965. shared_target => "linux-shared",
  1966. shared_cflag => "-fPIC",
  1967. ranlib => sub { env('RANLIB') },
  1968. },
  1969. ##### VMS
  1970. # Most things happen in vms-generic.
  1971. # Note that vms_info extracts the pointer size from the end of
  1972. # the target name, and will assume that anything matching /-p\d+$/
  1973. # indicates the pointer size setting for the desired target.
  1974. "vms-generic" => {
  1975. inherit_from => [ "BASE_VMS" ],
  1976. template => 1,
  1977. CC => "CC/DECC",
  1978. CPP => '$(CC)/PREPROCESS_ONLY=SYS$OUTPUT:',
  1979. CFLAGS =>
  1980. combine(picker(default => "/STANDARD=(ISOC94,RELAXED)/NOLIST/PREFIX=ALL",
  1981. debug => "/NOOPTIMIZE/DEBUG",
  1982. release => "/OPTIMIZE/NODEBUG"),
  1983. sub { my @warnings =
  1984. @{vms_info()->{disable_warns}};
  1985. @warnings
  1986. ? "/WARNINGS=DISABLE=(".join(",",@warnings).")" : (); }),
  1987. cflag_incfirst => '/FIRST_INCLUDE=',
  1988. lib_defines =>
  1989. add("OPENSSL_USE_NODELETE", "_XOPEN_SOURCE", "_XOPEN_SOURCE_EXTENDED",
  1990. sub {
  1991. return vms_info()->{def_zlib}
  1992. ? "LIBZ=\"\"\"".vms_info()->{def_zlib}."\"\"\"" : ();
  1993. }),
  1994. lflags => picker(default => "/MAP='F\$PARSE(\".MAP\",\"\$\@\")'",
  1995. debug => "/DEBUG/TRACEBACK",
  1996. release => "/NODEBUG/NOTRACEBACK"),
  1997. # Because of dso_cflags below, we can't set the generic |cflags| here,
  1998. # as it can't be overridden, so we set separate C flags for libraries
  1999. # and binaries instead.
  2000. bin_cflags => add("/NAMES=(AS_IS,SHORTENED)/EXTERN_MODEL=STRICT_REFDEF"),
  2001. lib_cflags => add("/NAMES=(AS_IS,SHORTENED)/EXTERN_MODEL=STRICT_REFDEF"),
  2002. # Strictly speaking, DSOs should not need to have name shortening,
  2003. # as all their exported symbols should be short enough to fit the
  2004. # linker's 31 character per symbol name limit. However, providers
  2005. # may be composed of more than one object file, and internal symbols
  2006. # may and do surpass the 31 character limit.
  2007. dso_cflags => add("/NAMES=(SHORTENED)"),
  2008. ex_libs => add(sub { return vms_info()->{zlib} || (); }),
  2009. shared_target => "vms-shared",
  2010. # def_flag made to empty string so a .opt file gets generated
  2011. shared_defflag => '',
  2012. dso_scheme => "vms",
  2013. thread_scheme => "pthreads",
  2014. makedep_scheme => 'VMS C',
  2015. AS => sub { vms_info()->{AS} },
  2016. ASFLAGS => sub { vms_info()->{ASFLAGS} },
  2017. asoutflag => sub { vms_info()->{asoutflag} },
  2018. asflags => sub { vms_info()->{asflags} },
  2019. perlasm_scheme => sub { vms_info()->{perlasm_scheme} },
  2020. disable => add('pinshared', 'loadereng'),
  2021. },
  2022. # From HELP CC/POINTER_SIZE:
  2023. #
  2024. # ----------
  2025. # LONG[=ARGV] The compiler assumes 64-bit pointers. If the ARGV option to
  2026. # LONG or 64 is present, the main argument argv will be an
  2027. # array of long pointers instead of an array of short pointers.
  2028. #
  2029. # 64[=ARGV] Same as LONG.
  2030. # ----------
  2031. #
  2032. # We don't want the hassle of dealing with 32-bit pointers with argv, so
  2033. # we force it to have 64-bit pointers, see the added cflags in the -p64
  2034. # config targets below.
  2035. "vms-alpha" => {
  2036. inherit_from => [ "vms-generic" ],
  2037. bn_ops => "SIXTY_FOUR_BIT RC4_INT",
  2038. pointer_size => "",
  2039. },
  2040. "vms-alpha-p32" => {
  2041. inherit_from => [ "vms-alpha" ],
  2042. cflags => add("/POINTER_SIZE=32"),
  2043. pointer_size => "32",
  2044. },
  2045. "vms-alpha-p64" => {
  2046. inherit_from => [ "vms-alpha" ],
  2047. cflags => add("/POINTER_SIZE=64=ARGV"),
  2048. pointer_size => "64",
  2049. },
  2050. "vms-ia64" => {
  2051. inherit_from => [ "vms-generic" ],
  2052. bn_ops => "SIXTY_FOUR_BIT RC4_INT",
  2053. asm_arch => sub { vms_info()->{AS} ? 'ia64' : undef },
  2054. perlasm_scheme => 'ias',
  2055. pointer_size => "",
  2056. },
  2057. "vms-ia64-p32" => {
  2058. inherit_from => [ "vms-ia64" ],
  2059. cflags => add("/POINTER_SIZE=32"),
  2060. pointer_size => "32",
  2061. },
  2062. "vms-ia64-p64" => {
  2063. inherit_from => [ "vms-ia64" ],
  2064. cflags => add("/POINTER_SIZE=64=ARGV"),
  2065. pointer_size => "64",
  2066. },
  2067. "vms-x86_64" => {
  2068. inherit_from => [ "vms-generic" ],
  2069. bn_ops => "SIXTY_FOUR_BIT",
  2070. pointer_size => "",
  2071. },
  2072. "vms-x86_64-p32" => {
  2073. inherit_from => [ "vms-x86_64" ],
  2074. cflags => add("/POINTER_SIZE=32"),
  2075. pointer_size => "32",
  2076. },
  2077. "vms-x86_64-p64" => {
  2078. inherit_from => [ "vms-x86_64" ],
  2079. cflags => add("/POINTER_SIZE=64=ARGV"),
  2080. pointer_size => "64",
  2081. }
  2082. );