forked from mfkiwl/nassl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
buildAll_win64.py
executable file
·66 lines (44 loc) · 2.24 KB
/
buildAll_win64.py
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
#!/usr/bin/python
from os import mkdir, getcwd
from os.path import join
from sys import platform, version_info
from buildAll_config import OPENSSL_CONF_CMD, BUILD_DIR, PY_VERSION, OPENSSL_DIR, ZLIB_DIR, TEST_DIR, perform_build_task, create_folder
##### Full build fails right now on win64 #####
# The Openssl build fails at the very end but libeay32.lib and
# ssleay32.lib are still generated. You need to copy them manually
# to ./build/openssl-win64/lib and run the rest of the script
NASSL_INSTALL_DIR = join(BUILD_DIR, 'lib.win-amd64-' + PY_VERSION)
OPENSSL_INSTALL_DIR = join(BUILD_DIR, 'openssl-win64')
ZLIB_LIB_DIR = ZLIB_DIR + '\\contrib\\vstudio\\vc9\\x64\\ZlibStatRelease\\zlibstat.lib'
def main():
# Create folder
create_folder(join(TEST_DIR, 'nassl'))
openssl_internal_dir = join(OPENSSL_INSTALL_DIR, "include", "openssl-internal")
create_folder(openssl_internal_dir)
# Build Zlib
ZLIB_BUILD_TASKS = [
'bld_ml64.bat',
'vcbuild /rebuild ..\\vstudio\\vc9\\zlibvc.sln "Release|x64"']
perform_build_task('ZLIB', ZLIB_BUILD_TASKS, ZLIB_DIR + '\\contrib\\masmx64\\')
# Build OpenSSL
OPENSSL_BUILD_TASKS = [
OPENSSL_CONF_CMD('VC-WIN64A' , OPENSSL_INSTALL_DIR, ZLIB_DIR, ZLIB_LIB_DIR) + ' -DZLIB_WINAPI', # *hate* zlib
'ms\\do_win64a.bat',
#'nmake -f ms\\nt.mak clean', # This mysteriously fails on win64
'nmake -f ms\\nt.mak',
'nmake -f ms\\nt.mak install',
'xcopy /y %s %s'%(join(OPENSSL_DIR, 'e_os.h'), openssl_internal_dir), # copy some internal headers for accessing EDH and ECDH parameters
'xcopy /y %s %s'%(join(OPENSSL_DIR, 'ssl', 'ssl_locl.h'), openssl_internal_dir)]
perform_build_task('OPENSSL', OPENSSL_BUILD_TASKS, OPENSSL_DIR)
# Build nassl
NASSL_BUILD_TASKS = [
'python setup_win64.py build --plat-name=win-amd64',
'xcopy /y /s ' + NASSL_INSTALL_DIR + ' ' + TEST_DIR]
perform_build_task('NASSL', NASSL_BUILD_TASKS)
# Test nassl
NASSL_TEST_TASKS = [
'C:\\Python27\\python.exe -m unittest discover --pattern=*_Tests.py']
perform_build_task('NASSL Tests', NASSL_TEST_TASKS, TEST_DIR)
print '=== All Done! Compiled module is available in ./test/nassl/ ==='
if __name__ == "__main__":
main()