Monday, September 10, 2012

Build OpenSSL with MinGW

lock

OpenSSL is an open-source library that provides cryptographic and network security functions. It is used by so many open-source software that require SSL/TLS support. To build OpenSSL for Windows, first install MinGW. There are two flavors of MinGW: mingw and mingw64. Just pick one of the following and set it up accordingly:





Then, download the latest source tarball from the OpenSSL website and unpack it with 7-zip. 7-zip should be used because MinGW/MSYS tar has trouble with tarballs containing symlinks. However, cygwin has no problem with tarballs containing symlinks.



7-zip openssl

OpenSSL optionally incorporates the following libraries when found.





Assuming that you compiled both zlib and pthread as shown in the above links, configure OpenSSL like this.



./Configure -DHAVE_STRUCT_TIMESPEC -DPTW32_STATIC_LIB -L/mingw/lib -lz -lpthreadGC2 -lws2_32 --prefix=/mingw threads zlib mingw


Then, run make.



make


If you run into errors compiling some test codes, just copy dummytest.c over. However, it doesn't happen under Cygwin.



cp -iv test/dummytest.c test/md2test.c
cp -iv test/dummytest.c test/rc5test.c
cp -iv test/dummytest.c test/jpaketest.c


Then, install OpenSSL.



make install

No comments:

Post a Comment

About This Blog

KBlog logo This blog is about current events and issues concerning general population. Thanks for visiting the blog and posting your comments.

© Contents by KBlog

© Blogger template by Emporium Digital 2008

Followers

Total Pageviews

icon
Powered By Blogger