1 // SoftEther VPN Source Code - Stable Edition Repository 2 // Build Utility 3 // 4 // SoftEther VPN Server, Client and Bridge are free software under the Apache License, Version 2.0. 5 // 6 // Copyright (c) Daiyuu Nobori. 7 // Copyright (c) SoftEther VPN Project, University of Tsukuba, Japan. 8 // Copyright (c) SoftEther Corporation. 9 // Copyright (c) all contributors on SoftEther VPN project in GitHub. 10 // 11 // All Rights Reserved. 12 // 13 // http://www.softether.org/ 14 // 15 // This stable branch is officially managed by Daiyuu Nobori, the owner of SoftEther VPN Project. 16 // Pull requests should be sent to the Developer Edition Master Repository on https://github.com/SoftEtherVPN/SoftEtherVPN 17 // 18 // License: The Apache License, Version 2.0 19 // https://www.apache.org/licenses/LICENSE-2.0 20 // 21 // DISCLAIMER 22 // ========== 23 // 24 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 25 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 26 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 27 // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 28 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 29 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 30 // SOFTWARE. 31 // 32 // THIS SOFTWARE IS DEVELOPED IN JAPAN, AND DISTRIBUTED FROM JAPAN, UNDER 33 // JAPANESE LAWS. YOU MUST AGREE IN ADVANCE TO USE, COPY, MODIFY, MERGE, PUBLISH, 34 // DISTRIBUTE, SUBLICENSE, AND/OR SELL COPIES OF THIS SOFTWARE, THAT ANY 35 // JURIDICAL DISPUTES WHICH ARE CONCERNED TO THIS SOFTWARE OR ITS CONTENTS, 36 // AGAINST US (SOFTETHER PROJECT, SOFTETHER CORPORATION, DAIYUU NOBORI OR OTHER 37 // SUPPLIERS), OR ANY JURIDICAL DISPUTES AGAINST US WHICH ARE CAUSED BY ANY KIND 38 // OF USING, COPYING, MODIFYING, MERGING, PUBLISHING, DISTRIBUTING, SUBLICENSING, 39 // AND/OR SELLING COPIES OF THIS SOFTWARE SHALL BE REGARDED AS BE CONSTRUED AND 40 // CONTROLLED BY JAPANESE LAWS, AND YOU MUST FURTHER CONSENT TO EXCLUSIVE 41 // JURISDICTION AND VENUE IN THE COURTS SITTING IN TOKYO, JAPAN. YOU MUST WAIVE 42 // ALL DEFENSES OF LACK OF PERSONAL JURISDICTION AND FORUM NON CONVENIENS. 43 // PROCESS MAY BE SERVED ON EITHER PARTY IN THE MANNER AUTHORIZED BY APPLICABLE 44 // LAW OR COURT RULE. 45 // 46 // USE ONLY IN JAPAN. DO NOT USE THIS SOFTWARE IN ANOTHER COUNTRY UNLESS YOU HAVE 47 // A CONFIRMATION THAT THIS SOFTWARE DOES NOT VIOLATE ANY CRIMINAL LAWS OR CIVIL 48 // RIGHTS IN THAT PARTICULAR COUNTRY. USING THIS SOFTWARE IN OTHER COUNTRIES IS 49 // COMPLETELY AT YOUR OWN RISK. THE SOFTETHER VPN PROJECT HAS DEVELOPED AND 50 // DISTRIBUTED THIS SOFTWARE TO COMPLY ONLY WITH THE JAPANESE LAWS AND EXISTING 51 // CIVIL RIGHTS INCLUDING PATENTS WHICH ARE SUBJECTS APPLY IN JAPAN. OTHER 52 // COUNTRIES' LAWS OR CIVIL RIGHTS ARE NONE OF OUR CONCERNS NOR RESPONSIBILITIES. 53 // WE HAVE NEVER INVESTIGATED ANY CRIMINAL REGULATIONS, CIVIL LAWS OR 54 // INTELLECTUAL PROPERTY RIGHTS INCLUDING PATENTS IN ANY OF OTHER 200+ COUNTRIES 55 // AND TERRITORIES. BY NATURE, THERE ARE 200+ REGIONS IN THE WORLD, WITH 56 // DIFFERENT LAWS. IT IS IMPOSSIBLE TO VERIFY EVERY COUNTRIES' LAWS, REGULATIONS 57 // AND CIVIL RIGHTS TO MAKE THE SOFTWARE COMPLY WITH ALL COUNTRIES' LAWS BY THE 58 // PROJECT. EVEN IF YOU WILL BE SUED BY A PRIVATE ENTITY OR BE DAMAGED BY A 59 // PUBLIC SERVANT IN YOUR COUNTRY, THE DEVELOPERS OF THIS SOFTWARE WILL NEVER BE 60 // LIABLE TO RECOVER OR COMPENSATE SUCH DAMAGES, CRIMINAL OR CIVIL 61 // RESPONSIBILITIES. NOTE THAT THIS LINE IS NOT LICENSE RESTRICTION BUT JUST A 62 // STATEMENT FOR WARNING AND DISCLAIMER. 63 // 64 // READ AND UNDERSTAND THE 'WARNING.TXT' FILE BEFORE USING THIS SOFTWARE. 65 // SOME SOFTWARE PROGRAMS FROM THIRD PARTIES ARE INCLUDED ON THIS SOFTWARE WITH 66 // LICENSE CONDITIONS WHICH ARE DESCRIBED ON THE 'THIRD_PARTY.TXT' FILE. 67 // 68 // 69 // SOURCE CODE CONTRIBUTION 70 // ------------------------ 71 // 72 // Your contribution to SoftEther VPN Project is much appreciated. 73 // Please send patches to us through GitHub. 74 // Read the SoftEther VPN Patch Acceptance Policy in advance: 75 // http://www.softether.org/5-download/src/9.patch 76 // 77 // 78 // DEAR SECURITY EXPERTS 79 // --------------------- 80 // 81 // If you find a bug or a security vulnerability please kindly inform us 82 // about the problem immediately so that we can fix the security problem 83 // to protect a lot of users around the world as soon as possible. 84 // 85 // Our e-mail address for security reports is: 86 // softether-vpn-security [at] softether.org 87 // 88 // Please note that the above e-mail address is not a technical support 89 // inquiry address. If you need technical assistance, please visit 90 // http://www.softether.org/ and ask your question on the users forum. 91 // 92 // Thank you for your cooperation. 93 // 94 // 95 // NO MEMORY OR RESOURCE LEAKS 96 // --------------------------- 97 // 98 // The memory-leaks and resource-leaks verification under the stress 99 // test has been passed before release this source code. 100 101 102 using System; 103 using System.Threading; 104 using System.Text; 105 using System.Configuration; 106 using System.Collections; 107 using System.Collections.Generic; 108 using System.Collections.Specialized; 109 using System.Security.Cryptography; 110 using System.Web; 111 using System.Web.Security; 112 using System.Web.UI; 113 using System.Web.UI.WebControls; 114 using System.Web.UI.WebControls.WebParts; 115 using System.Web.UI.HtmlControls; 116 using System.IO; 117 using System.Drawing; 118 using System.Drawing.Imaging; 119 using System.Drawing.Drawing2D; 120 using System.Diagnostics; 121 using System.Net; 122 using System.Net.Security; 123 using System.Reflection; 124 using System.Security.Cryptography.X509Certificates; 125 using CoreUtil; 126 127 namespace BuildUtil 128 { 129 // Build settings 130 public static class BuildConfig 131 { 132 public static readonly int NumMultipleCompileTasks = 1; 133 } 134 135 // Software List 136 public static class BuildSoftwareList 137 { 138 // List creation date and time 139 public static DateTime ListCreatedDateTime = DateTime.Now; 140 141 // ========== Windows ========== 142 // Server and Bridge 143 public static readonly BuildSoftware vpnserver_win32_x86x64_ja = 144 new BuildSoftwareWin32(Software.vpnserver_vpnbridge, 0, 0, "", CpuList.intel, OSList.Windows); 145 146 // Client 147 public static readonly BuildSoftware vpnclient_win32_x86x64_ja = 148 new BuildSoftwareWin32(Software.vpnclient, 0, 0, "", CpuList.intel, OSList.Windows); 149 150 // ========== Linux ========== 151 // Server 152 public static readonly BuildSoftware vpnserver_linux_x86_ja = 153 new BuildSoftwareUnix(Software.vpnserver, 0, 0, "", CpuList.x86, OSList.Linux, 154 "linux-x86-32bit", true, "linux-x86-32bit-3.4.6", false, 155 null); 156 public static readonly BuildSoftware vpnserver_linux_x64_ja = 157 new BuildSoftwareUnix(Software.vpnserver, 0, 0, "", CpuList.x64, OSList.Linux, 158 "linux-x86-64bit", true, "linux-x86-64bit-3.4.6", false, 159 null); 160 public static readonly BuildSoftware vpnserver_linux_arm_ja = 161 new BuildSoftwareUnix(Software.vpnserver, 0, 0, "", CpuList.arm, OSList.Linux, 162 "linux-arm-32bit", false, "linux-arm-32bit-3.4.6", false, 163 null); 164 public static readonly BuildSoftware vpnserver_linux_armeabi_ja = 165 new BuildSoftwareUnix(Software.vpnserver, 0, 0, "", CpuList.armeabi, OSList.Linux, 166 "linux-armeabi-32bit", false, "linux-armeabi-32bit-4.3.2", false, 167 null); 168 public static readonly BuildSoftware vpnserver_linux_arm64_ja = 169 new BuildSoftwareUnix(Software.vpnserver, 0, 0, "", CpuList.arm64, OSList.Linux, 170 "linux-arm64-64bit", false, "linux-arm64-64bit-4.8.4", false, 171 null); 172 public static readonly BuildSoftware vpnserver_linux_mipsel_ja = 173 new BuildSoftwareUnix(Software.vpnserver, 0, 0, "", CpuList.mipsel, OSList.Linux, 174 "linux-mipsel-32bit", false, "linux-mipsel-32bit-3.4.6", false, 175 null); 176 public static readonly BuildSoftware vpnserver_linux_ppc_ja = 177 new BuildSoftwareUnix(Software.vpnserver, 0, 0, "", CpuList.ppc32, OSList.Linux, 178 "linux-ppc-32bit", false, "linux-ppc-32bit-3.4.6", false, 179 null); 180 181 // Client 182 public static readonly BuildSoftware vpnclient_linux_x86_ja = 183 new BuildSoftwareUnix(Software.vpnclient, 0, 0, "", CpuList.x86, OSList.Linux, 184 "linux-x86-32bit", true, "linux-x86-32bit-3.4.6", false, 185 null); 186 public static readonly BuildSoftware vpnclient_linux_x64_ja = 187 new BuildSoftwareUnix(Software.vpnclient, 0, 0, "", CpuList.x64, OSList.Linux, 188 "linux-x86-64bit", true, "linux-x86-64bit-3.4.6", false, 189 null); 190 public static readonly BuildSoftware vpnclient_linux_arm_ja = 191 new BuildSoftwareUnix(Software.vpnclient, 0, 0, "", CpuList.arm, OSList.Linux, 192 "linux-arm-32bit", false, "linux-arm-32bit-3.4.6", false, 193 null); 194 public static readonly BuildSoftware vpnclient_linux_armeabi_ja = 195 new BuildSoftwareUnix(Software.vpnclient, 0, 0, "", CpuList.armeabi, OSList.Linux, 196 "linux-armeabi-32bit", false, "linux-armeabi-32bit-4.3.2", false, 197 null); 198 public static readonly BuildSoftware vpnclient_linux_arm64_ja = 199 new BuildSoftwareUnix(Software.vpnclient, 0, 0, "", CpuList.arm64, OSList.Linux, 200 "linux-arm64-64bit", false, "linux-arm64-64bit-4.8.4", false, 201 null); 202 public static readonly BuildSoftware vpnclient_linux_mipsel_ja = 203 new BuildSoftwareUnix(Software.vpnclient, 0, 0, "", CpuList.mipsel, OSList.Linux, 204 "linux-mipsel-32bit", false, "linux-mipsel-32bit-3.4.6", false, 205 null); 206 public static readonly BuildSoftware vpnclient_linux_ppc_ja = 207 new BuildSoftwareUnix(Software.vpnclient, 0, 0, "", CpuList.ppc32, OSList.Linux, 208 "linux-ppc-32bit", false, "linux-ppc-32bit-3.4.6", false, 209 null); 210 211 // Bridge 212 public static readonly BuildSoftware vpnbridge_linux_x86_ja = 213 new BuildSoftwareUnix(Software.vpnbridge, 0, 0, "", CpuList.x86, OSList.Linux, 214 "linux-x86-32bit", true, "linux-x86-32bit-3.4.6", false, 215 null); 216 public static readonly BuildSoftware vpnbridge_linux_x64_ja = 217 new BuildSoftwareUnix(Software.vpnbridge, 0, 0, "", CpuList.x64, OSList.Linux, 218 "linux-x86-64bit", true, "linux-x86-64bit-3.4.6", false, 219 null); 220 public static readonly BuildSoftware vpnbridge_linux_arm_ja = 221 new BuildSoftwareUnix(Software.vpnbridge, 0, 0, "", CpuList.arm, OSList.Linux, 222 "linux-arm-32bit", false, "linux-arm-32bit-3.4.6", false, 223 null); 224 public static readonly BuildSoftware vpnbridge_linux_armeabi_ja = 225 new BuildSoftwareUnix(Software.vpnbridge, 0, 0, "", CpuList.armeabi, OSList.Linux, 226 "linux-armeabi-32bit", false, "linux-armeabi-32bit-4.3.2", false, 227 null); 228 public static readonly BuildSoftware vpnbridge_linux_arm64_ja = 229 new BuildSoftwareUnix(Software.vpnbridge, 0, 0, "", CpuList.arm64, OSList.Linux, 230 "linux-arm64-64bit", false, "linux-arm64-64bit-4.8.4", false, 231 null); 232 public static readonly BuildSoftware vpnbridge_linux_mipsel_ja = 233 new BuildSoftwareUnix(Software.vpnbridge, 0, 0, "", CpuList.mipsel, OSList.Linux, 234 "linux-mipsel-32bit", false, "linux-mipsel-32bit-3.4.6", false, 235 null); 236 public static readonly BuildSoftware vpnbridge_linux_ppc_ja = 237 new BuildSoftwareUnix(Software.vpnbridge, 0, 0, "", CpuList.ppc32, OSList.Linux, 238 "linux-ppc-32bit", false, "linux-ppc-32bit-3.4.6", false, 239 null); 240 241 242 // ========== FreeBSD ========== 243 // Server 244 public static readonly BuildSoftware vpnserver_bsd_x86_ja = 245 new BuildSoftwareUnix(Software.vpnserver, 0, 0, "", CpuList.x86, OSList.FreeBSD, 246 "freebsd-x86-32bit", true, "freebsd-x86-32bit-3.4.6", false, 247 null); 248 public static readonly BuildSoftware vpnserver_bsd_x64_ja = 249 new BuildSoftwareUnix(Software.vpnserver, 0, 0, "", CpuList.x64, OSList.FreeBSD, 250 "freebsd-x86-64bit", true, "freebsd-x86-64bit-3.4.6", false, 251 null); 252 253 // Bridge 254 public static readonly BuildSoftware vpnbridge_bsd_x86_ja = 255 new BuildSoftwareUnix(Software.vpnbridge, 0, 0, "", CpuList.x86, OSList.FreeBSD, 256 "freebsd-x86-32bit", true, "freebsd-x86-32bit-3.4.6", false, 257 null); 258 public static readonly BuildSoftware vpnbridge_bsd_x64_ja = 259 new BuildSoftwareUnix(Software.vpnbridge, 0, 0, "", CpuList.x64, OSList.FreeBSD, 260 "freebsd-x86-64bit", true, "freebsd-x86-64bit-3.4.6", false, 261 null); 262 263 264 // ========== Mac OS X ========== 265 // Server 266 public static readonly BuildSoftware vpnserver_macos_ppc32_ja = 267 new BuildSoftwareUnix(Software.vpnserver, 0, 0, "", CpuList.ppc32, OSList.MacOS, 268 "macos-ppc-32bit", true, "macos-ppc-32bit-4.0.4", true, 269 "-isysroot /cygdrive/s/CommomDev/xc/common/apple_xcode/xcode_2.4/Developer/SDKs/MacOSX10.4u.sdk"); 270 public static readonly BuildSoftware vpnserver_macos_ppc64_ja = 271 new BuildSoftwareUnix(Software.vpnserver, 0, 0, "", CpuList.ppc64, OSList.MacOS, 272 "macos-ppc-64bit", true, "macos-ppc-64bit-4.0.4", true, 273 null); 274 public static readonly BuildSoftware vpnserver_macos_x86_ja = 275 new BuildSoftwareUnix(Software.vpnserver, 0, 0, "", CpuList.x86, OSList.MacOS, 276 "macos-x86-32bit", true, "macos-x86-32bit-4.0.4", true, 277 "-isysroot /cygdrive/s/CommomDev/xc/common/apple_xcode/xcode_2.4/Developer/SDKs/MacOSX10.4u.sdk"); 278 public static readonly BuildSoftware vpnserver_macos_x64_ja = 279 new BuildSoftwareUnix(Software.vpnserver, 0, 0, "", CpuList.x64, OSList.MacOS, 280 "macos-x86-64bit", true, "macos-x86-64bit-4.0.4", true, 281 null); 282 283 // Client 284 public static readonly BuildSoftware vpnclient_macos_ppc32_ja = 285 new BuildSoftwareUnix(Software.vpnclient, 0, 0, "", CpuList.ppc32, OSList.MacOS, 286 "macos-ppc-32bit", true, "macos-ppc-32bit-4.0.4", true, 287 "-isysroot /cygdrive/s/CommomDev/xc/common/apple_xcode/xcode_2.4/Developer/SDKs/MacOSX10.4u.sdk"); 288 public static readonly BuildSoftware vpnclient_macos_ppc64_ja = 289 new BuildSoftwareUnix(Software.vpnclient, 0, 0, "", CpuList.ppc64, OSList.MacOS, 290 "macos-ppc-64bit", true, "macos-ppc-64bit-4.0.4", true, 291 null); 292 public static readonly BuildSoftware vpnclient_macos_x86_ja = 293 new BuildSoftwareUnix(Software.vpnclient, 0, 0, "", CpuList.x86, OSList.MacOS, 294 "macos-x86-32bit", true, "macos-x86-32bit-4.0.4", true, 295 "-isysroot /cygdrive/s/CommomDev/xc/common/apple_xcode/xcode_2.4/Developer/SDKs/MacOSX10.4u.sdk"); 296 public static readonly BuildSoftware vpnclient_macos_x64_ja = 297 new BuildSoftwareUnix(Software.vpnclient, 0, 0, "", CpuList.x64, OSList.MacOS, 298 "macos-x86-64bit", true, "macos-x86-64bit-4.0.4", true, 299 null); 300 301 // Bridge 302 public static readonly BuildSoftware vpnbridge_macos_ppc32_ja = 303 new BuildSoftwareUnix(Software.vpnbridge, 0, 0, "", CpuList.ppc32, OSList.MacOS, 304 "macos-ppc-32bit", true, "macos-ppc-32bit-4.0.4", true, 305 "-isysroot /cygdrive/s/CommomDev/xc/common/apple_xcode/xcode_2.4/Developer/SDKs/MacOSX10.4u.sdk"); 306 public static readonly BuildSoftware vpnbridge_macos_ppc64_ja = 307 new BuildSoftwareUnix(Software.vpnbridge, 0, 0, "", CpuList.ppc64, OSList.MacOS, 308 "macos-ppc-64bit", true, "macos-ppc-64bit-4.0.4", true, 309 null); 310 public static readonly BuildSoftware vpnbridge_macos_x86_ja = 311 new BuildSoftwareUnix(Software.vpnbridge, 0, 0, "", CpuList.x86, OSList.MacOS, 312 "macos-x86-32bit", true, "macos-x86-32bit-4.0.4", true, 313 "-isysroot /cygdrive/s/CommomDev/xc/common/apple_xcode/xcode_2.4/Developer/SDKs/MacOSX10.4u.sdk"); 314 public static readonly BuildSoftware vpnbridge_macos_x64_ja = 315 new BuildSoftwareUnix(Software.vpnbridge, 0, 0, "", CpuList.x64, OSList.MacOS, 316 "macos-x86-64bit", true, "macos-x86-64bit-4.0.4", true, 317 null); 318 319 // ========== Solaris ========== 320 // Server 321 public static readonly BuildSoftware vpnserver_solaris_sparc32_ja = 322 new BuildSoftwareUnix(Software.vpnserver, 0, 0, "", CpuList.sparc32, OSList.Solaris, 323 "solaris-sparc-32bit", true, "solaris-sparc-32bit-3.4.6", true, 324 null); 325 public static readonly BuildSoftware vpnserver_solaris_sparc64_ja = 326 new BuildSoftwareUnix(Software.vpnserver, 0, 0, "", CpuList.sparc64, OSList.Solaris, 327 "solaris-sparc-64bit", true, "solaris-sparc-64bit-3.4.6", true, 328 null); 329 public static readonly BuildSoftware vpnserver_solaris_x86_ja = 330 new BuildSoftwareUnix(Software.vpnserver, 0, 0, "", CpuList.x86, OSList.Solaris, 331 "solaris-x86-32bit", true, "solaris-x86-32bit-3.4.6", true, 332 null); 333 public static readonly BuildSoftware vpnserver_solaris_x64_ja = 334 new BuildSoftwareUnix(Software.vpnserver, 0, 0, "", CpuList.x64, OSList.Solaris, 335 "solaris-x86-64bit", true, "solaris-x86-64bit-3.4.6", true, 336 null); 337 338 // Bridge 339 public static readonly BuildSoftware vpnbridge_solaris_sparc32_ja = 340 new BuildSoftwareUnix(Software.vpnbridge, 0, 0, "", CpuList.sparc32, OSList.Solaris, 341 "solaris-sparc-32bit", true, "solaris-sparc-32bit-3.4.6", true, 342 null); 343 public static readonly BuildSoftware vpnbridge_solaris_sparc64_ja = 344 new BuildSoftwareUnix(Software.vpnbridge, 0, 0, "", CpuList.sparc64, OSList.Solaris, 345 "solaris-sparc-64bit", true, "solaris-sparc-64bit-3.4.6", true, 346 null); 347 public static readonly BuildSoftware vpnbridge_solaris_x86_ja = 348 new BuildSoftwareUnix(Software.vpnbridge, 0, 0, "", CpuList.x86, OSList.Solaris, 349 "solaris-x86-32bit", true, "solaris-x86-32bit-3.4.6", true, 350 null); 351 public static readonly BuildSoftware vpnbridge_solaris_x64_ja = 352 new BuildSoftwareUnix(Software.vpnbridge, 0, 0, "", CpuList.x64, OSList.Solaris, 353 "solaris-x86-64bit", true, "solaris-x86-64bit-3.4.6", true, 354 null); 355 BuildSoftwareList()356 static BuildSoftwareList() 357 { 358 foreach (BuildSoftware soft in List) 359 { 360 BuildSoftwareUnix s = soft as BuildSoftwareUnix; 361 if (s != null) 362 { 363 // Make different settings for each OS 364 if (soft.Os == OSList.Linux) 365 { 366 s.GccMacros.Add("UNIX_LINUX"); 367 } 368 else if (soft.Os == OSList.FreeBSD) 369 { 370 s.GccMacros.Add("UNIX_BSD"); 371 s.GccMacros.Add("BRIDGE_BPF"); 372 s.GccMacros.Add("NO_VLAN"); 373 } 374 else if (soft.Os == OSList.MacOS) 375 { 376 s.GccMacros.Add("UNIX_MACOS"); 377 s.GccMacros.Add("BRIDGE_PCAP"); 378 //s.GccMacros.Add("NO_VLAN"); 379 } 380 else if (soft.Os == OSList.Solaris) 381 { 382 s.GccMacros.Add("UNIX_SOLARIS"); 383 s.GccMacros.Add("NO_VLAN"); 384 } 385 if (s.Cpu.Bits == CPUBits.Bits64) 386 { 387 s.GccMacros.Add("CPU_64"); 388 } 389 s.GccMacros.Add("CPU_" + s.Cpu.Name.ToUpperInvariant()); 390 } 391 } 392 } 393 394 public static BuildSoftware[] List 395 { 396 get 397 { 398 List<BuildSoftware> o = new List<BuildSoftware>(); 399 foreach (FieldInfo fi in typeof(BuildSoftwareList).GetFields(BindingFlags.Static | BindingFlags.Public)) 400 if (fi.FieldType == typeof(BuildSoftware)) 401 o.Add((BuildSoftware)fi.GetValue(null)); 402 return o.ToArray(); 403 } 404 } 405 Find(Software soft, OS os, Cpu cpu)406 public static BuildSoftware Find(Software soft, OS os, Cpu cpu) 407 { 408 foreach (BuildSoftware s in List) 409 { 410 if (s.Software == soft && s.Os == os && s.Cpu == cpu) 411 { 412 return s; 413 } 414 } 415 return null; 416 } 417 } 418 419 // OS List 420 public static class OSList 421 { 422 // Windows 423 public static readonly OS Windows = new OS("windows", "Windows", 424 "Windows 98 / 98 SE / ME / NT 4.0 SP6a / 2000 SP4 / XP SP2, SP3 / Vista SP1, SP2 / 7 SP1 / 8 / 8.1 / 10 / Server 2003 SP2 / Server 2008 SP1, SP2 / Hyper-V Server 2008 / Server 2008 R2 SP1 / Hyper-V Server 2008 R2 / Server 2012 / Hyper-V Server 2012 / Server 2012 R2 / Hyper-V Server 2012 R2 / Server 2016 / Server 2019", 425 new Cpu[] 426 { 427 CpuList.intel, 428 }); 429 430 // Linux 431 public static readonly OS Linux = new OS("linux", "Linux", 432 "Linux Kernel 2.4 / 2.6 / 3.x / 4.x", 433 new Cpu[] 434 { 435 CpuList.x86, 436 CpuList.x64, 437 CpuList.mipsel, 438 CpuList.ppc32, 439 CpuList.ppc64, 440 CpuList.arm, 441 CpuList.armeabi, 442 CpuList.arm64, 443 }); 444 445 // FreeBSD 446 public static readonly OS FreeBSD = new OS("freebsd", "FreeBSD", 447 "FreeBSD 5 / 6 / 7 / 8 / 9 / 10", 448 new Cpu[] 449 { 450 CpuList.x86, 451 CpuList.x64, 452 }); 453 454 // OpenBSD 455 public static readonly OS OpenBSD = new OS("openbsd", "OpenBSD", 456 "OpenBSD 5 / 6 / 7 / 8 / 9 / 10", 457 new Cpu[] 458 { 459 CpuList.x86, 460 CpuList.x64, 461 }); 462 463 // Solaris 464 public static readonly OS Solaris = new OS("solaris", "Solaris", 465 "Solaris 8 / 9 / 10 / 11", 466 new Cpu[] 467 { 468 CpuList.x86, 469 CpuList.x64, 470 CpuList.sparc32, 471 CpuList.sparc64, 472 }); 473 474 // Mac OS X 475 public static readonly OS MacOS = new OS("macos", "Mac OS X", 476 "Mac OS X 10.4 Tiger / 10.5 Leopard / 10.6 Snow Leopard / 10.7 Lion / 10.8 Mountain Lion / 10.9 Mavericks", 477 new Cpu[] 478 { 479 CpuList.x86, 480 CpuList.x64, 481 CpuList.ppc32, 482 CpuList.ppc64, 483 }); 484 OSList()485 static OSList() 486 { 487 OSList.Windows.IsWindows = true; 488 } 489 490 public static OS[] List 491 { 492 get 493 { 494 List<OS> o = new List<OS>(); 495 foreach (FieldInfo fi in typeof(OSList).GetFields(BindingFlags.Static | BindingFlags.Public)) 496 if (fi.FieldType == typeof(OS)) 497 o.Add((OS)fi.GetValue(null)); 498 return o.ToArray(); 499 } 500 } 501 FindByName(string name)502 public static OS FindByName(string name) 503 { 504 foreach (OS os in List) 505 { 506 if (os.Name.Equals(name, StringComparison.InvariantCultureIgnoreCase)) 507 { 508 return os; 509 } 510 } 511 512 throw new ApplicationException(name); 513 } 514 } 515 516 // CPU List 517 public static class CpuList 518 { 519 public static readonly Cpu x86 = new Cpu("x86", "Intel x86", CPUBits.Bits32); 520 public static readonly Cpu x64 = new Cpu("x64", "Intel x64 / AMD64", CPUBits.Bits64); 521 public static readonly Cpu intel = new Cpu("x86_x64", "Intel", CPUBits.Both); 522 public static readonly Cpu arm = new Cpu("arm", "ARM legacy ABI", CPUBits.Bits32); 523 public static readonly Cpu armeabi = new Cpu("arm_eabi", "ARM EABI", CPUBits.Bits32); 524 public static readonly Cpu arm64 = new Cpu("arm64", "ARM 64bit", CPUBits.Bits64); 525 public static readonly Cpu mipsel = new Cpu("mips_el", "MIPS Little-Endian", CPUBits.Bits32); 526 public static readonly Cpu ppc32 = new Cpu("powerpc", "PowerPC", CPUBits.Bits32); 527 public static readonly Cpu ppc64 = new Cpu("powerpc64", "PowerPC G5", CPUBits.Bits64); 528 public static readonly Cpu sparc32 = new Cpu("sparc", "SPARC", CPUBits.Bits32); 529 public static readonly Cpu sparc64 = new Cpu("sparc64", "SPARC", CPUBits.Bits64); 530 531 public static Cpu[] List 532 { 533 get 534 { 535 List<Cpu> o = new List<Cpu>(); 536 foreach (FieldInfo fi in typeof(CpuList).GetFields(BindingFlags.Static | BindingFlags.Public)) 537 if (fi.FieldType == typeof(Cpu)) 538 o.Add((Cpu)fi.GetValue(null)); 539 return o.ToArray(); 540 } 541 } 542 FindByName(string name)543 public static Cpu FindByName(string name) 544 { 545 foreach (Cpu c in List) 546 { 547 if (c.Name.Equals(name, StringComparison.InvariantCultureIgnoreCase)) 548 { 549 return c; 550 } 551 } 552 553 throw new ApplicationException(name); 554 } 555 } 556 } 557 558