Revision $Id: pcre-compile-mingw.base,v 1.4 2009/12/04 22:16:43 pab Exp $ Purpose This recipe demonstrates how to build a static version of PCRE using MinGW/MSYS with UTF-8 and Unicode support. Motivation When compiling FTimes, we prefer to link against statically compiled PCRE libraries. This eliminates the need to have PCRE DLLs deployed on the systems that will be running the tool. 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 pcre-8.00 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 PCRE can be downloaded from the following URL. http://www.pcre.org/ Solution The solution is to run the configure script passing it the following options. Please see the README file included with the PCRE distribution for more detailed descriptions of the options. --disable-cpp - suppress building of C++ wrapper library --disable-shared - build using static libraries only --enable-newline-is-anycrlf - newline is any carrage return or line feed --enable-utf8 - add support for UTF-8 Unicode character strings --enable-unicode-properties - add support for unicode character properties The following steps describe how to implement this solution. 1. Start a new MSYS shell, and unpack the PCRE tar ball. $ tar -jxf pcre-8.00.tar.bz2 2. Change to the newly created pcre-8.00 directory, and run the configure script as follows: $ cd pcre-8.00 $ ./configure --disable-cpp --disable-shared --enable-newline-is-anycrlf --enable-utf8 --enable-unicode-properties 3. Compile with: $ make 4. Test with: $ make test Note: This results in an exception for pcretest.exe, and some of the tests fail. However, this does not appear to impact FTimes in any way. 5. Install PCRE with: $ make install Closing Remarks The process documented in this recipe is known to work with the stated versions of PCRE, 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.