Changeset 85715 in vbox
- Timestamp:
- Aug 12, 2020 1:54:57 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/configure.vbs
r85653 r85715 764 764 765 765 '' 766 ' Helper for EnvPrintPrepend and EnvPrintAppend. 767 sub 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 & "%" 774 end sub 775 776 '' Use by EnvPrintPrepend to skip ';' stripping. 777 dim g_strPrependCleanEnvVars 778 779 '' 780 ' Print a statement prepending strValue to strEnv, removing duplicate values. 781 sub 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 & "%" 791 end sub 792 793 794 '' Use by EnvPrintPrepend to skip ';' stripping. 795 dim g_strAppendCleanEnvVars 796 797 '' 798 ' Print a statement appending strValue to strEnv, removing duplicate values. 799 sub 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 809 end sub 810 811 812 '' 766 813 ' No COM 767 814 sub DisableCOM(strReason) … … 968 1015 end if 969 1016 end if 1017 g_strPathkBuildBin = UnixSlashes(PathAbs(g_strPathkBuildBin)) 970 1018 971 1019 ' … … 994 1042 ' If PATH_DEV is set, check that it's pointing to something useful. 995 1043 ' 1044 ''' @todo wtf is this supposed to be again? Nobody uses it afaikt. 996 1045 str = EnvGet("PATH_DEV") 997 1046 g_strPathDev = str … … 1007 1056 1008 1057 ' 1009 ' Write KBUILD_PATH to the environment script if necessary.1058 ' Write KBUILD_PATH and updated PATH to the environment script if necessary. 1010 1059 ' 1011 1060 if blnNeedEnvVars = True then 1012 1061 EnvPrint "set KBUILD_PATH=" & g_strPathkBuild 1013 1062 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), ";" 1015 1071 EnvPrepend "PATH", g_strPathkBuildBin & ";" 1016 1072 end if … … 1159 1215 ' and the env.bat path fix. 1160 1216 if strPathVCCommon <> "" then 1161 EnvPrint "set PATH=%PATH%;" & strPathVCCommon & "/IDE;"1217 EnvPrintAppend "PATH", DosSlashes(strPathVCCommon) & "\IDE", ";" 1162 1218 end if 1163 1219 end sub … … 1688 1744 if bln32Bit = True then 1689 1745 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 1690 1754 end if 1691 1755 … … 2019 2083 CfgPrint "VBOX_WITH_LIBVPX := " '' @todo look for libvpx 1.1.0+ 2020 2084 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 2022 2092 if blnOptDisableSDL = True then 2023 2093 DisableSDL "--disable-sdl"
Note:
See TracChangeset
for help on using the changeset viewer.