VirtualBox

Changeset 7589

Show
Ignore:
Timestamp:
03/27/08 11:47:35 (6 months ago)
Author:
vboxsync
Message:

Enhanced Qt configuration of "configure.vbs" script:

- Can now be used with "qtwin" Qt/Free in any location (http://qtwin.sf.net).
- Added automatic support for future Qt releases (takes always the newest ones found).
- Added support for handling own built Qt versions (VBoxQtXXX.*).
- Bugfixed slashes when using the "--with-qt" command.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/configure.vbs

    r6081 r7589  
    519519      LogPrint "Testing '" & strPath & "': " & strPattern & " not found" 
    520520      LogFindFile = "" 
     521   end if 
     522end function 
     523 
     524 
     525'' 
     526' Finds the first directory matching the pattern. 
     527' If no directory is found, log the failure,  
     528' else return the complete path to the found directory. 
     529function LogFindDir(strPath, strPattern) 
     530   dim str 
     531 
     532   ' 
     533   ' Yes, there are some facy database kinda interface to the filesystem 
     534   ' however, breaking down the path and constructing a usable query is 
     535   ' too much hassle. So, we'll do it the unix way... 
     536   ' 
     537 
     538   ' List the alphabetically last names as first entries (with /O-N). 
     539   if Shell("dir /B /AD /O-N """ & DosSlashes(strPath) & "\" & DosSlashes(strPattern) & """", True) = 0 _ 
     540    And InStr(1, g_strShellOutput, Chr(13)) > 1 _ 
     541      then 
     542      ' return the first word. 
     543      LogFindDir = strPath & "/" & Left(g_strShellOutput, InStr(1, g_strShellOutput, Chr(13)) - 1) 
     544   else 
     545      LogPrint "Testing '" & strPath & "': " & strPattern & " not found" 
     546      LogFindDir = "" 
    521547   end if 
    522548end function 
     
    17711797end function 
    17721798 
    1773  
    1774 dim g_strQtVer 
     1799dim g_strQtVer    ' Global version number of Qt (3, 333, 338 for example) 
    17751800g_strQtVer = "" 
     1801 
     1802dim g_strQtLib    ' Full path to Qt .lib found 
     1803g_strQtLib = "" 
     1804 
     1805dim g_strQtDll    ' Full path to Qt .dll found 
     1806g_strQtDll = "" 
    17761807 
    17771808'' 
     
    17831814 
    17841815   ' 
    1785    ' Try find the Qt installation
     1816   ' Try find the Qt installation (user specified path with --with-qt=)
    17861817   ' 
    17871818   strPathQt = "" 
    1788  
     1819   bQtWinFree = False 
     1820 
     1821   LogPrint "Checking for user specified path of Qt ..." 
    17891822   if (strPathQt = "") And (strOptQt <> "") then 
     1823      strOptQt = UnixSlashes(strOptQt) 
    17901824      if CheckForQtSub(strOptQt) then strPathQt = strOptQt 
    1791    end if 
    1792  
     1825 
     1826      if (strPathQt = "") And (strOptQt <> "") then 
     1827         LogPrint "Checking for user specified path of Qt/free ..." 
     1828         if CheckForQtWinFreeSub(strOptQt) then 
     1829            strPathQt = strOptQt 
     1830            bQtWinFree = True 
     1831         end if 
     1832      end if 
     1833 
     1834   end if 
     1835 
     1836   ' 
     1837   ' Search for any 3.x version 
     1838   ' 
     1839   LogPrint "Checking for licensed version of Qt ..." 
    17931840   if strPathQt = "" then 
    1794       str = g_strPathDev & "/win.x86/qt/v3.3.3" 
    1795       if CheckForQtSub(str) then strPathQt = str 
     1841      str = LogFindDir(g_strPathDev & "/win.x86/qt", "v3.*") 
     1842      if (str <> "") then 
     1843         if CheckForQtSub(str) then strPathQt = str 
     1844      end if 
     1845   end if 
     1846    
     1847   ' 
     1848   ' Try to find the Open Source project "qtwin" Qt/free,  
     1849   ' located at http://qtwin.sf.net 
     1850   ' 
     1851   if strPathQt = "" then 
     1852      LogPrint "Checking for Qt/free ..." 
     1853      str = LogFindDir(g_strPathDev & "/win.x86/qt", "v3.*") 
     1854      if (str <> "") then 
     1855         if CheckForQtWinFreeSub(str) then  
     1856            strPathQt = str 
     1857            bQtWinFree = True 
     1858          end if 
     1859      end if 
    17961860   end if 
    17971861 
     
    18021866      CfgPrint "VBOX_WITH_QTGUI=" 
    18031867      PrintResult "Qt", "not found" 
    1804    else 
     1868   else                                
    18051869      CfgPrint "VBOX_PATH_QT          := " & strPathQt 
    18061870      CfgPrint "QTDIR                  = $(VBOX_PATH_QT)" 
    1807       CfgPrint "LIB_QT                 = $(VBOX_PATH_QT)/lib/dynamic/qt-mt" & g_strQtVer & ".lib" 
    1808       CfgPrint "VBOX_DLL_QT            = $(VBOX_PATH_QT)/bin/qt-mt" & g_strQtVer & ".dll" 
    1809       PrintResult "Qt (" & g_strQtVer & ")", strPathQt 
    1810    end if 
    1811 end sub 
     1871    
     1872      if bQtWinFree = True then     ' The "qtwin" 
     1873         PrintResult "Qt (v" & g_strQtVer & ", QtWin/Free)", strPathQt    
     1874      else                          ' Licensed from Trolltech 
     1875         PrintResult "Qt (v" & g_strQtVer & ")", strPathQt 
     1876      end if 
     1877 
     1878      CfgPrint "LIB_QT                 = " & g_strQtLib 
     1879      CfgPrint "VBOX_DLL_QT            = " & g_strQtDll 
     1880   end if 
     1881end sub 
     1882 
    18121883 
    18131884'' 
     
    18171888   CheckForQtSub = False 
    18181889   LogPrint "trying: strPathQt=" & strPathQt 
     1890 
     1891   ' For Qt 3.3.3 
     1892   dim str 
    18191893   if   LogFileExists(strPathQt, "bin/moc.exe") _ 
    18201894    And LogFileExists(strPathQt, "bin/uic.exe") _ 
     
    18251899    And LogFileExists(strPathQt, "lib/dynamic/qtmain.lib") _ 
    18261900      then 
    1827       dim str 
    18281901 
    18291902      ' This check might need improving. 
     
    18321905         g_strQtVer = Mid(str, Len("qt-mt") + 1, Len(str) - Len("qt-mt.lib")) 
    18331906         if LogFileExists(strPathQt, "bin/qt-mt" & g_strQtVer & ".dll") then 
     1907            g_strQtLib = strPathQt & "/lib/dynamic/" & str 
     1908            g_strQtDll = strPathQt & "/bin/qt-mt" & g_strQtVer & ".dll" 
    18341909            CheckForQtSub = True 
     1910         end if 
     1911      end if 
     1912   end if 
     1913 
     1914   ' For >= Qt 3.3.8 (no "dynamic" folder, VBoxQt338.lib /.dll instead of qt-mt33*.lib /.dll) 
     1915   str = "" 
     1916   if   LogFileExists(strPathQt, "bin/moc.exe") _ 
     1917    And LogFileExists(strPathQt, "bin/uic.exe") _ 
     1918    And LogFileExists(strPathQt, "include/qvbox.h") _ 
     1919    And LogFileExists(strPathQt, "include/qt_windows.h") _ 
     1920    And LogFileExists(strPathQt, "include/qapplication.h") _ 
     1921    And LogFileExists(strPathQt, "include/qtextedit.h") _ 
     1922    And LogFileExists(strPathQt, "lib/qtmain.lib") _ 
     1923      then 
     1924 
     1925      ' This check might need improving. 
     1926      str = LogFindFile(strPathQt, "lib/VBoxQt3*.lib") 
     1927      if str <> "" then 
     1928         g_strQtVer = Mid(str, Len("VBoxQt") + 1, Len(str) - Len("VBoxQt.lib")) 
     1929         if LogFileExists(strPathQt, "bin/VBoxQt" & g_strQtVer & ".dll") then 
     1930            g_strQtLib = strPathQt & "/lib/" & str 
     1931            g_strQtDll = strPathQt & "/bin/VBoxQt" & g_strQtVer & ".dll" 
     1932            CheckForQtSub = True 
     1933         end if 
     1934      end if 
     1935   end if 
     1936 
     1937end function 
     1938 
     1939 
     1940'' 
     1941' Checks if the specified path points to an usable "qtwin" Qt/Free install or not. 
     1942' "qtwin" is an Open Source project located at http://qtwin.sf.net and builds Qt 3.x.x sources 
     1943' of the official GPL'ed Qt 4.x sources from Trolltech. 
     1944function CheckForQtWinFreeSub(strPathQt) 
     1945 
     1946   CheckForQtWinFreeSub = False 
     1947   LogPrint "trying: strPathQt=" & strPathQt 
     1948   if   LogFileExists(strPathQt, "bin/moc.exe") _ 
     1949    And LogFileExists(strPathQt, "bin/uic.exe") _ 
     1950    And LogFileExists(strPathQt, "include/qvbox.h") _ 
     1951    And LogFileExists(strPathQt, "include/qt_windows.h") _ 
     1952    And LogFileExists(strPathQt, "include/qapplication.h") _ 
     1953    And LogFileExists(strPathQt, "include/qtextedit.h") _ 
     1954    And LogFileExists(strPathQt, "lib/qtmain.lib") _ 
     1955      then 
     1956      dim str 
     1957 
     1958      ' This check might need improving. 
     1959      str = LogFindFile(strPathQt, "lib/qt-mt3.lib") 
     1960      if str <> "" then 
     1961         g_strQtVer = Mid(str, Len("qt-mt") + 1, Len(str) - Len("qt-mt.lib")) 
     1962         if LogFileExists(strPathQt, "bin/qt-mt" & g_strQtVer & ".dll") then 
     1963            g_strQtLib = strPathQt & "/lib/" & str 
     1964            g_strQtDll = strPathQt & "/bin/qt-mt" & g_strQtVer & ".dll" 
     1965            CheckForQtWinFreeSub = True 
    18351966         end if 
    18361967      end if 

© 2008 Sun Microsystems, Inc.
ContactPrivacy policy