VirtualBox

Changeset 85721 in vbox


Ignore:
Timestamp:
Aug 12, 2020 4:49:38 PM (5 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
139868
Message:

configure.vbs: Locate the right libsdl.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/configure.vbs

    r85715 r85721  
    490490
    491491''
     492' Returns true if there are subfolders starting with the given string.
     493function HasSubdirsStartingWith(strFolder, strStartingWith)
     494   HasSubdirsStartingWith = False
     495   if DirExists(strFolder) then
     496      dim obj
     497      set obj = g_objFileSys.GetFolder(strFolder)
     498      for each objSub in obj.SubFolders
     499         if StrComp(Left(objSub.Name, Len(strStartingWith)), strStartingWith) = 0 Then
     500            HasSubdirsStartingWith = True
     501            LogPrint "# HasSubdirsStartingWith(" & strFolder & "," & strStartingWith & ") found " & objSub.Name
     502            exit for
     503         end if
     504      next
     505   end if
     506end function
     507
     508
     509''
    492510' Executes a command in the shell catching output in g_strShellOutput
    493511function Shell(strCommand, blnBoth)
     
    521539
    522540''
    523 ' Try find the specified file in the path.
    524 function Which(strFile)
     541' Try find the specified file in the specified path variable.
     542function WhichEx(strEnvVar, strFile)
    525543   dim strPath, iStart, iEnd, str
    526544
    527545   ' the path
    528    strPath = EnvGet("Path")
     546   strPath = EnvGet(strEnvVar)
    529547   iStart = 1
    530548   do while iStart <= Len(strPath)
     
    534552         str = Mid(strPath, iStart, iEnd - iStart) & "/" & strFile
    535553         if FileExists(str) then
    536             Which = str
     554            WhichEx = str
    537555            exit function
    538556         end if
     
    543561   ' registry or somewhere?
    544562
    545    Which = ""
     563   WhichEx = ""
     564end function
     565
     566
     567''
     568' Try find the specified file in the path.
     569function Which(strFile)
     570   Which = WhichEx("Path", strFile)
    546571end function
    547572
     
    15051530   ' The tools location (first).
    15061531   if (strPathlibSDL = "") And (g_blnInternalFirst = True) Then
    1507       str = g_strPathDev & "/win.x86/libsdl/v1.2.11"
    1508       if CheckForlibSDLSub(str) then strPathlibSDL = str
    1509    end if
    1510 
    1511    if (strPathlibSDL = "") And (g_blnInternalFirst = True) Then
    1512       str = g_strPathDev & "/win.x86/libsdl/v1.2.7-InnoTek"
    1513       if CheckForlibSDLSub(str) then strPathlibSDL = str
     1532      str = g_strPathDev & "/win." & g_strTargetArch & "/libsdl"
     1533      if HasSubdirsStartingWith(str, "v") then
     1534         PrintResult "libSDL", str & "/v* (auto)"
     1535         exit sub
     1536      end if
    15141537   end if
    15151538
    15161539   ' Poke about in the path.
    1517    str = Which("SDLmain.lib")
    1518    if (strPathlibSDL = "") And (str <> "") Then
    1519       str = PathParent(PathStripFilename(str))
    1520       if CheckForlibSDLSub(str) then strPathlibSDL = str
    1521    end if
    1522 
    1523    str = Which("SDL.dll")
    1524    if (strPathlibSDL = "") And (str <> "") Then
    1525       str = PathParent(PathStripFilename(str))
    1526       if CheckForlibSDLSub(str) then strPathlibSDL = str
     1540   if strPathlibSDL = "" Then
     1541      str = WhichEx("LIB", "SDLmain.lib")
     1542      if str = "" Then str = Which("..\lib\SDLmain.lib")
     1543      if str = "" Then str = Which("SDLmain.lib")
     1544      if str <> "" Then
     1545         str = PathParent(PathStripFilename(str))
     1546         if CheckForlibSDLSub(str) then strPathlibSDL = str
     1547      end if
     1548   end if
     1549
     1550   if strPathlibSDL = "" Then
     1551      str = Which("SDL.dll")
     1552      if str <> "" Then
     1553         str = PathParent(PathStripFilename(str))
     1554         if CheckForlibSDLSub(str) then strPathlibSDL = str
     1555      end if
    15271556   end if
    15281557
    15291558   ' The tools location (post).
    15301559   if (strPathlibSDL = "") And (g_blnInternalFirst = False) Then
    1531       str = g_strPathDev & "/win.x86/libsdl/v1.2.11"
    1532       if CheckForlibSDLSub(str) then strPathlibSDL = str
    1533    end if
    1534 
    1535    if (strPathlibSDL = "") And (g_blnInternalFirst = False) Then
    1536       str = g_strPathDev & "/win.x86/libsdl/v1.2.7-InnoTek"
    1537       if CheckForlibSDLSub(str) then strPathlibSDL = str
     1560      str = g_strPathDev & "/win." & g_strTargetArch & "/libsdl"
     1561      if HasSubdirsStartingWith(str, "v") then
     1562         PrintResult "libSDL", str & "/v* (auto)"
     1563         exit sub
     1564      end if
    15381565   end if
    15391566
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