安装准备
1)安装perl
推荐安装ActiveState Perl
网址: https://www.activestate.com/ActivePerl
需要将perl.exe所在bin目录加入PATH中
2)安装visual c编译器(这里已经安装了vs2015)
3)安装Netwide汇编器NSAM
网址: https://www.nasm.us
解压完成后,需要将nasm.exe所在目录加入PATH中
4)下载openssl源码
网址: https://www.openssl.org/source/
安装
# 进入源代码目录
cd F:\openssl
# 为了使用nmake
"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat"
# 执行下面语句如果还提示nmake.exe找不到,忽略警告,继续执行下面的命令
perl Configure VC-WIN32 --prefix=D:\openssl\release --openssldir=D:\openssl\release
nmake
# 可选
nmake test
nmake install
参考: https://wiki.openssl.org/index.php/Compilation_and_Installation#PREFIX_and_OPENSSLDIR
OpenSSL 1.1.0 and above
OpenSSL 1.1.0 changed the behavior of install rules. You should specify both --prefix and --openssldir to ensure make install works as expected.
错误提示
Failure! build file wasn't produced.
Please read INSTALL and associated NOTES files. You may also have to look over
your available compiler tool chain or change your configuration.
NASM not found - make sure it's installed and available on %PATH%
It looks like you don't have either nmake.exe or dmake.exe on your PATH,
so you will not be able to execute the commands from a Makefile. You can
install dmake.exe with the Perl Package Manager by running:
ppm install dmake
关于nmake
nmake是Microsoft Visual Studio中的附带命令
有两种方法能够使用nmake
- 打开vs2015 x86 Native Tools Command Prompt
- 将C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin将入环境变量PATH中