VirtualBox

Changeset 85715 in vbox


Ignore:
Timestamp:
Aug 12, 2020 1:54:57 PM (4 years ago)
Author:
vboxsync
Message:

configure.vbs: Use curl from src/libs if no specific option. Remove duplicate PATH elements when modifying it.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/configure.vbs

    r85653 r85715  
    764764
    765765''
     766' Helper for EnvPrintPrepend and EnvPrintAppend.
     767sub EnvPrintCleanup(strEnv, strValue, strSep)
     768   dim cchValueAndSep
     769   FileAppendLine g_strEnvFile, "set " & strEnv & "=%" & strEnv & ":" & strSep & strValue & strSep & "=" & strSep & "%"
     770   cchValueAndSep = Len(strValue) + Len(strSep)
     771   FileAppendLine g_strEnvFile, "if ""%" & strEnv & "%""==""" & strValue & """ set " & strEnv & "="
     772   FileAppendLine g_strEnvFile, "if ""%" & strEnv & ":~0," & cchValueAndSep & "%""==""" & strValue & strSep & """ set " & strEnv & "=%" & strEnv & ":~" & cchValueAndSep & "%"
     773   FileAppendLine g_strEnvFile, "if ""%" & strEnv & ":~-"  & cchValueAndSep & "%""==""" & strSep & strValue & """  set " & strEnv & "=%" & strEnv & ":~0,-" & cchValueAndSep & "%"
     774end sub
     775
     776'' Use by EnvPrintPrepend to skip ';' stripping.
     777dim g_strPrependCleanEnvVars
     778
     779''
     780' Print a statement prepending strValue to strEnv, removing duplicate values.
     781sub EnvPrintPrepend(strEnv, strValue, strSep)
     782   ' Remove old values and any leading separators.
     783   EnvPrintCleanup strEnv, strValue, strSep
     784   if InStr(1, g_strPrependCleanEnvVars, "|" & strEnv & "|") = 0 then
     785      FileAppendLine g_strEnvFile, "if ""%" & strEnv & ":~0,1%""==""" & strSep & """ set " & strEnv & "=%" & strEnv & ":~1%"
     786      FileAppendLine g_strEnvFile, "if ""%" & strEnv & ":~0,1%""==""" & strSep & """ set " & strEnv & "=%" & strEnv & ":~1%"
     787      g_strPrependCleanEnvVars = g_strPrependCleanEnvVars & "|" & strEnv & "|"
     788   end if
     789   ' Do the setting
     790   FileAppendLine g_strEnvFile, "set " & strEnv & "=" & strValue & strSep & "%" & strEnv & "%"
     791end sub
     792
     793
     794'' Use by EnvPrintPrepend to skip ';' stripping.
     795dim g_strAppendCleanEnvVars
     796
     797''
     798' Print a statement appending strValue to strEnv, removing duplicate values.
     799sub EnvPrintAppend(strEnv, strValue, strSep)
     800   ' Remove old values and any trailing separators.
     801   EnvPrintCleanup strEnv, strValue, strSep
     802   if InStr(1, g_strAppendCleanEnvVars, "|" & strEnv & "|") = 0 then
     803      FileAppendLine g_strEnvFile, "if ""%" & strEnv & ":~-1%""==""" & strSep & """ set " & strEnv & "=%" & strEnv & ":~0,-1%"
     804      FileAppendLine g_strEnvFile, "if ""%" & strEnv & ":~-1%""==""" & strSep & """ set " & strEnv & "=%" & strEnv & ":~0,-1%"
     805      g_strAppendCleanEnvVars = g_strAppendCleanEnvVars & "|" & strEnv & "|"
     806   end if
     807   ' Do the setting.
     808   FileAppendLine g_strEnvFile, "set " & strEnv & "=%" & strEnv & "%" & strSep & strValue
     809end sub
     810
     811
     812''
    766813' No COM
    767814sub DisableCOM(strReason)
     
    9681015      end if
    9691016   end if
     1017   g_strPathkBuildBin = UnixSlashes(PathAbs(g_strPathkBuildBin))
    9701018
    9711019   '
     
    9941042   ' If PATH_DEV is set, check that it's pointing to something useful.
    9951043   '
     1044   ''' @todo wtf is this supposed to be again?  Nobody uses it afaikt.
    9961045   str = EnvGet("PATH_DEV")
    9971046   g_strPathDev = str
     
    10071056
    10081057   '
    1009    ' Write KBUILD_PATH to the environment script if necessary.
     1058   ' Write KBUILD_PATH and updated PATH to the environment script if necessary.
    10101059   '
    10111060   if blnNeedEnvVars = True then
    10121061      EnvPrint "set KBUILD_PATH=" & g_strPathkBuild
    10131062      EnvSet "KBUILD_PATH", g_strPathkBuild
    1014       EnvPrint "set PATH=" & g_strPathkBuildBin & ";%PATH%"
     1063
     1064      if Right(g_strPathkBuildBin, 7) = "win.x86" then
     1065         EnvPrintCleanup "PATH", DosSlashes(Left(g_strPathkBuildBin, Len(g_strPathkBuildBin) - 7) & "win.amd64"), ";"
     1066      end if
     1067      if Right(g_strPathkBuildBin, 9) = "win.amd64" then
     1068         EnvPrintCleanup "PATH", DosSlashes(Left(g_strPathkBuildBin, Len(g_strPathkBuildBin) - 9) & "win.x86"), ";"
     1069      end if
     1070      EnvPrintPrepend "PATH", DosSlashes(g_strPathkBuildBin), ";"
    10151071      EnvPrepend "PATH", g_strPathkBuildBin & ";"
    10161072   end if
     
    11591215   ' and the env.bat path fix.
    11601216   if strPathVCCommon <> "" then
    1161       EnvPrint "set PATH=%PATH%;" & strPathVCCommon & "/IDE;"
     1217      EnvPrintAppend "PATH", DosSlashes(strPathVCCommon) & "\IDE", ";"
    11621218   end if
    11631219end sub
     
    16881744   if bln32Bit = True then
    16891745       strCurl = "libcurl32"
     1746   end if
     1747
     1748   '
     1749   ' Part of tarball / svn, so we can exit immediately if no path was specified.
     1750   '
     1751   if (strOptCurl = "") then
     1752      PrintResult strCurl, "src/libs/curl-*"
     1753      exit sub
    16901754   end if
    16911755
     
    20192083   CfgPrint "VBOX_WITH_LIBVPX := " '' @todo look for libvpx 1.1.0+
    20202084   CfgPrint "VBOX_WITH_LIBOPUS := " '' @todo look for libopus 1.2.1+
    2021    EnvPrint "set PATH=%PATH%;" & g_strPath& "/tools/win." & g_strTargetArch & "/bin;" '' @todo look for yasm
     2085
     2086   EnvPrintAppend "PATH", DosSlashes(g_strPath & "\tools\win." & g_strHostArch & "\bin"), ";" '' @todo look for yasm
     2087   if g_strHostArch = "amd64" then
     2088      EnvPrintAppend "PATH", DosSlashes(g_strPath & "\tools\win.x86\bin"), ";"
     2089   else
     2090      EnvPrintCleanup "PATH", DosSlashes(g_strPath & "\tools\win.amd64\bin"), ";"
     2091   end if
    20222092   if blnOptDisableSDL = True then
    20232093      DisableSDL "--disable-sdl"
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