Changeset 85784 in vbox
- Timestamp:
- Aug 16, 2020 1:27:11 PM (5 years ago)
- svn:sync-xref-src-repo-rev:
- 139940
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/configure.vbs
r85783 r85784 36 36 Set g_objFileSys = WScript.CreateObject("Scripting.FileSystemObject") 37 37 38 dim g_strPathkBuild, g_strPathkBuildBin, g_strPathDev, g_strPathVCC, g_strPathPSDK, g_strVerPSDK, g_strPathDDK, g_strSubOutput 38 ' kBuild stuff. 39 dim g_strPathkBuild, g_strPathkBuildBin, g_strPathDev 39 40 g_strPathkBuild = "" 41 g_strPathkBuildBin = "" 40 42 g_strPathDev = "" 41 g_strPathVCC = ""42 g_strPathPSDK = ""43 g_strPathDDK = ""44 43 45 44 dim g_strTargetArch … … 49 48 g_strHostArch = "" 50 49 50 ' Visual C++ info. 51 dim g_strPathVCC, g_strVCCVersion 52 g_strPathVCC = "" 53 g_strVCCVersion = "" 54 55 ' SDK and DDK. 56 dim g_strPathPSDK, g_strVerPSDK, g_strPathDDK 57 g_strPathPSDK = "" 58 g_strVerPSDK = "" 59 g_strPathDDK = "" 60 61 ' COM disabling. 51 62 dim g_blnDisableCOM, g_strDisableCOM 52 63 g_blnDisableCOM = False 53 64 g_strDisableCOM = "" 65 66 ' Whether to ignore (continue) on errors. 67 dim g_blnContinueOnError, g_rcExit 68 g_blnContinueOnError = False 69 70 ' The script's exit code (for ignored errors). 71 dim g_rcScript 72 g_rcScript = 0 54 73 55 74 ' Whether to try the internal stuff first or last. … … 499 518 set obj = g_objFileSys.GetFolder(strFolder) 500 519 for each objSub in obj.SubFolders 501 if StrComp(Left(objSub.Name, Len(strStartingWith)), strStartingWith) = 0 Then520 if StrComp(Left(objSub.Name, Len(strStartingWith)), strStartingWith) = 0 then 502 521 HasSubdirsStartingWith = True 503 522 LogPrint "# HasSubdirsStartingWith(" & strFolder & "," & strStartingWith & ") found " & objSub.Name … … 532 551 i = 0 533 552 for each objSub in obj.SubFolders 534 if StrComp(Left(objSub.Name, Len(strStartingWith)), strStartingWith) = 0 Then553 if StrComp(Left(objSub.Name, Len(strStartingWith)), strStartingWith) = 0 then 535 554 i = i + 1 536 555 end if … … 540 559 i = 0 541 560 for each objSub in obj.SubFolders 542 if StrComp(Left(objSub.Name, Len(strStartingWith)), strStartingWith) = 0 Then561 if StrComp(Left(objSub.Name, Len(strStartingWith)), strStartingWith) = 0 then 543 562 arrResult(i) = objSub.Name 544 563 i = i + 1 … … 682 701 sub MsgFatal(strMsg) 683 702 Print "fatal error: " & strMsg 684 Wscript.Quit 703 Wscript.Quit(1) 685 704 end sub 686 705 … … 690 709 sub MsgError(strMsg) 691 710 Print "error: " & strMsg 692 Wscript.Quit 711 if g_blnContinueOnError = False then 712 Wscript.Quit(1) 713 end if 714 g_rcScript = 1 693 715 end sub 694 716 … … 1114 1136 end if 1115 1137 1116 if (Shell(DosSlashes(g_strPathkBuildBin & "/kmk.exe") & " --version", True) <> 0) Then1138 if (Shell(DosSlashes(g_strPathkBuildBin & "/kmk.exe") & " --version", True) <> 0) then 1117 1139 MsgFatal "Can't execute '" & g_strPathkBuildBin & "/kmk.exe --version'. check configure.log for the out." 1118 1140 exit sub … … 1180 1202 1181 1203 strSavedPath = EnvGet("PATH") 1182 if (m_strPathVCCommon <> "") Then1204 if (m_strPathVCCommon <> "") then 1183 1205 EnvAppend "PATH", ";" & m_strPathVCCommon & "/IDE" 1184 1206 end if … … 1263 1285 ' 15.0+ layout? This is fun because of the multiple CL versions (/tools/msvc/xx.yy.bbbbb/). 1264 1286 ' OTOH, the user may have pointed us directly to one of them. 1265 if LogDirExists(m_strPathVC & "/Tools/MSVC") Then1287 if LogDirExists(m_strPathVC & "/Tools/MSVC") then 1266 1288 m_blnNewLayout = True 1267 1289 LogPrint " => seems okay. new layout." … … 1277 1299 checkInner(m_strPathVC) 1278 1300 ' 14.0 and older layout? 1279 elseif LogFileExists(m_strPathVC, "/bin/cl.exe") Then1301 elseif LogFileExists(m_strPathVC, "/bin/cl.exe") then 1280 1302 m_blnNewLayout = False 1281 1303 if LogFileExists(m_strPathVC, "bin/link.exe") _ … … 1325 1347 1326 1348 public function checkProgFiles(strSubdir) 1327 if m_blnFound = False Then1349 if m_blnFound = False then 1328 1350 dim strProgFiles 1329 1351 for each strProgFiles in g_arrProgramFiles … … 1394 1416 end if 1395 1417 g_strPathVCC = objState.m_strPathVC 1418 g_strVCCVersion = objState.m_strVersion 1396 1419 1397 1420 ' … … 1680 1703 1681 1704 ' The tools location (first). 1682 if (strPathlibSDL = "") And (g_blnInternalFirst = True) Then1705 if (strPathlibSDL = "") And (g_blnInternalFirst = True) then 1683 1706 str = g_strPathDev & "/win." & g_strTargetArch & "/libsdl" 1684 1707 if HasSubdirsStartingWith(str, "v") then … … 1689 1712 1690 1713 ' Poke about in the path. 1691 if strPathlibSDL = "" Then1714 if strPathlibSDL = "" then 1692 1715 str = WhichEx("LIB", "SDLmain.lib") 1693 if str = "" Then str = Which("..\lib\SDLmain.lib")1694 if str = "" Then str = Which("SDLmain.lib")1695 if str <> "" Then1716 if str = "" then str = Which("..\lib\SDLmain.lib") 1717 if str = "" then str = Which("SDLmain.lib") 1718 if str <> "" then 1696 1719 str = PathParent(PathStripFilename(str)) 1697 1720 if CheckForlibSDLSub(str) then strPathlibSDL = str … … 1699 1722 end if 1700 1723 1701 if strPathlibSDL = "" Then1724 if strPathlibSDL = "" then 1702 1725 str = Which("SDL.dll") 1703 if str <> "" Then1726 if str <> "" then 1704 1727 str = PathParent(PathStripFilename(str)) 1705 1728 if CheckForlibSDLSub(str) then strPathlibSDL = str … … 1708 1731 1709 1732 ' The tools location (post). 1710 if (strPathlibSDL = "") And (g_blnInternalFirst = False) Then1733 if (strPathlibSDL = "") And (g_blnInternalFirst = False) then 1711 1734 str = g_strPathDev & "/win." & g_strTargetArch & "/libsdl" 1712 1735 if HasSubdirsStartingWith(str, "v") then … … 1778 1801 end if 1779 1802 1780 if strPathXml2 = "" Then1803 if strPathXml2 = "" then 1781 1804 str = Which("libxml2.lib") 1782 if str <> "" Then1805 if str <> "" then 1783 1806 str = PathParent(PathStripFilename(str)) 1784 1807 if CheckForXml2Sub(str) then strPathXml2 = str … … 1852 1875 end if 1853 1876 1854 if strPathSsl = "" Then1877 if strPathSsl = "" then 1855 1878 str = Which("libssl.lib") 1856 if str <> "" Then1879 if str <> "" then 1857 1880 str = PathParent(PathStripFilename(str)) 1858 1881 if CheckForSslSub(str) then strPathSsl = str … … 1928 1951 end if 1929 1952 1930 if strPathCurl = "" Then1953 if strPathCurl = "" then 1931 1954 str = Which("libcurl.lib") 1932 if str <> "" Then1955 if str <> "" then 1933 1956 str = PathParent(PathStripFilename(str)) 1934 1957 if CheckForCurlSub(str) then strPathCurl = str … … 1980 2003 ' Checks for any Qt5 binaries. 1981 2004 sub CheckForQt(strOptQt5) 2005 dim strPathQt5, arrFolders, arrInfixes, strInfix 1982 2006 PrintHdr "Qt5" 1983 2007 … … 1985 2009 ' Try to find the Qt5 installation (user specified path with --with-qt5) 1986 2010 ' 2011 LogPrint "Checking for user specified path of Qt5 ... " 1987 2012 strPathQt5 = "" 1988 1989 LogPrint "Checking for user specified path of Qt5 ... " 1990 if (strPathQt5 = "") And (strOptQt5 <> "") then 1991 strOptQt5 = UnixSlashes(strOptQt5) 1992 if CheckForQt5Sub(strOptQt5) then strPathQt5 = strOptQt5 1993 end if 1994 1995 ' Check the dev tools 1996 if (strPathQt5 = "") Then 1997 strPathQt5 = g_strPathDev & "/win." & g_strTargetArch & "/qt/v5.5.1-r138" 1998 if CheckForQt5Sub(strPathQt5) = False then strPathQt5 = "" 1999 end if 2013 if strOptQt5 <> "" then 2014 strPathQt5 = CheckForQt5Sub(UnixSlashes(strOptQt5)) 2015 end if 2016 2017 ' Check the dev tools - prefer ones matching the compiler. 2018 if strPathQt5 = "" then 2019 arrFolders = GetSubdirsStartingWithSorted(g_strPathDev & "/win." & g_strTargetArch & "/qt", "v5") 2020 arrInfixes = Array(LCase(g_strVCCVersion), Left(LCase(g_strVCCVersion), Len(g_strVCCVersion) - 1), "") 2021 for each strInfix in arrInfixes 2022 for i = UBound(arrFolders) to LBound(arrFolders) step -1 2023 if strInfix = "" or InStr(1, LCase(arrFolders(i)), strInfix) > 0 then 2024 strPathQt5 = CheckForQt5Sub(g_strPathDev & "/win." & g_strTargetArch & "/qt/" & arrFolders(i)) 2025 if strPathQt5 <> "" then exit for 2026 end if 2027 next 2028 if strPathQt5 <> "" then exit for 2029 next 2030 end if 2031 2032 ' Note! We could scan Computer\HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\UFH\SHC looking for entries 2033 ' executing stuff like C:\qt\5.x.y\msvc2017_64\bin\qtenv2.bat 2000 2034 2001 2035 ' Display the result. … … 2020 2054 ' Checks if the specified path points to an usable Qt5 library. 2021 2055 function CheckForQt5Sub(strPathQt5) 2022 2023 CheckForQt5Sub = False 2056 CheckForQt5Sub = "" 2024 2057 LogPrint "trying: strPathQt5=" & strPathQt5 2025 2058 … … 2035 2068 Or LogFileExists(strPathQt5, "lib/Qt5NetworkVBox.lib")) _ 2036 2069 then 2037 CheckForQt5Sub = True 2038 end if 2039 2070 CheckForQt5Sub = strPathQt5 2071 end if 2040 2072 end function 2041 2073 … … 2067 2099 Print " -h, --help Display this." 2068 2100 Print " --target-arch=x86|amd64 The target architecture." 2101 Print " --continue-on-error Do not stop on errors." 2069 2102 Print " --internal-last Check internal tools (tools/win.*) last." 2070 2103 Print " --internal-first Check internal tools (tools/win.*) first (default)." … … 2085 2118 Print " (Expecting bin, include and lib subdirs.)" 2086 2119 Print " --with-VC-Common=PATH Maybe needed for 2015 and older to" 2087 Print " locate the Common7 directory. 2120 Print " locate the Common7 directory." 2088 2121 Print " --with-python=PATH The python to use." 2089 2122 Print " --with-libxml2=PATH To use a libxml2 other than the VBox one." … … 2098 2131 ' The main() like function. 2099 2132 ' 2100 SubMain2133 function Main 2101 2134 ' 2102 2135 ' Write the log header and check that we're not using wscript. 2103 2136 ' 2104 2137 LogInit 2105 If UCase(Right(Wscript.FullName, 11)) = "WSCRIPT.EXE" Then2138 if UCase(Right(Wscript.FullName, 11)) = "WSCRIPT.EXE" then 2106 2139 Wscript.Echo "This script must be run under CScript." 2107 Wscript.Quit(1) 2108 End If 2140 Main = 1 2141 exit function 2142 end if 2109 2143 2110 2144 ' … … 2188 2222 case "--disable-sdl" 2189 2223 blnOptDisableSDL = True 2224 case "--continue-on-error" 2225 g_blnContinueOnError = True 2190 2226 case "--internal-first" 2191 2227 g_blnInternalFirst = True … … 2196 2232 case "-h", "--help", "-?" 2197 2233 usage 2198 Wscript.Quit(0) 2234 Main = 0 2235 exit function 2199 2236 case else 2200 2237 Wscript.echo "syntax error: Unknown option '" & str &"'." 2201 2238 usage 2202 Wscript.Quit(1) 2239 Main = 2 2240 exit function 2203 2241 end select 2204 2242 next … … 2276 2314 Print " kmk" 2277 2315 Print "" 2278 2279 End Sub 2280 2281 2282 Main 2283 2316 if g_rcScript <> 0 then 2317 Print "Warning: ignored errors. See above or in configure.log." 2318 end if 2319 2320 Main = g_rcScript 2321 end function 2322 2323 ' 2324 ' What crt0.o typically does: 2325 ' 2326 WScript.Quit(Main()) 2327
Note:
See TracChangeset
for help on using the changeset viewer.