10-main.conf 78 KB

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