VirtualBox

Changeset 101256 in vbox for trunk


Ignore:
Timestamp:
Sep 25, 2023 4:45:59 PM (19 months ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
159239
Message:

configure.vbs: bugref:10450: Tweaking Qt6 support for configure script for Windows.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/configure.vbs

    r98254 r101256  
    17571757
    17581758''
    1759 ' Checks for any Qt5 binaries.
    1760 '
    1761 sub CheckForQt(strOptQt5, strOptInfix)
    1762    dim strPathQt5, strInfixQt5, arrFolders, arrVccInfixes, strVccInfix, strPathDev
    1763    PrintHdr "Qt5"
    1764 
    1765    '
    1766    ' Try to find the Qt5 installation (user specified path with --with-qt5)
    1767    '
    1768    LogPrint "Checking for user specified path of Qt5 ... "
    1769    strPathQt5 = CheckForQt5Sub(UnixSlashes(strOptQt5), strOptInfix, strInfixQt5)
    1770    if strPathQt5 = "" and g_blnInternalFirst = true then strPathQt5 = CheckForQt5Internal(strOptInfix, strInfixQt5)
    1771    if strPathQt5 = "" then
     1759' Checks for any Qt binaries.
     1760'
     1761sub CheckForQt(strOptQt, strOptInfix)
     1762   dim strPathQt, strInfixQt, arrFolders, arrVccInfixes, strVccInfix, strPathDev
     1763   PrintHdr "Qt"
     1764
     1765   '
     1766   ' Try to find the Qt installation (user specified path with --with-qt)
     1767   '
     1768   LogPrint "Checking for user specified path of Qt ... "
     1769   strPathQt = CheckForQtSub(UnixSlashes(strOptQt), strOptInfix, strInfixQt)
     1770   if strPathQt = "" and g_blnInternalFirst = true then strPathQt = CheckForQtInternal(strOptInfix, strInfixQt)
     1771   if strPathQt = "" then
    17721772      '
    17731773      ' Collect links from "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\UFH\SHC"
    17741774      '
    17751775      ' Typical string list:
    1776       '   C:\Users\someuser\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Qt\5.x.y\MSVC 20zz (64-bit)\Qt 5.x.y (MSVC 20zz 64-bit).lnk
     1776      '   C:\Users\someuser\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Qt\6.x.y\MSVC 20zz (64-bit)\Qt 6.x.y (MSVC 20zz 64-bit).lnk
    17771777      '   C:\Windows\System32\cmd.exe
    1778       '   /A /Q /K E:\qt\installed\5.x.y\msvc20zz_64\bin\qtenv2.bat
     1778      '   /A /Q /K E:\qt\installed\6.x.y\msvc20zz_64\bin\qtenv2.bat
    17791779      '
    17801780      dim arrCandidates, strCandidate
    1781       arrCandidates = CollectFromProgramItemLinks(GetRef("Qt5ProgramItemCallback"), strPathQt5)
     1781      arrCandidates = CollectFromProgramItemLinks(GetRef("QtProgramItemCallback"), strPathQt)
    17821782      LogPrint "Testing qtenv2.bat links (" & ArraySize(arrCandidates) & ") ..."
    17831783
     
    17851785      if     g_strVCCVersion = "VCC142" or g_strVCCVersion = "" then
    17861786         arrVccInfixes = Array("msvc2019_64", "msvc2017_64", "msvc2015_64")
    1787       elseif g_strVCCVersion = "VCC141" then
    1788          arrVccInfixes = Array("msvc2017_64", "msvc2015_64", "msvc2019_64")
    1789       elseif g_strVCCVersion = "VCC140" then
    1790          arrVccInfixes = Array("msvc2015_64", "msvc2017_64", "msvc2019_64")
    1791       elseif g_strVCCVersion = "VCC120" then
    1792          arrVccInfixes = Array("msvc2013_64")
    1793       elseif g_strVCCVersion = "VCC110" then
    1794          arrVccInfixes = Array("msvc2012_64")
    1795       elseif g_strVCCVersion = "VCC100" then
    1796          arrVccInfixes = Array("msvc2010_64")
    17971787      else
    17981788         MsgFatal "Unexpected VC version: " & g_strVCCVersion
     
    18021792         for each strCandidate in arrCandidates
    18031793            if InStr(1, LCase(strCandidate), strVccInfix) > 0 then
    1804                strPathQt5 = CheckForQt5Sub(strCandidate, strOptInfix, strInfixQt5)
    1805                if strPathQt5 <> "" then exit for
     1794               strPathQt = CheckForQtSub(strCandidate, strOptInfix, strInfixQt)
     1795               if strPathQt <> "" then exit for
    18061796            end if
    18071797         next
    1808          if strPathQt5 <> "" then exit for
     1798         if strPathQt <> "" then exit for
    18091799      next
    18101800   end if
    18111801
    18121802   ' Check the dev tools - prefer ones matching the compiler.
    1813    if strPathQt5 = "" and g_blnInternalFirst = false then strPathQt5 = CheckForQt5Internal(strOptInfix, strInfixQt5)
     1803   if strPathQt = "" and g_blnInternalFirst = false then strPathQt = CheckForQtInternal(strOptInfix, strInfixQt)
    18141804
    18151805   '
    18161806   ' Display the result and output the config.
    18171807   '
    1818    if strPathQt5 <> "" then
    1819       PrintResult "Qt5", strPathQt5
    1820       PrintResultMsg "Qt5 infix", strInfixQt5
    1821       CfgPrintAssign "PATH_SDK_QT5",          strPathQt5
    1822       CfgPrintAssign "PATH_TOOL_QT5",         "$(PATH_SDK_QT5)"
    1823       CfgPrintAssign "VBOX_PATH_QT",          "$(PATH_SDK_QT5)"
    1824       CfgPrintAssign "VBOX_QT_INFIX",         strInfixQt5
     1808   if strPathQt <> "" then
     1809      PrintResult "Qt", strPathQt
     1810      PrintResultMsg "Qt infix", strInfixQt
     1811      CfgPrintAssign "PATH_SDK_QT6",          strPathQt
     1812      CfgPrintAssign "PATH_TOOL_QT6",         "$(PATH_SDK_QT6)"
     1813      CfgPrintAssign "VBOX_PATH_QT",          "$(PATH_SDK_QT6)"
     1814      CfgPrintAssign "VBOX_QT_INFIX",         strInfixQt
    18251815      CfgPrintAssign "VBOX_WITH_QT_PAYLOAD",  "1"
    18261816   else
    1827       PrintResultMsg "Qt5", "not found"
     1817      PrintResultMsg "Qt", "not found"
    18281818      CfgPrintAssign "VBOX_WITH_QTGUI", ""
    18291819   end if
    18301820end sub
    18311821
    1832 function CheckForQt5Internal(strOptInfix, ByRef strInfixQt5)
     1822function CheckForQtInternal(strOptInfix, ByRef strInfixQt)
    18331823   dim strPathDev, arrFolders, arrVccInfixes, strVccInfix, i
    1834    CheckForQt5Internal = ""
     1824   CheckForQtInternal = ""
    18351825   for each strPathDev in g_arrPathDev
    1836       LogPrint "Testing tools dir (" & strPathDev & "/win." & g_strTargetArch & "/qt/v5*) ..."
    1837       arrFolders = GetSubdirsStartingWithVerSorted(strPathDev & "/win." & g_strTargetArch & "/qt", "v5")
     1826      LogPrint "Testing tools dir (" & strPathDev & "/win." & g_strTargetArch & "/qt/v6*) ..."
     1827      arrFolders = GetSubdirsStartingWithVerSorted(strPathDev & "/win." & g_strTargetArch & "/qt", "v6")
    18381828      arrVccInfixes = Array(LCase(g_strVCCVersion), Left(LCase(g_strVCCVersion), Len(g_strVCCVersion) - 1), "")
    18391829      for each strVccInfix in arrVccInfixes
     
    18411831            if strVccInfix = "" or InStr(1, LCase(arrFolders(i)), strVccInfix) > 0 then
    18421832LogPrint "i="&i&" strVccInfix="&strVccInfix
    1843                strPathQt5 = CheckForQt5Sub(strPathDev & "/win." & g_strTargetArch & "/qt/" & arrFolders(i), strOptInfix, strInfixQt5)
    1844                if strPathQt5 <> "" then
    1845                   CheckForQt5Internal = strPathQt5
     1833               strPathQt = CheckForQtSub(strPathDev & "/win." & g_strTargetArch & "/qt/" & arrFolders(i), strOptInfix, strInfixQt)
     1834               if strPathQt <> "" then
     1835                  CheckForQtInternal = strPathQt
    18461836                  exit function
    18471837               end if
     
    18521842end function
    18531843
    1854 function Qt5ProgramItemCallback(ByRef arrStrings, cStrings, ByRef strUnused)
     1844function QtProgramItemCallback(ByRef arrStrings, cStrings, ByRef strUnused)
    18551845   dim str, off
    1856    Qt5ProgramItemCallback = ""
     1846   QtProgramItemCallback = ""
    18571847   if cStrings >= 3 then
    18581848      str = Trim(arrStrings(UBound(arrStrings)))
     
    18621852      then
    18631853         off = InStr(1, str, ":") - 1
    1864          Qt5ProgramItemCallback = Mid(str, off, Len(str) - off - Len("\bin\qtenv2.bat") + 1)
    1865       end if
    1866    end if
    1867 end function
    1868 
    1869 function CheckForQt5Sub(strPathQt5, strOptInfix, ByRef strInfixQt5)
    1870    CheckForQt5Sub = ""
    1871    if strPathQt5 <> "" then
    1872       LogPrint "Trying: strPathQt5=" & strPathQt5
    1873 
    1874       if   LogFileExists(strPathQt5, "bin/moc.exe") _
    1875        and LogFileExists(strPathQt5, "bin/uic.exe") _
    1876        and LogFileExists(strPathQt5, "include/QtWidgets/qwidget.h") _
    1877        and LogFileExists(strPathQt5, "include/QtWidgets/QApplication") _
    1878        and LogFileExists(strPathQt5, "include/QtGui/QImage") _
    1879        and LogFileExists(strPathQt5, "include/QtNetwork/QHostAddress") _
     1854         QtProgramItemCallback = Mid(str, off, Len(str) - off - Len("\bin\qtenv2.bat") + 1)
     1855      end if
     1856   end if
     1857end function
     1858
     1859function CheckForQtSub(strPathQt, strOptInfix, ByRef strInfixQt)
     1860   CheckForQtSub = ""
     1861   if strPathQt <> "" then
     1862      LogPrint "Trying: strPathQt=" & strPathQt
     1863
     1864      if   LogFileExists(strPathQt, "bin/moc.exe") _
     1865       and LogFileExists(strPathQt, "bin/uic.exe") _
     1866       and LogFileExists(strPathQt, "include/QtWidgets/qwidget.h") _
     1867       and LogFileExists(strPathQt, "include/QtWidgets/QApplication") _
     1868       and LogFileExists(strPathQt, "include/QtGui/QImage") _
     1869       and LogFileExists(strPathQt, "include/QtNetwork/QHostAddress") _
    18801870      then
    18811871         ' Infix testing.
    1882          if   LogFileExists(strPathQt5, "lib/Qt5Core.lib") _
    1883           and LogFileExists(strPathQt5, "lib/Qt5Network.lib") then
     1872         if   LogFileExists(strPathQt, "lib/Qt6Core.lib") _
     1873          and LogFileExists(strPathQt, "lib/Qt6Network.lib") then
    18841874            LogPrint "found it w/o infix"
    1885             strInfixQt5 = ""
    1886             CheckForQt5Sub = UnixSlashes(PathAbs(strPathQt5))
    1887          elseif LogFileExists(strPathQt5, "lib/Qt5Core" & strOptInfix & ".lib") _
    1888             and LogFileExists(strPathQt5, "lib/Qt5Network" & strOptInfix & ".lib") then
     1875            strInfixQt = ""
     1876            CheckForQtSub = UnixSlashes(PathAbs(strPathQt))
     1877         elseif LogFileExists(strPathQt, "lib/Qt6Core" & strOptInfix & ".lib") _
     1878            and LogFileExists(strPathQt, "lib/Qt6Network" & strOptInfix & ".lib") then
    18891879            LogPrint "found it w/ infix: " & strOptInfix & " (option)"
    1890             strInfixQt5 = strOptInfix
    1891             CheckForQt5Sub = UnixSlashes(PathAbs(strPathQt5))
    1892          elseif LogFileExists(strPathQt5, "lib/Qt5CoreVBox.lib") _
    1893             and LogFileExists(strPathQt5, "lib/Qt5NetworkVBox.lib") then
     1880            strInfixQt = strOptInfix
     1881            CheckForQtSub = UnixSlashes(PathAbs(strPathQt))
     1882         elseif LogFileExists(strPathQt, "lib/Qt6CoreVBox.lib") _
     1883            and LogFileExists(strPathQt, "lib/Qt6NetworkVBox.lib") then
    18941884            LogPrint "found it w/ infix: VBox"
    1895             strInfixQt5 = "VBox"
    1896             CheckForQt5Sub = UnixSlashes(PathAbs(strPathQt5))
     1885            strInfixQt = "VBox"
     1886            CheckForQtSub = UnixSlashes(PathAbs(strPathQt))
    18971887         end if
    18981888      end if
     
    19711961   Print "  --with-kBuild=PATH      Where kBuild is to be found."
    19721962   Print "  --with-libSDL=PATH      Where libSDL is to be found."
    1973    Print "  --with-Qt5=PATH         Where Qt5 is to be found (optional)."
     1963   Print "  --with-Qt=PATH          Where Qt is to be found (optional)."
    19741964   Print "  --with-DDK=PATH         Where the WDK is to be found."
    19751965   Print "  --with-SDK=PATH         Where the Windows SDK is to be found."
     
    20222012   strOptkBuild = ""
    20232013   strOptlibSDL = ""
    2024    strOptQt5 = ""
    2025    strOptQt5Infix = ""
     2014   strOptQt = ""
     2015   strOptQtInfix = ""
    20262016   strOptSDK10 = ""
    20272017   strOptSDK10Version = ""
     
    20702060         case "--with-mingw-w64"
    20712061            ' ignore
    2072          case "--with-qt5"
    2073             strOptQt5 = strPath
    2074          case "--with-qt5-infix"
    2075             strOptQt5Infix = strPath
     2062         case "--with-qt"
     2063            strOptQt = strPath
     2064         case "--with-qt-infix"
     2065            strOptQtInfix = strPath
    20762066         case "--with-sdk"
    20772067            MsgWarning "Ignoring --with-sdk (the legacy Platform SDK is no longer required)."
     
    22192209      CheckForCurl      strOptCurl32, True
    22202210   end if
    2221    CheckForQt           strOptQt5, strOptQt5Infix
     2211   CheckForQt           strOptQt, strOptQtInfix
    22222212   CheckForPython       strOptPython
    22232213   CfgPrintAssign "VBOX_WITH_LIBVPX",    "" '' @todo look for libvpx 1.1.0+
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