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

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

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

revision 93 by nigel, Sat Feb 24 21:41:42 2007 UTC revision 691 by ph10, Sun Sep 11 14:31:21 2011 UTC
# Line 1  Line 1 
1  .TH PCREBUILD 3  .TH PCREBUILD 3
2  .SH NAME  .SH NAME
3  PCRE - Perl-compatible regular expressions  PCRE - Perl-compatible regular expressions
4    .
5    .
6  .SH "PCRE BUILD-TIME OPTIONS"  .SH "PCRE BUILD-TIME OPTIONS"
7  .rs  .rs
8  .sp  .sp
9  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
10  the library is compiled. They are all selected, or deselected, by providing  the library is compiled. It assumes use of the \fBconfigure\fP script, where
11  options to the \fBconfigure\fP script that is run before the \fBmake\fP  the optional features are selected or deselected by providing options to
12  command. The complete list of options for \fBconfigure\fP (which includes the  \fBconfigure\fP before running the \fBmake\fP command. However, the same
13  standard ones such as the selection of the installation directory) can be  options can be selected in both Unix-like and non-Unix-like environments using
14  obtained by running  the GUI facility of \fBcmake-gui\fP if you are using \fBCMake\fP instead of
15    \fBconfigure\fP to build PCRE.
16    .P
17    There is a lot more information about building PCRE in non-Unix-like
18    environments in the file called \fINON_UNIX_USE\fP, which is part of the PCRE
19    distribution. You should consult this file as well as the \fIREADME\fP file if
20    you are building in a non-Unix-like environment.
21    .P
22    The complete list of options for \fBconfigure\fP (which includes the standard
23    ones such as the selection of the installation directory) can be obtained by
24    running
25  .sp  .sp
26    ./configure --help    ./configure --help
27  .sp  .sp
28  The following sections describe certain options whose names begin with --enable  The following sections include descriptions of options whose names begin with
29  or --disable. These settings specify changes to the defaults for the  --enable or --disable. These settings specify changes to the defaults for the
30  \fBconfigure\fP command. Because of the way that \fBconfigure\fP works,  \fBconfigure\fP command. Because of the way that \fBconfigure\fP works,
31  --enable and --disable always come in pairs, so the complementary option always  --enable and --disable always come in pairs, so the complementary option always
32  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.
33  .  .
34    .
35    .SH "BUILDING SHARED AND STATIC LIBRARIES"
36    .rs
37    .sp
38    The PCRE building process uses \fBlibtool\fP to build both shared and static
39    Unix libraries by default. You can suppress one of these by adding one of
40    .sp
41      --disable-shared
42      --disable-static
43    .sp
44    to the \fBconfigure\fP command, as required.
45    .
46    .
47  .SH "C++ SUPPORT"  .SH "C++ SUPPORT"
48  .rs  .rs
49  .sp  .sp
# Line 30  for PCRE. You can disable this by adding Line 55  for PCRE. You can disable this by adding
55  .sp  .sp
56  to the \fBconfigure\fP command.  to the \fBconfigure\fP command.
57  .  .
58    .
59  .SH "UTF-8 SUPPORT"  .SH "UTF-8 SUPPORT"
60  .rs  .rs
61  .sp  .sp
62  To build PCRE with support for UTF-8 character strings, add  To build PCRE with support for UTF-8 Unicode character strings, add
63  .sp  .sp
64    --enable-utf8    --enable-utf8
65  .sp  .sp
66  to the \fBconfigure\fP command. Of itself, this does not make PCRE treat  to the \fBconfigure\fP command. Of itself, this does not make PCRE treat
67  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
68  have to set the PCRE_UTF8 option when you call the \fBpcre_compile()\fP  have to set the PCRE_UTF8 option when you call the \fBpcre_compile()\fP
69  function.  or \fBpcre_compile2()\fP functions.
70    .P
71    If you set --enable-utf8 when compiling in an EBCDIC environment, PCRE expects
72    its input to be either ASCII or UTF-8 (depending on the runtime option). It is
73    not possible to support both EBCDIC and UTF-8 codes in the same version of the
74    library. Consequently, --enable-utf8 and --enable-ebcdic are mutually
75    exclusive.
76    .
77  .  .
78  .SH "UNICODE CHARACTER PROPERTY SUPPORT"  .SH "UNICODE CHARACTER PROPERTY SUPPORT"
79  .rs  .rs
# Line 56  character properties, you must add Line 89  character properties, you must add
89  to the \fBconfigure\fP command. This implies UTF-8 support, even if you have  to the \fBconfigure\fP command. This implies UTF-8 support, even if you have
90  not explicitly requested it.  not explicitly requested it.
91  .P  .P
92  Including Unicode property support adds around 90K of tables to the PCRE  Including Unicode property support adds around 30K of tables to the PCRE
93  library, approximately doubling its size. Only the general category properties  library. Only the general category properties such as \fILu\fP and \fINd\fP are
94  such as \fILu\fP and \fINd\fP are supported. Details are given in the  supported. Details are given in the
95  .\" HREF  .\" HREF
96  \fBpcrepattern\fP  \fBpcrepattern\fP
97  .\"  .\"
98  documentation.  documentation.
99  .  .
100    .
101    .SH "JUST-IN-TIME COMPILER SUPPORT"
102    .rs
103    .sp
104    Just-in-time compiler support is included in the build by specifying
105    .sp
106      --enable-jit
107    .sp
108    This support is available only for certain hardware architectures. If this
109    option is set for an unsupported architecture, a compile time error occurs.
110    See the
111    .\" HREF
112    \fBpcrejit\fP
113    .\"
114    documentation for a discussion of JIT usage. When JIT support is enabled,
115    pcregrep automatically makes use of it, unless you add
116    .sp
117      --disable-pcregrep-jit
118    .sp
119    to the "configure" command.
120    .
121    .
122  .SH "CODE VALUE OF NEWLINE"  .SH "CODE VALUE OF NEWLINE"
123  .rs  .rs
124  .sp  .sp
125  By default, PCRE interprets character 10 (linefeed, LF) as indicating the end  By default, PCRE interprets the linefeed (LF) character as indicating the end
126  of a line. This is the normal newline character on Unix-like systems. You can  of a line. This is the normal newline character on Unix-like systems. You can
127  compile PCRE to use character 13 (carriage return, CR) instead, by adding  compile PCRE to use carriage return (CR) instead, by adding
128  .sp  .sp
129    --enable-newline-is-cr    --enable-newline-is-cr
130  .sp  .sp
# Line 83  character sequence CRLF. If you want thi Line 138  character sequence CRLF. If you want thi
138  .sp  .sp
139  to the \fBconfigure\fP command. There is a fourth option, specified by  to the \fBconfigure\fP command. There is a fourth option, specified by
140  .sp  .sp
141      --enable-newline-is-anycrlf
142    .sp
143    which causes PCRE to recognize any of the three sequences CR, LF, or CRLF as
144    indicating a line ending. Finally, a fifth option, specified by
145    .sp
146    --enable-newline-is-any    --enable-newline-is-any
147  .sp  .sp
148  which causes PCRE to recognize any Unicode newline sequence.  causes PCRE to recognize any Unicode newline sequence.
149  .P  .P
150  Whatever line ending convention is selected when PCRE is built can be  Whatever line ending convention is selected when PCRE is built can be
151  overridden when the library functions are called. At build time it is  overridden when the library functions are called. At build time it is
152  conventional to use the standard for your operating system.  conventional to use the standard for your operating system.
153  .  .
154  .SH "BUILDING SHARED AND STATIC LIBRARIES"  .
155    .SH "WHAT \eR MATCHES"
156  .rs  .rs
157  .sp  .sp
158  The PCRE building process uses \fBlibtool\fP to build both shared and static  By default, the sequence \eR in a pattern matches any Unicode newline sequence,
159  Unix libraries by default. You can suppress one of these by adding one of  whatever has been selected as the line ending sequence. If you specify
160  .sp  .sp
161    --disable-shared    --enable-bsr-anycrlf
   --disable-static  
