OpenSSL version: 1.0.2H
Compiler: MSVC (VS2013)
Need to prepare the tool: Perl.
Perl download for Windows environment Please poke here: Http://www.activestate.com/activeperl
Open the VS2013 x86 Native command Prompt (compiled by the 32-bit version) and switch to the SSL solution path:
Perl Configure vc-win32 --prefix=C:\build-openssl-vc-32 #rel Ease version with Vc-win32 Debug version with Debug-vc-win32
ms\do_ms.bat nmake -F MS\NT. Mak nmake -F MS\NT. Mak Install
Run the command above, resulting in an error:
ssembling: tmp32\sha1-586.asm
tmp32\sha1-586.asm(1432) : error A2070:invalid instruction operands
tmp32\sha1-586.asm(1576) : error A2070:invalid instruction operands
Then the reason traced here: https://github.com/openssl/openssl/issues/169
See after the reason is that the original Do_ms.bat compilation is used MASM compiler, MASM compile sha1-586.asm file error. Issue above someone said do not use MASM compile, replace NASM compile,
Then I downloaded the NASM from NASM's official website, with the environment variable, run the following command:
Perl Configure vc-win32 --prefix=C:\build-openssl-vc-32 #rel Ease version with Vc-win32 Debug version with Debug-vc-win32
ms\do_nasm.bat nmake -F MS\NT. Mak nmake -F MS\NT. Mak Install
Then you can build it successfully.
References
http://developer.covenanteyes.com/building-openssl-for-visual-studio/
https://github.com/openssl/openssl/issues/169
Http://stackoverflow.com/questions/12850607/initializing-big-numbers-with-constants-in-masm
VS2013 compiling OpenSSL under Windows environment