-
Notifications
You must be signed in to change notification settings - Fork 23
/
build_openssl.bat
75 lines (67 loc) · 1.68 KB
/
build_openssl.bat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
SETLOCAL
echo ---- Building OpenSSL ----
set OPENSSL_PATH=openssl-1.0.2h
SET VALRETURN=0
if %MACHINE_X86% (
set PLATFORM=Win32
) else (
set PLATFORM=x64
)
if %CONFIG_RELEASE% (
set CONFIG=Release
) else (
set CONFIG=Debug
)
cd build\%OPENSSL_PATH%
if %PLATFORM% == x64 (
rem From https://wiki.openssl.org/index.php/Compilation_and_Installation#Windows
perl Configure VC-WIN64A
call ms\do_win64a.bat
) else (
perl Configure VC-WIN32
rem NASM bust be in the PATH
call ms\do_nasm
rem Use the below instead if you don't want the assembly language files
rem perl Configure VC-WIN32 no-asm
rem ms\do_ms
)
IF ERRORLEVEL 1 (
SET VALRETURN=1
goto END
)
echo Cleaning both...
nmake -f ms\ntdll.mak clean
nmake -f ms\nt.mak clean
REM IGNORING ERRORS on either of these, because if the directory does not exist, they fail with
REM the del command and would make the compilation stop.
echo Building...
if %STATIC_LIBS% (
nmake -f ms\nt.mak
) else (
nmake -f ms\ntdll.mak
)
IF ERRORLEVEL 1 (
SET VALRETURN=1
goto END
)
set OPENSSL_TARGETS=out32
if NOT %STATIC_LIBS% (
set OPENSSL_TARGETS=%OPENSSL_TARGETS%dll
)
if NOT %CONFIG_RELEASE% (
set OPENSSL_TARGETS=%OPENSSL_TARGETS%.dbg
)
copy /b %OPENSSL_TARGETS%\libeay32.lib %LIB_DIR%
copy /b %OPENSSL_TARGETS%\ssleay32.lib %LIB_DIR%
if NOT %STATIC_LIBS% (
copy /b %OPENSSL_TARGETS%\libeay32.dll %LIB_DIR%
copy /b %OPENSSL_TARGETS%\ssleay32.dll %LIB_DIR%
)
md %INCLUDE_DIR%\openssl
copy /b inc32\openssl\*.h %INCLUDE_DIR%\openssl\
:END
cd %ROOT_DIR%
REM the GOTO command resets the errorlevel and the endlocal resets the local environment,
REM so I have to use this workaround
ENDLOCAL & SET VALRETURN=%VALRETURN%
exit /b %VALRETURN%