162  .sp  .sp
163  to the \fBconfigure\fP command, as required.  the default is changed so that \eR matches only CR, LF, or CRLF. Whatever is
164    selected when PCRE is built can be overridden when the library functions are
165    called.
166    .
167  .  .
168  .SH "POSIX MALLOC USAGE"  .SH "POSIX MALLOC USAGE"
169  .rs  .rs
# Line 121  such as Line 184  such as
184  .sp  .sp
185  to the \fBconfigure\fP command.  to the \fBconfigure\fP command.
186  .  .
187    .
188  .SH "HANDLING VERY LARGE PATTERNS"  .SH "HANDLING VERY LARGE PATTERNS"
189  .rs  .rs
190  .sp  .sp
# Line 129  another (for example, from an opening pa Line 193  another (for example, from an opening pa
193  metacharacter). By default, two-byte values are used for these offsets, leading  metacharacter). By default, two-byte values are used for these offsets, leading
194  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
195  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
196  process enormous patterns, so it is possible to compile PCRE to use three-byte  process truyl enormous patterns, so it is possible to compile PCRE to use
197  or four-byte offsets by adding a setting such as  three-byte or four-byte offsets by adding a setting such as
198  .sp  .sp
199    --with-link-size=3    --with-link-size=3
200  .sp  .sp
201  to the \fBconfigure\fP command. The value given must be 2, 3, or 4. Using  to the \fBconfigure\fP command. The value given must be 2, 3, or 4. Using
202  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
203  additional bytes when handling them.  additional bytes when handling them.
204  .P  .
 If you build PCRE with an increased link size, test 2 (and test 5 if you are  
 using UTF-8) will fail. Part of the output of these tests is a representation  
 of the compiled pattern, and this changes with the link size.  
