win10 源碼安裝openssl


安裝准備

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

  1. 打開vs2015 x86 Native Tools Command Prompt
  2. 將C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin將入環境變量PATH中

參考


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM