Zachary Ware | 6b6e687 | 2017-06-10 14:58:42 -0500 | [diff] [blame] | 1 | @echo off |
Steve Dower | 68d663c | 2017-07-17 11:15:48 +0200 | [diff] [blame] | 2 | rem Downloads and build sources for libraries we depend upon |
| 3 | |
| 4 | goto Run |
| 5 | :Usage |
| 6 | echo.%~nx0 [flags and arguments] |
| 7 | echo. |
| 8 | echo.Download and build OpenSSL. This should only be performed in order to |
| 9 | echo.update the binaries kept online - in most cases, the files downloaded |
| 10 | echo.by the get_externals.bat script are sufficient for building CPython. |
| 11 | echo. |
| 12 | echo.Available flags: |
| 13 | echo. -h Display this help message |
| 14 | echo. |
| 15 | echo.Available arguments: |
| 16 | echo. --certificate (-c) The signing certificate to use for binaries. |
| 17 | echo. --organization The github organization to obtain sources from. |
| 18 | echo. |
| 19 | exit /b 127 |
| 20 | |
| 21 | :Run |
| 22 | setlocal |
| 23 | if "%PCBUILD%"=="" (set PCBUILD=%~dp0) |
| 24 | if "%EXTERNALS_DIR%"=="" (set EXTERNALS_DIR=%PCBUILD%\..\externals) |
| 25 | |
| 26 | set ORG_SETTING= |
| 27 | |
| 28 | :CheckOpts |
| 29 | if "%~1"=="-h" shift & goto Usage |
| 30 | if "%~1"=="--certificate" (set SigningCertificate=%~2) && shift && shift & goto CheckOpts |
| 31 | if "%~1"=="-c" (set SigningCertificate=%~2) && shift && shift & goto CheckOpts |
| 32 | if "%~1"=="--organization" (set ORG_SETTING=--organization "%~2") && shift && shift && goto CheckOpts |
| 33 | |
| 34 | if "%~1"=="" goto Build |
| 35 | echo Unrecognized option: %1 |
| 36 | goto Usage |
| 37 | |
| 38 | :Build |
Zachary Ware | 6c6d3a4 | 2017-12-30 17:17:36 -0600 | [diff] [blame] | 39 | call "%PCBUILD%\find_msbuild.bat" %MSBUILD% |
Steve Dower | 68d663c | 2017-07-17 11:15:48 +0200 | [diff] [blame] | 40 | if ERRORLEVEL 1 (echo Cannot locate MSBuild.exe on PATH or as MSBUILD variable & exit /b 2) |
| 41 | |
Zachary Ware | 6c6d3a4 | 2017-12-30 17:17:36 -0600 | [diff] [blame] | 42 | call "%PCBUILD%\find_python.bat" "%PYTHON%" |
Steve Dower | 68d663c | 2017-07-17 11:15:48 +0200 | [diff] [blame] | 43 | if ERRORLEVEL 1 (echo Cannot locate python.exe on PATH or as PYTHON variable & exit /b 3) |
| 44 | |
Paul Monson | fb7e750 | 2019-05-15 15:38:55 -0700 | [diff] [blame] | 45 | call "%PCBUILD%\get_externals.bat" --openssl-src --no-openssl %ORG_SETTING% |
Steve Dower | 68d663c | 2017-07-17 11:15:48 +0200 | [diff] [blame] | 46 | |
| 47 | if "%PERL%" == "" where perl > "%TEMP%\perl.loc" 2> nul && set /P PERL= <"%TEMP%\perl.loc" & del "%TEMP%\perl.loc" |
| 48 | if "%PERL%" == "" (echo Cannot locate perl.exe on PATH or as PERL variable & exit /b 4) |
| 49 | |
Zachary Ware | 6c6d3a4 | 2017-12-30 17:17:36 -0600 | [diff] [blame] | 50 | %MSBUILD% "%PCBUILD%\openssl.vcxproj" /p:Configuration=Release /p:Platform=Win32 |
Steve Dower | 68d663c | 2017-07-17 11:15:48 +0200 | [diff] [blame] | 51 | if errorlevel 1 exit /b |
Zachary Ware | 6c6d3a4 | 2017-12-30 17:17:36 -0600 | [diff] [blame] | 52 | %MSBUILD% "%PCBUILD%\openssl.vcxproj" /p:Configuration=Release /p:Platform=x64 |
Steve Dower | 68d663c | 2017-07-17 11:15:48 +0200 | [diff] [blame] | 53 | if errorlevel 1 exit /b |
Paul Monson | fb7e750 | 2019-05-15 15:38:55 -0700 | [diff] [blame] | 54 | %MSBUILD% "%PCBUILD%\openssl.vcxproj" /p:Configuration=Release /p:Platform=ARM |
| 55 | if errorlevel 1 exit /b |
| 56 | %MSBUILD% "%PCBUILD%\openssl.vcxproj" /p:Configuration=Release /p:Platform=ARM64 |
| 57 | if errorlevel 1 exit /b |
Steve Dower | b84bcc4 | 2017-09-09 06:13:06 -0700 | [diff] [blame] | 58 | |