Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

165 lines
5.2 KiB

  1. @echo off
  2. if not "%1"=="" set _ntdrive=%1
  3. if not "%2"=="" set _ntroot=%2
  4. rem
  5. rem Extract _ntdrive and _ntroot from the path of this batch file.
  6. rem _ntroot is expected to be exactly three characters long (e.g. \nt, \ie)
  7. rem
  8. if "%_ntdrive%"=="" set _ntdrive=%~d0
  9. if NOT "%_ntroot%"=="" goto skip
  10. set _ntroot=%~f0
  11. set _ntroot=%_ntroot:~2,3%
  12. :skip
  13. set _ntbindir=%_ntdrive%%_ntroot%
  14. set _ieroot=%_ntroot%
  15. set use_switches_in_retail_build=1
  16. if not "%processor_architecture%" == "x86" set build_default_targets=-%processor_architecture%
  17. set mshtmenv=1
  18. set NO_BINPLACE=1
  19. if "%OS%"=="Windows_NT" goto WinNT
  20. echo.
  21. echo This batch file does not support non-NT systems.
  22. echo.
  23. goto done
  24. :WinNT
  25. rem
  26. rem set the MSHTML environment variable to the name of the mshtml directory
  27. rem (:getmshtml is at the bottom of this file).
  28. rem
  29. call :getmshtml %~p0
  30. if "%MSHTML%" == "" set MSHTML=mshtml
  31. rem
  32. rem Path trickyness (NT only): We want our final path to end up like this:
  33. rem path=<path set by ieenv.cmd>;<user's original path>;<mshtmenv additions>
  34. rem
  35. rem The problem is that ieenv.bat blows away your path entirely and you lose
  36. rem any additions you set in your global environment. As a result, we save
  37. rem the user's path, call ieenv.bat, and then reconstruct things ourselves
  38. rem afterward.
  39. rem
  40. rem
  41. rem Put all interesting paths in %temp%\mshtmenv.tmp in reverse order.
  42. rem Duplicates are removed later.
  43. rem
  44. echo %_ntbindir%\private\inet\%mshtml%\perf\bin> %temp%\mshtmenv.tmp
  45. rem Need to remove quotes from the existing path or it really messes us up.
  46. echo %path:"=%>%temp%\mshtmenv2.tmp
  47. for /F "tokens=1-26 delims=;=" %%a in (%temp%\mshtmenv2.tmp) do call :writepath "%%z" "%%y" "%%x" "%%w" "%%v" "%%u" "%%t" "%%s" "%%r" "%%q" "%%p" "%%o" "%%n" "%%m" "%%l" "%%k" "%%j" "%%i" "%%h" "%%g" "%%f" "%%e" "%%d" "%%c" "%%b"
  48. call %_ntdrive%%_ntroot%\bin\ieenv.cmd
  49. rem Have to put this here since it uses %_ntuser%
  50. echo %_ntbindir%\private\developr\%_ntuser%>> %temp%\mshtmenv.tmp
  51. echo %path:"=%>%temp%\mshtmenv2.tmp
  52. for /F "tokens=1-26 delims=;=" %%a in (%temp%\mshtmenv2.tmp) do call :writepath "%%z" "%%y" "%%x" "%%w" "%%v" "%%u" "%%t" "%%s" "%%r" "%%q" "%%p" "%%o" "%%n" "%%m" "%%l" "%%k" "%%j" "%%i" "%%h" "%%g" "%%f" "%%e" "%%d" "%%c" "%%b"
  53. path .
  54. set /A linecnt=0
  55. for /F "tokens=*" %%a in (%temp%\mshtmenv.tmp) do call :addtopath "%%a"
  56. del /q %temp%\mshtmenv.tmp >nul 2>nul
  57. del /q %temp%\mshtmenv2.tmp >nul 2>nul
  58. :setenv
  59. set ntdebug=ntsd
  60. set ntdebugtype=both
  61. set ntdbgfiles=1
  62. set msc_optimization=/Odi
  63. set BUILD_OPTIONS=%BUILD_OPTIONS% -w
  64. set BUILD_DEFAULT=%BUILD_DEFAULT% %MSHTML%
  65. set BUILD_PRODUCT=IE
  66. if "%use_mshtml_incremental_linking%"=="" set use_mshtml_incremental_linking=%3
  67. if %NUMBER_OF_PROCESSORS% GTR 1 if "%1" == "" set use_mshtml_incremental_linking=0
  68. if "%use_mshtml_incremental_linking%"=="" set use_mshtml_incremental_linking=1
  69. if "%use_mshtml_incremental_linking%"=="1" set use_mshtml_pdb_rules=1
  70. rem
  71. rem We no longer need to update the i386mk.inc or alphamk.inc files. But we need to make sure
  72. rem they are not checked out and that you have the latest version.
  73. rem
  74. copy %_ntdrive%%_ntroot%\public\oak\bin\i386mk.inc %temp%\i386mk.inc 1>nul: 2>nul:
  75. if errorlevel 1 goto nocopy1
  76. copy %temp%\i386mk.inc %_ntdrive%%_ntroot%\public\oak\bin\i386mk.inc 1>nul: 2>nul:
  77. if errorlevel 1 goto doalpha
  78. echo mshtmenv: i386mk.inc is read/write; performing "in -i & ssync"
  79. pushd %_ntdrive%%_ntroot%\public\oak\bin\
  80. in -!fi i386mk.inc
  81. ssync i386mk.inc
  82. popd
  83. goto :doalpha
  84. :nocopy1
  85. echo mshtmenv: Unable to copy i386mk.inc to %temp%\i386mk.inc
  86. goto :doalpha
  87. :doalpha
  88. copy %_ntdrive%%_ntroot%\public\oak\bin\alphamk.inc %temp%\alphamk.inc 1>nul: 2>nul:
  89. if errorlevel 1 goto nocopy2
  90. copy %temp%\alphamk.inc %_ntdrive%%_ntroot%\public\oak\bin\alphamk.inc 1>nul: 2>nul:
  91. if errorlevel 1 goto alphadone
  92. echo mshtmenv: alphamk.inc is read/write; performing "in -i & ssync"
  93. pushd %_ntdrive%%_ntroot%\public\oak\bin\
  94. in -!fi alphamk.inc
  95. ssync alphamk.inc
  96. popd
  97. goto :alphadone
  98. :nocopy2
  99. echo mshtmenv: Unable to copy alphamk.inc to %temp%\alphamk.inc
  100. goto :alphadone
  101. :alphadone
  102. goto :done
  103. :getmshtml
  104. rem
  105. rem Strip off one directory name at a time until we get to the last directory
  106. rem name. (e.g. d:\nt\private\inet\mshtml\ == mshtml) There's no way to
  107. rem strip off from the end, we have to get rid of one directory at a time
  108. rem from the beginning.
  109. rem
  110. set temppath=%1
  111. set temppath=%temppath:*\=%
  112. if NOT "%temppath%" == "" call :getmshtml %temppath% & goto :eof
  113. set MSHTML=%1
  114. rem Get rid of trailing slash
  115. set MSHTML=%MSHTML:\=%
  116. goto :eof
  117. :writepath
  118. rem
  119. rem Loop through all the passed arguments and write them out to the temp file
  120. rem
  121. if {%1} == {} goto :eof
  122. if {%1} == {""} shift & goto :writepath
  123. set newdir=%1
  124. echo %newdir:"=%>> %temp%\mshtmenv.tmp
  125. shift
  126. goto :writepath
  127. :addtopath
  128. rem
  129. rem See if the given argument (a directory) occurs later in our file containing
  130. rem directories to add to our path. If not, then add it to our path.
  131. rem
  132. set /A linecnt=%linecnt%+1
  133. set newdir=%1
  134. set newdir=%newdir:"=%
  135. for /F "skip=%linecnt% tokens=*" %%i in (%temp%\mshtmenv.tmp) do if /I {"%%i"} == {%1} goto :eof
  136. path %newdir%;%path%
  137. goto :eof
  138. :done