zlib

Zlib is an essential compression library that’s required by most open-source software. Download the Zlib source (zlib125.zip) and unpack it with unzip or 7zip. Then, compile Zlib like this:

cd zlib-1.2.5/
make -f win32/Makefile.gcc

Manually copy the files as follows:

cp -iv zlib1.dll /mingw/bin
cp -iv zconf.h zlib.h /mingw/include
cp -iv libz.a /mingw/lib
cp -iv libzdll.a /mingw/lib/libz.dll.a

open_ssl build

環境:winxp x32

0. If you yet to have MinGW, read http://blog.simpleit.us/2010/05/30/installing-qt-qtcreator-and-mingw-for-windows/ to learn how to install it.

1. Download Perl from ActiveState site: http://www.activestate.com/activeperl/downloads . Choose version that match your Windows. MSI installer is recommended, unless you are so fluent in Windows and don’t mind spending time with little tweaks like adding PATH, etc

2. Run the MSI installer and point path to C:developtoolsperl . You may choose different path, but that’s what on my machine.

3. Having installed with Perl, now let’s fetch OpenSSL: http://www.openssl.org/source/openssl-0.9.8n.tar.gz (the latest version of OpenSSL 0.9.8 at the time of writing). I wouldn’t recommend chasing after the version 1.0 for now.

4. Extract openssl to C:developtools and you will obtain directory C:developtoolsopenssl-0.9.8n . Get inside it.

5. Before you start building anything, take note that the macro OPENSSL_IMPLEMENT_GLOBAL causes fatal errors. Find it inside the files openssl-0.9.8ne_os2.h , openssl-0.9.8nincludeopenssle_os2.h and openssl-0.9.8noutincopenssle_os2.h . Find the macro’s definition and change

static type _hide_##name

to

/* static type _hide_##name */ type _hide_##name

6. Now let’s build shared & static versions of OpenSSL with a single command (you are now inside C:developtoolsopenssl-0.9.8n):

msmingw32.bat shared

Navigate to YouTube and have some snack. It may take 15-20 mins to finish building.

7. When building is finished, you can copy outincopenssl to your mingwinclude directory. You also can copy generated *.a and *.dll files to mingwlib directory and the *.dll to mingwbin directory. If you hate copying, remember to make use of -I and -L flags to appropriate folders when building with MinGW.

Building & installation of OpenSSL is done.