/[pcre]/code/trunk/doc/html/pcrebuild.html
ViewVC logotype

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 83 - (show annotations)
Sat Feb 24 21:41:06 2007 UTC (13 years, 1 month ago) by nigel
File MIME type: text/html
File size: 8783 byte(s)
Error occurred while calculating annotation data.
Load pcre-6.3 into code/trunk.
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>
19 <li><a name="TOC4" href="#SEC4">UNICODE CHARACTER PROPERTY SUPPORT</a>
20 <li><a name="TOC5" href="#SEC5">CODE VALUE OF NEWLINE</a>
21 <li><a name="TOC6" href="#SEC6">BUILDING SHARED AND STATIC LIBRARIES</a>
22 <li><a name="TOC7" href="#SEC7">POSIX MALLOC USAGE</a>
23 <li><a name="TOC8" href="#SEC8">LIMITING PCRE RESOURCE USAGE</a>
24 <li><a name="TOC9" href="#SEC9">HANDLING VERY LARGE PATTERNS</a>
25 <li><a name="TOC10" href="#SEC10">AVOIDING EXCESSIVE STACK USAGE</a>
26 <li><a name="TOC11" href="#SEC11">USING EBCDIC CODE</a>
27 </ul>
28 <br><a name="SEC1" href="#TOC1">PCRE BUILD-TIME OPTIONS</a><br>
29 <P>
30 This document describes the optional features of PCRE that can be selected when
31 the library is compiled. They are all selected, or deselected, by providing
32 options to the <b>configure</b> script that is run before the <b>make</b>
33 command. The complete list of options for <b>configure</b> (which includes the
34 standard ones such as the selection of the installation directory) can be
35 obtained by running
36 <pre>
37 ./configure --help
38 </pre>
39 The following sections describe certain options whose names begin with --enable
40 or --disable. These settings specify changes to the defaults for the
41 <b>configure</b> command. Because of the way that <b>configure</b> works,
42 --enable and --disable always come in pairs, so the complementary option always
43 exists as well, but as it specifies the default, it is not described.
44 </P>
45 <br><a name="SEC2" href="#TOC1">C++ SUPPORT</a><br>
46 <P>
47 By default, the <b>configure</b> script will search for a C++ compiler and C++
48 header files. If it finds them, it automatically builds the C++ wrapper library
49 for PCRE. You can disable this by adding
50 <pre>
51 --disable-cpp
52 </pre>
53 to the <b>configure</b> command.
54 </P>
55 <br><a name="SEC3" href="#TOC1">UTF-8 SUPPORT</a><br>
56 <P>
57 To build PCRE with support for UTF-8 character strings, add
58 <pre>
59 --enable-utf8
60 </pre>
61 to the <b>configure</b> command. Of itself, this does not make PCRE treat
62 strings as UTF-8. As well as compiling PCRE with this option, you also have
63 have to set the PCRE_UTF8 option when you call the <b>pcre_compile()</b>
64 function.
65 </P>
66 <br><a name="SEC4" href="#TOC1">UNICODE CHARACTER PROPERTY SUPPORT</a><br>
67 <P>
68 UTF-8 support allows PCRE to process character values greater than 255 in the
69 strings that it handles. On its own, however, it does not provide any
70 facilities for accessing the properties of such characters. If you want to be
71 able to use the pattern escapes \P, \p, and \X, which refer to Unicode
72 character properties, you must add
73 <pre>
74 --enable-unicode-properties
75 </pre>
76 to the <b>configure</b> command. This implies UTF-8 support, even if you have
77 not explicitly requested it.
78 </P>
79 <P>
80 Including Unicode property support adds around 90K of tables to the PCRE
81 library, approximately doubling its size. Only the general category properties
82 such as <i>Lu</i> and <i>Nd</i> are supported. Details are given in the
83 <a href="pcrepattern.html"><b>pcrepattern</b></a>
84 documentation.
85 </P>
86 <br><a name="SEC5" href="#TOC1">CODE VALUE OF NEWLINE</a><br>
87 <P>
88 By default, PCRE treats character 10 (linefeed) as the newline character. This
89 is the normal newline character on Unix-like systems. You can compile PCRE to
90 use character 13 (carriage return) instead by adding
91 <pre>
92 --enable-newline-is-cr
93 </pre>
94 to the <b>configure</b> command. For completeness there is also a
95 --enable-newline-is-lf option, which explicitly specifies linefeed as the
96 newline character.
97 </P>
98 <br><a name="SEC6" href="#TOC1">BUILDING SHARED AND STATIC LIBRARIES</a><br>
99 <P>
100 The PCRE building process uses <b>libtool</b> to build both shared and static
101 Unix libraries by default. You can suppress one of these by adding one of
102 <pre>
103 --disable-shared
104 --disable-static
105 </pre>
106 to the <b>configure</b> command, as required.
107 </P>
108 <br><a name="SEC7" href="#TOC1">POSIX MALLOC USAGE</a><br>
109 <P>
110 When PCRE is called through the POSIX interface (see the
111 <a href="pcreposix.html"><b>pcreposix</b></a>
112 documentation), additional working storage is required for holding the pointers
113 to capturing substrings, because PCRE requires three integers per substring,
114 whereas the POSIX interface provides only two. If the number of expected
115 substrings is small, the wrapper function uses space on the stack, because this
116 is faster than using <b>malloc()</b> for each call. The default threshold above
117 which the stack is no longer used is 10; it can be changed by adding a setting
118 such as
119 <pre>
120 --with-posix-malloc-threshold=20
121 </pre>
122 to the <b>configure</b> command.
123 </P>
124 <br><a name="SEC8" href="#TOC1">LIMITING PCRE RESOURCE USAGE</a><br>
125 <P>
126 Internally, PCRE has a function called <b>match()</b>, which it calls repeatedly
127 (possibly recursively) when matching a pattern with the <b>pcre_exec()</b>
128 function. By controlling the maximum number of times this function may be
129 called during a single matching operation, a limit can be placed on the
130 resources used by a single call to <b>pcre_exec()</b>. The limit can be changed
131 at run time, as described in the
132 <a href="pcreapi.html"><b>pcreapi</b></a>
133 documentation. The default is 10 million, but this can be changed by adding a
134 setting such as
135 <pre>
136 --with-match-limit=500000
137 </pre>
138 to the <b>configure</b> command. This setting has no effect on the
139 <b>pcre_dfa_exec()</b> matching function.
140 </P>
141 <br><a name="SEC9" href="#TOC1">HANDLING VERY LARGE PATTERNS</a><br>
142 <P>
143 Within a compiled pattern, offset values are used to point from one part to
144 another (for example, from an opening parenthesis to an alternation
145 metacharacter). By default, two-byte values are used for these offsets, leading
146 to a maximum size for a compiled pattern of around 64K. This is sufficient to
147 handle all but the most gigantic patterns. Nevertheless, some people do want to
148 process enormous patterns, so it is possible to compile PCRE to use three-byte
149 or four-byte offsets by adding a setting such as
150 <pre>
151 --with-link-size=3
152 </pre>
153 to the <b>configure</b> command. The value given must be 2, 3, or 4. Using
154 longer offsets slows down the operation of PCRE because it has to load
155 additional bytes when handling them.
156 </P>
157 <P>
158 If you build PCRE with an increased link size, test 2 (and test 5 if you are
159 using UTF-8) will fail. Part of the output of these tests is a representation
160 of the compiled pattern, and this changes with the link size.
161 </P>
162 <br><a name="SEC10" href="#TOC1">AVOIDING EXCESSIVE STACK USAGE</a><br>
163 <P>
164 When matching with the <b>pcre_exec()</b> function, PCRE implements backtracking
165 by making recursive calls to an internal function called <b>match()</b>. In
166 environments where the size of the stack is limited, this can severely limit
167 PCRE's operation. (The Unix environment does not usually suffer from this
168 problem.) An alternative approach that uses memory from the heap to remember
169 data, instead of using recursive function calls, has been implemented to work
170 round this problem. If you want to build a version of PCRE that works this way,
171 add
172 <pre>
173 --disable-stack-for-recursion
174 </pre>
175 to the <b>configure</b> command. With this configuration, PCRE will use the
176 <b>pcre_stack_malloc</b> and <b>pcre_stack_free</b> variables to call memory
177 management functions. Separate functions are provided because the usage is very
178 predictable: the block sizes requested are always the same, and the blocks are
179 always freed in reverse order. A calling program might be able to implement
180 optimized functions that perform better than the standard <b>malloc()</b> and
181 <b>free()</b> functions. PCRE runs noticeably more slowly when built in this
182 way. This option affects only the <b>pcre_exec()</b> function; it is not
183 relevant for the the <b>pcre_dfa_exec()</b> function.
184 </P>
185 <br><a name="SEC11" href="#TOC1">USING EBCDIC CODE</a><br>
186 <P>
187 PCRE assumes by default that it will run in an environment where the character
188 code is ASCII (or Unicode, which is a superset of ASCII). PCRE can, however, be
189 compiled to run in an EBCDIC environment by adding
190 <pre>
191 --enable-ebcdic
192 </pre>
193 to the <b>configure</b> command.
194 </P>
195 <P>
196 Last updated: 15 August 2005
197 <br>
198 Copyright &copy; 1997-2005 University of Cambridge.
199 <p>
200 Return to the <a href="index.html">PCRE index page</a>.
201 </p>

  ViewVC Help
Powered by ViewVC 1.1.5