mirror of https://github.com/tp4a/teleport
.adjust build script for Windows.
parent
e58ca64e3f
commit
c16d32e6d5
|
@ -161,7 +161,10 @@ class BuilderWin(BuilderBase):
|
||||||
os.chdir(self.OPENSSL_PATH_SRC)
|
os.chdir(self.OPENSSL_PATH_SRC)
|
||||||
os.system('""{}" Configure VC-WIN32"'.format(env.perl))
|
os.system('""{}" Configure VC-WIN32"'.format(env.perl))
|
||||||
os.system(r'ms\do_nasm')
|
os.system(r'ms\do_nasm')
|
||||||
os.system(r'"{}\VC\bin\vcvars32.bat" && nmake -f ms\nt.mak'.format(env.visual_studio_path))
|
# for vs2015
|
||||||
|
# utils.sys_exec(r'"{}\VC\bin\vcvars32.bat" && nmake -f ms\nt.mak'.format(env.visual_studio_path), direct_output=True)
|
||||||
|
# for vs2017 community
|
||||||
|
utils.sys_exec(r'"{}VC\Auxiliary\Build\vcvars32.bat" && nmake -f ms\nt.mak'.format(env.visual_studio_path), direct_output=True)
|
||||||
|
|
||||||
for f in _chk_output:
|
for f in _chk_output:
|
||||||
if not os.path.exists(f):
|
if not os.path.exists(f):
|
||||||
|
@ -175,9 +178,17 @@ class BuilderWin(BuilderBase):
|
||||||
utils.unzip(os.path.join(PATH_DOWNLOAD, file_name), PATH_EXTERNAL)
|
utils.unzip(os.path.join(PATH_DOWNLOAD, file_name), PATH_EXTERNAL)
|
||||||
os.rename(os.path.join(PATH_EXTERNAL, 'libssh-{}'.format(env.ver_libssh)), self.LIBSSH_PATH_SRC)
|
os.rename(os.path.join(PATH_EXTERNAL, 'libssh-{}'.format(env.ver_libssh)), self.LIBSSH_PATH_SRC)
|
||||||
|
|
||||||
|
# cc.n('fix libssh source code... ', end='')
|
||||||
|
# utils.ensure_file_exists(os.path.join(PATH_EXTERNAL, 'fix-external', 'libssh', 'src', 'sftp.c'))
|
||||||
|
# utils.copy_file(os.path.join(PATH_EXTERNAL, 'fix-external', 'libssh', 'src'), os.path.join(self.LIBSSH_PATH_SRC, 'src'), 'sftp.c')
|
||||||
cc.n('fix libssh source code... ', end='')
|
cc.n('fix libssh source code... ', end='')
|
||||||
utils.ensure_file_exists(os.path.join(PATH_EXTERNAL, 'fix-external', 'libssh', 'src', 'sftp.c'))
|
s_name = 'libssh-{}'.format(env.ver_libssh)
|
||||||
utils.copy_file(os.path.join(PATH_EXTERNAL, 'fix-external', 'libssh', 'src'), os.path.join(self.LIBSSH_PATH_SRC, 'src'), 'sftp.c')
|
utils.ensure_file_exists(os.path.join(PATH_EXTERNAL, 'fix-external', 'libssh', s_name, 'src', 'session.c'))
|
||||||
|
utils.ensure_file_exists(os.path.join(PATH_EXTERNAL, 'fix-external', 'libssh', s_name, 'src', 'libcrypto.c'))
|
||||||
|
utils.ensure_file_exists(os.path.join(PATH_EXTERNAL, 'fix-external', 'libssh', s_name, 'src', 'libcrypto-compat.c'))
|
||||||
|
utils.copy_file(os.path.join(PATH_EXTERNAL, 'fix-external', 'libssh', s_name, 'src'), os.path.join(self.LIBSSH_PATH_SRC, 'src'), 'session.c')
|
||||||
|
utils.copy_file(os.path.join(PATH_EXTERNAL, 'fix-external', 'libssh', s_name, 'src'), os.path.join(self.LIBSSH_PATH_SRC, 'src'), 'libcrypto.c')
|
||||||
|
utils.copy_file(os.path.join(PATH_EXTERNAL, 'fix-external', 'libssh', s_name, 'src'), os.path.join(self.LIBSSH_PATH_SRC, 'src'), 'libcrypto-compat.c')
|
||||||
|
|
||||||
out_file_lib = os.path.join(self.LIBSSH_PATH_SRC, 'lib', ctx.target_path, 'ssh.lib')
|
out_file_lib = os.path.join(self.LIBSSH_PATH_SRC, 'lib', ctx.target_path, 'ssh.lib')
|
||||||
out_file_dll = os.path.join(self.LIBSSH_PATH_SRC, 'lib', ctx.target_path, 'ssh.dll')
|
out_file_dll = os.path.join(self.LIBSSH_PATH_SRC, 'lib', ctx.target_path, 'ssh.dll')
|
||||||
|
|
|
@ -111,7 +111,7 @@ class Env(object):
|
||||||
|
|
||||||
if self.nasm is None or not os.path.exists(self.nasm):
|
if self.nasm is None or not os.path.exists(self.nasm):
|
||||||
if warn_miss_tool:
|
if warn_miss_tool:
|
||||||
cc.w(' - can not locate `nasm`, so I can build openssl.')
|
cc.w(' - can not locate `nasm`, so I can not build openssl.')
|
||||||
else:
|
else:
|
||||||
_nasm_path = os.path.abspath(os.path.join(self.nasm, '..'))
|
_nasm_path = os.path.abspath(os.path.join(self.nasm, '..'))
|
||||||
os.environ['path'] = os.environ['path'] + ';' + _nasm_path
|
os.environ['path'] = os.environ['path'] + ';' + _nasm_path
|
||||||
|
@ -123,12 +123,12 @@ class Env(object):
|
||||||
|
|
||||||
if self.perl is None or not os.path.exists(self.perl):
|
if self.perl is None or not os.path.exists(self.perl):
|
||||||
if warn_miss_tool:
|
if warn_miss_tool:
|
||||||
cc.w(' - can not locate `perl`, so I can build openssl.')
|
cc.w(' - can not locate `perl`, so I can not build openssl.')
|
||||||
|
|
||||||
self.visual_studio_path = self._get_visual_studio_path()
|
self.visual_studio_path = self._get_visual_studio_path()
|
||||||
if self.visual_studio_path is None or not os.path.exists(self.visual_studio_path):
|
if self.visual_studio_path is None or not os.path.exists(self.visual_studio_path):
|
||||||
if warn_miss_tool:
|
if warn_miss_tool:
|
||||||
cc.w(' - can not locate Visual Studio installation, so I can build openssl.')
|
cc.w(' - can not locate Visual Studio installation, so I can build nothing.')
|
||||||
|
|
||||||
if 'msbuild' in _tmp:
|
if 'msbuild' in _tmp:
|
||||||
self.msbuild = _tmp['msbuild']
|
self.msbuild = _tmp['msbuild']
|
||||||
|
@ -215,7 +215,6 @@ class Env(object):
|
||||||
# return p[0] if p is not None else None
|
# return p[0] if p is not None else None
|
||||||
|
|
||||||
def _get_visual_studio_path(self):
|
def _get_visual_studio_path(self):
|
||||||
p = None
|
|
||||||
p = self._winreg_read(winreg.HKEY_LOCAL_MACHINE, r'SOFTWARE\WOW6432Node\Microsoft\VisualStudio\SxS\VS7', r'15.0')
|
p = self._winreg_read(winreg.HKEY_LOCAL_MACHINE, r'SOFTWARE\WOW6432Node\Microsoft\VisualStudio\SxS\VS7', r'15.0')
|
||||||
return p[0] if p is not None else None
|
return p[0] if p is not None else None
|
||||||
|
|
||||||
|
|
|
@ -269,6 +269,7 @@ def ensure_file_exists(filename):
|
||||||
|
|
||||||
|
|
||||||
def sys_exec(cmd, direct_output=False, output_codec=None):
|
def sys_exec(cmd, direct_output=False, output_codec=None):
|
||||||
|
print(cmd)
|
||||||
if output_codec is None:
|
if output_codec is None:
|
||||||
if env.is_win:
|
if env.is_win:
|
||||||
output_codec = 'gb2312'
|
output_codec = 'gb2312'
|
||||||
|
|
|
@ -4,7 +4,7 @@ teleport项目用到的第三方库
|
||||||
|
|
||||||
- openssl
|
- openssl
|
||||||
https://www.openssl.org
|
https://www.openssl.org
|
||||||
openssl-1.0.2h
|
openssl-1.0.2p
|
||||||
请按openssl文档所述,编译出openssl的静态库。要编译openssl,需要
|
请按openssl文档所述,编译出openssl的静态库。要编译openssl,需要
|
||||||
- perl 建议安装ActivePerl http://www.activestate.com/ActivePerl
|
- perl 建议安装ActivePerl http://www.activestate.com/ActivePerl
|
||||||
- nasm http://www.nasm.us
|
- nasm http://www.nasm.us
|
||||||
|
@ -17,15 +17,15 @@ teleport项目用到的第三方库
|
||||||
注意:teleport项目使用源代码直接编译,因此解压缩源代码到此即可。
|
注意:teleport项目使用源代码直接编译,因此解压缩源代码到此即可。
|
||||||
- mongoose
|
- mongoose
|
||||||
https://github.com/cesanta/mongoose
|
https://github.com/cesanta/mongoose
|
||||||
mongoose 6.6
|
mongoose 6.12
|
||||||
注意:teleport项目使用源代码直接编译,因此解压缩源代码到此即可。
|
注意:teleport项目使用源代码直接编译,因此解压缩源代码到此即可。
|
||||||
- sqlite3
|
- sqlite3
|
||||||
http://sqlite.org/download.html
|
http://sqlite.org/download.html
|
||||||
sqlite3-amalgamation-3150200
|
sqlite3-autoconf-3250000
|
||||||
注意:teleport项目使用源代码直接编译,因此解压缩源代码到此即可。
|
注意:teleport项目使用源代码直接编译,因此解压缩源代码到此即可。
|
||||||
- mbedtls
|
- mbedtls
|
||||||
https://github.com/ARMmbed/mbedtls
|
https://github.com/ARMmbed/mbedtls
|
||||||
mbedtls-mbedtls-2.2.1
|
mbedtls-mbedtls-2.12.0
|
||||||
注意:teleport项目使用源代码直接编译,因此解压缩源代码到此即可。
|
注意:teleport项目使用源代码直接编译,因此解压缩源代码到此即可。
|
||||||
- libssh
|
- libssh
|
||||||
https://git.libssh.org/projects/libssh.git/snapshot
|
https://git.libssh.org/projects/libssh.git/snapshot
|
||||||
|
@ -33,7 +33,7 @@ teleport项目用到的第三方库
|
||||||
Windows平台使用预制的libssh-static工程进行编译。
|
Windows平台使用预制的libssh-static工程进行编译。
|
||||||
- libuv
|
- libuv
|
||||||
https://github.com/libuv/libuv
|
https://github.com/libuv/libuv
|
||||||
v1.11.0.zip
|
v1.23.0.zip
|
||||||
注意:teleport项目使用源代码直接编译,因此解压缩源代码到此即可。
|
注意:teleport项目使用源代码直接编译,因此解压缩源代码到此即可。
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue