2
0

10-main.conf 77 KB

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