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

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

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

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

Legend:
Removed from v.73  
changed lines
  Added in v.93

  ViewVC Help
Powered by ViewVC 1.1.5