1@echo off
2rem Downloads and build sources for libraries we depend upon
3
4goto Run
5:Usage
6echo.%~nx0 [flags and arguments]
7echo.
8echo.Download and build Tcl/Tk. This should only be performed in order to
9echo.update the binaries kept online - in most cases, the files downloaded
10echo.by the get_externals.bat script are sufficient for building CPython.
11echo.
12echo.Available flags:
13echo.  -h  Display this help message
14echo.
15echo.Available arguments:
16echo.  --certificate (-c)   The signing certificate to use for binaries.
17echo.  --organization       The github organization to obtain sources from.
18echo.
19exit /b 127
20
21:Run
22setlocal
23
24if "%PCBUILD%"=="" (set PCBUILD=%~dp0)
25if "%EXTERNALS_DIR%"=="" (set EXTERNALS_DIR=%PCBUILD%\..\externals)
26
27set CERT_SETTING=
28set ORG_SETTING=
29
30:CheckOpts
31if "%~1"=="-h" shift & goto Usage
32if "%~1"=="--certificate" (set SigningCertificate=%~2) && shift && shift & goto CheckOpts
33if "%~1"=="-c" (set SigningCertificate=%~2) && shift && shift & goto CheckOpts
34if "%~1"=="--organization" (set ORG_SETTING=--organization "%~2") && shift && shift && goto CheckOpts
35
36if "%~1"=="" goto Build
37echo Unrecognized option: %1
38goto Usage
39
40:Build
41call "%PCBUILD%\find_msbuild.bat" %MSBUILD%
42if ERRORLEVEL 1 (echo Cannot locate MSBuild.exe on PATH or as MSBUILD variable & exit /b 2)
43
44rem call "%PCBUILD%\find_python.bat" "%PYTHON%"
45rem if ERRORLEVEL 1 (echo Cannot locate python.exe on PATH or as PYTHON variable & exit /b 3)
46
47call "%PCBUILD%\get_externals.bat" --tkinter-src %ORG_SETTING%
48
49%MSBUILD% "%PCBUILD%\tcl.vcxproj" /p:Configuration=Release /p:Platform=Win32
50%MSBUILD% "%PCBUILD%\tk.vcxproj" /p:Configuration=Release /p:Platform=Win32
51%MSBUILD% "%PCBUILD%\tix.vcxproj" /p:Configuration=Release /p:Platform=Win32
52
53%MSBUILD% "%PCBUILD%\tcl.vcxproj" /p:Configuration=Release /p:Platform=x64
54%MSBUILD% "%PCBUILD%\tk.vcxproj" /p:Configuration=Release /p:Platform=x64
55%MSBUILD% "%PCBUILD%\tix.vcxproj" /p:Configuration=Release /p:Platform=x64
56