@TITLE Building Mesa3D
@cd "%~dp0"
@cd ..\..\
@for %%I in ("%cd%") do @set mesa=%%~sI
@set mesa=%mesa%\
@where /q cmake.exe
@IF ERRORLEVEL 1 set PATH=%mesa%cmake\bin\;%PATH%
@set ERRORLEVEL=0
@where /q python.exe
@IF ERRORLEVEL 1 set PATH=%mesa%Python\;%mesa%Python\Scripts\;%PATH%
@set ERRORLEVEL=0
@set pyupd=n
@where python.exe>pyupd.ini
@set /p pythonloc=<pyupd.ini
@set makoloc="%pythonloc:python.exe=%Lib\site-packages\mako"
@set sconsloc="%pythonloc:python.exe=%Scripts\scons.py"
@if NOT EXIST %makoloc% set pyupd=y
@if EXIST %makoloc% set /p pyupd=Install/update python modules (y/n):
@if /I "%pyupd%"=="y" (
@python -m pip install -U wheel
@python -m pip install -U scons
@python -m pip install -U mako
@python -m pip freeze > requirements.txt
@python -m pip install -r requirements.txt --upgrade
@del requirements.txt
@echo.
)
@set abi=x86
@set /p x64=Do you want to build for x64? (y/n) Otherwise build for x86:
@if /I "%x64%"=="y" set abi=x64
@set longabi=%abi%
@if %abi%==x64 set longabi=x86_64
@set altabi=i686
@if %abi%==x64 set altabi=%longabi%
@set minabi=32
@if %abi%==x64 set minabi=64
@set targetabi=x86
@if %abi%==x64 set targetabi=amd64
@set hostabi=x86
@set vsenv="%ProgramFiles%
@if NOT "%ProgramW6432%"=="" set hostabi=amd64
@set vsabi=%minabi%
@if NOT %targetabi%==%hostabi% set vsabi=%hostabi%_%targetabi%
@if NOT "%ProgramW6432%"=="" set vsenv=%vsenv% (x86)
@set vsenv15=%vsenv%\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars%vsabi%.bat"
@if %vsabi%==32 set vsenv14=%VS140COMNTOOLS%..\..\VC\bin\vcvars%vsabi%.bat"
@if %vsabi%==64 set vsenv14=%VS140COMNTOOLS%..\..\VC\bin\%targetabi%\vcvars%vsabi%.bat"
@if NOT %targetabi%==%hostabi% set vsenv14=%VS140COMNTOOLS%..\..\VC\bin\%vsabi%\vcvars%vsabi%.bat"
@set gcc=%mesa%mingw-w64\%abi%\mingw%minabi%\bin
@set vsenvloaded=0
@set toolset=14
@if EXIST %vsenv15% set toolset=15
@if EXIST toolset-%abi%.ini set /p toolset=<toolset-%abi%.ini
@set vsenv=%vsenv14%
@if %toolset%==15 set vsenv=%vsenv15%
@set PATH=%mesa%flexbison\;%PATH%
@set oldpath=%PATH%
@TITLE Building Mesa3D %abi%

:build_llvm
@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 prep_mesa
@echo.
@cd %mesa%llvm
@if EXIST %abi% RD /S /Q %abi%
@if EXIST cmake-%abi% RD /S /Q cmake-%abi%
@md cmake-%abi%
@cd cmake-%abi%
@set toolchain=Visual Studio 14
@set toolset=14
@if EXIST %vsenv15% set toolchain=Visual Studio 15 2017
@if EXIST %vsenv15% set toolset=15
@set ninja=n
@set oldtoolset=n
@set x64compiler= -Thost=x64
@if EXIST %mesa%ninja set ninja=1
@if EXIST %vsenv15% set ninja=%ninja%2
@if %ninja%==12 set /p oldtoolset=Build with MSVC 2015 backward compatibility toolset, alternative solution for LLVM 3.9.1 build with Visual Studio 2017 (y/n):
@if %ninja%==12 echo.
@if /I "%oldtoolset%"=="y" set ninja=y
@if /I "%oldtoolset%"=="y" set toolset=14
@if %ninja%==12 set ninja=2
@if %ninja%==1 set ninja=2
@if %ninja%==2 set /p ninja=Use Ninja build system instead of MsBuild, there is no requirement to do this with the primary toolset though (y/n):
@echo.
@if /I "%ninja%"=="y" set toolchain=Ninja
@if /I "%ninja%"=="y" set x64compiler=
@if "%toolchain%"=="Ninja" set PATH=%mesa%ninja\;%PATH%
@set vsenv=%vsenv14%
@if %toolset%==15 set vsenv=%vsenv15%
@set llvmbuildsys=%CD%
@call %vsenv%
@set vsenvloaded=1
@echo.
@set modtoolchainabi=0
@if NOT "%toolchain%"=="Ninja" set modtoolchainabi=1
@if %abi%==x64 set modtoolchainabi=%modtoolchainabi%2
@if %modtoolchainabi%==12 set toolchain=%toolchain% Win64
@cd %llvmbuildsys%
@if NOT %hostabi%==amd64 set x64compiler=
@cmake -G "%toolchain%"%x64compiler% -DLLVM_TARGETS_TO_BUILD=X86 -DCMAKE_BUILD_TYPE=Release -DLLVM_USE_CRT_RELEASE=MT -DLLVM_ENABLE_RTTI=1 -DLLVM_ENABLE_TERMINFO=OFF -DCMAKE_INSTALL_PREFIX=../%abi% ..
@echo.
@pause
@echo.
@if NOT "%toolchain%"=="Ninja" cmake --build . --config Release --target install
@if "%toolchain%"=="Ninja" ninja install
@echo.
@echo %toolset% > %mesa%toolset-%abi%.ini

:prep_mesa
@set PATH=%oldpath%
@cd %mesa%
@set mesapatched=0
@set branch=none
@set haltmesabuild=n
@set prepfail=0
@where /q git.exe
@IF ERRORLEVEL 1 (
@set ERRORLEVEL=0
@echo Error: Git not found. Patching disabled.
@set prepfail=1
)
@if NOT EXIST mesa set mesapatched=0
@if NOT EXIST mesa echo Warning: Mesa3D source code not found.
@if NOT EXIST mesa set prepfail=%prepfail%2
@if %prepfail%==12 echo Fatal: Both Mesa code and Git are missing. At least one is required. Execution halted.
@if %prepfail%==12 GOTO distcreate
@if NOT EXIST mesa set /p haltmesabuild=Press Y to abort execution. Press any other key to download Mesa via Git:
@if /I "%haltmesabuild%"=="y" GOTO distcreate
@if NOT EXIST mesa set /p branch=Enter Mesa source code branch name - defaults to master:
@if "%branch%"=="" set branch=master
@if "%branch%"=="none" set branch=master
@if NOT EXIST mesa echo.
@if NOT EXIST mesa git clone --depth=1 --branch=%branch% git://anongit.freedesktop.org/mesa/mesa mesa
@cd mesa
@set /p mesaver=<VERSION
@set branch=%mesaver:~0,4%
@if EXIST mesapatched.ini GOTO build_mesa
@if %prepfail%==1 GOTO build_dxtn
@if "%branch%"=="17.2" git apply -v ..\mesa-dist-win\patches\scons-llvm5.patch
@git apply -v ..\mesa-dist-win\patches\s3tc.patch
@if NOT "%mesaver:~-5%"=="devel" git apply -v ..\mesa-dist-win\patches\scons3.patch
@set mesapatched=1
@echo %mesapatched% > mesapatched.ini
@echo.

:build_mesa
@set /p buildmesa=Begin mesa build. Proceed (y/n):
@if /i NOT "%buildmesa%"=="y" GOTO build_dxtn
@echo.
@set LLVM=%mesa%llvm\%abi%
@if NOT EXIST %LLVM% (
@echo Could not find LLVM, aborting mesa build.
@echo.
@pause
@GOTO build_dxtn
)
@cd %mesa%mesa
@set openswr=n
@set sconscmd=python %sconsloc% build=release platform=windows machine=%longabi% libgl-gdi
@if %abi%==x64 set /p openswr=Do you want to build OpenSWR drivers? (y=yes):
@echo.
@if /I "%openswr%"=="y" set sconscmd=%sconscmd% swr=1
@set /p osmesa=Do you want to build off-screen rendering drivers (y/n):
@echo.
@if /I "%osmesa%"=="y" set sconscmd=%sconscmd% osmesa
@set /p graw=Do you want to build graw library (y/n):
@echo.
@if /I "%graw%"=="y" set sconscmd=%sconscmd% graw-gdi
@GOTO build_with_vs

:build_with_mingw
@set mingw=n
@set mingwtest=0
@if EXIST %gcc% set mingwtest=1
@set msys2=%mesa%msys64\msys2_shell.cmd
@if EXIST %msys2% set mingwtest=%mingwtest%2
@if %mingwtest%==12 set /p mingw=Do you want to build with MinGW-W64 instead of Visual Studio (y=yes):
@set ERRORLEVEL=0
@where /q gcc.exe
@IF ERRORLEVEL 1 set PATH=%gcc%\;%PATH%
@set ERRORLEVEL=0
@if /I "%mingw%"=="y" set sconscmd=%sconscmd% toolchain=crossmingw
@if /I "%mingw%"=="y" copy %gcc%\%altabi%-w64-mingw32-gcc-ar.exe %gcc%\%altabi%-w64-mingw32-ar.exe
@if /I "%mingw%"=="y" copy %gcc%\%altabi%-w64-mingw32-gcc-ranlib.exe %gcc%\%altabi%-w64-mingw32-ranlib.exe
@if /I "%mingw%"=="y" call "%msys2%" -use-full-path
@if /I "%mingw%"=="y" (
pacman -Syu
pacman -S python2
wget https://bootstrap.pypa.io/get-pip.py
python2 get-pip.py
pip install -U mako
pip install -U scons
pip freeze > requirements.txt
pip install -r requirements.txt --upgrade
cd $mesa
cd mesa
GOTO build_mesa_exec
)

:build_with_vs
@set cleanbuild=n
@if EXIST build\windows-%longabi% set /p cleanbuild=Do you want to clean build (y/n):
@if EXIST build\windows-%longabi% echo.
@if /I "%cleanbuild%"=="y" RD /S /Q build\windows-%longabi%
@cd %mesa%mesa
@echo.

:build_mesa_exec
@set dummygitver=#define MESA_GIT_SHA1 "git-"
@if %prepfail%==1 echo %dummygitver% > %mesa%mesa\build\windows-%abi%\git_sha1.h
@%sconscmd%
@echo.

:build_dxtn
@if NOT EXIST %gcc% GOTO distcreate
@if NOT EXIST %mesa%dxtn GOTO distcreate
@set /p builddxtn=Do you want to build S3 texture compression library? (y/n):
@if /i NOT "%builddxtn%"=="y" GOTO distcreate
@set PATH=%gcc%\;%PATH%
@cd %mesa%dxtn
@echo.
@if EXIST %abi% RD /S /Q %abi%
@MD %abi%
@set dxtn=gcc -shared -m%minabi% -v *.c *.h -I ..\mesa\include -Wl,--dll,--dynamicbase,--enable-auto-image-base,--nxcompat -o %abi%\dxtn.dll
@%dxtn%
@echo.

:distcreate
@set /p dist=Create or update Mesa3D distribution package (y/n):
@echo.
@if /I NOT "%dist%"=="y" GOTO exit
@cd %mesa%
@if NOT EXIST mesa-dist-win MD mesa-dist-win
@cd mesa-dist-win
@if NOT EXIST bin MD bin
@cd bin
@if EXIST %abi% RD /S /Q %abi%
@MD %abi%
@cd %abi%
@copy %mesa%mesa\build\windows-%longabi%\gallium\targets\libgl-gdi\opengl32.dll opengl32.dll
@if %abi%==x64 copy %mesa%mesa\build\windows-%longabi%\gallium\drivers\swr\swrAVX.dll swrAVX.dll
@if %abi%==x64 copy %mesa%mesa\build\windows-%longabi%\gallium\drivers\swr\swrAVX2.dll swrAVX2.dll
@copy %mesa%mesa\build\windows-%longabi%\mesa\drivers\osmesa\osmesa.dll osmesa-swrast.dll
@copy %mesa%mesa\build\windows-%longabi%\gallium\targets\osmesa\osmesa.dll osmesa-gallium.dll
@copy %mesa%mesa\build\windows-%longabi%\gallium\targets\graw-gdi\graw.dll graw.dll
@copy %mesa%dxtn\%abi%\dxtn.dll dxtn.dll
@echo.
@pause

:exit
exit

@TITLE Building Mesa3D
@cd "%~dp0"
@cd ..\..\
@for %%I in ("%cd%") do @set mesa=%%~sI
@set mesa=%mesa%\
@where /q cmake.exe
@IF ERRORLEVEL 1 set PATH=%mesa%cmake\bin\;%PATH%
@set ERRORLEVEL=0
@where /q python.exe
@IF ERRORLEVEL 1 set PATH=%mesa%Python\;%mesa%Python\Scripts\;%PATH%
@set ERRORLEVEL=0
@set pyupd=n
@where python.exe>pyupd.ini
@set /p pythonloc=<pyupd.ini
@set makoloc="%pythonloc:python.exe=%Lib\site-packages\mako"
@set sconsloc="%pythonloc:python.exe=%Scripts\scons.py"
@if NOT EXIST %makoloc% (
@python -m pip install wheel
@python -m pip install scons
@python -m pip install mako
@python -m pip freeze > requirements.txt
@python -m pip install -r requirements.txt --upgrade
@del requirements.txt
@echo.
)
@if EXIST %makoloc% set /p pyupd=Install/update python modules (y/n):
@if /I "%pyupd%"=="y" (
@python -m pip freeze > requirements.txt
@python -m pip install -r requirements.txt --upgrade
@del requirements.txt
@echo.
)
@set abi=x86
@set /p x64=Do you want to build for x64? (y/n) Otherwise build for x86:
@if /I "%x64%"=="y" set abi=x64
@set longabi=%abi%
@if %abi%==x64 set longabi=x86_64
@set altabi=i686
@if %abi%==x64 set altabi=%longabi%
@set minabi=32
@if %abi%==x64 set minabi=64
@set targetabi=x86
@if %abi%==x64 set targetabi=amd64
@set hostabi=x86
@set vsenv="%ProgramFiles%
@if NOT "%ProgramW6432%"=="" set hostabi=amd64
@set vsabi=%minabi%
@if NOT %targetabi%==%hostabi% set vsabi=%hostabi%_%targetabi%
@if NOT "%ProgramW6432%"=="" set vsenv=%vsenv% (x86)
@set vsenv15=%vsenv%\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars%vsabi%.bat"
@if %vsabi%==32 set vsenv14=%VS140COMNTOOLS%..\..\VC\bin\vcvars%vsabi%.bat"
@if %vsabi%==64 set vsenv14=%VS140COMNTOOLS%..\..\VC\bin\%targetabi%\vcvars%vsabi%.bat"
@if NOT %targetabi%==%hostabi% set vsenv14=%VS140COMNTOOLS%..\..\VC\bin\%vsabi%\vcvars%vsabi%.bat"
@set gcc=%mesa%mingw-w64\%abi%\mingw%minabi%\bin
@set vsenvloaded=0
@set toolset=14
@if EXIST %vsenv15% set toolset=15
@if EXIST toolset-%abi%.ini set /p toolset=<toolset-%abi%.ini
@set vsenv=%vsenv14%
@if %toolset%==15 set vsenv=%vsenv15%
@set PATH=%mesa%flexbison\;%PATH%
@set oldpath=%PATH%
@TITLE Building Mesa3D %abi%