205  .  .
206  .SH "AVOIDING EXCESSIVE STACK USAGE"  .SH "AVOIDING EXCESSIVE STACK USAGE"
207  .rs  .rs
# Line 163  build a version of PCRE that works this Line 224  build a version of PCRE that works this
224  .sp  .sp
225  to the \fBconfigure\fP command. With this configuration, PCRE will use the  to the \fBconfigure\fP command. With this configuration, PCRE will use the
226  \fBpcre_stack_malloc\fP and \fBpcre_stack_free\fP variables to call memory  \fBpcre_stack_malloc\fP and \fBpcre_stack_free\fP variables to call memory
227  management functions. Separate functions are provided because the usage is very  management functions. By default these point to \fBmalloc()\fP and
228  predictable: the block sizes requested are always the same, and the blocks are  \fBfree()\fP, but you can replace the pointers so that your own functions are
229  always freed in reverse order. A calling program might be able to implement  used instead.
230  optimized functions that perform better than the standard \fBmalloc()\fP and  .P
231  \fBfree()\fP functions. PCRE runs noticeably more slowly when built in this  Separate functions are provided rather than using \fBpcre_malloc\fP and
232  way. This option affects only the \fBpcre_exec()\fP function; it is not  \fBpcre_free\fP because the usage is very predictable: the block sizes
233  relevant for the the \fBpcre_dfa_exec()\fP function.  requested are always the same, and the blocks are always freed in reverse
234    order. A calling program might be able to implement optimized functions that
235    perform better than \fBmalloc()\fP and \fBfree()\fP. PCRE runs noticeably more
236    slowly when built in this way. This option affects only the \fBpcre_exec()\fP
237    function; it is not relevant for \fBpcre_dfa_exec()\fP.
238    .
239  .  .
240  .SH "LIMITING PCRE RESOURCE USAGE"  .SH "LIMITING PCRE RESOURCE USAGE"
241  .rs  .rs
# Line 202  constraints. However, you can set a lowe Line 268  constraints. However, you can set a lowe
268  .sp  .sp
269  to the \fBconfigure\fP command. This value can also be overridden at run time.  to the \fBconfigure\fP command. This value can also be overridden at run time.
270  .  .
271    .
272    .SH "CREATING CHARACTER TABLES AT BUILD TIME"
273    .rs
274    .sp
275    PCRE uses fixed tables for processing characters whose code values are less
276    than 256. By default, PCRE is built with a set of tables that are distributed
277    in the file \fIpcre_chartables.c.dist\fP. These tables are for ASCII codes
278    only. If you add
279    .sp
280      --enable-rebuild-chartables
281    .sp
282    to the \fBconfigure\fP command, the distributed tables are no longer used.
283    Instead, a program called \fBdftables\fP is compiled and run. This outputs the
284    source for new set of tables, created in the default locale of your C runtime
285    system. (This method of replacing the tables does not work if you are cross
286    compiling, because \fBdftables\fP is run on the local host. If you need to
287    create alternative tables when cross compiling, you will have to do so "by
288    hand".)
289    .
290    .
291  .SH "USING EBCDIC CODE"  .SH "USING EBCDIC CODE"
292  .rs  .rs
293  .sp  .sp
294  PCRE assumes by default that it will run in an environment where the character  PCRE assumes by default that it will run in an environment where the character
295  code is ASCII (or Unicode, which is a superset of ASCII). PCRE can, however, be  code is ASCII (or Unicode, which is a superset of ASCII). This is the case for
296  compiled to run in an EBCDIC environment by adding  most computer operating systems. PCRE can, however, be compiled to run in an
297    EBCDIC environment by adding
298  .sp  .sp
299    --enable-ebcdic    --enable-ebcdic
300  .sp  .sp
301  to the \fBconfigure\fP command.  to the \fBconfigure\fP command. This setting implies
302    --enable-rebuild-chartables. You should only use it if you know that you are in
303    an EBCDIC environment (for example, an IBM mainframe operating system). The
304    --enable-ebcdic option is incompatible with --enable-utf8.
305    .
306    .
307    .SH "PCREGREP OPTIONS FOR COMPRESSED FILE SUPPORT"
308    .rs
309    .sp
310    By default, \fBpcregrep\fP reads all files as plain text. You can build it so
311    that it recognizes files whose names end in \fB.gz\fP or \fB.bz2\fP, and reads
312    them with \fBlibz\fP or \fBlibbz2\fP, respectively, by adding one or both of
313    .sp
314      --enable-pcregrep-libz
315      --enable-pcregrep-libbz2
316    .sp
317    to the \fBconfigure\fP command. These options naturally require that the
318    relevant libraries are installed on your system. Configuration will fail if
319    they are not.
320    .
321    .
322    .SH "PCREGREP BUFFER SIZE"
323    .rs
324    .sp
325    \fBpcregrep\fP uses an internal buffer to hold a "window" on the file it is
326    scanning, in order to be able to output "before" and "after" lines when it
327    finds a match. The size of the buffer is controlled by a parameter whose
328    default value is 20K. The buffer itself is three times this size, but because
329    of the way it is used for holding "before" lines, the longest line that is
330    guaranteed to be processable is the parameter size. You can change the default
331    parameter value by adding, for example,
332    .sp
333      --with-pcregrep-bufsize=50K
334    .sp
335    to the \fBconfigure\fP command. The caller of \fPpcregrep\fP can, however,
336    override this value by specifying a run-time option.
337    .
338    .
339    .SH "PCRETEST OPTION FOR LIBREADLINE SUPPORT"
340    .rs
341    .sp
342    If you add
343    .sp
344      --enable-pcretest-libreadline
345    .sp
346    to the \fBconfigure\fP command, \fBpcretest\fP is linked with the
347    \fBlibreadline\fP library, and when its input is from a terminal, it reads it
348    using the \fBreadline()\fP function. This provides line-editing and history
349    facilities. Note that \fBlibreadline\fP is GPL-licensed, so if you distribute a
350    binary of \fBpcretest\fP linked in this way, there may be licensing issues.
351    .P
352    Setting this option causes the \fB-lreadline\fP option to be added to the
353    \fBpcretest\fP build. In many operating environments with a sytem-installed
354    \fBlibreadline\fP this is sufficient. However, in some environments (e.g.
355    if an unmodified distribution version of readline is in use), some extra
356    configuration may be necessary. The INSTALL file for \fBlibreadline\fP says
357    this:
358    .sp
359      "Readline uses the termcap functions, but does not link with the
360      termcap or curses library itself, allowing applications which link
361      with readline the to choose an appropriate library."
362    .sp
363    If your environment has not been set up so that an appropriate library is
364    automatically included, you may need to add something like
365    .sp
366      LIBS="-ncurses"
367    .sp
368    immediately before the \fBconfigure\fP command.
369  .  .
370  .  .
371  .SH "SEE ALSO"  .SH "SEE ALSO"
372  .rs  .rs
373  .sp  .sp
374  \fBpcreapi\fP(3), \fBpcre_config\fP(3).  \fBpcreapi\fP(3), \fBpcre_config\fP(3).
375  .P  .
376  .in 0  .
377  Last updated: 30 November 2006  .SH AUTHOR
378  .br  .rs
379  Copyright (c) 1997-2006 University of Cambridge.  .sp
380    .nf
381    Philip Hazel
382    University Computing Service
383    Cambridge CB2 3QH, England.
384    .fi
385    .
386    .
387    .SH REVISION
388    .rs
389    .sp
390    .nf
391    Last updated: 06 September 2011
392    Copyright (c) 1997-2011 University of Cambridge.
393    .fi

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

  ViewVC Help
Powered by ViewVC 1.1.5