1 |
<html>
|
2 |
<head>
|
3 |
<title>pcrebuild specification</title>
|
4 |
</head>
|
5 |
<body bgcolor="#FFFFFF" text="#00005A" link="#0066FF" alink="#3399FF" vlink="#2222BB">
|
6 |
This HTML document has been generated automatically from the original man page.
|
7 |
If there is any nonsense in it, please consult the man page, in case the
|
8 |
conversion went wrong.<br>
|
9 |
<ul>
|
10 |
<li><a name="TOC1" href="#SEC1">PCRE BUILD-TIME OPTIONS</a>
|
11 |
<li><a name="TOC2" href="#SEC2">UTF-8 SUPPORT</a>
|
12 |
<li><a name="TOC3" href="#SEC3">CODE VALUE OF NEWLINE</a>
|
13 |
<li><a name="TOC4" href="#SEC4">BUILDING SHARED AND STATIC LIBRARIES</a>
|
14 |
<li><a name="TOC5" href="#SEC5">POSIX MALLOC USAGE</a>
|
15 |
<li><a name="TOC6" href="#SEC6">LIMITING PCRE RESOURCE USAGE</a>
|
16 |
<li><a name="TOC7" href="#SEC7">HANDLING VERY LARGE PATTERNS</a>
|
17 |
</ul>
|
18 |
<br><a name="SEC1" href="#TOC1">PCRE BUILD-TIME OPTIONS</a><br>
|
19 |
<P>
|
20 |
This document describes the optional features of PCRE that can be selected when
|
21 |
the library is compiled. They are all selected, or deselected, by providing
|
22 |
options to the <b>configure</b> script which is run before the <b>make</b>
|
23 |
command. The complete list of options for <b>configure</b> (which includes the
|
24 |
standard ones such as the selection of the installation directory) can be
|
25 |
obtained by running
|
26 |
</P>
|
27 |
<P>
|
28 |
<pre>
|
29 |
./configure --help
|
30 |
</PRE>
|
31 |
</P>
|
32 |
<P>
|
33 |
The following sections describe certain options whose names begin with --enable
|
34 |
or --disable. These settings specify changes to the defaults for the
|
35 |
<b>configure</b> command. Because of the way that <b>configure</b> works,
|
36 |
--enable and --disable always come in pairs, so the complementary option always
|
37 |
exists as well, but as it specifies the default, it is not described.
|
38 |
</P>
|
39 |
<br><a name="SEC2" href="#TOC1">UTF-8 SUPPORT</a><br>
|
40 |
<P>
|
41 |
To build PCRE with support for UTF-8 character strings, add
|
42 |
</P>
|
43 |
<P>
|
44 |
<pre>
|
45 |
--enable-utf8
|
46 |
</PRE>
|
47 |
</P>
|
48 |
<P>
|
49 |
to the <b>configure</b> command. Of itself, this does not make PCRE treat
|
50 |
strings as UTF-8. As well as compiling PCRE with this option, you also have
|
51 |
have to set the PCRE_UTF8 option when you call the <b>pcre_compile()</b>
|
52 |
function.
|
53 |
</P>
|
54 |
<br><a name="SEC3" href="#TOC1">CODE VALUE OF NEWLINE</a><br>
|
55 |
<P>
|
56 |
By default, PCRE treats character 10 (linefeed) as the newline character. This
|
57 |
is the normal newline character on Unix-like systems. You can compile PCRE to
|
58 |
use character 13 (carriage return) instead by adding
|
59 |
</P>
|
60 |
<P>
|
61 |
<pre>
|
62 |
--enable-newline-is-cr
|
63 |
</PRE>
|
64 |
</P>
|
65 |
<P>
|
66 |
to the <b>configure</b> command. For completeness there is also a
|
67 |
--enable-newline-is-lf option, which explicitly specifies linefeed as the
|
68 |
newline character.
|
69 |
</P>
|
70 |
<br><a name="SEC4" href="#TOC1">BUILDING SHARED AND STATIC LIBRARIES</a><br>
|
71 |
<P>
|
72 |
The PCRE building process uses <b>libtool</b> to build both shared and static
|
73 |
Unix libraries by default. You can suppress one of these by adding one of
|
74 |
</P>
|
75 |
<P>
|
76 |
<pre>
|
77 |
--disable-shared
|
78 |
--disable-static
|
79 |
</PRE>
|
80 |
</P>
|
81 |
<P>
|
82 |
to the <b>configure</b> command, as required.
|
83 |
</P>
|
84 |
<br><a name="SEC5" href="#TOC1">POSIX MALLOC USAGE</a><br>
|
85 |
<P>
|
86 |
When PCRE is called through the POSIX interface (see the <b>pcreposix</b>
|
87 |
documentation), additional working storage is required for holding the pointers
|
88 |
to capturing substrings because PCRE requires three integers per substring,
|
89 |
whereas the POSIX interface provides only two. If the number of expected
|
90 |
substrings is small, the wrapper function uses space on the stack, because this
|
91 |
is faster than using <b>malloc()</b> for each call. The default threshold above
|
92 |
which the stack is no longer used is 10; it can be changed by adding a setting
|
93 |
such as
|
94 |
</P>
|
95 |
<P>
|
96 |
<pre>
|
97 |
--with-posix-malloc-threshold=20
|
98 |
</PRE>
|
99 |
</P>
|
100 |
<P>
|
101 |
to the <b>configure</b> command.
|
102 |
</P>
|
103 |
<br><a name="SEC6" href="#TOC1">LIMITING PCRE RESOURCE USAGE</a><br>
|
104 |
<P>
|
105 |
Internally, PCRE has a function called <b>match()</b> which it calls repeatedly
|
106 |
(possibly recursively) when performing a matching operation. By limiting the
|
107 |
number of times this function may be called, a limit can be placed on the
|
108 |
resources used by a single call to <b>pcre_exec()</b>. The limit can be changed
|
109 |
at run time, as described in the <b>pcreapi</b> documentation. The default is 10
|
110 |
million, but this can be changed by adding a setting such as
|
111 |
</P>
|
112 |
<P>
|
113 |
<pre>
|
114 |
--with-match-limit=500000
|
115 |
</PRE>
|
116 |
</P>
|
117 |
<P>
|
118 |
to the <b>configure</b> command.
|
119 |
</P>
|
120 |
<br><a name="SEC7" href="#TOC1">HANDLING VERY LARGE PATTERNS</a><br>
|
121 |
<P>
|
122 |
Within a compiled pattern, offset values are used to point from one part to
|
123 |
another (for example, from an opening parenthesis to an alternation
|
124 |
metacharacter). By default two-byte values are used for these offsets, leading
|
125 |
to a maximum size for a compiled pattern of around 64K. This is sufficient to
|
126 |
handle all but the most gigantic patterns. Nevertheless, some people do want to
|
127 |
process enormous patterns, so it is possible to compile PCRE to use three-byte
|
128 |
or four-byte offsets by adding a setting such as
|
129 |
</P>
|
130 |
<P>
|
131 |
<pre>
|
132 |
--with-link-size=3
|
133 |
</PRE>
|
134 |
</P>
|
135 |
<P>
|
136 |
to the <b>configure</b> command. The value given must be 2, 3, or 4. Using
|
137 |
longer offsets slows down the operation of PCRE because it has to load
|
138 |
additional bytes when handling them.
|
139 |
</P>
|
140 |
<P>
|
141 |
If you build PCRE with an increased link size, test 2 (and test 5 if you are
|
142 |
using UTF-8) will fail. Part of the output of these tests is a representation
|
143 |
of the compiled pattern, and this changes with the link size.
|
144 |
</P>
|
145 |
<P>
|
146 |
Last updated: 21 January 2003
|
147 |
<br>
|
148 |
Copyright © 1997-2003 University of Cambridge.
|