安裝准備
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中