| 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 |
|
Stack size in Windows environments |
| 11 |
Comments about Win32 builds |
Comments about Win32 builds |
| 12 |
Building under Windows with BCC5.5 |
Building under Windows with BCC5.5 |
| 13 |
Building PCRE on OpenVMS |
Building PCRE on OpenVMS |
| 15 |
|
|
| 16 |
GENERAL |
GENERAL |
| 17 |
|
|
| 18 |
I (Philip Hazel) have no knowledge of Windows or VMS sytems and how their |
I (Philip Hazel) have no experience of Windows or VMS sytems and how their |
| 19 |
libraries work. The items in the PCRE distribution and Makefile that relate to |
libraries work. The items in the PCRE distribution and Makefile that relate to |
| 20 |
anything other than Unix-like systems are untested by me. |
anything other than Unix-like systems are untested by me. |
| 21 |
|
|
| 42 |
(1) Copy or rename the file config.h.generic as config.h, and edit the macro |
(1) Copy or rename the file config.h.generic as config.h, and edit the macro |
| 43 |
settings that it contains to whatever is appropriate for your environment. |
settings that it contains to whatever is appropriate for your environment. |
| 44 |
In particular, if you want to force a specific value for newline, you can |
In particular, if you want to force a specific value for newline, you can |
| 45 |
define the NEWLINE macro. |
define the NEWLINE macro. When you compile any of the PCRE modules, you |
| 46 |
|
must specify -DHAVE_CONFIG_H to your compiler so that config.h is included |
| 47 |
|
in the sources. |
| 48 |
|
|
| 49 |
An alternative approach is not to edit config.h, but to use -D on the |
An alternative approach is not to edit config.h, but to use -D on the |
| 50 |
compiler command line to make any changes that you need. |
compiler command line to make any changes that you need to the |
| 51 |
|
configuration options. In this case -DHAVE_CONFIG_H must not be set. |
| 52 |
|
|
| 53 |
NOTE: There have been occasions when the way in which certain parameters |
NOTE: There have been occasions when the way in which certain parameters |
| 54 |
in config.h are used has changed between releases. (In the configure/make |
in config.h are used has changed between releases. (In the configure/make |
| 55 |
world, this is handled automatically.) When upgrading to a new release, |
world, this is handled automatically.) When upgrading to a new release, |
| 56 |
you are strongly advised to review config.h.generic before re-using what |
you are strongly advised to review config.h.generic before re-using what |
| 57 |
you had previously. |
you had previously. |
| 58 |
|
|
| 59 |
(2) Copy or rename the file pcre.h.generic as pcre.h. |
(2) Copy or rename the file pcre.h.generic as pcre.h. |
| 60 |
|
|
| 61 |
(3) EITHER: |
(3) EITHER: |
| 62 |
Copy or rename file pcre_chartables.c.dist as pcre_chartables.c. |
Copy or rename file pcre_chartables.c.dist as pcre_chartables.c. |
| 63 |
|
|
| 64 |
OR: |
OR: |
| 65 |
Compile dftables.c as a stand-alone program, and then run it with the |
Compile dftables.c as a stand-alone program (using -DHAVE_CONFIG_H if |
| 66 |
single argument "pcre_chartables.c". This generates a set of standard |
you have set up config.h), and then run it with the single argument |
| 67 |
character tables and writes them to that file. The tables are generated |
"pcre_chartables.c". This generates a set of standard character tables |
| 68 |
using the default C locale for your system. If you want to use a locale |
and writes them to that file. The tables are generated using the default |
| 69 |
that is specified by LC_xxx environment variables, add the -L option to |
C locale for your system. If you want to use a locale that is specified |
| 70 |
the dftables command. You must use this method if you are building on |
by LC_xxx environment variables, add the -L option to the dftables |
| 71 |
a system that uses EBCDIC code. |
command. You must use this method if you are building on a system that |
| 72 |
|
uses EBCDIC code. |
| 73 |
|
|
| 74 |
The tables in pcre_chartables.c are defaults. The caller of PCRE can |
The tables in pcre_chartables.c are defaults. The caller of PCRE can |
| 75 |
specify alternative tables at run time. |
specify alternative tables at run time. |
| 76 |
|
|
| 77 |
(4) Ensure that you have the following header files: |
(4) Ensure that you have the following header files: |
| 78 |
|
|
| 79 |
pcre_internal.h |
pcre_internal.h |
| 80 |
ucp.h |
ucp.h |
| 81 |
ucpinternal.h |
ucpinternal.h |
| 82 |
ucptable.h |
ucptable.h |
| 83 |
|
|
| 84 |
(5) Also ensure that you have the following file, which is #included as source |
(5) Also ensure that you have the following file, which is #included as source |
| 85 |
when building a debugging version of PCRE and is also used by pcretest. |
when building a debugging version of PCRE and is also used by pcretest. |
| 86 |
|
|
| 87 |
pcre_printint.src |
pcre_printint.src |
| 88 |
|
|
| 89 |
(6) Compile the following source files: |
(6) Compile the following source files, setting -DHAVE_CONFIG_H as a compiler |
| 90 |
|
option if you have set up config.h with your configuration, or else use |
| 91 |
|
other -D settings to change the configuration as required. |
| 92 |
|
|
| 93 |
pcre_chartables.c |
pcre_chartables.c |
| 94 |
pcre_compile.c |
pcre_compile.c |
| 95 |
pcre_config.c |
pcre_config.c |
| 110 |
pcre_valid_utf8.c |
pcre_valid_utf8.c |
| 111 |
pcre_version.c |
pcre_version.c |
| 112 |
pcre_xclass.c |
pcre_xclass.c |
| 113 |
|
|
| 114 |
|
Make sure that you include -I. in the compiler command (or equivalent for |
| 115 |
|
an unusual compiler) so that all included PCRE header files are first |
| 116 |
|
sought in the current directory. Otherwise you run the risk of picking up |
| 117 |
|
a previously-installed file from somewhere else. |
| 118 |
|
|
| 119 |
(7) Now link all the compiled code into an object library in whichever form |
(7) Now link all the compiled code into an object library in whichever form |
| 120 |
your system keeps such libraries. This is the basic PCRE C library. If |
your system keeps such libraries. This is the basic PCRE C library. If |
| 121 |
your system has static and shared libraries, you may have to do this once |
your system has static and shared libraries, you may have to do this once |
| 122 |
for each type. |
for each type. |
| 123 |
|
|
| 124 |
(8) Similarly, compile pcreposix.c and link the result (on its own) as the |
(8) Similarly, compile pcreposix.c (remembering -DHAVE_CONFIG_H if necessary) |
| 125 |
pcreposix library. |
and link the result (on its own) as the pcreposix library. |
| 126 |
|
|
| 127 |
(9) Compile the test program pcretest.c. This needs the functions in the |
(9) Compile the test program pcretest.c (again, don't forget -DHAVE_CONFIG_H). |
| 128 |
pcre and pcreposix libraries when linking. It also needs the |
This needs the functions in the pcre and pcreposix libraries when linking. |
| 129 |
pcre_printint.src source file, which it #includes. |
It also needs the pcre_printint.src source file, which it #includes. |
| 130 |
|
|
| 131 |
(10) Run pcretest on the testinput files in the testdata directory, and check |
(10) Run pcretest on the testinput files in the testdata directory, and check |
| 132 |
that the output matches the corresponding testoutput files. Note that the |
that the output matches the corresponding testoutput files. Note that the |
| 156 |
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. |
| 157 |
|
|
| 158 |
|
|
| 159 |
|
STACK SIZE IN WINDOWS ENVIRONMENTS |
| 160 |
|
|
| 161 |
|
The default processor stack size of 1Mb in some Windows environments is too |
| 162 |
|
small for matching patterns that need much recursion. In particular, test 2 may |
| 163 |
|
fail because of this. Normally, running out of stack causes a crash, but there |
| 164 |
|
have been cases where the test program has just died silently. See your linker |
| 165 |
|
documentation for how to increase stack size if you experience problems. The |
| 166 |
|
Linux default of 8Mb is a reasonable choice for the stack, though even that can |
| 167 |
|
be too small for some pattern/subject combinations. There is more about stack |
| 168 |
|
usage in the "pcrestack" documentation. |
| 169 |
|
|
| 170 |
|
|
| 171 |
COMMENTS ABOUT WIN32 BUILDS |
COMMENTS ABOUT WIN32 BUILDS |
| 172 |
|
|
| 173 |
There are two ways of building PCRE using the "configure, make, make install" |
There are two ways of building PCRE using the "configure, make, make install" |
| 321 |
$! |
$! |
| 322 |
========================= |
========================= |
| 323 |
|
|
| 324 |
Last Updated: 05 July 2007 |
Last Updated: 11 September 2007 |
| 325 |
**** |
**** |