anchor.diff:  @if /i NOT %builddxtn%==y GOTO build_mesa
   @set PATH=%gcc%\;%PATH%
   @cd "%mesa%dxtn"
  +@echo.
   @RD /S /Q %abi%
  +@echo.
   @MD %abi%
   @set dxtn=gcc -shared
   @if %abi%==x86 set dxtn=%dxtn% -m32
   @set dxtn=%dxtn% -v *.c *.h -I ..\mesa\include -Wl,--dll,--dynamicbase,--enable-auto-image-base,--nxcompat -o %abi%\dxtn.dll
  -@echo.
   @%dxtn%
   @echo.
   @set dxtnbuilt=1
  
positive.code: @set vsenv=%ProgramFiles%
  @if NOT "%ProgramW6432%"=="" set vsenv=%vsenv% (x86)
  @set vsenv15=%vsenv%\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars%minabi%.bat
  @if EXIST "%vsenv15%" @set toolchain=Visual Studio 15 2017
  @if NOT EXIST "%vsenv15%" @set toolchain=Visual Studio 14
  @set vsenv14=%VS140COMNTOOLS%..\..\VC\bin\vcvars%minabi%.bat
  @if %abi%==x64 @set toolchain=%toolchain% Win64
  @set gcc=%mesa%mingw-w64-%abi%\mingw%minabi%\bin
  @set vsenvloaded=0
  @set dxtnbuilt=0
  @set /p buildllvm=Begin LLVM build. Only needs to run once for each ABI and version. Proceed y/n? 
  @if /I NOT %buildllvm%==y GOTO build_dxtn
  
  :build_llvm
  @cd "%mesa%llvm"
  @RD /S /Q %abi%
  @RD /S /Q cmake-%abi%
  @md cmake-%abi%
  @cd cmake-%abi%
  @if EXIST "%vsenv15%" set vsenv=%vsenv15%
  @if NOT EXIST "%vsenv15%" set vsenv=%vsenv14%
  @set vsenvloaded=1
  @call "%vsenv%"
  @set PATH=%mesa%cmake\%abi%\bin\;%PATH%
  @cmake -G "%toolchain%" -DLLVM_TARGETS_TO_BUILD=X86 -DLLVM_ENABLE_RTTI=1 -DLLVM_USE_CRT_RELEASE=MT -DLLVM_ENABLE_TERMINFO=OFF -DCMAKE_INSTALL_PREFIX=%mesa:\=/%llvm/%abi% ..
  @pause
  @msbuild /p:Configuration=Release INSTALL.vcxproj
  @pause
  
  :build_dxtn
  @if NOT EXIST "%gcc%" GOTO build_mesa
  
negative.code: pip install -r requirements.txt --upgrade
  cd $mesa
  cd mesa
  
  
  :build_with_vs
  @RD /S /Q build\windows-%longabi%
  @echo.
  @set PATH=%mesa%Python\%abi%\;%mesa%Python\%abi%\Scripts\;%mesa%flexbison\;%mesa%m4\%abi%\usr\bin\;%PATH%
  @pip install -U mako
  @pip freeze > requirements.txt
  @pip install -r requirements.txt --upgrade
  @del requirements.txt
  @set restartcond=0
  @set vs2017toolset=n
  @echo.
  @if EXIST "%vsenv15%" set /p vs2017toolset=Do you want to build with Visual Studio 2017 toolset (y/n) - WARNING, this is a hack, it will break if Mesa MSVC build gets support for LLVM 4.0 before Scons gets support for MSVC 2017:
  @if /i %vs2017toolset%==y @set vsenvloaded=%vsenvloaded%15
  @if /i NOT %vs2017toolset%==y @set vsenvloaded=%vsenvloaded%14
  @if %vsenvloaded%==01514 set restartcond=1
  @echo.
  @if %vsenvloaded%==015 call "%vsenv15%"
  @if %vsenvloaded%==014 call "%vsenv14%"
  @if %restartcond%==1 (
  @echo.
  @echo A Visual Studio build environment is already loaded. The script will now restart to flush loaded environment.
  @pause
  @GOTO exit
  )
  @echo.
  
  :build_mesa_exec
  @python "%mesa%Python\%abi%\Scripts\scons.py" build=release platform=windows machine=%longabi% toolchain=%mesatoolchain% swr=%buildswr% libgl-gdi
  @echo.
  @pause
  
  :exit
  