:build_llvm
@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 prep_mesa
@echo.
@cd %mesa%llvm
@if EXIST %abi% RD /S /Q %abi%
@if EXIST cmake-%abi% RD /S /Q cmake-%abi%
@md cmake-%abi%
@cd cmake-%abi%
@set toolchain=Visual Studio 14
@set toolset=14
@if EXIST %vsenv15% set toolchain=Visual Studio 15 2017
@if EXIST %vsenv15% set toolset=15
@set ninja=n
@set oldtoolset=n
@set x64compiler= -Thost=x64
@if EXIST %mesa%ninja set ninja=1
@if EXIST %vsenv15% set ninja=%ninja%2
@if %ninja%==12 set /p oldtoolset=Build with MSVC 2015 backward compatibility toolset, alternative solution for LLVM 3.9.1 build with Visual Studio 2017 (y/n):
@if %ninja%==12 echo.
@if /I "%oldtoolset%"=="y" set ninja=y
@if /I "%oldtoolset%"=="y" set toolset=14
@if %ninja%==12 set ninja=2
@if %ninja%==1 set ninja=2
@if %ninja%==2 set /p ninja=Use Ninja build system instead of MsBuild, there is no requirement to do this with the primary toolset though (y/n):
@echo.
@if /I "%ninja%"=="y" set toolchain=Ninja
@if /I "%ninja%"=="y" set x64compiler=
@if "%toolchain%"=="Ninja" set PATH=%mesa%ninja\;%PATH%
@set vsenv=%vsenv14%
@if %toolset%==15 set vsenv=%vsenv15%
@set llvmbuildsys=%CD%
@call %vsenv%
@set vsenvloaded=1
@echo.
@set modtoolchainabi=0
@if NOT "%toolchain%"=="Ninja" set modtoolchainabi=1
@if %abi%==x64 set modtoolchainabi=%modtoolchainabi%2
@if %modtoolchainabi%==12 set toolchain=%toolchain% Win64
@cd %llvmbuildsys%
@if NOT %hostabi%==amd64 set x64compiler=
@cmake -G "%toolchain%"%x64compiler% -DLLVM_TARGETS_TO_BUILD=X86 -DCMAKE_BUILD_TYPE=Release -DLLVM_USE_CRT_RELEASE=MT -DLLVM_ENABLE_RTTI=1 -DLLVM_ENABLE_TERMINFO=OFF -DCMAKE_INSTALL_PREFIX=../%abi% ..
@echo.
@pause
@echo.
@if NOT "%toolchain%"=="Ninja" cmake --build . --config Release --target install
@if "%toolchain%"=="Ninja" ninja install
@echo.
@echo %toolset% > %mesa%toolset-%abi%.ini

:prep_mesa
@set PATH=%oldpath%
@cd %mesa%
@set mesapatched=0
@set branch=none
@set haltmesabuild=n
@set prepfail=0
@where /q git.exe
@IF ERRORLEVEL 1 (
@set ERRORLEVEL=0
@echo Error: Git not found. Patching disabled.
@set prepfail=1
)
@if NOT EXIST mesa set mesapatched=0
@if NOT EXIST mesa echo Warning: Mesa3D source code not found.
@if NOT EXIST mesa set prepfail=%prepfail%2
@if %prepfail%==12 echo Fatal: Both Mesa code and Git are missing. At least one is required. Execution halted.
@if %prepfail%==12 GOTO distcreate
@if NOT EXIST mesa set /p haltmesabuild=Press Y to abort execution. Press any other key to download Mesa via Git:
@if /I "%haltmesabuild%"=="y" GOTO distcreate
@if NOT EXIST mesa set /p branch=Enter Mesa source code branch name - defaults to master:
@if "%branch%"=="" set branch=master
@if "%branch%"=="none" set branch=master
@if NOT EXIST mesa echo.
@if NOT EXIST mesa git clone --depth=1 --branch=%branch% git://anongit.freedesktop.org/mesa/mesa mesa
@cd mesa
@set /p mesaver=<VERSION
@set branch=%mesaver:~0,4%
@if EXIST mesapatched.ini GOTO build_mesa
@if %prepfail%==1 GOTO build_dxtn
@if "%branch%"=="17.2" git apply -v ..\mesa-dist-win\patches\scons-llvm5.patch
@git apply -v ..\mesa-dist-win\patches\s3tc.patch
@if NOT "%mesaver:~-5%"=="devel" git apply -v ..\mesa-dist-win\patches\scons3.patch
@set mesapatched=1
@echo %mesapatched% > mesapatched.ini
@echo.

:build_mesa
@set /p buildmesa=Begin mesa build. Proceed (y/n):
@if /i NOT "%buildmesa%"=="y" GOTO build_dxtn
@echo.
@set LLVM=%mesa%llvm\%abi%
@if NOT EXIST %LLVM% (
@echo Could not find LLVM, aborting mesa build.
@echo.
@pause
@GOTO build_dxtn
)
@cd %mesa%mesa
@set openswr=n
@set sconscmd=python %sconsloc% build=release platform=windows machine=%longabi% libgl-gdi
@if %abi%==x64 set /p openswr=Do you want to build OpenSWR drivers? (y=yes):
@echo.
@if /I "%openswr%"=="y" set sconscmd=%sconscmd% swr=1
@set /p osmesa=Do you want to build off-screen rendering drivers (y/n):
@echo.
@if /I "%osmesa%"=="y" set sconscmd=%sconscmd% osmesa
@set /p graw=Do you want to build graw library (y/n):
@echo.
@if /I "%graw%"=="y" set sconscmd=%sconscmd% graw-gdi
@GOTO build_with_vs

:build_with_mingw
@set mingw=n
@set mingwtest=0
@if EXIST %gcc% set mingwtest=1
@set msys2=%mesa%msys64\msys2_shell.cmd
@if EXIST %msys2% set mingwtest=%mingwtest%2
@if %mingwtest%==12 set /p mingw=Do you want to build with MinGW-W64 instead of Visual Studio (y=yes):
@set ERRORLEVEL=0
@where /q gcc.exe
@IF ERRORLEVEL 1 set PATH=%gcc%\;%PATH%
@set ERRORLEVEL=0
@if /I "%mingw%"=="y" set sconscmd=%sconscmd% toolchain=crossmingw
@if /I "%mingw%"=="y" copy %gcc%\%altabi%-w64-mingw32-gcc-ar.exe %gcc%\%altabi%-w64-mingw32-ar.exe
@if /I "%mingw%"=="y" copy %gcc%\%altabi%-w64-mingw32-gcc-ranlib.exe %gcc%\%altabi%-w64-mingw32-ranlib.exe
@if /I "%mingw%"=="y" call "%msys2%" -use-full-path
@if /I "%mingw%"=="y" (
pacman -Syu
pacman -S python2
wget https://bootstrap.pypa.io/get-pip.py
python2 get-pip.py
pip install -U mako
pip install -U scons
pip freeze > requirements.txt
pip install -r requirements.txt --upgrade
cd $mesa
cd mesa
GOTO build_mesa_exec
)

:build_with_vs
@set cleanbuild=n
@if EXIST build\windows-%longabi% set /p cleanbuild=Do you want to clean build (y/n):
@if EXIST build\windows-%longabi% echo.
@if /I "%cleanbuild%"=="y" RD /S /Q build\windows-%longabi%
@cd %mesa%mesa
@echo.

:build_mesa_exec
@set dummygitver=#define MESA_GIT_SHA1 "git-"
@if %prepfail%==1 echo %dummygitver% > %mesa%mesa\build\windows-%abi%\git_sha1.h
@%sconscmd%
@echo.

:build_dxtn
@if NOT EXIST %gcc% GOTO distcreate
@if NOT EXIST %mesa%dxtn GOTO distcreate
@set /p builddxtn=Do you want to build S3 texture compression library? (y/n):
@if /i NOT "%builddxtn%"=="y" GOTO distcreate
@set PATH=%gcc%\;%PATH%
@cd %mesa%dxtn
@echo.
@if EXIST %abi% RD /S /Q %abi%
@MD %abi%
@set dxtn=gcc -shared -m%minabi% -v *.c *.h -I ..\mesa\include -Wl,--dll,--dynamicbase,--enable-auto-image-base,--nxcompat -o %abi%\dxtn.dll
@%dxtn%
@echo.

:distcreate
@set /p dist=Create or update Mesa3D distribution package (y/n):
@echo.
@if /I NOT "%dist%"=="y" GOTO exit
@cd %mesa%
@if NOT EXIST mesa-dist-win MD mesa-dist-win
@cd mesa-dist-win
@if NOT EXIST bin MD bin
@cd bin
@if EXIST %abi% RD /S /Q %abi%
@MD %abi%
@cd %abi%
@copy %mesa%mesa\build\windows-%longabi%\gallium\targets\libgl-gdi\opengl32.dll opengl32.dll
@if %abi%==x64 copy %mesa%mesa\build\windows-%longabi%\gallium\drivers\swr\swrAVX.dll swrAVX.dll
@if %abi%==x64 copy %mesa%mesa\build\windows-%longabi%\gallium\drivers\swr\swrAVX2.dll swrAVX2.dll
@copy %mesa%mesa\build\windows-%longabi%\mesa\drivers\osmesa\osmesa.dll osmesa-swrast.dll
@copy %mesa%mesa\build\windows-%longabi%\gallium\targets\osmesa\osmesa.dll osmesa-gallium.dll
@copy %mesa%mesa\build\windows-%longabi%\gallium\targets\graw-gdi\graw.dll graw.dll
@copy %mesa%dxtn\%abi%\dxtn.dll dxtn.dll
@echo.
@pause

:exit
exit

Build script: Python modules update performance enhancements.


:: Copyright 2012 The Go Authors. All rights reserved.
:: Use of this source code is governed by a BSD-style
:: license that can be found in the LICENSE file.
@echo off

:: Keep environment variables within this script
:: unless invoked with --no-local.
if x%1==x--no-local goto nolocal
if x%2==x--no-local goto nolocal
setlocal
:nolocal

set GOBUILDFAIL=0

if exist make.bat goto ok
echo Must run make.bat from Go src directory.
goto fail
:ok

:: Grab default GOROOT_FINAL and set GOROOT for build.
:: The expression %VAR:\=\\% means to take %VAR%
:: and apply the substitution \ = \\, escaping the
:: backslashes.  Then we wrap that in quotes to create
:: a C string.
cd ..
set GOROOT=%CD%
cd src
if "x%GOROOT_FINAL%"=="x" set GOROOT_FINAL=%GOROOT%
set DEFGOROOT=-DGOROOT_FINAL="\"%GOROOT_FINAL:\=\\%\""

