Saturday, February 21, 2015

Compiling OpenSSL, curl, and zlib on Windows

Getting these libraries compiled on Windows was surprisingly easy. Cross-platform support has come a long way. OpenSSL required the most setup. Both ActiveState Perl and NASM were necessary for the build process. Also, this assumes there is a temporary compile folder and then an install folder. The temporary compile folder in these examples has the version number afterward. The install folder is just the product name.

zlib
 mkdir \projects\zlib 
 mkdir \projects\zlib\bin
 mkdir \projects\zlib\include
 mkdir \projects\zlib\lib 
 cd \projects\zlib-1.2.8\  
 nmake /f .\win32\Makefile.msc  
 copy zlib.h ..\zlib\include
 copy zconf.h ..\zlib\include
 copy *.lib ..\zlib\lib  
 copy *.dll ..\zlib\bin  

curl
 cd \projects\curl-7.40.0\  
 nmake /f Makefile.vc mode=dll MACHINE=x86  
 move .\builds\libcurl-vc-x86-release-dll-ipv6-sspi-winssl ..\..\libcurl  

OpenSSL (static)
 cd \projects\openssl-1.0.2  
 perl Configure VC-WIN32 --prefix=c:/projects/openssl  
 .\ms\do_nasm  
 nmake -f .\ms\nt.mak  
 nmake -f .\ms\nt.mak test  
 nmake -f .\ms\nt.mak install  

OpenSSL (dll)
 cd \projects\openssl-1.0.2
 perl Configure VC-WIN32 --prefix=c:/projects/openssl  
 .\ms\do_nasm  
 nmake -f .\ms\ntdll.mak  
 nmake -f .\ms\ntdll.mak test  
 nmake -f .\ms\ntdll.mak install  

I may expand on this post. There are a few other libraries that I'd like to use and keeping instructions in one place seems like a good idea.