VirtualBox

Changeset 85862 in vbox


Ignore:
Timestamp:
Aug 21, 2020 10:56:05 AM (4 years ago)
Author:
vboxsync
Message:

tools/env*: fixes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/envSub.vbs

    r85853 r85862  
    243243   next
    244244
    245    ' Add some gnuwin32 tools to the end of the path.
    246    EnvAppendPathItem "Path", DosSlashes(strPathDevTools & "\bin\win.x86\gnuwin32\r1\bin"), ";"
    247 
    248    ' Add the newest debugger we can find to the front of the path.
    249    dim strDir, blnStop
    250    bldExitLoop = false
    251    for each str1 in arrArchitectures
    252       for each strDir in GetSubdirsStartingWithRVerSorted(strPathDevTools & "\bin\win." & str1 & "\sdk", "v")
    253          if FileExists(strWinDbgDir & "\Debuggers\" & XlateArchitectureToWin(strHostArch) & "\windbg.exe") then
    254             EnvPrependPathItem "Path", DosSlashes(strWinDbgDir & "\Debuggers\" & XlateArchitectureToWin(strHostArch)), ";"
    255             bldExitLoop = true
    256             exit for
    257          end if
    258       next
    259       if bldExitLoop then exit for
    260    next
    261 
    262    ' Add VCC to the end of the path.
    263    dim str2, arrVccBinDirs
    264    arrVccBinDirs = Array("\bin\Host" & XlateArchitectureToWin(strHostArch) & "\" & XlateArchitectureToWin(strTargetArch), _
    265                          "\bin\" & strHostArch & "_" & strTargetArch, _
    266                          "\bin\" & strTargetArch, _
    267                          "\bin")
    268    bldExitLoop = false
    269    for each str1 in Array("amd64", "x86")
    270       for each strDir in GetSubdirsStartingWithRVerSorted(strPathDevTools & "\bin\win." & str1 & "\vcc", "v")
    271          for each str2 in arrVccBinDirs
    272             if FileExists(strDir & str2 & "\cl.exe") then
    273                EnvAppendPathItem "Path", DosSlashes(strDir & str2), ";"
    274                if str2 = arrVccBinDirs(1) or str2 = arrVccBinDirs(2) then
    275                   EnvAppendPathItem "Path", DosSlashes(strDir & "bin"), ";"
    276                end if
     245   '
     246   ' We skip the extra stuff like gnuwin32, windbg, cl.exe and mingw64 if
     247   ' there is a command to execute.
     248   '
     249   if ArraySize(arrCmdToExec) = 0 then
     250      ' Add some gnuwin32 tools to the end of the path.
     251      EnvAppendPathItem "Path", DosSlashes(strPathDevTools & "\win.x86\gnuwin32\r1\bin"), ";"
     252
     253      ' Add the newest debugger we can find to the front of the path.
     254      dim strDir, blnStop
     255      bldExitLoop = false
     256      for each str1 in arrArchitectures
     257         for each strDir in GetSubdirsStartingWithRVerSorted(strPathDevTools & "\win." & str1 & "\sdk", "v")
     258            if FileExists(strWinDbgDir & "\Debuggers\" & XlateArchitectureToWin(strHostArch) & "\windbg.exe") then
     259               EnvPrependPathItem "Path", DosSlashes(strWinDbgDir & "\Debuggers\" & XlateArchitectureToWin(strHostArch)), ";"
    277260               bldExitLoop = true
    278261               exit for
     
    281264         if bldExitLoop then exit for
    282265      next
    283       if bldExitLoop then exit for
    284    next
    285 
    286    ' Add mingw64 if it's still there.
    287    if strHostArch = "amd64" or strTargetArch = "amd64" then
    288       str1 = strPathDev & "win.amd64\mingw-64\r1\bin"
    289       if DirExists(str1) then EnvAppendPathItem "Path", DosSlashes(str1), ";"
     266
     267      ' Add VCC to the end of the path.
     268      dim str2, strDir2, arrVccOldBinDirs
     269      arrVccOldBinDirs = Array("\bin\" & strHostArch & "_" & strTargetArch, "\bin\" & strTargetArch, "\bin")
     270      bldExitLoop = false
     271      for each str1 in Array("amd64", "x86")
     272         for each strDir in GetSubdirsStartingWithRVerSorted(strPathDevTools & "\win." & str1 & "\vcc", "v")
     273            strDir = strPathDevTools & "\win." & str1 & "\vcc\" & strDir
     274            if DirExists(strDir & "\Tools\MSVC") then
     275               for each strDir2 in GetSubdirsStartingWithRVerSorted(strDir & "\Tools\MSVC", "1")
     276                  strDir2 = strDir & "\Tools\MSVC\" & strDir2 & "\bin\Host" & XlateArchitectureToWin(strHostArch) _
     277                          & "\" & XlateArchitectureToWin(strTargetArch)
     278                  if FileExists(strDir2 & "\cl.exe") then
     279                     EnvAppendPathItem "Path", DosSlashes(strDir2), ";"
     280                     if strTargetArch <> strHostArch then
     281                        EnvAppendPathItem "Path", DosSlashes(PathStripFilename(strDir2) & "\" & XlateArchitectureToWin(strHostArch)), ";"
     282                     end if
     283                     bldExitLoop = true
     284                     exit for
     285                  end if
     286               next
     287            elseif DirExists(strDir & "\bin") then
     288               for each str2 in arrVccOldBinDirs
     289                  if FileExists(strDir & str2 & "\cl.exe") then
     290                     EnvAppendPathItem "Path", DosSlashes(strDir & str2), ";"
     291                     if str2 <> "\bin" then EnvAppendPathItem "Path", DosSlashes(strDir & "bin"), ";"
     292                     bldExitLoop = true
     293                     exit for
     294                  end if
     295               next
     296            end if
     297            if bldExitLoop then exit for
     298         next
     299         if bldExitLoop then exit for
     300      next
     301
     302      ' Add mingw64 if it's still there.
     303      if strHostArch = "amd64" or strTargetArch = "amd64" then
     304         str1 = strPathDev & "win.amd64\mingw-64\r1\bin"
     305         if DirExists(str1) then EnvAppendPathItem "Path", DosSlashes(str1), ";"
     306      end if
    290307   end if
    291308
Note: See TracChangeset for help on using the changeset viewer.

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