echo # Building C bootstrap tool.
echo cmd/dist
if not exist ..\bin\tool mkdir ..\bin\tool
:: Windows has no glob expansion, so spell out cmd/dist/*.c.
gcc -O2 -Wall -Werror -o cmd/dist/dist.exe -Icmd/dist %DEFGOROOT% cmd/dist/buf.c cmd/dist/build.c cmd/dist/buildgc.c cmd/dist/buildruntime.c cmd/dist/goc2c.c cmd/dist/main.c cmd/dist/windows.c
if errorlevel 1 goto fail
.\cmd\dist\dist env -wp >env.bat
if errorlevel 1 goto fail
call env.bat
del env.bat
:: Echo with no arguments prints whether echo is turned on, so echo dot.
echo .

echo # Building compilers and Go bootstrap tool.
.\cmd\dist\dist bootstrap -a -v
if errorlevel 1 goto fail
:: Delay move of dist tool to now, because bootstrap cleared tool directory.
move .\cmd\dist\dist.exe %GOTOOLDIR%\dist.exe
%GOTOOLDIR%\go_bootstrap clean -i std
echo .

if not %GOHOSTARCH% == %GOARCH% goto localbuild
if not %GOHOSTOS% == %GOOS% goto localbuild
goto mainbuild

:localbuild
echo # Building tools for local system. %GOHOSTOS%/%GOHOSTARCH%
setlocal
set GOOS=%GOHOSTOS%
set GOARCH=%GOHOSTARCH%
%GOTOOLDIR%\go_bootstrap install -v std
endlocal
if errorlevel 1 goto fail
echo .

:mainbuild
echo # Building packages and commands.
%GOTOOLDIR%\go_bootstrap install -a -v std
if errorlevel 1 goto fail
del %GOTOOLDIR%\go_bootstrap.exe
echo .

if x%1==x--no-banner goto nobanner
%GOTOOLDIR%\dist banner
:nobanner

goto end

:fail
set GOBUILDFAIL=1

:end

:: Copyright 2012 The Go Authors. All rights reserved.
:: Use of this source code is governed by a BSD-style
:: license that can be found in the LICENSE file.
@echo off

:: Keep environment variables within this script
:: unless invoked with --no-local.
if x%1==x--no-local goto nolocal
if x%2==x--no-local goto nolocal
setlocal
:nolocal

set GOBUILDFAIL=0

if exist make.bat goto ok
echo Must run make.bat from Go src directory.
goto fail
:ok

:: Grab default GOROOT_FINAL and set GOROOT for build.
:: The expression %VAR:\=\\% means to take %VAR%
:: and apply the substitution \ = \\, escaping the
:: backslashes.  Then we wrap that in quotes to create
:: a C string.
cd ..
set GOROOT=%CD%
cd src
if "x%GOROOT_FINAL%"=="x" set GOROOT_FINAL=%GOROOT%
set DEFGOROOT=-DGOROOT_FINAL="\"%GOROOT_FINAL:\=\\%\""

echo # Building C bootstrap tool.
echo cmd/dist
if not exist ..\bin\tool mkdir ..\bin\tool
:: Windows has no glob expansion, so spell out cmd/dist/*.c.
gcc -O2 -Wall -Werror -o cmd/dist/dist.exe -Icmd/dist %DEFGOROOT% cmd/dist/buf.c cmd/dist/build.c cmd/dist/buildgc.c cmd/dist/buildruntime.c cmd/dist/goc2c.c cmd/dist/main.c cmd/dist/windows.c
if errorlevel 1 goto fail
.\cmd\dist\dist env -wp >env.bat
if errorlevel 1 goto fail
call env.bat
del env.bat
:: Echo with no arguments prints whether echo is turned on, so echo dot.
echo .

echo # Building compilers and Go bootstrap tool.
set buildall=-a
if x%1==x--no-clean set buildall=
.\cmd\dist\dist bootstrap %buildall% -v
if errorlevel 1 goto fail
:: Delay move of dist tool to now, because bootstrap cleared tool directory.
move .\cmd\dist\dist.exe %GOTOOLDIR%\dist.exe
%GOTOOLDIR%\go_bootstrap clean -i std
echo .

if not %GOHOSTARCH% == %GOARCH% goto localbuild
if not %GOHOSTOS% == %GOOS% goto localbuild
goto mainbuild

:localbuild
echo # Building tools for local system. %GOHOSTOS%/%GOHOSTARCH%
setlocal
set GOOS=%GOHOSTOS%
set GOARCH=%GOHOSTARCH%
%GOTOOLDIR%\go_bootstrap install -v std
endlocal
if errorlevel 1 goto fail
echo .

:mainbuild
echo # Building packages and commands.
%GOTOOLDIR%\go_bootstrap install -a -v std
if errorlevel 1 goto fail
del %GOTOOLDIR%\go_bootstrap.exe
echo .

if x%1==x--no-banner goto nobanner
%GOTOOLDIR%\dist banner
:nobanner

goto end

:fail
set GOBUILDFAIL=1

:end

implement --no-clean

make.bat: implement --no-clean

R=golang-dev, r
CC=golang-dev
http://codereview.appspot.com/5656070


del TbSync.xpi
"C:\Program Files\7-Zip\7zG.exe" a -tzip TbSync.xpi components content defaults locale skin chrome.manifest install.rdf LICENSE.txt README.md

del TbSync.xpi
"C:\Program Files\7-Zip\7zG.exe" a -tzip TbSync.xpi content locale skin chrome.manifest install.rdf LICENSE.txt README.md bootstrap.js

update pack.bat

bootstraping: update pack.bat


mkdir build
cd build

cmake ^
    -G "Ninja" ^
    -DCMAKE_INSTALL_PREFIX=%LIBRARY_PREFIX% ^
    -DCMAKE_BUILD_TYPE=Release ^
    -DCMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP=True ^
    -DSKIP_optix:BOOL=ON ^
    %SRC_DIR%
if errorlevel 1 exit 1

:: Build.
cmake --build . --config Release
if errorlevel 1 exit 1

:: Install.
cmake --build . --config Release --target install
if errorlevel 1 exit 1

:: Test.
:: Do not run tests as they require to open a display and this is not supported on CI at the moment
:: See https://github.com/conda-forge/libignition-rendering4-feedstock/pull/19#issuecomment-937678806
:: set RENDER_ENGINE_VALUES=ogre
:: ctest --output-on-failure -C Release -E "INTEGRATION|PERFORMANCE|REGRESSION|UNIT_RenderingIface_TEST|check_"
:: if errorlevel 1 exit 1

setlocal EnableDelayedExpansion
:: Copy the [de]activate scripts to %PREFIX%\etc\conda\[de]activate.d.
:: This will allow them to be run on environment activation.
for %%F in (activate deactivate) DO (
    if not exist %PREFIX%\etc\conda\%%F.d mkdir %PREFIX%\etc\conda\%%F.d
    copy %RECIPE_DIR%\%%F.bat %PREFIX%\etc\conda\%%F.d\%PKG_NAME%_%%F.bat
    if %errorlevel% neq 0 exit /b %errorlevel%
)

Create bld_cxx.bat

Create bld_cxx.bat


REM Install Internet Information Server (IIS).
exit 1

Update before-install.bat

Update before-install.bat

return error code


@echo off
rmdir /s /q yojimbo
mkdir yojimbo
mkdir yojimbo\tests
copy ..\*.h yojimbo
copy ..\*.cpp yojimbo
copy ..\premake5.lua yojimbo
robocopy /MIR /DCOPY:T ..\tlsf yojimbo\tlsf
REM because robocopy sometimes sets non-zero error codes on successful operation. what the actual fuck windows
cmd /c "exit /b 0"

@echo off
rmdir /s /q yojimbo
mkdir yojimbo
mkdir yojimbo\tests
copy ..\*.h yojimbo
copy ..\*.cpp yojimbo
copy ..\premake5.lua yojimbo
robocopy /MIR /DCOPY:T ..\tlsf yojimbo\tlsf
robocopy /MIR /DCOPY:T ..\netcode.io yojimbo\netcode.io
robocopy /MIR /DCOPY:T ..\reliable.io yojimbo\reliable.io
REM because robocopy sometimes sets non-zero error codes on successful operation. what the actual fuck windows
cmd /c "exit /b 0"

fix docker copy files on windows

fix docker copy files on windows


set npm_config_wcjs_runtime="electron"
set npm_config_wcjs_runtime_version="0.33.9"
set npm_config_wcjs_arch="ia32"

npm install

set npm_config_wcjs_runtime="electron"
set npm_config_wcjs_runtime_version="11.1.0"
set npm_config_wcjs_arch="ia32"

npm install

use latest Electron version

use latest Electron version


@ECHO OFF
REM -- Automates cygwin installation

SETLOCAL

REM -- Change to the directory of the executing batch file
CD %~dp0

REM -- Configure our paths
SET ROOTDIR=C:\cygwin
SET SITE=http://cygwin.mirrors.pair.com/
SET SSHD_PORT=13610

REM -- Additional variables
SET ADD_ARGS=""
SET LOCALDIR="%ROOTDIR%\setup"
set HSTART_URL=http://files.ntwind.com/download/Hstart_4.2-bin.zip
IF "%PROCESSOR_ARCHITECTURE%" == "x86" (
	SET SETUP_NAME=setup-x86.exe
	SET HSTART_BIN=hstart.exe
) else (
	SET SETUP_NAME=setup-x86_64.exe
	SET HSTART_BIN=hstart64.exe
)

REM -- STARTING SCRIPT
set DLOAD_SCRIPT=download.vbs
REM -- Get the user's startup directory
for /F "skip=2 tokens=2*" %%j in ('reg query "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /v "Startup"') do set STARTUP_DIR=%%k

REM -- pure batch downloader: https://semitwist.com/articles/article/view/downloading-files-from-plain-batch-with-zero-dependencies
REM -- Windows has no built-in wget or curl, so generate a VBS script to do it:
REM -------------------------------------------------------------------------
ECHO Option Explicit                                                    >  %DLOAD_SCRIPT%
ECHO Dim args, http, fileSystem, adoStream, url, target, status         >> %DLOAD_SCRIPT%
ECHO.                                                                   >> %DLOAD_SCRIPT%
ECHO Set args = Wscript.Arguments                                       >> %DLOAD_SCRIPT%
ECHO Set http = CreateObject("WinHttp.WinHttpRequest.5.1")              >> %DLOAD_SCRIPT%
ECHO url = args(0)                                                      >> %DLOAD_SCRIPT%
ECHO target = args(1)                                                   >> %DLOAD_SCRIPT%
ECHO WScript.Echo "Getting '" ^& target ^& "' from '" ^& url ^& "'..."  >> %DLOAD_SCRIPT%
ECHO.                                                                   >> %DLOAD_SCRIPT%
ECHO http.Open "GET", url, False                                        >> %DLOAD_SCRIPT%
ECHO http.Send                                                          >> %DLOAD_SCRIPT%
ECHO status = http.Status                                               >> %DLOAD_SCRIPT%
ECHO.                                                                   >> %DLOAD_SCRIPT%
ECHO If status ^<^> 200 Then                                            >> %DLOAD_SCRIPT%
ECHO 	WScript.Echo "FAILED to download: HTTP Status " ^& status       >> %DLOAD_SCRIPT%
ECHO 	WScript.Quit 1                                                  >> %DLOAD_SCRIPT%
ECHO End If                                                             >> %DLOAD_SCRIPT%
ECHO.                                                                   >> %DLOAD_SCRIPT%
ECHO Set adoStream = CreateObject("ADODB.Stream")                       >> %DLOAD_SCRIPT%
ECHO adoStream.Open                                                     >> %DLOAD_SCRIPT%
ECHO adoStream.Type = 1                                                 >> %DLOAD_SCRIPT%
ECHO adoStream.Write http.ResponseBody                                  >> %DLOAD_SCRIPT%
ECHO adoStream.Position = 0                                             >> %DLOAD_SCRIPT%
ECHO.                                                                   >> %DLOAD_SCRIPT%
ECHO Set fileSystem = CreateObject("Scripting.FileSystemObject")        >> %DLOAD_SCRIPT%
ECHO If fileSystem.FileExists(target) Then fileSystem.DeleteFile target >> %DLOAD_SCRIPT%
ECHO adoStream.SaveToFile target                                        >> %DLOAD_SCRIPT%
ECHO adoStream.Close                                                    >> %DLOAD_SCRIPT%
ECHO.                                                                   >> %DLOAD_SCRIPT%
REM -------------------------------------------------------------------------

mkdir "%ROOTDIR%"
mkdir "%LOCALDIR%"

IF NOT EXIST "%ROOTDIR%\%SETUP_NAME%" cscript //Nologo "%DLOAD_SCRIPT%" http://cygwin.com/%SETUP_NAME% "%ROOTDIR%\%SETUP_NAME%"

REM -- cleanup temp files
del "%DLOAD_SCRIPT%"

REM -- These are the packages we will install (in addition to the default packages)
SET PACKAGES=bash-completion,bc,bind,ca-certificates,curl,cygutils-extra,git,git-completion,git-svn
SET PACKAGES=%PACKAGES%,inetutils,nc,nc6,ncurses,openssh,openssl,procps,rsync,screen,unzip,vim,wget,xxd
REM -- Extra packages
SET PACKAGES=%PACKAGES%,GraphicsMagick,ImageMagick,aspell,aspell-en,bzip2,fdupes,heimdal,mkisofs,p7zip

REM -- Do it!
ECHO *** INSTALLING DEFAULT PACKAGES
"%ROOTDIR%\%SETUP_NAME%" -q -d -D -L -X -s "%SITE%" -l "%LOCALDIR%" -R "%ROOTDIR%" "%ADD_ARGS%"
ECHO.
ECHO.
ECHO *** INSTALLING CUSTOM PACKAGES
"%ROOTDIR%\%SETUP_NAME%" -q -d -D -L -X -s "%SITE%" -l "%LOCALDIR%" -R "%ROOTDIR%" "%ADD_ARGS%" -P "%PACKAGES%"

REM -- Show what we did
ECHO.
ECHO.
ECHO cygwin installation updated
ECHO - "%PACKAGES%"
ECHO.

REM -- make cygdrive root / instead of /cygdrive
ECHO.
ECHO.
ECHO updating cygdrive fstab
"%ROOTDIR%\bin\bash.exe" --login -c "sed -i 's/# none \/cygdrive cygdrive /none \/ cygdrive /' /etc/fstab"
"%ROOTDIR%\bin\bash.exe" --login -c "sed -i 's/none \/cygdrive cygdrive /none \/ cygdrive /' /etc/fstab"
ECHO.
ECHO.

REM -- make the home directory
ECHO.
ECHO.
ECHO making the home directory be the windows home
REM -- WIN XP-
"%ROOTDIR%\bin\bash.exe" --login -c "if [[ -d \"/c/Documents and Settings/$USER\" ]]; then mv \"/home/$USER\" \"/home/$USER.bak\"; ln -s \"/c/Documents and Settings/$USER\" \"/home/$USER\"; fi;"
REM -- WIN Vista+
"%ROOTDIR%\bin\bash.exe" --login -c "if [[ -d \"/c/Users/$USER\" ]]; then mv \"/home/$USER\" \"/home/$USER.bak\"; ln -s \"/c/Users/$USER\" \"/home/$USER\"; fi;"
ECHO.
ECHO.

REM -- setup sshd for local user only
ECHO.
ECHO.
ECHO setup sshd for local user only
"%ROOTDIR%\bin\bash.exe" --login -c "ssh-host-config --no --port %SSHD_PORT%"
"%ROOTDIR%\bin\bash.exe" --login -c "sed -i 's/^#ListenAddress 0.0.0.0$/ListenAddress 127.0.0.1/' /etc/sshd_config"
"%ROOTDIR%\bin\bash.exe" --login -c "sed -i 's/^#ListenAddress ::$/ListenAddress ::1/' /etc/sshd_config"
"%ROOTDIR%\bin\bash.exe" --login -c "sed -i 's/^#PasswordAuthentication yes$/PasswordAuthentication no/' /etc/sshd_config"
"%ROOTDIR%\bin\bash.exe" --login -c "sed -i 's/^UsePrivilegeSeparation sandbox/UsePrivilegeSeparation no/' /etc/sshd_config"
"%ROOTDIR%\bin\bash.exe" --login -c "if [[ ! -f ~/.ssh/id_rsa ]]; then ssh-keygen -q -t rsa -N '' -f ~/.ssh/id_rsa && cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys && chmod 0600 ~/.ssh/authorized_keys; fi;"
"%ROOTDIR%\bin\bash.exe" --login -c "echo > /etc/motd"

REM -- download hstart
IF NOT EXIST "%ROOTDIR%\startup\%HSTART_BIN%" (
	"%ROOTDIR%\bin\bash.exe" --login -c "mkdir /startup"
	"%ROOTDIR%\bin\bash.exe" --login -c "wget -O /tmp/hstart.zip %HSTART_URL% && unzip -p /tmp/hstart.zip %HSTART_BIN% > /startup/%HSTART_BIN%"
	"%ROOTDIR%\bin\bash.exe" --login -c "rm -f /tmp/hstart.zip"
)

REM -- create the startup entry for ssh to run on login
IF NOT EXIST "%ROOTDIR%\startup\sshd.cmd" (
echo ^
SET PATH=%%PATH%%;%ROOTDIR%\bin^

chdir %ROOTDIR%^

start "" "%ROOTDIR%\startup\%HSTART_BIN%" /noconsole /elevate "%ROOTDIR%\bin\bash.exe --login -c '/usr/sbin/sshd.exe -D'"^
 > "%ROOTDIR%\startup\sshd.cmd"
)

IF NOT EXIST "%STARTUP_DIR%\sshd.cmd" (
	mklink "%STARTUP_DIR%\sshd.cmd" "%ROOTDIR%\startup\sshd.cmd"
)

IF NOT EXIST "%ROOTDIR%\cygsetup.cmd" (
	echo "%ROOTDIR%\%SETUP_NAME%" -s "%SITE%" -l "%LOCALDIR%" -R "%ROOTDIR%" "%ADD_ARGS%" > "%ROOTDIR%\cygsetup.cmd"
)

ECHO.
ECHO.

ENDLOCAL

PAUSE
EXIT /B 0

@ECHO OFF
REM -- Automates cygwin installation

SETLOCAL

REM -- Change to the directory of the executing batch file
CD %~dp0

REM -- Configure our paths
SET ROOTDIR=C:\cygwin
SET SITE=http://cygwin.mirrors.pair.com/
SET SSHD_PORT=13610

REM -- Additional variables
SET ADD_ARGS=""
SET LOCALDIR="%ROOTDIR%\setup"
set HSTART_URL=http://files.ntwind.com/download/Hstart_4.2-bin.zip
IF "%PROCESSOR_ARCHITECTURE%" == "x86" (
	SET SETUP_NAME=setup-x86.exe
	SET HSTART_BIN=hstart.exe
) else (
	SET SETUP_NAME=setup-x86_64.exe
	SET HSTART_BIN=hstart64.exe
)

REM -- STARTING SCRIPT
set DLOAD_SCRIPT=download.vbs
REM -- Get the user's startup directory
for /F "skip=2 tokens=2*" %%j in ('reg query "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /v "Startup"') do set STARTUP_DIR=%%k

REM -- pure batch downloader: https://semitwist.com/articles/article/view/downloading-files-from-plain-batch-with-zero-dependencies
REM -- Windows has no built-in wget or curl, so generate a VBS script to do it:
REM -------------------------------------------------------------------------
ECHO Option Explicit                                                    >  %DLOAD_SCRIPT%
ECHO Dim args, http, fileSystem, adoStream, url, target, status         >> %DLOAD_SCRIPT%
ECHO.                                                                   >> %DLOAD_SCRIPT%
ECHO Set args = Wscript.Arguments                                       >> %DLOAD_SCRIPT%
ECHO Set http = CreateObject("WinHttp.WinHttpRequest.5.1")              >> %DLOAD_SCRIPT%
ECHO url = args(0)                                                      >> %DLOAD_SCRIPT%
ECHO target = args(1)                                                   >> %DLOAD_SCRIPT%
ECHO WScript.Echo "Getting '" ^& target ^& "' from '" ^& url ^& "'..."  >> %DLOAD_SCRIPT%
ECHO.                                                                   >> %DLOAD_SCRIPT%
ECHO http.Open "GET", url, False                                        >> %DLOAD_SCRIPT%
ECHO http.Send                                                          >> %DLOAD_SCRIPT%
ECHO status = http.Status                                               >> %DLOAD_SCRIPT%
ECHO.                                                                   >> %DLOAD_SCRIPT%
ECHO If status ^<^> 200 Then                                            >> %DLOAD_SCRIPT%
ECHO 	WScript.Echo "FAILED to download: HTTP Status " ^& status       >> %DLOAD_SCRIPT%
ECHO 	WScript.Quit 1                                                  >> %DLOAD_SCRIPT%
ECHO End If                                                             >> %DLOAD_SCRIPT%
ECHO.                                                                   >> %DLOAD_SCRIPT%
ECHO Set adoStream = CreateObject("ADODB.Stream")                       >> %DLOAD_SCRIPT%
ECHO adoStream.Open                                                     >> %DLOAD_SCRIPT%
ECHO adoStream.Type = 1                                                 >> %DLOAD_SCRIPT%
ECHO adoStream.Write http.ResponseBody                                  >> %DLOAD_SCRIPT%
ECHO adoStream.Position = 0                                             >> %DLOAD_SCRIPT%
ECHO.                                                                   >> %DLOAD_SCRIPT%
ECHO Set fileSystem = CreateObject("Scripting.FileSystemObject")        >> %DLOAD_SCRIPT%
ECHO If fileSystem.FileExists(target) Then fileSystem.DeleteFile target >> %DLOAD_SCRIPT%
ECHO adoStream.SaveToFile target                                        >> %DLOAD_SCRIPT%
ECHO adoStream.Close                                                    >> %DLOAD_SCRIPT%
ECHO.                                                                   >> %DLOAD_SCRIPT%
REM -------------------------------------------------------------------------

mkdir "%ROOTDIR%"
mkdir "%LOCALDIR%"

IF NOT EXIST "%ROOTDIR%\%SETUP_NAME%" cscript //Nologo "%DLOAD_SCRIPT%" http://cygwin.com/%SETUP_NAME% "%ROOTDIR%\%SETUP_NAME%"

REM -- cleanup temp files
del "%DLOAD_SCRIPT%"

REM -- These are the packages we will install (in addition to the default packages)
SET PACKAGES=bash-completion,bc,bind,ca-certificates,curl,cygutils-extra,git,git-completion,git-svn,gnupg
SET PACKAGES=%PACKAGES%,inetutils,nc,nc6,ncurses,openssh,openssl,procps,rsync,screen,unzip,vim,wget,xxd
REM -- Extra packages
SET PACKAGES=%PACKAGES%,GraphicsMagick,ImageMagick,aspell,aspell-en,bzip2,fdupes,heimdal,mkisofs,p7zip

REM -- Do it!
ECHO *** INSTALLING DEFAULT PACKAGES
"%ROOTDIR%\%SETUP_NAME%" -q -d -D -L -X -s "%SITE%" -l "%LOCALDIR%" -R "%ROOTDIR%" "%ADD_ARGS%"
ECHO.
ECHO.
ECHO *** INSTALLING CUSTOM PACKAGES
"%ROOTDIR%\%SETUP_NAME%" -q -d -D -L -X -s "%SITE%" -l "%LOCALDIR%" -R "%ROOTDIR%" "%ADD_ARGS%" -P "%PACKAGES%"

REM -- Show what we did
ECHO.
ECHO.
ECHO cygwin installation updated
ECHO - "%PACKAGES%"
ECHO.

REM -- make cygdrive root / instead of /cygdrive
ECHO.
ECHO.
ECHO updating cygdrive fstab
"%ROOTDIR%\bin\bash.exe" --login -c "sed -i 's/# none \/cygdrive cygdrive /none \/ cygdrive /' /etc/fstab"
"%ROOTDIR%\bin\bash.exe" --login -c "sed -i 's/none \/cygdrive cygdrive /none \/ cygdrive /' /etc/fstab"
ECHO.
ECHO.

REM -- make the home directory
ECHO.
ECHO.
ECHO making the home directory be the windows home
REM -- WIN XP-
"%ROOTDIR%\bin\bash.exe" --login -c "if [[ -d \"/c/Documents and Settings/$USER\" ]]; then mv \"/home/$USER\" \"/home/$USER.bak\"; ln -s \"/c/Documents and Settings/$USER\" \"/home/$USER\"; fi;"
REM -- WIN Vista+
"%ROOTDIR%\bin\bash.exe" --login -c "if [[ -d \"/c/Users/$USER\" ]]; then mv \"/home/$USER\" \"/home/$USER.bak\"; ln -s \"/c/Users/$USER\" \"/home/$USER\"; fi;"
ECHO.
ECHO.

REM -- setup sshd for local user only
ECHO.
ECHO.
ECHO setup sshd for local user only
"%ROOTDIR%\bin\bash.exe" --login -c "ssh-host-config --no --port %SSHD_PORT%"
"%ROOTDIR%\bin\bash.exe" --login -c "sed -i 's/^#ListenAddress 0.0.0.0$/ListenAddress 127.0.0.1/' /etc/sshd_config"
"%ROOTDIR%\bin\bash.exe" --login -c "sed -i 's/^#ListenAddress ::$/ListenAddress ::1/' /etc/sshd_config"
"%ROOTDIR%\bin\bash.exe" --login -c "sed -i 's/^#PasswordAuthentication yes$/PasswordAuthentication no/' /etc/sshd_config"
"%ROOTDIR%\bin\bash.exe" --login -c "sed -i 's/^UsePrivilegeSeparation sandbox/UsePrivilegeSeparation no/' /etc/sshd_config"
"%ROOTDIR%\bin\bash.exe" --login -c "if [[ ! -f ~/.ssh/id_rsa ]]; then ssh-keygen -q -t rsa -N '' -f ~/.ssh/id_rsa && cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys && chmod 0600 ~/.ssh/authorized_keys; fi;"
"%ROOTDIR%\bin\bash.exe" --login -c "echo > /etc/motd"

REM -- download hstart
IF NOT EXIST "%ROOTDIR%\startup\%HSTART_BIN%" (
	"%ROOTDIR%\bin\bash.exe" --login -c "mkdir /startup"
	"%ROOTDIR%\bin\bash.exe" --login -c "wget -O /tmp/hstart.zip %HSTART_URL% && unzip -p /tmp/hstart.zip %HSTART_BIN% > /startup/%HSTART_BIN%"
	"%ROOTDIR%\bin\bash.exe" --login -c "rm -f /tmp/hstart.zip"
)

REM -- create the startup entry for ssh to run on login
IF NOT EXIST "%ROOTDIR%\startup\sshd.cmd" (
echo ^
SET PATH=%%PATH%%;%ROOTDIR%\bin^

chdir %ROOTDIR%^

start "" "%ROOTDIR%\startup\%HSTART_BIN%" /noconsole /elevate "%ROOTDIR%\bin\bash.exe --login -c '/usr/sbin/sshd.exe -D'"^
 > "%ROOTDIR%\startup\sshd.cmd"
)

IF NOT EXIST "%STARTUP_DIR%\sshd.cmd" (
	mklink "%STARTUP_DIR%\sshd.cmd" "%ROOTDIR%\startup\sshd.cmd"
)

IF NOT EXIST "%ROOTDIR%\cygsetup.cmd" (
	echo "%ROOTDIR%\%SETUP_NAME%" -s "%SITE%" -l "%LOCALDIR%" -R "%ROOTDIR%" "%ADD_ARGS%" > "%ROOTDIR%\cygsetup.cmd"
)

ECHO.
ECHO.

ENDLOCAL

PAUSE
EXIT /B 0

Install gnupg on cygwin

Install gnupg on cygwin


@echo Off

echo ====== Starting to build dvc installer for Windows... ======

if not exist dvc\NUL (echo Error: Please run this script from repository root && goto :error)

rmdir /Q /S build
rmdir /Q /S dist
del /Q /S dvc.spec
del /Q /S "dvc-*.exe"

where pip
if %errorlevel% neq 0 (echo Error: pip not found && goto :error)

where choco
if %errorlevel% neq 0 (echo Error: choco not found && goto :error)

choco install InnoSetup
call refreshenv
where iscc
if %errorlevel% neq 0 (echo Error: Couldn't find Inno Setup compiler. && goto :error)

echo ====== Installing requirements... ======
echo PKG = "exe" > dvc\utils\build.py
call pip install .[all] || goto :error
call pip install psutil || goto :error
call dvc pull || goto :error
call pip install pyinstaller || goto :error

echo ====== Building dvc binary... ======
call pyinstaller --additional-hooks-dir scripts\hooks dvc/__main__.py --name dvc --specpath build

echo ====== Copying additional files... ======
copy scripts\innosetup\addSymLinkPermissions.ps1 dist\ || goto :error

echo ====== Building dvc installer... ======
set PYTHONPATH=%cd%
call python scripts\innosetup\config_gen.py || goto :error
call iscc scripts\innosetup\setup.iss || goto :error

echo ====== DONE ======
goto :EOF

:error
echo ====== FAIL ======
exit /b 1

@echo Off

echo ====== Starting to build dvc installer for Windows... ======

if not exist dvc\NUL (echo Error: Please run this script from repository root && goto :error)

rmdir /Q /S build
rmdir /Q /S dist
del /Q /S dvc.spec
del /Q /S "dvc-*.exe"

where pip
if %errorlevel% neq 0 (echo Error: pip not found && goto :error)

where choco
if %errorlevel% neq 0 (echo Error: choco not found && goto :error)

choco install InnoSetup
call refreshenv
where iscc
if %errorlevel% neq 0 (echo Error: Couldn't find Inno Setup compiler. && goto :error)

echo ====== Installing requirements... ======
echo 'PKG = "exe"' > dvc\utils\build.py
call pip install .[all] || goto :error
call pip install psutil || goto :error
call dvc pull || goto :error
call pip install pyinstaller || goto :error

echo ====== Building dvc binary... ======
call pyinstaller --additional-hooks-dir scripts\hooks dvc/__main__.py --name dvc --specpath build

echo ====== Copying additional files... ======
copy scripts\innosetup\addSymLinkPermissions.ps1 dist\ || goto :error

echo ====== Building dvc installer... ======
set PYTHONPATH=%cd%
call python scripts\innosetup\config_gen.py || goto :error
call iscc scripts\innosetup\setup.iss || goto :error

echo ====== DONE ======
goto :EOF

:error
echo ====== FAIL ======
exit /b 1

fix windows echo

fix windows echo


java -cp .;lib/jms-testing-tool.jar;lib-ext/* ru.jms.testingtool.server

java -cp .;lib/jms-testing-tool.jar;lib-ext/* -Dfile.encoding=utf-8 ru.jms.testingtool.server

fix java encoding for windows

fix java encoding for windows


emcc main.c -O2 -s USE_SDL=2 --embed-file assets -o bin/game.html

Build Enscripten batch file

Build Enscripten batch file


set CHEF_EXT_DIR=%~dp0

echo %CHEF_EXT_DIR%

ruby %CHEF_EXT_DIR%bin\chef-enable.rb

set CHEF_EXT_DIR=%~dp0

echo %CHEF_EXT_DIR%

set path=C:\opscode\chef\bin;C:\opscode\chef\embedded\bin;%path%

ruby %CHEF_EXT_DIR%bin\chef-enable.rb

set path for chef

set path for chef


@rem Licensed to the Apache Software Foundation (ASF) under one
@rem or more contributor license agreements.  See the NOTICE file
@rem distributed with this work for additional information
@rem regarding copyright ownership.  The ASF licenses this file
@rem to you under the Apache License, Version 2.0 (the
@rem "License"); you may not use this file except in compliance
@rem with the License.  You may obtain a copy of the License at
@rem
@rem   http://www.apache.org/licenses/LICENSE-2.0
@rem
@rem Unless required by applicable law or agreed to in writing,
@rem software distributed under the License is distributed on an
@rem "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@rem KIND, either express or implied.  See the License for the
@rem specific language governing permissions and limitations
@rem under the License.

@rem To run the script:
@rem verify-release-candidate.bat VERSION RC_NUM

@echo on

if not exist "C:\tmp\" mkdir C:\tmp
if exist "C:\tmp\arrow-verify-release" rd C:\tmp\arrow-verify-release /s /q
if not exist "C:\tmp\arrow-verify-release" mkdir C:\tmp\arrow-verify-release

set _VERIFICATION_DIR=C:\tmp\arrow-verify-release
set _VERIFICATION_DIR_UNIX=C:/tmp/arrow-verify-release
set _VERIFICATION_CONDA_ENV=%_VERIFICATION_DIR%\conda-env
set _DIST_URL=https://dist.apache.org/repos/dist/dev/arrow
set _TARBALL=apache-arrow-%1.tar.gz
set ARROW_SOURCE=%_VERIFICATION_DIR%\apache-arrow-%1
set INSTALL_DIR=%_VERIFICATION_DIR%\install

@rem Requires GNU Wget for Windows
wget --no-check-certificate -O %_TARBALL% %_DIST_URL%/apache-arrow-%1-rc%2/%_TARBALL% || exit /B

tar xf %_TARBALL% -C %_VERIFICATION_DIR_UNIX%

set PYTHON=3.6

@rem Using call with conda.bat seems necessary to avoid terminating the batch
@rem script execution
call conda create -p %_VERIFICATION_CONDA_ENV% -f -q -y python=%PYTHON% || exit /B

call activate %_VERIFICATION_CONDA_ENV% || exit /B

call conda install -y ^
     python=3.7 ^
     git ^
     --file=ci\conda_env_cpp.yml ^
     --file=ci\conda_env_python.yml ^
     -c conda-forge || exit /B

set GENERATOR=Visual Studio 14 2015 Win64
set CONFIGURATION=release

pushd %ARROW_SOURCE%

set ARROW_BUILD_TOOLCHAIN=%CONDA_PREFIX%\Library

set ARROW_HOME=%INSTALL_DIR%
set PARQUET_HOME=%INSTALL_DIR%
set PATH=%INSTALL_DIR%\bin;%PATH%

@rem Build and test Arrow C++ libraries
mkdir %ARROW_SOURCE%\cpp\build
pushd %ARROW_SOURCE%\cpp\build

@rem This is the path for Visual Studio Community 2017
call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\Tools\VsDevCmd.bat" -arch=amd64

cmake -G "%GENERATOR%" ^
      -DCMAKE_INSTALL_PREFIX=%ARROW_HOME% ^
      -DARROW_BOOST_USE_SHARED=ON ^
      -DCMAKE_BUILD_TYPE=%CONFIGURATION% ^
      -DARROW_CXXFLAGS="/MP" ^
      -DARROW_PYTHON=ON ^
      -DARROW_PARQUET=ON ^
      ..  || exit /B
cmake --build . --target INSTALL --config %CONFIGURATION%  || exit /B

@rem Get testing datasets for Parquet unit tests
git clone https://github.com/apache/parquet-testing.git %_VERIFICATION_DIR%\parquet-testing
set PARQUET_TEST_DATA=%_VERIFICATION_DIR%\parquet-testing\data

@rem Needed so python-test.exe works
set PYTHONPATH=%CONDA_PREFIX%\Lib;%CONDA_PREFIX%\Lib\site-packages;%CONDA_PREFIX%\python35.zip;%CONDA_PREFIX%\DLLs;%CONDA_PREFIX%;%PYTHONPATH%

ctest -VV  || exit /B
popd

@rem Build and import pyarrow
@rem parquet-cpp has some additional runtime dependencies that we need to figure out
@rem see PARQUET-1018
pushd %ARROW_SOURCE%\python

python setup.py build_ext --inplace --with-parquet --bundle-arrow-cpp bdist_wheel  || exit /B
py.test pyarrow -v -s --parquet || exit /B

popd

call deactivate

@rem Licensed to the Apache Software Foundation (ASF) under one
@rem or more contributor license agreements.  See the NOTICE file
@rem distributed with this work for additional information
@rem regarding copyright ownership.  The ASF licenses this file
@rem to you under the Apache License, Version 2.0 (the
@rem "License"); you may not use this file except in compliance
@rem with the License.  You may obtain a copy of the License at
@rem
@rem   http://www.apache.org/licenses/LICENSE-2.0
@rem
@rem Unless required by applicable law or agreed to in writing,
@rem software distributed under the License is distributed on an
@rem "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@rem KIND, either express or implied.  See the License for the
@rem specific language governing permissions and limitations
@rem under the License.

@rem To run the script:
@rem verify-release-candidate.bat VERSION RC_NUM

@echo on

if not exist "C:\tmp\" mkdir C:\tmp
if exist "C:\tmp\arrow-verify-release" rd C:\tmp\arrow-verify-release /s /q
if not exist "C:\tmp\arrow-verify-release" mkdir C:\tmp\arrow-verify-release

set _VERIFICATION_DIR=C:\tmp\arrow-verify-release
set _VERIFICATION_DIR_UNIX=C:/tmp/arrow-verify-release
set _VERIFICATION_CONDA_ENV=%_VERIFICATION_DIR%\conda-env
set _DIST_URL=https://dist.apache.org/repos/dist/dev/arrow
set _TARBALL=apache-arrow-%1.tar.gz
set ARROW_SOURCE=%_VERIFICATION_DIR%\apache-arrow-%1
set INSTALL_DIR=%_VERIFICATION_DIR%\install

@rem Requires GNU Wget for Windows
wget --no-check-certificate -O %_TARBALL% %_DIST_URL%/apache-arrow-%1-rc%2/%_TARBALL% || exit /B

tar xf %_TARBALL% -C %_VERIFICATION_DIR_UNIX%

set PYTHON=3.6

@rem Using call with conda.bat seems necessary to avoid terminating the batch
@rem script execution
call conda create -p %_VERIFICATION_CONDA_ENV% -f -q -y python=%PYTHON% || exit /B

call activate %_VERIFICATION_CONDA_ENV% || exit /B

call conda install -y ^
     python=3.7 ^
     git ^
     --file=ci\conda_env_cpp.yml ^
     --file=ci\conda_env_python.yml ^
     -c conda-forge || exit /B

set GENERATOR=Visual Studio 14 2015 Win64
set CONFIGURATION=release

pushd %ARROW_SOURCE%

set ARROW_BUILD_TOOLCHAIN=%CONDA_PREFIX%\Library

set ARROW_HOME=%INSTALL_DIR%
set PARQUET_HOME=%INSTALL_DIR%
set PATH=%INSTALL_DIR%\bin;%PATH%

@rem Build and test Arrow C++ libraries
mkdir %ARROW_SOURCE%\cpp\build
pushd %ARROW_SOURCE%\cpp\build

@rem This is the path for Visual Studio Community 2017
call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\Tools\VsDevCmd.bat" -arch=amd64

cmake -G "%GENERATOR%" ^
      -DCMAKE_INSTALL_PREFIX=%ARROW_HOME% ^
      -DARROW_BOOST_USE_SHARED=ON ^
      -DARROW_BUILD_TESTS=ON ^
      -DCMAKE_BUILD_TYPE=%CONFIGURATION% ^
      -DARROW_CXXFLAGS="/MP" ^
      -DARROW_PYTHON=ON ^
      -DARROW_PARQUET=ON ^
      ..  || exit /B
cmake --build . --target INSTALL --config %CONFIGURATION%  || exit /B

@rem Get testing datasets for Parquet unit tests
git clone https://github.com/apache/parquet-testing.git %_VERIFICATION_DIR%\parquet-testing
set PARQUET_TEST_DATA=%_VERIFICATION_DIR%\parquet-testing\data

@rem Needed so python-test.exe works
set PYTHONPATH=%CONDA_PREFIX%\Lib;%CONDA_PREFIX%\Lib\site-packages;%CONDA_PREFIX%\python35.zip;%CONDA_PREFIX%\DLLs;%CONDA_PREFIX%;%PYTHONPATH%

ctest -VV  || exit /B
popd

@rem Build and import pyarrow
@rem parquet-cpp has some additional runtime dependencies that we need to figure out
@rem see PARQUET-1018
pushd %ARROW_SOURCE%\python

python setup.py build_ext --inplace --with-parquet --bundle-arrow-cpp bdist_wheel  || exit /B
py.test pyarrow -v -s --parquet || exit /B

popd

call deactivate

[Release] Build C++ unit tests in verify-release-candidate.bat


:: ========================================================================================================
:: ==== <CONFIGURATION>
:: ========================================================================================================

:: Set the version of Visual Studio. This will just add a suffix to the string
:: of your directories to avoid mixing them up.
SET VS_VERSION=vs2013

:: Set this to the directory that contains vcvarsall.bat file of the
:: VC Visual Studio version you want to use for building ICU.
SET VISUAL_STUDIO_VC="C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC"

:: Set this to the version of ICU you are building
SET V8_VERSION=3.31.74.1

:: x86_amd64 or x86
set ARCHITECTURE=%1

::x64 or ia32
set PLATFORM=%2

:: x64 or Win32
set MSPLATFORM=%3

:: 64 or 32
set SUFFIX=%4

:: ========================================================================================================
:: ==== <BUILD>
:: ========================================================================================================

call %VISUAL_STUDIO_VC%\vcvarsall.bat %ARCHITECTURE%

set CMD=-G msvs_version=2013
set CMD=%CMD% -Dtarget_arch=%PLATFORM%
set CMD=%CMD% -Dcomponent=static_library
set CMD=%CMD% -Dmode=release
set CMD=%CMD% -Dlibrary=static_library
set CMD=%CMD% -Dv8_use_snapshot=false

echo %CMD%

cd V8-%V8_VERSION%

python build\gyp_v8 %CMD%

cd build

:: DEBUG

rmdir /S /Q Debug
rmdir /S /Q Debug%SUFFIX%

msbuild All.sln /t:v8 /p:Configuration=Debug /p:Platform=%MSPLATFORM%
msbuild All.sln /t:v8_libbase /p:Configuration=Debug /p:Platform=%MSPLATFORM%
msbuild All.sln /t:v8_libplatform /p:Configuration=Debug /p:Platform=%MSPLATFORM%

cd ..\third_party\icu
msbuild icu.sln /t:icudata /p:Configuration=Debug /p:Platform=%MSPLATFORM%
msbuild icu.sln /t:icui18n /p:Configuration=Debug /p:Platform=%MSPLATFORM%
msbuild icu.sln /t:icuuc /p:Configuration=Debug /p:Platform=%MSPLATFORM%
cd ..\..\build

ren Debug Debug%SUFFIX%

:: RELEASE

rmdir /S /Q Release
rmdir /S /Q Release%SUFFIX%

msbuild All.sln /t:v8 /p:Configuration=Release /p:Platform=%MSPLATFORM%
msbuild All.sln /t:v8_libbase /p:Configuration=Release /p:Platform=%MSPLATFORM%
msbuild All.sln /t:v8_libplatform /p:Configuration=Release /p:Platform=%MSPLATFORM%

cd ..\third_party\icu
msbuild icu.sln /t:icudata /p:Configuration=Release /p:Platform=%MSPLATFORM%
msbuild icu.sln /t:icui18n /p:Configuration=Release /p:Platform=%MSPLATFORM%
msbuild icu.sln /t:icuuc /p:Configuration=Release /p:Platform=%MSPLATFORM%
cd ..\..\build

ren Release Release%SUFFIX%

cd ..
cd ..

exit

:: ========================================================================================================
:: ==== <CONFIGURATION>
:: ========================================================================================================

:: Set the version of Visual Studio. This will just add a suffix to the string
:: of your directories to avoid mixing them up.
SET VS_VERSION=vs2013

:: Set this to the directory that contains vcvarsall.bat file of the
:: VC Visual Studio version you want to use for building ICU.
SET VISUAL_STUDIO_VC="C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC"

:: Set this to the version of ICU you are building
SET V8_VERSION=3.31.74.1

:: x86_amd64 or x86
set ARCHITECTURE=%1

::x64 or ia32
set PLATFORM=%2

:: x64 or Win32
set MSPLATFORM=%3

:: 64 or 32
set SUFFIX=%4

:: ========================================================================================================
:: ==== <BUILD>
:: ========================================================================================================

call %VISUAL_STUDIO_VC%\vcvarsall.bat %ARCHITECTURE%

set CMD=-G msvs_version=2013
set CMD=%CMD% -Dtarget_arch=%PLATFORM%
set CMD=%CMD% -Dcomponent=static_library
set CMD=%CMD% -Dmode=release
set CMD=%CMD% -Dlibrary=static_library
set CMD=%CMD% -Dv8_use_snapshot=false

echo %CMD%

cd V8-%V8_VERSION%

.\third_party\python_26\python.exe build\gyp_v8 %CMD%

cd build

:: DEBUG

rmdir /S /Q Debug
rmdir /S /Q Debug%SUFFIX%

msbuild All.sln /t:v8 /p:Configuration=Debug /p:Platform=%MSPLATFORM%
msbuild All.sln /t:v8_libbase /p:Configuration=Debug /p:Platform=%MSPLATFORM%
msbuild All.sln /t:v8_libplatform /p:Configuration=Debug /p:Platform=%MSPLATFORM%

cd ..\third_party\icu
msbuild icu.sln /t:icudata /p:Configuration=Debug /p:Platform=%MSPLATFORM%
msbuild icu.sln /t:icui18n /p:Configuration=Debug /p:Platform=%MSPLATFORM%
msbuild icu.sln /t:icuuc /p:Configuration=Debug /p:Platform=%MSPLATFORM%
cd ..\..\build

ren Debug Debug%SUFFIX%

:: RELEASE

rmdir /S /Q Release
rmdir /S /Q Release%SUFFIX%

msbuild All.sln /t:v8 /p:Configuration=Release /p:Platform=%MSPLATFORM%
msbuild All.sln /t:v8_libbase /p:Configuration=Release /p:Platform=%MSPLATFORM%
msbuild All.sln /t:v8_libplatform /p:Configuration=Release /p:Platform=%MSPLATFORM%

cd ..\third_party\icu
msbuild icu.sln /t:icudata /p:Configuration=Release /p:Platform=%MSPLATFORM%
msbuild icu.sln /t:icui18n /p:Configuration=Release /p:Platform=%MSPLATFORM%
msbuild icu.sln /t:icuuc /p:Configuration=Release /p:Platform=%MSPLATFORM%
cd ..\..\build

ren Release Release%SUFFIX%

cd ..
cd ..

exit

Use the python interpreter which V8 brings to run gyp.


@ECHO OFF
SETLOCAL
SETLOCAL ENABLEDELAYEDEXPANSION

REM ===========================================================================

SET SelfPath="%0"
SET VsWherePath="C:/Program Files (x86)/Microsoft Visual Studio/Installer/vswhere.exe"

REM ===========================================================================

SET vsversion=%1
IF "%vsversion%" == "" (
	CALL :BootstrapLatest
	EXIT /B %ERRORLEVEL%
)

IF "%vsversion%" == "vs2010" (
	CALL :LegacyVisualBootstrap "%vsversion%" "100"

) ELSE IF "%vsversion%" == "vs2012" (
	CALL :LegacyVisualBootstrap "%vsversion%" "110"

) ELSE IF "%vsversion%" == "vs2013" (
	CALL :LegacyVisualBootstrap "%vsversion%" "120"

) ELSE IF "%vsversion%" == "vs2015" (
	CALL :LegacyVisualBootstrap "%vsversion%" "140"

) ELSE IF "%vsversion%" == "vs2017" (
	CALL :VsWhereVisualBootstrap "%vsversion%" "15.0" "16.0"

) ELSE IF "%vsversion%" == "vs2019" (
	CALL :VsWhereVisualBootstrap "%vsversion%" "16.0" "17.0"

) ELSE (
	ECHO Unrecognized Visual Studio version %vsversion%
	EXIT /B 2
)

REM On error, pause to allow user to notice it if script was launched through explorer
IF %ERRORLEVEL% NEQ 0 (
	PAUSE
)

EXIT /B %ERRORLEVEL%

REM ===========================================================================

REM Utils

REM ===========================================================================

REM %1: PremakeVsVersion -> ex: vs2015
REM %2: VsVersion envvar -> ex: 140
:LegacyVisualBootstrap

SET "VsVersion_NoPoint=%~2"
SET "VsEnvVar=VS%VsVersion_NoPoint%COMNTOOLS"
SET "VsPath=!%VsEnvVar%!"

IF NOT EXIST "%VsPath%vsdevcmd.bat" (
	ECHO Could not find vsdevcmd.bat to setup Visual Studio environment
	EXIT /B 2
)

CALL "%VsPath%vsdevcmd.bat" && nmake MSDEV="%~1" -f Bootstrap.mak windows
EXIT /B %ERRORLEVEL%

REM :LegacyVisualBootstrap

REM ===========================================================================

REM %1: PremakeVsVersion -> ex: vs2010
REM %2: VisualStudio-style VSversionMin -> ex: 15.0
REM %3: VisualStudio-style VSversionMax -> ex: 16.0
:VsWhereVisualBootstrap
SET "PremakeVsVersion=%~1"
SET "VsVersionMin=%~2"
SET "VsVersionMax=%~3"

REM ref: https://github.com/Microsoft/vswhere/wiki/Start-Developer-Command-Prompt

IF NOT EXIST %VsWherePath% (
	ECHO Could not find vswhere.exe
	EXIT /B 2
)

SET VsWhereCmdLine="!VsWherePath! -nologo -latest -version [%VsVersionMin%,%VsVersionMax%) -property installationPath"

FOR /F "usebackq delims=" %%i in (`!VsWhereCmdLine!`) DO (

	IF EXIST "%%i\VC\Auxiliary\Build\vcvars32.bat" (
		CALL "%%i\VC\Auxiliary\Build\vcvars32.bat" && nmake MSDEV="%PremakeVsVersion%" -f Bootstrap.mak windows
		EXIT /B %ERRORLEVEL%
	)
)

ECHO Could not find vcvars32.bat to setup Visual Studio environment
EXIT /B 2

REM :VsWhereVisualBootstrap

REM ===========================================================================

:BootstrapLatest

IF EXIST %VsWherePath% (

	REM First try for not legacy Visual Studios ( >vs2017 )

	SET VsWhereCmdLine="!VsWherePath! -nologo -latest -property catalog.productLineVersion"

	FOR /F "usebackq delims=" %%i in (`!VsWhereCmdLine!`) DO (

		CALL %SelfPath% vs%%i

		EXIT /B %ERRORLEVEL%
	)

)

SET LegacyVSVersions=

REM Get latest Visual Studio legacy version

REM For all env var starting with VS
FOR /F "usebackq delims==" %%i in (`SET VS`) DO (

	REM Check if env var match pattern VS*COMNTOOLS (ie: VS140COMNTOOLS)
	ECHO "%%i" | FINDSTR /R /C:VS.*COMNTOOLS >nul && (

		SET "LegacyVSVersions=%%i"
	)
)

REM Strip VS
SET LegacyVSVersions=%LegacyVSVersions:VS=%
REM Strip COMNTOOLS
SET LegacyVSVersions=%LegacyVSVersions:COMNTOOLS=%

SET "VsVersionMap=140-vs2015;120-vs2013;110-vs2012;100-vs2010"
CALL SET PremakeVsVersion=%%VsVersionMap:*%LegacyVSVersions%-=%%
SET PremakeVsVersion=%PremakeVsVersion:;=&REM.%

IF NOT "%PremakeVsVersion%" == "" (
	CALL %SelfPath% %PremakeVsVersion%
	EXIT /B %ERRORLEVEL%
)

ECHO Could not find a Visual Studio installation
EXIT /B 2

REM :BootstrapLatest

REM ===========================================================================

REM SETLOCAL ENABLEDELAYEDEXPANSION
ENDLOCAL
REM SETLOCAL
ENDLOCAL

@ECHO OFF
SETLOCAL
SETLOCAL ENABLEDELAYEDEXPANSION

REM ===========================================================================

SET SelfPath="%0"
SET VsWherePath="C:/Program Files (x86)/Microsoft Visual Studio/Installer/vswhere.exe"

REM ===========================================================================

SET vsversion=%1
IF "%vsversion%" == "" (
	CALL :BootstrapLatest
	EXIT /B %ERRORLEVEL%
)

IF "%vsversion%" == "vs2010" (
	CALL :LegacyVisualBootstrap "%vsversion%" "100"

) ELSE IF "%vsversion%" == "vs2012" (
	CALL :LegacyVisualBootstrap "%vsversion%" "110"

) ELSE IF "%vsversion%" == "vs2013" (
	CALL :LegacyVisualBootstrap "%vsversion%" "120"

) ELSE IF "%vsversion%" == "vs2015" (
	CALL :LegacyVisualBootstrap "%vsversion%" "140"

) ELSE IF "%vsversion%" == "vs2017" (
	CALL :VsWhereVisualBootstrap "%vsversion%" "15.0" "16.0"

) ELSE IF "%vsversion%" == "vs2019" (
	CALL :VsWhereVisualBootstrap "%vsversion%" "16.0" "17.0"

) ELSE IF "%vsversion%" == "vs2022" (
	CALL :VsWhereVisualBootstrap "%vsversion%" "17.0" "18.0"

) ELSE (
	ECHO Unrecognized Visual Studio version %vsversion%
	EXIT /B 2
)

REM On error, pause to allow user to notice it if script was launched through explorer
IF %ERRORLEVEL% NEQ 0 (
	PAUSE
)

EXIT /B %ERRORLEVEL%

REM ===========================================================================

REM Utils

REM ===========================================================================

REM %1: PremakeVsVersion -> ex: vs2015
REM %2: VsVersion envvar -> ex: 140
:LegacyVisualBootstrap

SET "VsVersion_NoPoint=%~2"
SET "VsEnvVar=VS%VsVersion_NoPoint%COMNTOOLS"
SET "VsPath=!%VsEnvVar%!"

IF NOT EXIST "%VsPath%vsdevcmd.bat" (
	ECHO Could not find vsdevcmd.bat to setup Visual Studio environment
	EXIT /B 2
)

CALL "%VsPath%vsdevcmd.bat" && nmake MSDEV="%~1" -f Bootstrap.mak windows
EXIT /B %ERRORLEVEL%

REM :LegacyVisualBootstrap

REM ===========================================================================

REM %1: PremakeVsVersion -> ex: vs2010
REM %2: VisualStudio-style VSversionMin -> ex: 15.0
REM %3: VisualStudio-style VSversionMax -> ex: 16.0
:VsWhereVisualBootstrap
SET "PremakeVsVersion=%~1"
SET "VsVersionMin=%~2"
SET "VsVersionMax=%~3"

REM ref: https://github.com/Microsoft/vswhere/wiki/Start-Developer-Command-Prompt

IF NOT EXIST %VsWherePath% (
	ECHO Could not find vswhere.exe
	EXIT /B 2
)

SET VsWhereCmdLine="!VsWherePath! -nologo -latest -version [%VsVersionMin%,%VsVersionMax%) -property installationPath"

FOR /F "usebackq delims=" %%i in (`!VsWhereCmdLine!`) DO (

	IF EXIST "%%i\VC\Auxiliary\Build\vcvars32.bat" (
		CALL "%%i\VC\Auxiliary\Build\vcvars32.bat" && nmake MSDEV="%PremakeVsVersion%" -f Bootstrap.mak windows
		EXIT /B %ERRORLEVEL%
	)
)

ECHO Could not find vcvars32.bat to setup Visual Studio environment
EXIT /B 2

REM :VsWhereVisualBootstrap

REM ===========================================================================

:BootstrapLatest

IF EXIST %VsWherePath% (

	REM First try for not legacy Visual Studios ( >vs2017 )

	SET VsWhereCmdLine="!VsWherePath! -nologo -latest -property catalog.productLineVersion"

	FOR /F "usebackq delims=" %%i in (`!VsWhereCmdLine!`) DO (

		CALL %SelfPath% vs%%i

		EXIT /B %ERRORLEVEL%
	)

)

SET LegacyVSVersions=

REM Get latest Visual Studio legacy version

REM For all env var starting with VS
FOR /F "usebackq delims==" %%i in (`SET VS`) DO (

	REM Check if env var match pattern VS*COMNTOOLS (ie: VS140COMNTOOLS)
	ECHO "%%i" | FINDSTR /R /C:VS.*COMNTOOLS >nul && (

		SET "LegacyVSVersions=%%i"
	)
)

REM Strip VS
SET LegacyVSVersions=%LegacyVSVersions:VS=%
REM Strip COMNTOOLS
SET LegacyVSVersions=%LegacyVSVersions:COMNTOOLS=%

SET "VsVersionMap=140-vs2015;120-vs2013;110-vs2012;100-vs2010"
CALL SET PremakeVsVersion=%%VsVersionMap:*%LegacyVSVersions%-=%%
SET PremakeVsVersion=%PremakeVsVersion:;=&REM.%

IF NOT "%PremakeVsVersion%" == "" (
	CALL %SelfPath% %PremakeVsVersion%
	EXIT /B %ERRORLEVEL%
)

ECHO Could not find a Visual Studio installation
EXIT /B 2

REM :BootstrapLatest

REM ===========================================================================

REM SETLOCAL ENABLEDELAYEDEXPANSION
ENDLOCAL
REM SETLOCAL
ENDLOCAL

Add vs2022 support

Bootstrap.bat: Add vs2022 support


@rem Fetches (and builds if necessary) external dependencies
setlocal

@rem need this so that 'devenv' is found
call "%VS71COMNTOOLS%vsvars32.bat"
@rem set the build environment
call "%MSSdk%\SetEnv" /XP64 /RETAIL

@rem Assume we start inside the Python source directory
for %%i in (.) do set CWD=%%~fi
cd ..

@rem sqlite
if not exist sqlite-source-3.3.4 (
   svn export http://svn.python.org/projects/external/sqlite-source-3.3.4
   if exist %CWD%\PCbuild\sqlite3.dll del %CWD%\PCbuild\sqlite3.dll
)
if not exist %CWD%\PCbuild\sqlite3.dll (
   cd sqlite-source-3.3.4\amd64
   cl ..\*.c
   link /def:..\sqlite3.def  /dll *.obj /out:sqlite3.dll bufferoverflowU.lib
   cd ..\..
   copy sqlite-source-3.3.4\amd64\sqlite3.dll %CWD%\PCbuild
)

@rem bzip
if not exist bzip2-1.0.3 svn export http://svn.python.org/projects/external/bzip2-1.0.3

@rem Sleepycat db
if not exist db-4.4.20 svn export http://svn.python.org/projects/external/db-4.4.20
if not exist "db-4.4.20\build_win32\Release_AMD64\libdb44s.lib" (
   cd db-4.4.20\build_win32
   devenv Berkeley_DB.sln /build "Release AMD64" /project db_static /useenv
   cd ..\..
)

@rem OpenSSL
if not exist openssl-0.9.8a svn export http://svn.python.org/projects/external/openssl-0.9.8a

@rem tcltk
if not exist tcl8.4.12 (
   if exist tcltk rd /s/q tcltk
   svn export http://svn.python.org/projects/external/tcl8.4.12
   svn export http://svn.python.org/projects/external/tk8.4.12
)

@rem Fetches (and builds if necessary) external dependencies
setlocal

@rem need this so that 'devenv' is found
call "%VS71COMNTOOLS%vsvars32.bat"
@rem set the build environment
call "%MSSdk%\SetEnv" /XP64 /RETAIL

@rem Assume we start inside the Python source directory
for %%i in (.) do set CWD=%%~fi
cd ..

@rem sqlite
if not exist sqlite-source-3.3.4 (
   svn export http://svn.python.org/projects/external/sqlite-source-3.3.4
   if exist %CWD%\PCbuild\sqlite3.dll del %CWD%\PCbuild\sqlite3.dll
)
if not exist %CWD%\PCbuild\sqlite3.dll (
   cd sqlite-source-3.3.4\amd64
   cl ..\*.c
   link /def:..\sqlite3.def  /dll *.obj /out:sqlite3.dll bufferoverflowU.lib
   cd ..\..
   copy sqlite-source-3.3.4\amd64\sqlite3.dll %CWD%\PCbuild
)

@rem bzip
if not exist bzip2-1.0.3 svn export http://svn.python.org/projects/external/bzip2-1.0.3
if not exist bzip2-1.0.3\libbz2.lib (
   cd bzip2-1.0.3
   nmake /f makefile.msc CFLAGS="-DWIN32 -MD -Ox -D_FILE_OFFSET_BITS=64 -nologo /GS-"
   cd ..
)

@rem Sleepycat db
if not exist db-4.4.20 svn export http://svn.python.org/projects/external/db-4.4.20
if not exist "db-4.4.20\build_win32\Release_AMD64\libdb44s.lib" (
   cd db-4.4.20\build_win32
   devenv Berkeley_DB.sln /build "Release AMD64" /project db_static /useenv
   cd ..\..
)

@rem OpenSSL
if not exist openssl-0.9.8a svn export http://svn.python.org/projects/external/openssl-0.9.8a

@rem tcltk
if not exist tcl8.4.12 (
   if exist tcltk rd /s/q tcltk
   svn export http://svn.python.org/projects/external/tcl8.4.12
   svn export http://svn.python.org/projects/external/tk8.4.12
)

Build bzip2.

Build bzip2.


@ECHO OFF
rem Build frePPLe with Microsoft Visual C++ 2015 (aka vc14.0)
setlocal

rem EDIT THIS SECTION TO MATCH YOUR INSTALLATION
set PYTHON=C:\develop\python35
set XERCES=C:\develop\xerces-c-3.1.3-x86_64-windows-vc-14.0
set DOTNET=C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319

rem EDIT THIS SECTION WHEN NON_DEFAULT INSTALLATION FOLDER WAS CHOSEN
if exist "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC" (
  set VC=C:\Program Files ^(x86^)\Microsoft Visual Studio 14.0\VC
) else (
if exist "C:\Program Files\Microsoft Visual Studio 14.0\VC" (
  set VC=C:\Program Files\Microsoft Visual Studio 14.0\VC
) else (
  echo "Microsoft Visual Studio C++ 2015 not found"
  exit /B
))

rem PROCESS COMMAND LINE ARGUMENTS "-r (rebuild)" and "-d (debug)"
set conf=Release
set build=
:CheckOpts
if "%1"=="-r" (set build="/t:rebuild") & shift & goto CheckOpts
if "%1"=="-d" (set conf=Debug) & shift & goto CheckOpts

rem BUILD THE PROJECT
call "%VC%\vcvarsall" x86_amd64
set INCLUDE=%PYTHON%\include;%XERCES%\include;%INCLUDE%
set LIB=%PYTHON%\libs;%XERCES%\lib;%LIB%

"%DOTNET%\msbuild.exe" %build% /m /p:useenv=true /p:showenv=true frepple.sln "/p:Configuration=%conf%" /p:Platform=x64

@ECHO OFF
rem Build frePPLe with Microsoft Visual C++ 2015 (aka vc14.0)
setlocal

rem EDIT THIS SECTION TO MATCH YOUR INSTALLATION
set PYTHON=C:\develop\python35
set XERCES=C:\develop\xerces-c-3.1.3-x86_64-windows-vc14.0
set MSBUILD=C:\Program Files (x86)\MSBuild\14.0

rem EDIT THIS SECTION WHEN NON_DEFAULT INSTALLATION FOLDER WAS CHOSEN
if exist "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC" (
  set VC=C:\Program Files ^(x86^)\Microsoft Visual Studio 14.0\VC
) else (
if exist "C:\Program Files\Microsoft Visual Studio 14.0\VC" (
  set VC=C:\Program Files\Microsoft Visual Studio 14.0\VC
) else (
  echo "Microsoft Visual Studio C++ 2015 not found"
  exit /B
))

rem PROCESS COMMAND LINE ARGUMENTS "-r (rebuild)" and "-d (debug)"
set conf=Release
set build=
:CheckOpts
if "%1"=="-r" (set build="/t:rebuild") & shift & goto CheckOpts
if "%1"=="-d" (set conf=Debug) & shift & goto CheckOpts

rem BUILD THE PROJECT
call "%VC%\vcvarsall" x86_amd64
set INCLUDE=%PYTHON%\include;%XERCES%\include;%INCLUDE%
set LIB=%PYTHON%\libs;%XERCES%\lib;%LIB%

"%MSBUILD%\bin\msbuild.exe" %build% /m /p:useenv=true /p:showenv=true frepple.sln "/p:Configuration=%conf%" /p:Platform=x64

build script update for visual studio 2015


mkdir SQLite.Net
copy ..\src\SQLite.Net\bin\Release\SQLite.Net.dll SQLite.Net

mkdir SQLite.Net.Async
copy ..\src\SQLite.Net.Async\bin\Release\SQLite.Net.Async.dll SQLite.Net.Async

mkdir SQLite.Net.Platform.Generic
copy ..\src\SQLite.Net.Platform.Generic\bin\Release\SQLite.Net.Platform.Generic.dll SQLite.Net.Platform.Generic

mkdir SQLite.Net.Platform.Win32
copy ..\src\SQLite.Net.Platform.Win32\bin\Release\SQLite.Net.Platform.Win32.dll SQLite.Net.Platform.Win32

mkdir SQLite.Net.Platform.WindowsPhone8
mkdir SQLite.Net.Platform.WindowsPhone8\ARM
mkdir SQLite.Net.Platform.WindowsPhone8\x86
copy ..\src\SQLite.Net.Platform.WindowsPhone8\bin\x86\Release\SQLite.Net.Platform.WindowsPhone8.dll SQLite.Net.Platform.WindowsPhone8\x86
copy ..\src\SQLite.Net.Platform.WindowsPhone8\bin\ARM\Release\SQLite.Net.Platform.WindowsPhone8.dll SQLite.Net.Platform.WindowsPhone8\ARM

mkdir SQLite.Net.Platform.WinRT
copy ..\src\SQLite.Net.Platform.WinRT\bin\Release\SQLite.Net.Platform.WinRT.dll SQLite.Net.Platform.WinRT

mkdir SQLite.Net.Platform.XamarinAndroid
copy ..\src\SQLite.Net.Platform.XamarinAndroid\bin\Release\SQLite.Net.Platform.XamarinAndroid.dll SQLite.Net.Platform.XamarinAndroid

mkdir SQLite.Net.Platform.XamarinIOS
copy ..\src\SQLite.Net.Platform.XamarinIOS\bin\iPhone\Release\SQLite.Net.Platform.XamarinIOS.dll SQLite.Net.Platform.XamarinIOS

mkdir SQLite.Net.Platform.XamarinIOS.Unified
copy ..\src\SQLite.Net.Platform.XamarinIOS.Unified\bin\iPhone\Release\SQLite.Net.Platform.XamarinIOS.Unified.dll SQLite.Net.Platform.XamarinIOS.Unified

mkdir SQLite.Net
copy ..\src\SQLite.Net\bin\Release\SQLite.Net.dll SQLite.Net

mkdir SQLite.Net.Async
copy ..\src\SQLite.Net.Async\bin\Release\SQLite.Net.Async.dll SQLite.Net.Async

mkdir SQLite.Net.Platform.Generic
copy ..\src\SQLite.Net.Platform.Generic\bin\Release\SQLite.Net.Platform.Generic.dll SQLite.Net.Platform.Generic

mkdir SQLite.Net.Platform.Win32
copy ..\src\SQLite.Net.Platform.Win32\bin\Release\SQLite.Net.Platform.Win32.dll SQLite.Net.Platform.Win32

mkdir SQLite.Net.Platform.WindowsPhone8
mkdir SQLite.Net.Platform.WindowsPhone8\ARM
mkdir SQLite.Net.Platform.WindowsPhone8\x86
copy ..\src\SQLite.Net.Platform.WindowsPhone8\bin\x86\Release\SQLite.Net.Platform.WindowsPhone8.dll SQLite.Net.Platform.WindowsPhone8\x86
copy ..\src\SQLite.Net.Platform.WindowsPhone8\bin\ARM\Release\SQLite.Net.Platform.WindowsPhone8.dll SQLite.Net.Platform.WindowsPhone8\ARM

mkdir SQLite.Net.Platform.WinRT
copy ..\src\SQLite.Net.Platform.WinRT\bin\Release\SQLite.Net.Platform.WinRT.dll SQLite.Net.Platform.WinRT

mkdir SQLite.Net.Platform.XamarinAndroid
copy ..\src\SQLite.Net.Platform.XamarinAndroid\bin\Release\SQLite.Net.Platform.XamarinAndroid.dll SQLite.Net.Platform.XamarinAndroid

mkdir SQLite.Net.Platform.XamarinIOS
copy ..\src\SQLite.Net.Platform.XamarinIOS\bin\iPhone\Release\SQLite.Net.Platform.XamarinIOS.dll SQLite.Net.Platform.XamarinIOS

mkdir SQLite.Net.Platform.XamarinIOS.Unified
copy ..\src\SQLite.Net.Platform.XamarinIOS.Unified\bin\Release\SQLite.Net.Platform.XamarinIOS.Unified.dll SQLite.Net.Platform.XamarinIOS.Unified

Fix minor error in prepare.bat

packaging: Fix minor error in prepare.bat


mkdir /Script
cd /Script

create STRING "Restart DAQ"
set "Restart DAQ" "/home/newg2/Applications/field-daq/online/bin/restart_daq.sh
"
create STRING "Restart Front-Ends"
set "Restart Front-Ends" "/home/newg2/Applications/field-daq/online/bin/restart_frontends.sh"

Add odb init for run script buttons.

Add odb init for run script buttons.


set GRPC_TRACE=api
set GRPC_VERBOSITY=DEBUG
echo %GRPC_TRACE%
lua-cpp.exe greeter_server.lua
pause

REM set GRPC_TRACE=api
REM set GRPC_VERBOSITY=DEBUG
lua-cpp.exe greeter_server.lua
pause

Update bat.

Update bat.


@echo OFF
@setlocal

set VERSION=1.25.0
set TFDIR=C:\TreeFrog\%VERSION%
set MONBOC_VERSION=1.14.0
set LZ4_VERSION=1.9.1

:parse_loop
if "%1" == "" goto :start
if /i "%1" == "--prefix" goto :prefix
if /i "%1" == "--enable-debug" goto :enable_debug
if /i "%1" == "--enable-gui-mod" goto :enable_gui_mod
if /i "%1" == "--help" goto :help
if /i "%1" == "-h" goto :help
goto :help
:continue
shift
goto :parse_loop

:help
  echo Usage: %0 [OPTION]... [VAR=VALUE]...
  echo;
  echo Configuration:
  echo   -h, --help          display this help and exit
  echo   --enable-debug      compile with debugging information
  echo   --enable-gui-mod    compile and link with QtGui module
  echo;
  echo Installation directories:
  echo   --prefix=PREFIX     install files in PREFIX [%TFDIR%]
  goto :exit

:prefix
  shift
  if "%1" == "" goto :help
  set TFDIR=%1
  goto :continue

:enable_debug
  set DEBUG=yes
  goto :continue

:enable_gui_mod
  set USE_GUI=use_gui=1
  goto :continue

:start
if "%DEBUG%" == "yes" (
  set OPT="CONFIG+=debug"
) else (
  set OPT="CONFIG+=release"
)

::
:: Generates tfenv.bat
::
set BASEDIR=%~dp0
for %%I in (qmake.exe) do if exist %%~$path:I set QMAKE=%%~$path:I
for %%I in (cmake.exe) do if exist %%~$path:I set CMAKE=%%~$path:I
for %%I in (cl.exe)    do if exist %%~$path:I set MSCOMPILER=%%~$path:I
for %%I in (g++.exe)   do if exist %%~$path:I set GNUCOMPILER=%%~$path:I

if "%QMAKE%" == "" (
  echo Qt environment not found
  exit /b
)
if "%CMAKE%" == "" (
  echo CMake not found
  exit /b
)
if "%MSCOMPILER%" == "" if "%GNUCOMPILER%"  == "" (
  echo compiler not found
  exit /b
)

:: get qt install prefix
for /f usebackq %%I in (`qtpaths.exe --install-prefix`) do (
  set QT_INSTALL_PREFIX=%%I
  goto :break
)
:break

:: vcvarsall.bat setup
if not "%MSCOMPILER%" == "" (
  set MAKE=nmake
  if /i "%Platform%" == "x64" (
    set VCVARSOPT=amd64
    set BUILDTARGET=x64
    set ENVSTR=Environment to build for 64-bit executable  MSVC / Qt
  ) else (
    set VCVARSOPT=x86
    set BUILDTARGET=win32
    set ENVSTR=Environment to build for 32-bit executable  MSVC / Qt
  )

  echo %QT_INSTALL_PREFIX% | find "msvc2015" >NUL
  if not ERRORLEVEL 1 (
    if /i "%Platform%" == "x64" (
      set CMAKEOPT=Visual Studio 14 2015 Win64
    ) else (
      set CMAKEOPT=Visual Studio 14 2015
    )
  ) else (
    if /i "%Platform%" == "x64" (
      set CMAKEOPT=Visual Studio 15 2017 Win64
    ) else (
      set CMAKEOPT=Visual Studio 15 2017
    )
  )
) else (
  set MAKE=mingw32-make -j%NUMBER_OF_PROCESSORS%
  set ENVSTR=Environment to build for executable MinGW / Qt
)
SET /P X="%ENVSTR%"<NUL
qtpaths.exe --qt-version

for %%I in (qtenv2.bat) do if exist %%~$path:I set QTENV=%%~$path:I
set TFENV=tfenv.bat
echo @echo OFF> %TFENV%
echo ::>> %TFENV%
echo :: This file is generated by configure.bat>> %TFENV%
echo ::>> %TFENV%
echo;>> %TFENV%
echo set TFDIR=%TFDIR%>> %TFENV%
echo set TreeFrog_DIR=%TFDIR%>> %TFENV%
echo set QTENV="%QTENV%">> %TFENV%
echo set QMAKESPEC=%QMAKESPEC%>> %TFENV%
echo if exist %%QTENV%% ( call %%QTENV%% )>> %TFENV%
if not "%VCVARSOPT%" == "" (
  echo if not "%%VS140COMNTOOLS%%" == "" ^(>> %TFENV%
  echo   set VCVARSBAT="%%VS140COMNTOOLS%%..\..\VC\vcvarsall.bat">> %TFENV%
  echo ^) else if not "%%VS120COMNTOOLS%%" == "" ^(>> %TFENV%
  echo   set VCVARSBAT="%%VS120COMNTOOLS%%..\..\VC\vcvarsall.bat">> %TFENV%
  echo ^) else ^(>> %TFENV%
  echo   set VCVARSBAT="">> %TFENV%
  echo ^)>> %TFENV%
  echo if exist %%VCVARSBAT%% ^(>> %TFENV%
  echo   echo Setting up environment for MSVC usage...>> %TFENV%
  echo   call %%VCVARSBAT%% %VCVARSOPT%>> %TFENV%
  echo ^)>> %TFENV%
)
echo set PATH=%%TFDIR^%%\bin;%%PATH%%>> %TFENV%
echo echo Setup a TreeFrog/Qt environment.>> %TFENV%
echo echo -- TFDIR set to %%TFDIR%%>> %TFENV%
echo cd /D %%HOMEDRIVE%%%%HOMEPATH%%>> %TFENV%

set TFDIR=%TFDIR:\=/%
:: Builds MongoDB driver
cd %BASEDIR%3rdparty
rd /s /q  mongo-driver >nul 2>&1
del /f /q mongo-driver >nul 2>&1
mklink /j mongo-driver mongo-c-driver-%MONBOC_VERSION% >nul 2>&1
cd %BASEDIR%3rdparty\mongo-driver
rmdir /s /q cmake-build >nul 2>&1
mkdir cmake-build
cd %BASEDIR%3rdparty\mongo-driver\cmake-build
echo cmake -G"%CMAKEOPT%" -DCMAKE_CONFIGURATION_TYPES=Release -DENABLE_SSL=OFF -DENABLE_SNAPPY=OFF -DENABLE_SRV=OFF -DENABLE_SASL=OFF -DENABLE_ZLIB=OFF ..
cmake -G"%CMAKEOPT%" -DCMAKE_CONFIGURATION_TYPES=Release -DENABLE_SSL=OFF -DENABLE_SNAPPY=OFF -DENABLE_SRV=OFF -DENABLE_SASL=OFF -DENABLE_ZLIB=OFF ..
echo Compiling MongoDB driver library ...
devenv mongo-c-driver.sln /project bson_static /rebuild Release >nul 2>&1
devenv mongo-c-driver.sln /project mongoc_static /rebuild Release >nul 2>&1
if ERRORLEVEL 1 (
  echo Build failed.
  echo MongoDB driver not available.
  exit /b
)

:: Builds LZ4
cd %BASEDIR%3rdparty
echo Compiling LZ4 library ...
rd /s /q  lz4 >nul 2>&1
del /f /q lz4 >nul 2>&1
mklink /j lz4 lz4-%LZ4_VERSION% >nul 2>&1
if not "%MSCOMPILER%" == "" (
  for /F %%i in ('qtpaths.exe --install-prefix') do echo %%i | find "msvc2015" >NUL
  if not ERRORLEVEL 1 (
    devenv lz4\visual\VS2015\lz4.sln /project liblz4 /rebuild "Release|%BUILDTARGET%" >nul 2>&1
  ) else (
    devenv lz4\visual\VS2017\lz4.sln /project liblz4 /rebuild "Release|%BUILDTARGET%" >nul 2>&1
  )
  if ERRORLEVEL 1 (
    echo Build failed.
    echo LZ4 not available.
    exit /b
  )
) else (
  cd %BASEDIR%3rdparty\lz4\lib
  qmake -o makefile.liblz4
  %MAKE% -f makefile.liblz4 clean >nul 2>&1
  %MAKE% -f makefile.liblz4 >nul 2>&1
)

cd %BASEDIR%src
if exist Makefile ( %MAKE% -k distclean >nul 2>&1 )
qmake %OPT% target.path='%TFDIR%/bin' header.path='%TFDIR%/include' %USE_GUI%

cd %BASEDIR%tools
if exist Makefile ( %MAKE% -k distclean >nul 2>&1 )
qmake -recursive %OPT% target.path='%TFDIR%/bin' header.path='%TFDIR%/include' datadir='%TFDIR%'
%MAKE% qmake

echo;
echo First, run "%MAKE% install" in src directory.
echo Next, run "%MAKE% install" in tools directory.

:exit
exit /b

@echo OFF
@setlocal

set VERSION=1.25.0
set TFDIR=C:\TreeFrog\%VERSION%
set MONBOC_VERSION=1.14.0
set LZ4_VERSION=1.9.1
set BASEDIR=%~dp0

:parse_loop
if "%1" == "" goto :start
if /i "%1" == "--prefix" goto :prefix
if /i "%1" == "--enable-debug" goto :enable_debug
if /i "%1" == "--enable-gui-mod" goto :enable_gui_mod
if /i "%1" == "--help" goto :help
if /i "%1" == "-h" goto :help
goto :help
:continue
shift
goto :parse_loop

:help
  echo Usage: %0 [OPTION]... [VAR=VALUE]...
  echo;
  echo Configuration:
  echo   -h, --help          display this help and exit
  echo   --enable-debug      compile with debugging information
  echo   --enable-gui-mod    compile and link with QtGui module
  echo;
  echo Installation directories:
  echo   --prefix=PREFIX     install files in PREFIX [%TFDIR%]
  goto :exit

:prefix
  shift
  if "%1" == "" goto :help
  set TFDIR=%1
  goto :continue

:enable_debug
  set DEBUG=yes
  goto :continue

:enable_gui_mod
  set USE_GUI=use_gui=1
  goto :continue

:start
if "%DEBUG%" == "yes" (
  set OPT="CONFIG+=debug"
) else (
  set OPT="CONFIG+=release"
)

::
:: Generates tfenv.bat
::
for %%I in (qmake.exe) do if exist %%~$path:I set QMAKE=%%~$path:I
for %%I in (cmake.exe) do if exist %%~$path:I set CMAKE=%%~$path:I
for %%I in (cl.exe)    do if exist %%~$path:I set MSCOMPILER=%%~$path:I
for %%I in (g++.exe)   do if exist %%~$path:I set GNUCOMPILER=%%~$path:I

if "%QMAKE%" == "" (
  echo Qt environment not found
  exit /b
)
if "%CMAKE%" == "" (
  echo CMake not found
  exit /b
)
if "%MSCOMPILER%" == "" if "%GNUCOMPILER%"  == "" (
  echo compiler not found
  exit /b
)

:: get qt install prefix
for /f usebackq %%I in (`qtpaths.exe --install-prefix`) do (
  set QT_INSTALL_PREFIX=%%I
  goto :break
)
:break

:: vcvarsall.bat setup
if not "%MSCOMPILER%" == "" (
  set MAKE=nmake
  if /i "%Platform%" == "x64" (
    set VCVARSOPT=amd64
    set BUILDTARGET=x64
    set ENVSTR=Environment to build for 64-bit executable  MSVC / Qt
  ) else (
    set VCVARSOPT=x86
    set BUILDTARGET=win32
    set ENVSTR=Environment to build for 32-bit executable  MSVC / Qt
  )

  echo %QT_INSTALL_PREFIX% | find "msvc2015" >NUL
  if not ERRORLEVEL 1 (
    if /i "%Platform%" == "x64" (
      set CMAKEOPT=Visual Studio 14 2015 Win64
    ) else (
      set CMAKEOPT=Visual Studio 14 2015
    )
  ) else (
    if /i "%Platform%" == "x64" (
      set CMAKEOPT=Visual Studio 15 2017 Win64
    ) else (
      set CMAKEOPT=Visual Studio 15 2017
    )
  )
) else (
  set MAKE=mingw32-make -j%NUMBER_OF_PROCESSORS%
  set ENVSTR=Environment to build for executable MinGW / Qt
)
SET /P X="%ENVSTR%"<NUL
qtpaths.exe --qt-version

for %%I in (qtenv2.bat) do if exist %%~$path:I set QTENV=%%~$path:I
set TFENV=tfenv.bat
echo @echo OFF> %TFENV%
echo ::>> %TFENV%
echo :: This file is generated by configure.bat>> %TFENV%
echo ::>> %TFENV%
echo;>> %TFENV%
echo set TFDIR=%TFDIR%>> %TFENV%
echo set TreeFrog_DIR=%TFDIR%>> %TFENV%
echo set QTENV="%QTENV%">> %TFENV%
echo set QMAKESPEC=%QMAKESPEC%>> %TFENV%
echo if exist %%QTENV%% ( call %%QTENV%% )>> %TFENV%
if not "%VCVARSOPT%" == "" (
  echo if not "%%VS140COMNTOOLS%%" == "" ^(>> %TFENV%
  echo   set VCVARSBAT="%%VS140COMNTOOLS%%..\..\VC\vcvarsall.bat">> %TFENV%
  echo ^) else if not "%%VS120COMNTOOLS%%" == "" ^(>> %TFENV%
  echo   set VCVARSBAT="%%VS120COMNTOOLS%%..\..\VC\vcvarsall.bat">> %TFENV%
  echo ^) else ^(>> %TFENV%
  echo   set VCVARSBAT="">> %TFENV%
  echo ^)>> %TFENV%
  echo if exist %%VCVARSBAT%% ^(>> %TFENV%
  echo   echo Setting up environment for MSVC usage...>> %TFENV%
  echo   call %%VCVARSBAT%% %VCVARSOPT%>> %TFENV%
  echo ^)>> %TFENV%
)
echo set PATH=%%TFDIR^%%\bin;%%PATH%%>> %TFENV%
echo echo Setup a TreeFrog/Qt environment.>> %TFENV%
echo echo -- TFDIR set to %%TFDIR%%>> %TFENV%
echo cd /D %%HOMEDRIVE%%%%HOMEPATH%%>> %TFENV%

set TFDIR=%TFDIR:\=/%
:: Builds MongoDB driver
cd %BASEDIR%3rdparty
rd /s /q  mongo-driver >nul 2>&1
del /f /q mongo-driver >nul 2>&1
mklink /j mongo-driver mongo-c-driver-%MONBOC_VERSION% >nul 2>&1
cd %BASEDIR%3rdparty\mongo-driver
rmdir /s /q cmake-build >nul 2>&1
mkdir cmake-build
cd %BASEDIR%3rdparty\mongo-driver\cmake-build
echo cmake -G"%CMAKEOPT%" -DCMAKE_CONFIGURATION_TYPES=Release -DENABLE_SSL=OFF -DENABLE_SNAPPY=OFF -DENABLE_SRV=OFF -DENABLE_SASL=OFF -DENABLE_ZLIB=OFF ..
cmake -G"%CMAKEOPT%" -DCMAKE_CONFIGURATION_TYPES=Release -DENABLE_SSL=OFF -DENABLE_SNAPPY=OFF -DENABLE_SRV=OFF -DENABLE_SASL=OFF -DENABLE_ZLIB=OFF ..
echo Compiling MongoDB driver library ...
devenv mongo-c-driver.sln /project bson_static /rebuild Release >nul 2>&1
devenv mongo-c-driver.sln /project mongoc_static /rebuild Release >nul 2>&1
if ERRORLEVEL 1 (
  echo Build failed.
  echo MongoDB driver not available.
  exit /b
)

:: Builds LZ4
cd %BASEDIR%3rdparty
echo Compiling LZ4 library ...
rd /s /q  lz4 >nul 2>&1
del /f /q lz4 >nul 2>&1
mklink /j lz4 lz4-%LZ4_VERSION% >nul 2>&1
if not "%MSCOMPILER%" == "" (
  for /F %%i in ('qtpaths.exe --install-prefix') do echo %%i | find "msvc2015" >NUL
  if not ERRORLEVEL 1 (
    devenv lz4\visual\VS2015\lz4.sln /project liblz4 /rebuild "Release|%BUILDTARGET%" >nul 2>&1
  ) else (
    devenv lz4\visual\VS2017\lz4.sln /project liblz4 /rebuild "Release|%BUILDTARGET%" >nul 2>&1
  )
  if ERRORLEVEL 1 (
    echo Build failed.
    echo LZ4 not available.
    exit /b
  )
) else (
  cd %BASEDIR%3rdparty\lz4\lib
  qmake -o makefile.liblz4
  %MAKE% -f makefile.liblz4 clean >nul 2>&1
  %MAKE% -f makefile.liblz4 >nul 2>&1
)

cd %BASEDIR%src
if exist Makefile ( %MAKE% -k distclean >nul 2>&1 )
qmake %OPT% target.path='%TFDIR%/bin' header.path='%TFDIR%/include' %USE_GUI%

cd %BASEDIR%tools
if exist Makefile ( %MAKE% -k distclean >nul 2>&1 )
qmake -recursive %OPT% target.path='%TFDIR%/bin' header.path='%TFDIR%/include' datadir='%TFDIR%'
%MAKE% qmake

echo;
echo First, run "%MAKE% install" in src directory.
echo Next, run "%MAKE% install" in tools directory.

:exit
exit /b

Fix build error on Windows

Fix build error on Windows


..\cov-analysis\bin\cov-build.exe --dir cov-int "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\MSBuild.exe" /t:Rebuild MailKit.Coverity.sln

..\cov-analysis\bin\cov-build.exe --dir cov-int "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\MSBuild.exe" /t:Rebuild MailKit.Coverity.sln

Update cov-build.bat

Update cov-build.bat


@rem Copyright 2017 gRPC authors.
@rem
@rem Licensed under the Apache License, Version 2.0 (the "License");
@rem you may not use this file except in compliance with the License.
@rem You may obtain a copy of the License at
@rem
@rem     http://www.apache.org/licenses/LICENSE-2.0
@rem
@rem Unless required by applicable law or agreed to in writing, software
@rem distributed under the License is distributed on an "AS IS" BASIS,
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@rem See the License for the specific language governing permissions and
@rem limitations under the License.

SET ROOT=%~dp0
cd /d %~dp0

powershell -c "Get-Host"
powershell -c "$PSVersionTable"
powershell -c "[System.Environment]::OSVersion"
powershell -c "Get-WmiObject -Class Win32_ComputerSystem"
powershell -c "(Get-WmiObject -Class Win32_ComputerSystem).SystemType"

powershell -c "& { iwr https://raw.githubusercontent.com/grumpycoders/nvm-ps/master/nvm.ps1 | iex }"

SET PATH=%APPDATA%\nvm-ps;%APPDATA%\nvm-ps\nodejs;%PATH%
SET JOBS=8

call nvm version

call nvm install 8
call nvm use 8

call npm install || goto :error

SET JUNIT_REPORT_STACK=1
SET FAILED=0

for %%v in (4 6 7 8 9) do (
  call nvm install %%v
  call nvm use %%v
  @rem https://github.com/mapbox/node-pre-gyp/issues/362
  call npm install -g node-gyp
  node -e "console.log(process.versions)"

  mkdir reports\node%%v
  SET JUNIT_REPORT_PATH=reports/node%%v

  node -e "process.exit(process.version.startsWith('v%%v') ? 0 : -1)" || goto :error

  call .\node_modules\.bin\gulp clean.all || SET FAILED=1
  call .\node_modules\.bin\gulp setup.windows || SET FAILED=1
  call .\node_modules\.bin\gulp native.test || SET FAILED=1
)

node merge_kokoro_logs.js
if %FAILED% neq 0 exit /b 1
goto :EOF

:error
exit /b 1

@rem Copyright 2017 gRPC authors.
@rem
@rem Licensed under the Apache License, Version 2.0 (the "License");
@rem you may not use this file except in compliance with the License.
@rem You may obtain a copy of the License at
@rem
@rem     http://www.apache.org/licenses/LICENSE-2.0
@rem
@rem Unless required by applicable law or agreed to in writing, software
@rem distributed under the License is distributed on an "AS IS" BASIS,
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@rem See the License for the specific language governing permissions and
@rem limitations under the License.

SET ROOT=%~dp0
cd /d %~dp0

powershell -c "Get-Host"
powershell -c "$PSVersionTable"
powershell -c "[System.Environment]::OSVersion"
powershell -c "Get-WmiObject -Class Win32_ComputerSystem"
powershell -c "(Get-WmiObject -Class Win32_ComputerSystem).SystemType"

powershell -c "& { iwr https://raw.githubusercontent.com/grumpycoders/nvm-ps/master/nvm.ps1 | iex }"

SET PATH=%APPDATA%\nvm-ps;%APPDATA%\nvm-ps\nodejs;%PATH%
SET JOBS=8

call nvm version

call nvm install 8
call nvm use 8

call npm install || goto :error

SET JUNIT_REPORT_STACK=1
SET FAILED=0

for %%v in (4 6 7 8 9) do (
  call nvm install %%v
  call nvm use %%v
  if "%%v"=="4" (
    npm install -g npm@5
  )
  @rem https://github.com/mapbox/node-pre-gyp/issues/362
  call npm install -g node-gyp
  node -e "console.log(process.versions)"

  mkdir reports\node%%v
  SET JUNIT_REPORT_PATH=reports/node%%v

  node -e "process.exit(process.version.startsWith('v%%v') ? 0 : -1)" || goto :error

  call .\node_modules\.bin\gulp clean.all || SET FAILED=1
  call .\node_modules\.bin\gulp setup.windows || SET FAILED=1
  call .\node_modules\.bin\gulp native.test || SET FAILED=1
)

node merge_kokoro_logs.js
if %FAILED% neq 0 exit /b 1
goto :EOF

:error
exit /b 1

Upgrade npm on Node 4

Upgrade npm on Node 4


REM /!\ THIS SCRIPT SUPPOSE A FIXED PATH FOR PYTHON /!\
REM Each blocks could be triggered independently (i.e. commenting others)
REM (e.g. want to upload only python35 artifacts)

echo Uploading all Python artifacts...
tools\make pypi_upload WINDOWS_PATH_TO_PYTHON=c:\python27-64
tools\make pypi_upload WINDOWS_PATH_TO_PYTHON=c:\python35-64
tools\make pypi_upload WINDOWS_PATH_TO_PYTHON=c:\python36-64
echo Uploading all Python artifacts...DONE

echo Uploading .NET artifacts...
tools\make nuget_upload WINDOWS_PATH_TO_PYTHON=c:\python27-64
echo Uploading .NET artifacts...DONE

Add publish_delivery_win.cmd

Add publish_delivery_win.cmd


cd /d %~dp0
java -jar pathvisio.jar -p visplugins.jar %*

cd /d %~dp0
java -Xmx1024m -jar pathvisio.jar -p visplugins.jar %*

Increase memory limit for standard installation


@echo off

rem We use FPC to found out the Platform and OS to create a lib output path
fpc -iTP > tmpvar
set /p myplatform= < tmpvar
fpc -iTO > tmpvar
set /p myos= < tmpvar
del tmpvar

if exist ..\lib\%myplatform%-%myos%\nul.x goto exists

echo Creating missing directory ..\lib\%myplatform%-%myos%
mkdir ..\lib\%myplatform%-%myos%
goto end

:exists
echo "You've got the correct output lib directory"

:end

fpc -dDEBUG -dGDI @extrafpc.cfg corelib\gdi\fpgui_toolkit.pas

@echo off

rem We use FPC to found out the Platform and OS to create a lib output path
fpc -iTP > tmpvar
set /p myplatform= < tmpvar
fpc -iTO > tmpvar
set /p myos= < tmpvar
del tmpvar

if exist ..\lib\%myplatform%-%myos%\nul.x goto exists

echo Creating missing directory ..\lib\%myplatform%-%myos%
mkdir ..\lib\%myplatform%-%myos%
goto end

:exists
echo "You've got the correct output lib directory"

:end

fpc -dGDI @extrafpc.cfg corelib\gdi\fpgui_toolkit.pas

Disable -dDEBUG compiler define under windows (build from batch file).

It causes extensive debug info and checks not required for normal usage.


@ECHO OFF

REM Command file for Sphinx documentation

if "%SPHINXBUILD%" == "" (
	set SPHINXBUILD=sphinx-build
)
set BUILDDIR=build
set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% source
set I18NSPHINXOPTS=%SPHINXOPTS% source
if NOT "%PAPER%" == "" (
	set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS%
	set I18NSPHINXOPTS=-D latex_paper_size=%PAPER% %I18NSPHINXOPTS%
)

if "%1" == "" goto help

if "%1" == "help" (
	:help
	echo.Please use `make ^<target^>` where ^<target^> is one of
	echo.  html       to make standalone HTML files
	echo.  dirhtml    to make HTML files named index.html in directories
	echo.  singlehtml to make a single large HTML file
	echo.  pickle     to make pickle files
	echo.  json       to make JSON files
	echo.  htmlhelp   to make HTML files and a HTML help project
	echo.  qthelp     to make HTML files and a qthelp project
	echo.  devhelp    to make HTML files and a Devhelp project
	echo.  epub       to make an epub
	echo.  latex      to make LaTeX files, you can set PAPER=a4 or PAPER=letter
	echo.  text       to make text files
	echo.  man        to make manual pages
	echo.  texinfo    to make Texinfo files
	echo.  gettext    to make PO message catalogs
	echo.  changes    to make an overview over all changed/added/deprecated items
	echo.  xml        to make Docutils-native XML files
	echo.  pseudoxml  to make pseudoxml-XML files for display purposes
	echo.  linkcheck  to check all external links for integrity
	echo.  doctest    to run all doctests embedded in the documentation if enabled
	goto end
)

if "%1" == "clean" (
	for /d %%i in (%BUILDDIR%\*) do rmdir /q /s %%i
	del /q /s %BUILDDIR%\*
	goto end
)

%SPHINXBUILD% 2> nul
if errorlevel 9009 (
	echo.
	echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
	echo.installed, then set the SPHINXBUILD environment variable to point
	echo.to the full path of the 'sphinx-build' executable. Alternatively you
	echo.may add the Sphinx directory to PATH.
	echo.
	echo.If you don't have Sphinx installed, grab it from
	echo.http://sphinx-doc.org/
	exit /b 1
)

if "%1" == "html" (
	%SPHINXBUILD% -b html %ALLSPHINXOPTS% %BUILDDIR%/html
	if errorlevel 1 exit /b 1
	echo.
	echo.Build finished. The HTML pages are in %BUILDDIR%/html.
	goto end
)

if "%1" == "dirhtml" (
	%SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% %BUILDDIR%/dirhtml
	if errorlevel 1 exit /b 1
	echo.
	echo.Build finished. The HTML pages are in %BUILDDIR%/dirhtml.
	goto end
)

if "%1" == "singlehtml" (
	%SPHINXBUILD% -b singlehtml %ALLSPHINXOPTS% %BUILDDIR%/singlehtml
	if errorlevel 1 exit /b 1
	echo.
	echo.Build finished. The HTML pages are in %BUILDDIR%/singlehtml.
	goto end
)

if "%1" == "pickle" (
	%SPHINXBUILD% -b pickle %ALLSPHINXOPTS% %BUILDDIR%/pickle
	if errorlevel 1 exit /b 1
	echo.
	echo.Build finished; now you can process the pickle files.
	goto end
)

if "%1" == "json" (
	%SPHINXBUILD% -b json %ALLSPHINXOPTS% %BUILDDIR%/json
	if errorlevel 1 exit /b 1
	echo.
	echo.Build finished; now you can process the JSON files.
	goto end
)

if "%1" == "htmlhelp" (
	%SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% %BUILDDIR%/htmlhelp
	if errorlevel 1 exit /b 1
	echo.
	echo.Build finished; now you can run HTML Help Workshop with the ^
.hhp project file in %BUILDDIR%/htmlhelp.
	goto end
)

if "%1" == "qthelp" (
	%SPHINXBUILD% -b qthelp %ALLSPHINXOPTS% %BUILDDIR%/qthelp
	if errorlevel 1 exit /b 1
	echo.
	echo.Build finished; now you can run "qcollectiongenerator" with the ^
.qhcp project file in %BUILDDIR%/qthelp, like this:
	echo.^> qcollectiongenerator %BUILDDIR%\qthelp\SimPhoNy.qhcp
	echo.To view the help file:
	echo.^> assistant -collectionFile %BUILDDIR%\qthelp\SimPhoNy.ghc
	goto end
)

if "%1" == "devhelp" (
	%SPHINXBUILD% -b devhelp %ALLSPHINXOPTS% %BUILDDIR%/devhelp
	if errorlevel 1 exit /b 1
	echo.
	echo.Build finished.
	goto end
)

if "%1" == "epub" (
	%SPHINXBUILD% -b epub %ALLSPHINXOPTS% %BUILDDIR%/epub
	if errorlevel 1 exit /b 1
	echo.
	echo.Build finished. The epub file is in %BUILDDIR%/epub.
	goto end
)

if "%1" == "latex" (
	%SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex
	if errorlevel 1 exit /b 1
	echo.
	echo.Build finished; the LaTeX files are in %BUILDDIR%/latex.
	goto end
)

if "%1" == "latexpdf" (
	%SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex
	cd %BUILDDIR%/latex
	make all-pdf
	cd %BUILDDIR%/..
	echo.
	echo.Build finished; the PDF files are in %BUILDDIR%/latex.
	goto end
)

if "%1" == "latexpdfja" (
	%SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex
	cd %BUILDDIR%/latex
	make all-pdf-ja
	cd %BUILDDIR%/..
	echo.
	echo.Build finished; the PDF files are in %BUILDDIR%/latex.
	goto end
)

if "%1" == "text" (
	%SPHINXBUILD% -b text %ALLSPHINXOPTS% %BUILDDIR%/text
	if errorlevel 1 exit /b 1
	echo.
	echo.Build finished. The text files are in %BUILDDIR%/text.
	goto end
)

if "%1" == "man" (
	%SPHINXBUILD% -b man %ALLSPHINXOPTS% %BUILDDIR%/man
	if errorlevel 1 exit /b 1
	echo.
	echo.Build finished. The manual pages are in %BUILDDIR%/man.
	goto end
)

if "%1" == "texinfo" (
	%SPHINXBUILD% -b texinfo %ALLSPHINXOPTS% %BUILDDIR%/texinfo
	if errorlevel 1 exit /b 1
	echo.
	echo.Build finished. The Texinfo files are in %BUILDDIR%/texinfo.
	goto end
)

if "%1" == "gettext" (
	%SPHINXBUILD% -b gettext %I18NSPHINXOPTS% %BUILDDIR%/locale
	if errorlevel 1 exit /b 1
	echo.
	echo.Build finished. The message catalogs are in %BUILDDIR%/locale.
	goto end
)

if "%1" == "changes" (
	%SPHINXBUILD% -b changes %ALLSPHINXOPTS% %BUILDDIR%/changes
	if errorlevel 1 exit /b 1
	echo.
	echo.The overview file is in %BUILDDIR%/changes.
	goto end
)

if "%1" == "linkcheck" (
	%SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% %BUILDDIR%/linkcheck
	if errorlevel 1 exit /b 1
	echo.
	echo.Link check complete; look for any errors in the above output ^
or in %BUILDDIR%/linkcheck/output.txt.
	goto end
)

if "%1" == "doctest" (
	%SPHINXBUILD% -b doctest %ALLSPHINXOPTS% %BUILDDIR%/doctest
	if errorlevel 1 exit /b 1
	echo.
	echo.Testing of doctests in the sources finished, look at the ^
results in %BUILDDIR%/doctest/output.txt.
	goto end
)

if "%1" == "xml" (
	%SPHINXBUILD% -b xml %ALLSPHINXOPTS% %BUILDDIR%/xml
	if errorlevel 1 exit /b 1
	echo.
	echo.Build finished. The XML files are in %BUILDDIR%/xml.
	goto end
)

if "%1" == "pseudoxml" (
	%SPHINXBUILD% -b pseudoxml %ALLSPHINXOPTS% %BUILDDIR%/pseudoxml
	if errorlevel 1 exit /b 1
	echo.
	echo.Build finished. The pseudo-XML files are in %BUILDDIR%/pseudoxml.
	goto end
)

:end

add a make.bat for windows machines

add a make.bat for windows machines


@ECHO OFF

pushd %~dp0

REM Command file for Sphinx documentation

if "%SPHINXBUILD%" == "" (
	set SPHINXBUILD=sphinx-build
)
set SOURCEDIR=source
set BUILDDIR=build
set SPHINXPROJ=ChainerCV

if "%1" == "" goto help

%SPHINXBUILD% >NUL 2>NUL
if errorlevel 9009 (
	echo.
	echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
	echo.installed, then set the SPHINXBUILD environment variable to point
	echo.to the full path of the 'sphinx-build' executable. Alternatively you
	echo.may add the Sphinx directory to PATH.
	echo.
	echo.If you don't have Sphinx installed, grab it from
	echo.http://sphinx-doc.org/
	exit /b 1
)

%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS%
goto end

:help
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS%

:end
popd

Revert make.bat

Revert make.bat


@rem Used by the buildbot "clean" step.
call "%VS71COMNTOOLS%vsvars32.bat"
cd PCbuild
@echo Deleting .pyc/.pyo files ...
python_d.exe rmpyc.py
devenv.com /clean Debug pcbuild.sln

@rem Used by the buildbot "clean" step.
call "%VS71COMNTOOLS%vsvars32.bat"
cd PCbuild
@echo Deleting .pyc/.pyo files ...
python_d.exe rmpyc.py
devenv.com /clean Release pcbuild.sln
devenv.com /clean Debug pcbuild.sln

Clean both Release and Debug projects, to support the MSI builder.