| 4 |
This document contains the following sections: |
This document contains the following sections: |
| 5 |
|
|
| 6 |
General |
General |
| 7 |
Generic instructions for the PCRE C library |
Generic instructions for the PCRE C library |
| 8 |
The C++ wrapper functions |
The C++ wrapper functions |
| 9 |
Building for virtual Pascal |
Building for virtual Pascal |
| 10 |
Comments about Win32 builds |
Comments about Win32 builds |
| 11 |
Building under Windows with BCC5.5 |
Building under Windows with BCC5.5 |
| 12 |
Building PCRE on OpenVMS |
Building PCRE on OpenVMS |
| 13 |
|
|
| 14 |
|
|
| 15 |
GENERAL |
GENERAL |
| 23 |
|
|
| 24 |
ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/Contrib |
ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/Contrib |
| 25 |
|
|
| 26 |
If you want to compile PCRE for a non-Unix system (or perhaps, more strictly, |
If you want to compile PCRE for a non-Unix system (especially for a system that |
| 27 |
for a system that does not support "configure" and "make" files), note that |
does not support "configure" and "make" files), note that the basic PCRE |
| 28 |
the basic PCRE library consists entirely of code written in Standard C, and so |
library consists entirely of code written in Standard C, and so should compile |
| 29 |
should compile successfully on any system that has a Standard C compiler and |
successfully on any system that has a Standard C compiler and library. The C++ |
| 30 |
library. The C++ wrapper functions are a separate issue (see below). |
wrapper functions are a separate issue (see below). |
| 31 |
|
|
| 32 |
|
The PCRE distribution contains some experimental support for "cmake", but this |
| 33 |
|
is incomplete and not documented. However if you are a "cmake" user you might |
| 34 |
|
like to try building with "cmake". |
| 35 |
|
|
| 36 |
|
|
| 37 |
GENERIC INSTRUCTIONS FOR THE PCRE C LIBRARY |
GENERIC INSTRUCTIONS FOR THE PCRE C LIBRARY |
| 122 |
A script for building PCRE using Borland's C++ compiler for use with VPASCAL |
A script for building PCRE using Borland's C++ compiler for use with VPASCAL |
| 123 |
was contributed by Alexander Tokarev. Stefan Weber updated the script and added |
was contributed by Alexander Tokarev. Stefan Weber updated the script and added |
| 124 |
additional files. The following files in the distribution are for building PCRE |
additional files. The following files in the distribution are for building PCRE |
| 125 |
for use with VP/Borland: makevp-c.txt, makevp-l.txt, makevp.bat, pcregexp.pas. |
for use with VP/Borland: makevp_c.txt, makevp_l.txt, makevp.bat, pcregexp.pas. |
| 126 |
|
|
| 127 |
|
|
| 128 |
COMMENTS ABOUT WIN32 BUILDS |
COMMENTS ABOUT WIN32 BUILDS |
| 129 |
|
|
| 130 |
There are two ways of building PCRE on Windows systems: using MinGW or using |
There are two ways of building PCRE using the "congifure, make, make install" |
| 131 |
Cygwin. These are not at all the same thing, and are completely different from |
paradigm on Windows systems: using MinGW or using Cygwin. These are not at all |
| 132 |
each other. |
the same thing; they are completely different from each other. There is also |
| 133 |
|
some experimental, undocumented support for building using "cmake", which you |
| 134 |
|
might like to try if you are familiar with "cmake". However, at the present |
| 135 |
|
time, the "cmake" process builds only a static library (not a dll), and the |
| 136 |
|
tests are not automatically run. |
| 137 |
|
|
| 138 |
The MinGW home page (http://www.mingw.org/) says this: |
The MinGW home page (http://www.mingw.org/) says this: |
| 139 |
|
|
| 144 |
|
|
| 145 |
The Cygwin home page (http://www.cygwin.com/) says this: |
The Cygwin home page (http://www.cygwin.com/) says this: |
| 146 |
|
|
| 147 |
Cygwin is a Linux-like environment for Windows. It consists of two parts: |
Cygwin is a Linux-like environment for Windows. It consists of two parts: |
| 148 |
|
|
| 149 |
. A DLL (cygwin1.dll) which acts as a Linux API emulation layer providing |
. A DLL (cygwin1.dll) which acts as a Linux API emulation layer providing |
| 150 |
substantial Linux API functionality |
substantial Linux API functionality |
| 151 |
|
|
| 152 |
. A collection of tools which provide Linux look and feel. |
. A collection of tools which provide Linux look and feel. |
| 153 |
|
|
| 154 |
The Cygwin DLL currently works with all recent, commercially released x86 32 |
The Cygwin DLL currently works with all recent, commercially released x86 32 |
| 155 |
bit and 64 bit versions of Windows, with the exception of Windows CE. |
bit and 64 bit versions of Windows, with the exception of Windows CE. |
| 156 |
|
|
| 157 |
On both MinGW and Cygwin, PCRE should build correctly using: |
On both MinGW and Cygwin, PCRE should build correctly using: |
| 158 |
|
|
| 159 |
./configure && make && make install |
./configure && make && make install |
| 160 |
|
|
| 161 |
However, if you want to statically link your program against the .a file, you |
This should create two libraries called libpcre and libpcreposix, and, if you |
| 162 |
must define PCRE_STATIC before including pcre.h, otherwise the pcre_malloc() |
have enabled building the C++ wrapper, a third one called libpcrecpp. |
| 163 |
and pcre_free() exported functions will be declared __declspec(dllimport), with |
|
| 164 |
|
If you want to statically link your program against a non-dll .a file, you must |
| 165 |
|
define PCRE_STATIC before including pcre.h, otherwise the pcre_malloc() and |
| 166 |
|
pcre_free() exported functions will be declared __declspec(dllimport), with |
| 167 |
unwanted results. |
unwanted results. |
| 168 |
|
|
| 169 |
Using Cygwin's compiler generates libraries and executables that depend on |
Using Cygwin's compiler generates libraries and executables that depend on |
| 184 |
front end to MinGW's gcc (if you install Cygwin's gcc, you get both Cygwin's |
front end to MinGW's gcc (if you install Cygwin's gcc, you get both Cygwin's |
| 185 |
gcc and MinGW's gcc). So, a user can: |
gcc and MinGW's gcc). So, a user can: |
| 186 |
|
|
| 187 |
. Build native binaries by using MinGW or by getting Cygwin and using |
. Build native binaries by using MinGW or by getting Cygwin and using |
| 188 |
-mno-cygwin. |
-mno-cygwin. |
| 189 |
|
|
| 190 |
. Build binaries that depend on cygwin1.dll by using Cygwin with the normal |
. Build binaries that depend on cygwin1.dll by using Cygwin with the normal |
| 191 |
compiler flags. |
compiler flags. |
| 192 |
|
|
| 193 |
The test files that are supplied with PCRE are in Unix format, with LF |
The test files that are supplied with PCRE are in Unix format, with LF |
| 194 |
characters as line terminators. It may be necessary to change the line |
characters as line terminators. It may be necessary to change the line |
| 195 |
terminators in order to get some of the tests to work. We hope to improves |
terminators in order to get some of the tests to work. We hope to improves |
| 196 |
things in this area in future. |
things in this area in future. |
| 197 |
|
|
| 198 |
|
|