summaryrefslogtreecommitdiffstats
path: root/PCbuild/prepare_ssl.bat
diff options
context:
space:
mode:
authorSteve Dower <steve.dower@microsoft.com>2017-07-17 09:15:48 (GMT)
committerGitHub <noreply@github.com>2017-07-17 09:15:48 (GMT)
commit68d663cf85d1ac5eaf83482eed39c0a6f8093601 (patch)
treefe26ff995655c31aca2d5c0f7bc4f8048cca5cc4 /PCbuild/prepare_ssl.bat
parent49f6449ef4b81537c19b82329caaf60596c516c2 (diff)
downloadcpython-68d663cf85d1ac5eaf83482eed39c0a6f8093601.zip
cpython-68d663cf85d1ac5eaf83482eed39c0a6f8093601.tar.gz
cpython-68d663cf85d1ac5eaf83482eed39c0a6f8093601.tar.bz2
[bpo-30916] Pre-build OpenSSL and Tcl/Tk for Windows (#2688)
Updates ssl and tkinter projects to use pre-built externals
Diffstat (limited to 'PCbuild/prepare_ssl.bat')
-rw-r--r--PCbuild/prepare_ssl.bat63
1 files changed, 52 insertions, 11 deletions
diff --git a/PCbuild/prepare_ssl.bat b/PCbuild/prepare_ssl.bat
index ef8f7ad..1df5b8d 100644
--- a/PCbuild/prepare_ssl.bat
+++ b/PCbuild/prepare_ssl.bat
@@ -1,12 +1,53 @@
@echo off
-if not defined HOST_PYTHON (
- if "%1" EQU "Debug" (
- shift
- set HOST_PYTHON=python_d.exe
- if not exist python37_d.dll exit 1
- ) ELSE (
- set HOST_PYTHON=python.exe
- if not exist python37.dll exit 1
- )
-)
-%HOST_PYTHON% "%~dp0prepare_ssl.py" %1
+rem Downloads and build sources for libraries we depend upon
+
+goto Run
+:Usage
+echo.%~nx0 [flags and arguments]
+echo.
+echo.Download and build OpenSSL. This should only be performed in order to
+echo.update the binaries kept online - in most cases, the files downloaded
+echo.by the get_externals.bat script are sufficient for building CPython.
+echo.
+echo.Available flags:
+echo. -h Display this help message
+echo.
+echo.Available arguments:
+echo. --certificate (-c) The signing certificate to use for binaries.
+echo. --organization The github organization to obtain sources from.
+echo.
+exit /b 127
+
+:Run
+setlocal
+if "%PCBUILD%"=="" (set PCBUILD=%~dp0)
+if "%EXTERNALS_DIR%"=="" (set EXTERNALS_DIR=%PCBUILD%\..\externals)
+
+set ORG_SETTING=
+
+:CheckOpts
+if "%~1"=="-h" shift & goto Usage
+if "%~1"=="--certificate" (set SigningCertificate=%~2) && shift && shift & goto CheckOpts
+if "%~1"=="-c" (set SigningCertificate=%~2) && shift && shift & goto CheckOpts
+if "%~1"=="--organization" (set ORG_SETTING=--organization "%~2") && shift && shift && goto CheckOpts
+
+if "%~1"=="" goto Build
+echo Unrecognized option: %1
+goto Usage
+
+:Build
+call "%PCBUILD%find_msbuild.bat" %MSBUILD%
+if ERRORLEVEL 1 (echo Cannot locate MSBuild.exe on PATH or as MSBUILD variable & exit /b 2)
+
+call "%PCBUILD%find_python.bat" "%PYTHON%"
+if ERRORLEVEL 1 (echo Cannot locate python.exe on PATH or as PYTHON variable & exit /b 3)
+
+call "%PCBUILD%get_externals.bat" --openssl-src %ORG_SETTING%
+
+if "%PERL%" == "" where perl > "%TEMP%\perl.loc" 2> nul && set /P PERL= <"%TEMP%\perl.loc" & del "%TEMP%\perl.loc"
+if "%PERL%" == "" (echo Cannot locate perl.exe on PATH or as PERL variable & exit /b 4)
+
+%MSBUILD% "%PCBUILD%openssl.vcxproj" /p:Configuration=Release /p:Platform=Win32
+if errorlevel 1 exit /b
+%MSBUILD% "%PCBUILD%openssl.vcxproj" /p:Configuration=Release /p:Platform=x64
+if errorlevel 1 exit /b