VirtualBox

Changeset 85784 in vbox


Ignore:
Timestamp:
Aug 16, 2020 1:27:11 PM (5 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
139940
Message:

configure.vbs: Corrected internal qt detection and updated it to vcc142 level. Added --continue-on-error option. Some cleanups. bugref:8489

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/configure.vbs

    r85783 r85784  
    3636Set g_objFileSys = WScript.CreateObject("Scripting.FileSystemObject")
    3737
    38 dim g_strPathkBuild, g_strPathkBuildBin, g_strPathDev, g_strPathVCC, g_strPathPSDK, g_strVerPSDK, g_strPathDDK, g_strSubOutput
     38' kBuild stuff.
     39dim g_strPathkBuild, g_strPathkBuildBin, g_strPathDev
    3940g_strPathkBuild = ""
     41g_strPathkBuildBin = ""
    4042g_strPathDev = ""
    41 g_strPathVCC = ""
    42 g_strPathPSDK = ""
    43 g_strPathDDK = ""
    4443
    4544dim g_strTargetArch
     
    4948g_strHostArch = ""
    5049
     50' Visual C++ info.
     51dim g_strPathVCC, g_strVCCVersion
     52g_strPathVCC = ""
     53g_strVCCVersion = ""
     54
     55' SDK and DDK.
     56dim g_strPathPSDK, g_strVerPSDK, g_strPathDDK
     57g_strPathPSDK = ""
     58g_strVerPSDK = ""
     59g_strPathDDK = ""
     60
     61' COM disabling.
    5162dim g_blnDisableCOM, g_strDisableCOM
    5263g_blnDisableCOM = False
    5364g_strDisableCOM = ""
     65
     66' Whether to ignore (continue) on errors.
     67dim g_blnContinueOnError, g_rcExit
     68g_blnContinueOnError = False
     69
     70' The script's exit code (for ignored errors).
     71dim g_rcScript
     72g_rcScript = 0
    5473
    5574' Whether to try the internal stuff first or last.
     
    499518      set obj = g_objFileSys.GetFolder(strFolder)
    500519      for each objSub in obj.SubFolders
    501          if StrComp(Left(objSub.Name, Len(strStartingWith)), strStartingWith) = 0 Then
     520         if StrComp(Left(objSub.Name, Len(strStartingWith)), strStartingWith) = 0 then
    502521            HasSubdirsStartingWith = True
    503522            LogPrint "# HasSubdirsStartingWith(" & strFolder & "," & strStartingWith & ") found " & objSub.Name
     
    532551      i = 0
    533552      for each objSub in obj.SubFolders
    534          if StrComp(Left(objSub.Name, Len(strStartingWith)), strStartingWith) = 0 Then
     553         if StrComp(Left(objSub.Name, Len(strStartingWith)), strStartingWith) = 0 then
    535554            i = i + 1
    536555         end if
     
    540559         i = 0
    541560         for each objSub in obj.SubFolders
    542             if StrComp(Left(objSub.Name, Len(strStartingWith)), strStartingWith) = 0 Then
     561            if StrComp(Left(objSub.Name, Len(strStartingWith)), strStartingWith) = 0 then
    543562               arrResult(i) = objSub.Name
    544563               i = i + 1
     
    682701sub MsgFatal(strMsg)
    683702   Print "fatal error: " & strMsg
    684    Wscript.Quit
     703   Wscript.Quit(1)
    685704end sub
    686705
     
    690709sub MsgError(strMsg)
    691710   Print "error: " & strMsg
    692    Wscript.Quit
     711   if g_blnContinueOnError = False then
     712      Wscript.Quit(1)
     713   end if
     714   g_rcScript = 1
    693715end sub
    694716
     
    11141136   end if
    11151137
    1116    if (Shell(DosSlashes(g_strPathkBuildBin & "/kmk.exe") & " --version", True) <> 0) Then
     1138   if (Shell(DosSlashes(g_strPathkBuildBin & "/kmk.exe") & " --version", True) <> 0) then
    11171139      MsgFatal "Can't execute '" & g_strPathkBuildBin & "/kmk.exe --version'. check configure.log for the out."
    11181140      exit sub
     
    11801202
    11811203      strSavedPath = EnvGet("PATH")
    1182       if (m_strPathVCCommon <> "") Then
     1204      if (m_strPathVCCommon <> "") then
    11831205         EnvAppend "PATH", ";" & m_strPathVCCommon & "/IDE"
    11841206      end if
     
    12631285            ' 15.0+ layout?  This is fun because of the multiple CL versions (/tools/msvc/xx.yy.bbbbb/).
    12641286            ' OTOH, the user may have pointed us directly to one of them.
    1265             if LogDirExists(m_strPathVC & "/Tools/MSVC") Then
     1287            if LogDirExists(m_strPathVC & "/Tools/MSVC") then
    12661288               m_blnNewLayout = True
    12671289               LogPrint " => seems okay. new layout."
     
    12771299               checkInner(m_strPathVC)
    12781300            ' 14.0 and older layout?
    1279             elseif LogFileExists(m_strPathVC, "/bin/cl.exe") Then
     1301            elseif LogFileExists(m_strPathVC, "/bin/cl.exe") then
    12801302               m_blnNewLayout = False
    12811303               if   LogFileExists(m_strPathVC, "bin/link.exe") _
     
    13251347
    13261348   public function checkProgFiles(strSubdir)
    1327       if m_blnFound = False Then
     1349      if m_blnFound = False then
    13281350         dim strProgFiles
    13291351         for each strProgFiles in g_arrProgramFiles
     
    13941416   end if
    13951417   g_strPathVCC = objState.m_strPathVC
     1418   g_strVCCVersion = objState.m_strVersion
    13961419
    13971420   '
     
    16801703
    16811704   ' The tools location (first).
    1682    if (strPathlibSDL = "") And (g_blnInternalFirst = True) Then
     1705   if (strPathlibSDL = "") And (g_blnInternalFirst = True) then
    16831706      str = g_strPathDev & "/win." & g_strTargetArch & "/libsdl"
    16841707      if HasSubdirsStartingWith(str, "v") then
     
    16891712
    16901713   ' Poke about in the path.
    1691    if strPathlibSDL = "" Then
     1714   if strPathlibSDL = "" then
    16921715      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 <> "" Then
     1716      if str = "" then str = Which("..\lib\SDLmain.lib")
     1717      if str = "" then str = Which("SDLmain.lib")
     1718      if str <> "" then
    16961719         str = PathParent(PathStripFilename(str))
    16971720         if CheckForlibSDLSub(str) then strPathlibSDL = str
     
    16991722   end if
    17001723
    1701    if strPathlibSDL = "" Then
     1724   if strPathlibSDL = "" then
    17021725      str = Which("SDL.dll")
    1703       if str <> "" Then
     1726      if str <> "" then
    17041727         str = PathParent(PathStripFilename(str))
    17051728         if CheckForlibSDLSub(str) then strPathlibSDL = str
     
    17081731
    17091732   ' The tools location (post).
    1710    if (strPathlibSDL = "") And (g_blnInternalFirst = False) Then
     1733   if (strPathlibSDL = "") And (g_blnInternalFirst = False) then
    17111734      str = g_strPathDev & "/win." & g_strTargetArch & "/libsdl"
    17121735      if HasSubdirsStartingWith(str, "v") then
     
    17781801   end if
    17791802
    1780    if strPathXml2 = "" Then
     1803   if strPathXml2 = "" then
    17811804      str = Which("libxml2.lib")
    1782       if str <> "" Then
     1805      if str <> "" then
    17831806         str = PathParent(PathStripFilename(str))
    17841807         if CheckForXml2Sub(str) then strPathXml2 = str
     
    18521875   end if
    18531876
    1854    if strPathSsl = "" Then
     1877   if strPathSsl = "" then
    18551878      str = Which("libssl.lib")
    1856       if str <> "" Then
     1879      if str <> "" then
    18571880         str = PathParent(PathStripFilename(str))
    18581881         if CheckForSslSub(str) then strPathSsl = str
     
    19281951   end if
    19291952
    1930    if strPathCurl = "" Then
     1953   if strPathCurl = "" then
    19311954      str = Which("libcurl.lib")
    1932       if str <> "" Then
     1955      if str <> "" then
    19331956         str = PathParent(PathStripFilename(str))
    19341957         if CheckForCurlSub(str) then strPathCurl = str
     
    19802003' Checks for any Qt5 binaries.
    19812004sub CheckForQt(strOptQt5)
     2005   dim strPathQt5, arrFolders, arrInfixes, strInfix
    19822006   PrintHdr "Qt5"
    19832007
     
    19852009   ' Try to find the Qt5 installation (user specified path with --with-qt5)
    19862010   '
     2011   LogPrint "Checking for user specified path of Qt5 ... "
    19872012   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
    20002034
    20012035   ' Display the result.
     
    20202054' Checks if the specified path points to an usable Qt5 library.
    20212055function CheckForQt5Sub(strPathQt5)
    2022 
    2023    CheckForQt5Sub = False
     2056   CheckForQt5Sub = ""
    20242057   LogPrint "trying: strPathQt5=" & strPathQt5
    20252058
     
    20352068         Or LogFileExists(strPathQt5, "lib/Qt5NetworkVBox.lib")) _
    20362069      then
    2037          CheckForQt5Sub = True
    2038    end if
    2039 
     2070         CheckForQt5Sub = strPathQt5
     2071   end if
    20402072end function
    20412073
     
    20672099   Print "  -h, --help              Display this."
    20682100   Print "  --target-arch=x86|amd64 The target architecture."
     2101   Print "  --continue-on-error     Do not stop on errors."
    20692102   Print "  --internal-last         Check internal tools (tools/win.*) last."
    20702103   Print "  --internal-first        Check internal tools (tools/win.*) first (default)."
     
    20852118   Print "                          (Expecting bin, include and lib subdirs.)"
    20862119   Print "  --with-VC-Common=PATH   Maybe needed for 2015 and older to"
    2087    Print "                          locate the Common7 directory.
     2120   Print "                          locate the Common7 directory."
    20882121   Print "  --with-python=PATH      The python to use."
    20892122   Print "  --with-libxml2=PATH     To use a libxml2 other than the VBox one."
     
    20982131' The main() like function.
    20992132'
    2100 Sub Main
     2133function Main
    21012134   '
    21022135   ' Write the log header and check that we're not using wscript.
    21032136   '
    21042137   LogInit
    2105    If UCase(Right(Wscript.FullName, 11)) = "WSCRIPT.EXE" Then
     2138   if UCase(Right(Wscript.FullName, 11)) = "WSCRIPT.EXE" then
    21062139      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
    21092143
    21102144   '
     
    21882222         case "--disable-sdl"
    21892223            blnOptDisableSDL = True
     2224         case "--continue-on-error"
     2225            g_blnContinueOnError = True
    21902226         case "--internal-first"
    21912227            g_blnInternalFirst = True
     
    21962232         case "-h", "--help", "-?"
    21972233            usage
    2198             Wscript.Quit(0)
     2234            Main = 0
     2235            exit function
    21992236         case else
    22002237            Wscript.echo "syntax error: Unknown option '" & str &"'."
    22012238            usage
    2202             Wscript.Quit(1)
     2239            Main = 2
     2240            exit function
    22032241      end select
    22042242   next
     
    22762314   Print "  kmk"
    22772315   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
     2321end function
     2322
     2323'
     2324' What crt0.o typically does:
     2325'
     2326WScript.Quit(Main())
     2327
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette