-
Notifications
You must be signed in to change notification settings - Fork 0
/
build_win64.bat
116 lines (85 loc) · 2.4 KB
/
build_win64.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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
@echo off
set ROOT=%~pd0
set OPENSSL_SOURCEDIR=%ROOT%openssl-1.0.??
set OPENSSL_INSTALDIR=%ROOT%openssl
set MAKEFLAGS=
if not "%1" == "" goto help
call :testroot %ROOT%
if errorlevel 1 goto error0
nmake -? >NUL 2>&1
if errorlevel 1 goto error1
ml64 -? >NUL 2>&1
if errorlevel 1 goto error1
perl -v >NUL 2>&1
if errorlevel 1 goto error2
cd /D %OPENSSL_SOURCEDIR% >NUL 2>&1
if errorlevel 1 goto error3
perl Configure VC-WIN64A no-ec --prefix=%OPENSSL_INSTALDIR%
if errorlevel 1 goto error
sed -i "/perl/ s/\\\\/\\//g" ms/do_win64a.bat
call ms\do_win64a
if errorlevel 1 goto error
sed -i "/PERL/ s/\\\\/\\//g; /PERL/ s/\\$@/\$(@:\\\\=\\/)/;" ms/nt*.mak
nmake -f ms\nt.mak clean
nmake -f ms\nt.mak
if errorlevel 1 goto error
nmake -f ms\nt.mak install
if errorlevel 1 goto error
:ossl_done
cd ..\Stack
if errorlevel 1 goto error
nmake -f win32_msc.mak clean
if errorlevel 1 goto error
nmake -f win32_msc.mak
if errorlevel 1 goto error
cd ..\AnsiCSample
if errorlevel 1 goto error
nmake -f win32_msc.mak clean
if errorlevel 1 goto error
nmake -f win32_msc.mak
if errorlevel 1 goto error
cd ..
goto done
:ossl_build
set CONFIGURE_INSIST=1
set PERL=perl
perl Configure VC-WIN64A no-shared no-asm no-ec --prefix=%OPENSSL_INSTALDIR% --openssldir=%OPENSSL_INSTALDIR%\ssl
if errorlevel 1 goto error
nmake
if errorlevel 1 goto error
nmake install
if errorlevel 1 goto error
copy ..\openssl\lib\libcrypto.lib ..\openssl\lib\libeay32.lib
copy ..\openssl\lib\libssl.lib ..\openssl\lib\ssleay32.lib
goto ossl_done
:testroot
if "%1" == "%ROOT%" exit /B 0
exit /B 1
:error0
echo fatal error: cannot continue.
echo the directory %ROOT% must not contain blanks
goto done
:error1
echo fatal error: cannot continue.
echo this batch has to be called from a
echo 64bit visual studio command shell
goto done
:error2
echo fatal error: cannot continue.
echo perl has to be in the path
goto done
:error3
cd /D %ROOT%openssl-1.1.?? >NUL 2>&1
if not errorlevel 1 goto ossl_build
echo fatal error: cannot continue.
echo openssl sources must be at %OPENSSL_SOURCEDIR%
goto done
:error
echo fatal error: cannot continue.
:help
echo this batch has to be called from a
echo 64bit visual studio command shell
echo the directory %ROOT% must not contain blanks
echo openssl sources must be at %OPENSSL_SOURCEDIR%
echo perl has to be in the path
:done