ViewVC logotype

Contents of /code/trunk/doc/html/pcrebuild.html

Parent Directory Parent Directory | Revision Log Revision Log

Revision 111 - (show annotations)
Thu Mar 8 16:53:09 2007 UTC (14 years ago) by ph10
File MIME type: text/html
File size: 10564 byte(s)
Error occurred while calculating annotation data.
Create the PrepareRelease script to process the documentation and create the 
.generic files for distribution, also to remove trailing spaces. Update a lot 
more of the build-time documentation. Arrange for PrepareRelease and its 
sub-scripts to be distributed.
1 <html>
2 <head>
3 <title>pcrebuild specification</title>
4 </head>
5 <body bgcolor="#FFFFFF" text="#00005A" link="#0066FF" alink="#3399FF" vlink="#2222BB">
6 <h1>pcrebuild man page</h1>
7 <p>
8 Return to the <a href="index.html">PCRE index page</a>.
9 </p>
10 <p>
11 This page is part of the PCRE HTML documentation. It was generated automatically
12 from the original man page. If there is any nonsense in it, please consult the
13 man page, in case the conversion went wrong.
14 <br>
15 <ul>
16 <li><a name="TOC1" href="#SEC1">PCRE BUILD-TIME OPTIONS</a>
17 <li><a name="TOC2" href="#SEC2">C++ SUPPORT</a>
18 <li><a name="TOC3" href="#SEC3">UTF-8 SUPPORT</a>
20 <li><a name="TOC5" href="#SEC5">CODE VALUE OF NEWLINE</a>
22 <li><a name="TOC7" href="#SEC7">POSIX MALLOC USAGE</a>
23 <li><a name="TOC8" href="#SEC8">HANDLING VERY LARGE PATTERNS</a>
24 <li><a name="TOC9" href="#SEC9">AVOIDING EXCESSIVE STACK USAGE</a>
25 <li><a name="TOC10" href="#SEC10">LIMITING PCRE RESOURCE USAGE</a>
26 <li><a name="TOC11" href="#SEC11">USING EBCDIC CODE</a>
27 <li><a name="TOC12" href="#SEC12">SEE ALSO</a>
28 <li><a name="TOC13" href="#SEC13">AUTHOR</a>
29 <li><a name="TOC14" href="#SEC14">REVISION</a>
30 </ul>
31 <br><a name="SEC1" href="#TOC1">PCRE BUILD-TIME OPTIONS</a><br>
32 <P>
33 This document describes the optional features of PCRE that can be selected when
34 the library is compiled. They are all selected, or deselected, by providing
35 options to the <b>configure</b> script that is run before the <b>make</b>
36 command. The complete list of options for <b>configure</b> (which includes the
37 standard ones such as the selection of the installation directory) can be
38 obtained by running
39 <pre>
40 ./configure --help
41 </pre>
42 The following sections describe certain options whose names begin with --enable
43 or --disable. These settings specify changes to the defaults for the
44 <b>configure</b> command. Because of the way that <b>configure</b> works,
45 --enable and --disable always come in pairs, so the complementary option always
46 exists as well, but as it specifies the default, it is not described.
47 </P>
48 <br><a name="SEC2" href="#TOC1">C++ SUPPORT</a><br>
49 <P>
50 By default, the <b>configure</b> script will search for a C++ compiler and C++
51 header files. If it finds them, it automatically builds the C++ wrapper library
52 for PCRE. You can disable this by adding
53 <pre>
54 --disable-cpp
55 </pre>
56 to the <b>configure</b> command.
57 </P>
58 <br><a name="SEC3" href="#TOC1">UTF-8 SUPPORT</a><br>
59 <P>
60 To build PCRE with support for UTF-8 character strings, add
61 <pre>
62 --enable-utf8
63 </pre>
64 to the <b>configure</b> command. Of itself, this does not make PCRE treat
65 strings as UTF-8. As well as compiling PCRE with this option, you also have
66 have to set the PCRE_UTF8 option when you call the <b>pcre_compile()</b>
67 function.
68 </P>
69 <br><a name="SEC4" href="#TOC1">UNICODE CHARACTER PROPERTY SUPPORT</a><br>
70 <P>
71 UTF-8 support allows PCRE to process character values greater than 255 in the
72 strings that it handles. On its own, however, it does not provide any
73 facilities for accessing the properties of such characters. If you want to be
74 able to use the pattern escapes \P, \p, and \X, which refer to Unicode
75 character properties, you must add
76 <pre>
77 --enable-unicode-properties
78 </pre>
79 to the <b>configure</b> command. This implies UTF-8 support, even if you have
80 not explicitly requested it.
81 </P>
82 <P>
83 Including Unicode property support adds around 90K of tables to the PCRE
84 library, approximately doubling its size. Only the general category properties
85 such as <i>Lu</i> and <i>Nd</i> are supported. Details are given in the
86 <a href="pcrepattern.html"><b>pcrepattern</b></a>
87 documentation.
88 </P>
89 <br><a name="SEC5" href="#TOC1">CODE VALUE OF NEWLINE</a><br>
90 <P>
91 By default, PCRE interprets character 10 (linefeed, LF) as indicating the end
92 of a line. This is the normal newline character on Unix-like systems. You can
93 compile PCRE to use character 13 (carriage return, CR) instead, by adding
94 <pre>
95 --enable-newline-is-cr
96 </pre>
97 to the <b>configure</b> command. There is also a --enable-newline-is-lf option,
98 which explicitly specifies linefeed as the newline character.
99 <br>
100 <br>
101 Alternatively, you can specify that line endings are to be indicated by the two
102 character sequence CRLF. If you want this, add
103 <pre>
104 --enable-newline-is-crlf
105 </pre>
106 to the <b>configure</b> command. There is a fourth option, specified by
107 <pre>
108 --enable-newline-is-any
109 </pre>
110 which causes PCRE to recognize any Unicode newline sequence.
111 </P>
112 <P>
113 Whatever line ending convention is selected when PCRE is built can be
114 overridden when the library functions are called. At build time it is
115 conventional to use the standard for your operating system.
116 </P>
117 <br><a name="SEC6" href="#TOC1">BUILDING SHARED AND STATIC LIBRARIES</a><br>
118 <P>
119 The PCRE building process uses <b>libtool</b> to build both shared and static
120 Unix libraries by default. You can suppress one of these by adding one of
121 <pre>
122 --disable-shared
123 --disable-static
124 </pre>
125 to the <b>configure</b> command, as required.
126 </P>
127 <br><a name="SEC7" href="#TOC1">POSIX MALLOC USAGE</a><br>
128 <P>
129 When PCRE is called through the POSIX interface (see the
130 <a href="pcreposix.html"><b>pcreposix</b></a>
131 documentation), additional working storage is required for holding the pointers
132 to capturing substrings, because PCRE requires three integers per substring,
133 whereas the POSIX interface provides only two. If the number of expected
134 substrings is small, the wrapper function uses space on the stack, because this
135 is faster than using <b>malloc()</b> for each call. The default threshold above
136 which the stack is no longer used is 10; it can be changed by adding a setting
137 such as
138 <pre>
139 --with-posix-malloc-threshold=20
140 </pre>
141 to the <b>configure</b> command.
142 </P>
143 <br><a name="SEC8" href="#TOC1">HANDLING VERY LARGE PATTERNS</a><br>
144 <P>
145 Within a compiled pattern, offset values are used to point from one part to
146 another (for example, from an opening parenthesis to an alternation
147 metacharacter). By default, two-byte values are used for these offsets, leading
148 to a maximum size for a compiled pattern of around 64K. This is sufficient to
149 handle all but the most gigantic patterns. Nevertheless, some people do want to
150 process enormous patterns, so it is possible to compile PCRE to use three-byte
151 or four-byte offsets by adding a setting such as
152 <pre>
153 --with-link-size=3
154 </pre>
155 to the <b>configure</b> command. The value given must be 2, 3, or 4. Using
156 longer offsets slows down the operation of PCRE because it has to load
157 additional bytes when handling them.
158 </P>
159 <P>
160 If you build PCRE with an increased link size, test 2 (and test 5 if you are
161 using UTF-8) will fail. Part of the output of these tests is a representation
162 of the compiled pattern, and this changes with the link size.
163 </P>
164 <br><a name="SEC9" href="#TOC1">AVOIDING EXCESSIVE STACK USAGE</a><br>
165 <P>
166 When matching with the <b>pcre_exec()</b> function, PCRE implements backtracking
167 by making recursive calls to an internal function called <b>match()</b>. In
168 environments where the size of the stack is limited, this can severely limit
169 PCRE's operation. (The Unix environment does not usually suffer from this
170 problem, but it may sometimes be necessary to increase the maximum stack size.
171 There is a discussion in the
172 <a href="pcrestack.html"><b>pcrestack</b></a>
173 documentation.) An alternative approach to recursion that uses memory from the
174 heap to remember data, instead of using recursive function calls, has been
175 implemented to work round the problem of limited stack size. If you want to
176 build a version of PCRE that works this way, add
177 <pre>
178 --disable-stack-for-recursion
179 </pre>
180 to the <b>configure</b> command. With this configuration, PCRE will use the
181 <b>pcre_stack_malloc</b> and <b>pcre_stack_free</b> variables to call memory
182 management functions. Separate functions are provided because the usage is very
183 predictable: the block sizes requested are always the same, and the blocks are
184 always freed in reverse order. A calling program might be able to implement
185 optimized functions that perform better than the standard <b>malloc()</b> and
186 <b>free()</b> functions. PCRE runs noticeably more slowly when built in this
187 way. This option affects only the <b>pcre_exec()</b> function; it is not
188 relevant for the the <b>pcre_dfa_exec()</b> function.
189 </P>
190 <br><a name="SEC10" href="#TOC1">LIMITING PCRE RESOURCE USAGE</a><br>
191 <P>
192 Internally, PCRE has a function called <b>match()</b>, which it calls repeatedly
193 (sometimes recursively) when matching a pattern with the <b>pcre_exec()</b>
194 function. By controlling the maximum number of times this function may be
195 called during a single matching operation, a limit can be placed on the
196 resources used by a single call to <b>pcre_exec()</b>. The limit can be changed
197 at run time, as described in the
198 <a href="pcreapi.html"><b>pcreapi</b></a>
199 documentation. The default is 10 million, but this can be changed by adding a
200 setting such as
201 <pre>
202 --with-match-limit=500000
203 </pre>
204 to the <b>configure</b> command. This setting has no effect on the
205 <b>pcre_dfa_exec()</b> matching function.
206 </P>
207 <P>
208 In some environments it is desirable to limit the depth of recursive calls of
209 <b>match()</b> more strictly than the total number of calls, in order to
210 restrict the maximum amount of stack (or heap, if --disable-stack-for-recursion
211 is specified) that is used. A second limit controls this; it defaults to the
212 value that is set for --with-match-limit, which imposes no additional
213 constraints. However, you can set a lower limit by adding, for example,
214 <pre>
215 --with-match-limit-recursion=10000
216 </pre>
217 to the <b>configure</b> command. This value can also be overridden at run time.
218 </P>
219 <br><a name="SEC11" href="#TOC1">USING EBCDIC CODE</a><br>
220 <P>
221 PCRE assumes by default that it will run in an environment where the character
222 code is ASCII (or Unicode, which is a superset of ASCII). PCRE can, however, be
223 compiled to run in an EBCDIC environment by adding
224 <pre>
225 --enable-ebcdic
226 </pre>
227 to the <b>configure</b> command.
228 </P>
229 <br><a name="SEC12" href="#TOC1">SEE ALSO</a><br>
230 <P>
231 <b>pcreapi</b>(3), <b>pcre_config</b>(3).
232 </P>
233 <br><a name="SEC13" href="#TOC1">AUTHOR</a><br>
234 <P>
235 Philip Hazel
236 <br>
237 University Computing Service
238 <br>
239 Cambridge CB2 3QH, England.
240 <br>
241 </P>
242 <br><a name="SEC14" href="#TOC1">REVISION</a><br>
243 <P>
244 Last updated: 06 March 2007
245 <br>
246 Copyright &copy; 1997-2007 University of Cambridge.
247 <br>
248 <p>
249 Return to the <a href="index.html">PCRE index page</a>.
250 </p>


Name Value
svn:eol-style native
svn:keywords "Author Date Id Revision Url"

  ViewVC Help
Powered by ViewVC 1.1.5