Changeset 85787 in vbox
- Timestamp:
- Aug 16, 2020 9:14:49 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/configure.vbs
r85786 r85787 42 42 g_strPathDev = "" 43 43 44 dim g_strTargetArch 44 dim g_strTargetArch, g_StrTargetArchWin 45 45 g_strTargetArch = "" 46 47 dim g_strHostArch 46 g_StrTargetArchWin = "" 47 48 dim g_strHostArch, g_strHostArchWin 48 49 g_strHostArch = "" 50 g_strHostArchWin = "" 49 51 50 52 ' Visual C++ info. … … 54 56 55 57 ' SDK and DDK. 56 dim g_strPathPSDK, g_strVerPSDK, g_strPathDDK 58 dim g_strPathSDK10, g_strPathPSDK, g_strVerPSDK, g_strPathDDK 59 g_strPathSDK10 = "" 57 60 g_strPathPSDK = "" 58 61 g_strVerPSDK = "" … … 645 648 646 649 '' 647 ' Sorts a string array.648 sub SortStringArray(ByRef arr)649 dim i, j, strTemp650 for i = UBound(arr) - 1 to 0 step -1651 for j = 0 to i652 if StrComp(arr(j), arr(j + 1)) > 0 then653 strTemp = arr(j)654 arr(j) = arr(j + 1)655 arr(j + 1) = strTemp656 end if657 next658 next659 end sub660 661 ''662 650 ' Returns a sorted array of subfolder names that starts with the given string. 663 function GetSubdirsStartingWith Sorted(strFolder, strStartingWith)651 function GetSubdirsStartingWith(strFolder, strStartingWith) 664 652 if DirExists(strFolder) then 665 653 dim obj, i … … 672 660 next 673 661 if i > 0 then 674 redim arrResult(i )662 redim arrResult(i - 1) 675 663 i = 0 676 664 for each objSub in obj.SubFolders … … 680 668 end if 681 669 next 682 683 SortStringArray arrResult 684 GetSubdirsStartingWithSorted = arrResult 670 GetSubdirsStartingWith = arrResult 685 671 else 686 GetSubdirsStartingWith Sorted= Array()672 GetSubdirsStartingWith = Array() 687 673 end if 688 674 else 689 GetSubdirsStartingWithSorted = Array() 690 end if 675 GetSubdirsStartingWith = Array() 676 end if 677 end function 678 679 680 '' 681 ' Returns a sorted array of subfolder names that starts with the given string. 682 function GetSubdirsStartingWithSorted(strFolder, strStartingWith) 683 GetSubdirsStartingWithSorted = ArraySortStrings(GetSubdirsStartingWith(strFolder, strStartingWith)) 684 end function 685 686 687 '' 688 ' Returns a reverse sorted array of subfolder names that starts with the given string. 689 function GetSubdirsStartingWithRSorted(strFolder, strStartingWith) 690 GetSubdirsStartingWithRSorted = ArrayRSortStrings(GetSubdirsStartingWith(strFolder, strStartingWith)) 691 691 end function 692 692 … … 1181 1181 EnvPrint "set KBUILD_TARGET_ARCH=" & g_strTargetArch 1182 1182 1183 ' Windows variant of the arch name. 1184 g_strTargetArchWin = g_strTargetArch 1185 if g_strTargetArchWin = "amd64" then g_strTargetArchWin = "x64" 1186 1183 1187 str = EnvGetFirst("KBUILD_TARGET_CPU", "BUILD_TARGET_CPU") 1184 1188 ' perhaps a bit pedantic this since this isn't clearly define nor used much... … … 1214 1218 EnvPrint "set KBUILD_HOST_ARCH=" & str 1215 1219 g_strHostArch = str 1220 1221 ' Windows variant of the arch name. 1222 g_strHostArchWin = g_strHostArch 1223 if g_strHostArchWin = "amd64" then g_strHostArchWin = "x64" 1224 1216 1225 1217 1226 str = EnvGetFirst("KBUILD_HOST_CPU", "BUILD_PLATFORM_CPU") … … 1386 1395 then 1387 1396 LogPrint " => seems okay. new layout." 1388 if g_strHostArch = "amd64" then 1389 m_blnFound = checkClExe(strPathVC & "/bin/HostX64/x64/cl.exe") 1390 else 1391 m_blnFound = checkClExe(strPathVC & "/bin/Host" & g_strHostArch & "/bin/" & g_strHostArch & "/cl.exe") 1392 end if 1397 m_blnFound = checkClExe(strPathVC & "/bin/Host" & g_strHostArchWin & "/bin/" & g_strHostArchWin & "/cl.exe") 1393 1398 if m_blnFound then 1394 1399 m_strPathVC = strPathVC … … 1670 1675 g_strVerPSDK = "71" 1671 1676 CheckForPlatformSDKSub = True 1677 end if 1678 end if 1679 end function 1680 1681 1682 '' 1683 ' Checks for a platform SDK that works with the compiler 1684 sub CheckForSDK10(strOptSDK10, strOptSDK10Version) 1685 dim strPathSDK10, strSDK10Version, str 1686 PrintHdr "Windows 10 SDK/WDK" 1687 '' @todo implement strOptSDK10Version 1688 1689 ' 1690 ' Try find the Windows 10 kit. 1691 ' 1692 strSDK10Version = "" 1693 strPathSDK10 = CheckForSDK10Sub(strOptSDK10, strSDK10Version) 1694 if strPathSDK10 = "" and g_blnInternalFirst = True then strPathSDK10 = CheckForSDK10ToolsSub(strSDK10Version) 1695 if strPathSDK10 = "" then 1696 str = RegGetString("HKLM\SOFTWARE\Microsoft\Windows Kits\Installed Roots\KitsRoot10") 1697 strPathSDK10 = CheckForSDK10Sub(str, strSDK10Version) 1698 end if 1699 if strPathSDK10 = "" then 1700 for each str in g_arrProgramFiles 1701 strPathSDK10 = CheckForSDK10Sub(str & "/Windows Kits/10", strSDK10Version) 1702 if strPathSDK10 <> "" then exit for 1703 next 1704 end if 1705 if strPathSDK10 = "" and g_blnInternalFirst = False then strPathSDK10 = CheckForSDK10ToolsSub() 1706 1707 if strPathSDK10 = "" then 1708 MsgError "Cannot find a suitable Windows 10 SDK. Check configure.log and the build requirements." 1709 exit sub 1710 end if 1711 1712 ' 1713 ' Emit the config. 1714 ' 1715 strPathSDK10 = UnixSlashes(PathAbs(strPathSDK10)) 1716 CfgPrint "PATH_SDK_WINSDK10 := " & strPathSDK10 1717 CfgPrint "SDK_WINSDK10_VERSION := " & strSDK10Version 1718 1719 PrintResult "Windows 10 SDK (" & strSDK10Version & ")", strPathSDK10 1720 g_strPathSDK10 = strPathSDK10 1721 end sub 1722 1723 '' 1724 ' Checks the tools directory. 1725 function CheckForSDK10ToolsSub(ByRef strSDK10Version) 1726 dim arrToolsDirs, strToolsDir, arrDirs, strDir 1727 CheckForSDK10ToolSub = "" 1728 arrToolsDirs = Array(g_strPathDev & "/win." & g_strTargetArch & "/sdk", _ 1729 g_strPathDev & "/win.x86/sdk", g_strPathDev & "/win.amd64/sdk") 1730 for each strToolsDir in arrToolsDirs 1731 arrDirs = GetSubdirsStartingWithRSorted(strToolsDir, "v10.") 1732 for each strDir in arrDirs 1733 CheckForSDK10ToolsSub = CheckForSDK10Sub(strToolsDir & "/" & strDir, strSDK10Version) 1734 if CheckForSDK10ToolsSub <> "" then 1735 exit function 1736 end if 1737 next 1738 next 1739 1740 end function 1741 1742 '' 1743 ' Checks if the specified path points to a usable Windows 10 SDK/WDK. 1744 function CheckForSDK10Sub(strPathSDK10, ByRef strSDK10Version) 1745 CheckForSDK10Sub = "" 1746 if strPathSDK10 <> "" then 1747 LogPrint "Trying: strPathSDK10=" & strPathSDK10 1748 if LogDirExists(strPathSDK10) then 1749 if LogDirExists(strPathSDK10 & "/Bin") _ 1750 and LogDirExists(strPathSDK10 & "/Include") _ 1751 and LogDirExists(strPathSDK10 & "/Lib") _ 1752 and LogDirExists(strPathSDK10 & "/Redist") _ 1753 then 1754 ' Only testing the highest one, for now. '' @todo incorporate strOptSDK10Version 1755 dim arrVersions 1756 arrVersions = GetSubdirsStartingWithSorted(strPathSDK10 & "/Include", "10.0.") 1757 if UBound(arrVersions) >= 0 then 1758 dim strVersion 1759 strVersion = arrVersions(UBound(arrVersions)) 1760 LogPrint "Trying version: " & strVersion 1761 if LogFileExists(strPathSDK10, "include/" & strVersion & "/um/Windows.h") _ 1762 and LogFileExists(strPathSDK10, "include/" & strVersion & "/ucrt/malloc.h") _ 1763 and LogFileExists(strPathSDK10, "include/" & strVersion & "/ucrt/stdio.h") _ 1764 and LogFileExists(strPathSDK10, "lib/" & strVersion & "/um/" & g_strTargetArchWin & "/kernel32.lib") _ 1765 and LogFileExists(strPathSDK10, "lib/" & strVersion & "/um/" & g_strTargetArchWin & "/user32.lib") _ 1766 and LogFileExists(strPathSDK10, "lib/" & strVersion & "/ucrt/" & g_strTargetArchWin & "/libucrt.lib") _ 1767 and LogFileExists(strPathSDK10, "lib/" & strVersion & "/ucrt/" & g_strTargetArchWin & "/ucrt.lib") _ 1768 and LogFileExists(strPathSDK10, "bin/" & strVersion & "/" & g_strHostArchWin & "/rc.exe") _ 1769 and LogFileExists(strPathSDK10, "bin/" & strVersion & "/" & g_strHostArchWin & "/midl.exe") _ 1770 then 1771 '' @todo check minimum version (for WinHv). 1772 strSDK10Version = strVersion 1773 CheckForSDK10Sub = strPathSDK10 1774 end if 1775 else 1776 LogPrint "Found no 10.0.* subdirectories under '" & strPathSDK10 & "/Include'!" 1777 end if 1778 end if 1672 1779 end if 1673 1780 end if … … 2331 2438 Print " --with-DDK=PATH Where the WDK is to be found." 2332 2439 Print " --with-SDK=PATH Where the Windows SDK is to be found." 2333 '' @todo Print " --with-SDK10=PATH Where the Windows 10 SDK is to be found."2440 Print " --with-SDK10=PATH Where the Windows 10 SDK/WDK is to be found." 2334 2441 Print " --with-VC=PATH Where the Visual C++ compiler is to be found." 2335 2442 Print " (Expecting bin, include and lib subdirs.)" … … 2369 2476 strOptQt5Infix = "" 2370 2477 strOptSDK = "" 2478 strOptSDK10 = "" 2479 strOptSDK10Version = "" 2371 2480 strOptVC = "" 2372 2481 strOptVCCommon = "" … … 2415 2524 case "--with-sdk" 2416 2525 strOptSDK = strPath 2526 case "--with-sdk10" 2527 strOptSDK10 = strPath 2528 case "--with-sdk10-version" 2529 strOptSDK10Version = strPath 2417 2530 case "--with-vc" 2418 2531 strOptVC = strPath … … 2505 2618 CheckForVisualCPP strOptVC, strOptVCCommon 2506 2619 CheckForPlatformSDK strOptSDK 2620 CheckForSDK10 strOptSDK10, strOptSDK10Version 2507 2621 CheckForMidl 2508 2622 CfgPrint "VBOX_WITH_OPEN_WATCOM := " '' @todo look for openwatcom 1.9+
Note:
See TracChangeset
for help on using the changeset viewer.