Last active
March 14, 2016 14:39
-
-
Save Zingam/9e5fb170076490bedda3 to your computer and use it in GitHub Desktop.
How to build OpenSSL on Visual Studio 2013 (64bit target)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
How to build OpenSSL on Visual Studio 2013 (64bit target) | |
Note: | |
For some reason running the following commants from a .bat file won't work. | |
Use the Command Prompt. | |
Command Prompt: | |
VS2013 x64 Native Tools Command Prompt - for native builds for example if you | |
build for Windows 7 64 build you should use this Command Prompt. | |
VS2013 x86 Native Tools Command Prompt - use this if you are compiling on 32 bit | |
Windows for a 64 bit Windows target. | |
Required tools: | |
1. Install Visual Studio 2013 (latest version) | |
2. Install ActivePerl and add it to PATH - you need to be able to run it from | |
Command Prompt | |
Steps: | |
1. Get latest source version of OpenSSL from: https://www.openssl.org/source/ | |
2. Un-tar it (with 7-Zip) to C:/openssl-1.x.xx (for example openssl-1.0.1j) | |
3. Open VS2013 x64 Native Tools Command Prompt (on Windows 7 64bit) | |
Note: On Windows 8.1 open Command Prompt in the directory: | |
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\amd64 | |
and run vcvars64.bat | |
4. Change current directory to source directory C:/openssl-1.x.xx | |
5. Run the following commands: | |
perl Configure VC-WIN32 --prefix=C:\Build-OpenSSL-VC-32 | |
ms\do_win64a | |
nmake -f ms\ntdll.mak | |
nmake -f ms\ntdll.mak test | |
nmake -f ms\ntdll.mak install | |
You'll get a copy of the build in C:\Build-OpenSSL-VC-32 | |
Notes: | |
1. For all builds use separate source and output directories. This is important! | |
2. This option will configure the output directory for the install step to | |
C:\Build-OpenSSL-VC-32: | |
--prefix=C:\Build-OpenSSL-VC-32 | |
3. For a debug build use: | |
perl Configure debug-VC-WIN64A | |
4. To test the build use: | |
nmake -f ms\ntdll.mak test | |
5. For 32 bit build use: | |
Command Prompt initialized with vcvars32.bat | |
perl Configure VC-WIN32 --prefix=C:\Build-OpenSSL-VC-32 | |
ms\do_ms | |
Links: | |
http://wiki.openssl.org/index.php/Compilation_and_Installation#W64 | |
http://p-nand-q.com/programming/windows/building_openssl_with_visual_studio_2013.html | |
Additional links (OpenSSL): | |
http://developer.covenanteyes.com/building-openssl-for-visual-studio/ | |
http://blog.nu42.com/2014/04/building-openssl-101g-on-64-bit-windows.html | |
Additional links (Visual Studio 2013): | |
http://stackoverflow.com/questions/27246382/what-is-the-difference-between-x64-native-tools-command-prompt-and-x64-cross-too |
Thanks for that, it makes a much better read me file than the one supplied!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@terentz and other facing this NMAKE : fatal error U1077: 'C:\Perl64\bin\perl.EXE' : return code '0x1'
check the version of perl here it's not the perl version remmended especialy if you have several perl installed including perl for mysys
where perl (in cmd) gives you the perl which will be used
in case you can add the path of the perl you really need
set PATH="my/path/to/Perl";%PATH%
another issue can be the asm files (to check if it's the issue) check build with
perl Configure no-asm VC-WIN32 --prefix=C:\Build-OpenSSL-VC-32