| | 521 | end if |
|---|
| | 522 | end 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. |
|---|
| | 529 | function 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 = "" |
|---|
| 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 |
|---|
| 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 |
|---|
| | 1881 | end sub |
|---|
| | 1882 | |
|---|
| | 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 | |
|---|
| | 1937 | end 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. |
|---|
| | 1944 | function 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 |
|---|