After following the instructions in INSTALL.W64 I have two problems:
You can also use MSYS+mingw-w64:
1) download and extract msys to C:\msys
2) download and extract mingw-w64 to c:\mingw64
3) run msys postinstall script. When it asks for your mingw installation, point it to C:\mingw64\bin
4) Extract an openssl daily snapshot (1.0.0 release has a bug). In the source dir run
configure mingw64
make
make check
make install
5) openssl is installed to /local/
The build instructions have changed since this question was originally asked. The new instructions can be found here. Note that you will need to have perl and NASM installed, and you will need to use the developer command prompt.
At the time of writing this how-to the most recent version of OpenSSL is 1.1.1a.
Environment:
Prerequisites:
Make sure both Perl and NASM are in PATH environment variable.
Compiling x64:
Step 4 is optional.
Compiling x86:
Step 4 is optional.
To compile the static libraries (both release and debug), this is what you need to do:
# The output directory for everything intersting OUT_D=out64.dbg # The output directory for all the temporary muck TMP_D=tmp64.dbg # The output directory for the header files INC_D=inc64 INCO_D=inc64\openssl
Use Conan. It is very simple to install and use.
You can request the files ready for use. For example for Linux x64 or usage with Visual Studio 2012. Here a sample instruction:
conan install OpenSSL/1.0.2g@lasote/stable -s arch="x86_64" -s build_type="Debug" -s compiler="gcc" -s compiler.version="5.3" -s os="Linux" -o 386="False" -o no_asm="False" -o no_rsa="False" -o no_cast="False" -o no_hmac="False" -o no_sse2="False" -o no_zlib="False" ...
I solved the problem this way, using the 1.0.1c source:
Add this block to util/pl/VC-32.pl
, just before the $o='\\';
line.
if ($debug)
{
$ssl .= 'd';
$crypto .= 'd';
}
Add this block to util/pl/VC-32.pl
, just before the if ($debug)
line.
if ($FLAVOR =~ /WIN64/)
{
$out_def =~ s/32/64/;
$tmp_def =~ s/32/64/;
$inc_def =~ s/32/64/;
}
Then build all varieties:
setenv /x86 /release
perl Configure VC-WIN32 --prefix=build -DUNICODE -D_UNICODE
ms\do_ms
nmake -f ms\ntdll.mak
setenv /x64 /release
perl Configure VC-WIN64A --prefix=build
ms\do_win64a.bat
nmake -f ms\ntdll.mak
setenv /x86 /debug
perl Configure debug-VC-WIN32 --prefix=build -DUNICODE -D_UNICODE
ms\do_ms
move /y ms\libeay32.def ms\libeay32d.def
move /y ms\ssleay32.def ms\ssleay32d.def
nmake -f ms\ntdll.mak
setenv /x64 /debug
perl Configure debug-VC-WIN64A --prefix=build
ms\do_win64a.bat
move /y ms\libeay32.def ms\libeay32d.def
move /y ms\ssleay32.def ms\ssleay32d.def
nmake -f ms\ntdll.mak