Source code of Windows XP (NT5)
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.

148 lines
6.2 KiB

  1. @echo off
  2. REM ------------------------------------------------------------------
  3. REM
  4. REM bindsys.cmd
  5. REM Binds the NT system binaries
  6. REM
  7. REM Copyright (c) Microsoft Corporation. All rights reserved.
  8. REM
  9. REM ------------------------------------------------------------------
  10. if defined _CPCMAGIC goto CPCBegin
  11. perl -x "%~f0" %*
  12. goto :EOF
  13. #!perl
  14. use strict;
  15. use lib $ENV{RAZZLETOOLPATH} . "\\PostBuildScripts";
  16. use lib $ENV{RAZZLETOOLPATH};
  17. use PbuildEnv;
  18. use ParseArgs;
  19. sub Usage { print<<USAGE; exit(1) }
  20. $ENV{SCRIPT_NAME} [-l <language]
  21. Binds the NT binaries. Run during postbuild.
  22. USAGE
  23. sub Dependencies {
  24. if ( !open DEPEND, ">>$ENV{_NTPOSTBLD}\\..\\build_logs\\dependencies.txt" ) {
  25. errmsg("Unable to open dependency list file.");
  26. die;
  27. }
  28. print DEPEND<<DEPENDENCIES;
  29. \[$0\]
  30. IF {...} ADD {}
  31. DEPENDENCIES
  32. close DEPEND;
  33. exit;
  34. }
  35. parseargs('?' => \&Usage,
  36. 'plan' => \&Dependencies,
  37. 'qfe:' => \$ENV{QFE});
  38. if ( -f "$ENV{_NTPOSTBLD}\\..\\build_logs\\skip.txt" ) {
  39. if ( !open SKIP, "$ENV{_NTPOSTBLD}\\..\\build_logs\\skip.txt" ) {
  40. errmsg("Unable to open skip list file.");
  41. die;
  42. }
  43. while (<SKIP>) {
  44. chomp;
  45. exit if lc$_ eq lc$0;
  46. }
  47. close SKIP;
  48. }
  49. # *** NEXT FEW LINES ARE TEMPLATE ***
  50. $ENV{"_CPCMAGIC"}++;exit(system($0)>>8);
  51. __END__
  52. :CPCBegin
  53. set _CPCMAGIC=
  54. setlocal ENABLEDELAYEDEXPANSION ENABLEEXTENSIONS
  55. REM *** BEGIN YOUR CMD SCRIPT BELOW ***
  56. if defined ia64 goto :EOF
  57. if defined amd64 goto :EOF
  58. if defined QFE goto :EOF
  59. :OK
  60. REM ---------------------------------------------------------------------------
  61. REM BINDSYS.CMD - bind the NT binaries
  62. REM
  63. REM ---------------------------------------------------------------------------
  64. set binplacedir=%_NTPostBld%
  65. set bindlog=%binplacedir%\build_logs\bind.log
  66. REM
  67. REM To work around imagehlp::BindImageEx/ImageLoad's assumption of . being in the path,
  68. REM we must not be sitting in the binaries directory, so that asms\...\comctl32.dll can
  69. REM beat retail\comctl32.dll. We must list %binplacedir%; explicitly in many paths
  70. REM where before we did not.
  71. REM
  72. REM As well, we don't want to be in some random directory that contains .dlls, like
  73. REM %windir%\system32 or %sdxroot%\tools\x86
  74. REM
  75. REM presumably no .dlls in %binplacedir%\build_logs
  76. REM other good choices might be \ or %windir%\config or %binplacedir%\symbols or %binplacedir%\asms
  77. REM
  78. pushd %binplacedir%\build_logs
  79. REM ------------------------------------------------
  80. REM Exclude these crypto binaries:
  81. REM ------------------------------------------------
  82. set Excludeexe=
  83. for %%i in (ntoskrnl ntkrnlmp ntkrnlpa ntkrpamp) do set Excludeexe=!Excludeexe! -x ..\%%i.exe
  84. set Excludedll=
  85. for %%i in (gpkcsp rsaenh dssenh ) do set Excludedll=!Excludedll! -x ..\%%i.dll
  86. for %%i in (slbcsp sccbase ) do set Excludedll=!Excludedll! -x ..\%%i.dll
  87. for %%i in (disdnci disdnsu ) do set Excludedll=!Excludedll! -x ..\%%i.dll
  88. for %%i in (scrdaxp scrdenrl scrdsign scrdx86) do set Excludedll=!Excludedll! -x ..\%%i.dll
  89. for %%i in (xenraxp xenroll xenrsign xenrx86 ) do set Excludedll=!Excludedll! -x ..\%%i.dll
  90. REM
  91. REM Bind TO asms, even in non usa builds..
  92. REM
  93. set asmspath=
  94. set asmspath=%asmspath%;%binplacedir%\asms\10100\msft\windows\gdiplus
  95. set asmspath=%asmspath%;%binplacedir%\asms\6000\msft\vcrtl
  96. set asmspath=%asmspath%;%binplacedir%\asms\60100\msft\windows\common\controls
  97. set asmspath=%asmspath%;%binplacedir%\asms\70100\msft\windows\mswincrt
  98. REM
  99. REM There was some wierdness with these, so we use the unabstracted ..\ instead.
  100. REM
  101. REM set System32=%binplacedir%\System32
  102. REM set MSTools=%binplacedir%\MSTools
  103. REM set IDW=%binplacedir%\IDW
  104. REM set Symbols=%binplacedir%\Symbols
  105. if exist ..\System32\*.dll Bind %Excludedll% -u -s ..\Symbols\system32 -p %asmspath%;..;..\System32 ..\System32\*.dll >>%bindlog% 2>&1
  106. if exist ..\System32\*.exe Bind %Excludeexe% -u -s ..\Symbols\system32 -p %asmspath%;..;..\System32 ..\System32\*.exe >>%bindlog% 2>&1
  107. if exist ..\System32\*.com Bind % -u -s ..\Symbols\system32 -p %asmspath%;..;..\System32 ..\System32\*.com >>%bindlog% 2>&1
  108. if exist ..\*.dll Bind %Excludedll% -u -s ..\Symbols\retail -p %asmspath%;..;..\System32 ..\*.dll >>%bindlog% 2>&1
  109. if exist ..\*.exe Bind %Excludeexe% -u -s ..\Symbols\retail -p %asmspath%;..;..\System32 ..\*.exe >>%bindlog% 2>&1
  110. if exist ..\*.cpl Bind %Excludedll% -u -s ..\Symbols\retail -p %asmspath%;..;..\System32 ..\*.cpl >>%bindlog% 2>&1
  111. if exist ..\*.com Bind -u -s ..\Symbols\retail -p %asmspath%;..;..\System32 ..\*.com >>%bindlog% 2>&1
  112. if exist ..\.ocx Bind -u -s ..\Symbols\retail -p %asmspath%;..;..\System32 ..\*.ocx >>%bindlog% 2>&1
  113. if exist ..\*.ax Bind -u -s ..\Symbols\retail -p %asmspath%;..;..\System32 ..\*.ax >>%bindlog% 2>&1
  114. if exist ..\*.scr Bind -u -s ..\Symbols\retail -p %asmspath%;..;..\System32 ..\*.scr >>%bindlog% 2>&1
  115. if exist ..\*.tsp Bind -u -s ..\Symbols\retail -p %asmspath%;..;..\System32 ..\*.tsp >>%bindlog% 2>&1
  116. if exist ..\*.drv Bind -u -s ..\Symbols\retail -p %asmspath%;..;..\System32 ..\*.drv >>%bindlog% 2>&1
  117. if exist ..\MSTools\*.dll Bind %Excludedll% -u -s ..\Symbols\mstools -p %asmspath%;..;..\MSTools;..\System32 ..\MSTools\*.dll >>%bindlog% 2>&1
  118. if exist ..\MSTools\*.exe Bind %Excludeexe% -u -s ..\Symbols\mstools -p %asmspath%;..;..\MSTools;..\System32 ..\MSTools\*.exe >>%bindlog% 2>&1
  119. if exist ..\MSTools\*.com Bind -u -s ..\Symbols\mstools -p %asmspath%;..;..\MSTools;..\System32 ..\MSTools\*.com >>%bindlog% 2>&1
  120. if exist ..\IDW\*.dll Bind %Excludedll% -u -s ..\Symbols\idw -p %asmspath%;..;..\IDW;..\MSTools;..\System32 ..\IDW\*.dll >>%bindlog% 2>&1
  121. if exist ..\IDW\*.exe Bind %Excludeexe% -u -s ..\Symbols\idw -p %asmspath%;..;IDW;..\MSTools;..\System32 ..\IDW\*.exe >>%bindlog% 2>&1
  122. if exist ..\IDW\*.com Bind -u -s ..\Symbols\idw -p %asmspath%;..;..\IDW;..\MSTools;..\System32 ..\IDW\*.com >>%bindlog% 2>&1
  123. REM
  124. REM ..but only bind FROM asms for usa builds.
  125. REM
  126. if /i "%LANG%" equ "usa" for /f %%i in ('dir /s/b/ad ..\asms') do Bind %Excludedll% -u -s ..\Symbols\retail -p %asmspath%;..;..\System32 %%i\*.dll >>%bindlog% 2>&1
  127. popd