Revision $Id: openssl-compile-mingw.base,v 1.6 2008/08/15 20:46:03 klm Exp $ Purpose This recipe demonstrates how to build a static version of OpenSSL using MinGW/MSYS. Motivation When compiling FTimes and WebJob, we prefer to link against statically compiled OpenSSL libraries. This eliminates the need to have OpenSSL DLLs deployed on the systems that will be running the tools. Requirements Cooking with this recipe requires MinGW/MSYS and Active Perl 5.8.8 build 822 or higher. You can determine the version of Perl by running the command below inside the MSYS shell. $ perl -V This recipe was last tested on openssl-0.9.8h with MinGW 5.1.4, and MSYS 1.0.10. You can determine the version of MSYS by executing the command below in the MSYS shell. $ msysinfo You can determine the version of MinGW by viewing the programs listed in the "Add or Remove Programs" panel accessible from the Control Panel. The source tarball for OpenSSL can be downloaded from the following URL. http://openssl.org/source/ Solution The solution is to run the Configure script passing it two arguments: "mingw" and "no-shared". The following steps describe how to implement this solution. 1. Start a new MSYS shell, and unpack the OpenSSL tar ball. $ tar -zxf openssl-0.9.8h.tar.gz Note: There will be some "Cannot create symlink to ..." warnings, but you can safely ignore them. 2. Change to the newly created openssl-0.9.8h directory, run the Configure script as follows: $ cd openssl-0.9.8h $ ./Configure mingw no-shared 4. Compile with: $ make 5. Test with: $ make test 6. Install OpenSSL with: $ make install Note: There may be one or more "pod2man: command not found" errors. These can be ignored, but it would be good to figure out if they can be corrected. Closing Remarks The process documented in this recipe is known to work with the stated versions of OpenSSL, MinGW, MSYS, and Active Perl. Your mileage may vary with different version combinations. As a general rule, you should not use versions older than those stated above. Credits This recipe was brought to you by Klayton Monroe and Jason Smith.