10-main.conf 77 KB

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