/[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 195 by ph10, Mon Jul 30 13:23:28 2007 UTC revision 654 by ph10, Tue Aug 2 11:00:40 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
# Line 19  The following sections include descripti Line 31  The following sections include descripti
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 64  supported. Details are given in the Line 97  supported. Details are given in the
97  .\"  .\"
98  documentation.  documentation.
99  .  .
100    .
101  .SH "CODE VALUE OF NEWLINE"  .SH "CODE VALUE OF NEWLINE"
102  .rs  .rs
103  .sp  .sp
104  By default, PCRE interprets character 10 (linefeed, LF) as indicating the end  By default, PCRE interprets the linefeed (LF) character as indicating the end
105  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
106  compile PCRE to use character 13 (carriage return, CR) instead, by adding  compile PCRE to use carriage return (CR) instead, by adding
107  .sp  .sp
108    --enable-newline-is-cr    --enable-newline-is-cr
109  .sp  .sp
# Line 96  Whatever line ending convention is selec Line 130  Whatever line ending convention is selec
130  overridden when the library functions are called. At build time it is  overridden when the library functions are called. At build time it is
131  conventional to use the standard for your operating system.  conventional to use the standard for your operating system.
132  .  .
133  .SH "BUILDING SHARED AND STATIC LIBRARIES"  .
134    .SH "WHAT \eR MATCHES"
135  .rs  .rs
136  .sp  .sp
137  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,
138  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
139  .sp  .sp
140    --disable-shared    --enable-bsr-anycrlf
   --disable-static  
141  .sp  .sp
142  to the \fBconfigure\fP command, as required.  the default is changed so that \eR matches only CR, LF, or CRLF. Whatever is
143    selected when PCRE is built can be overridden when the library functions are
144    called.
145    .
146  .  .
147  .SH "POSIX MALLOC USAGE"  .SH "POSIX MALLOC USAGE"
148  .rs  .rs
# Line 126  such as Line 163  such as
163  .sp  .sp
164  to the \fBconfigure\fP command.  to the \fBconfigure\fP command.
165  .  .
166    .
167  .SH "HANDLING VERY LARGE PATTERNS"  .SH "HANDLING VERY LARGE PATTERNS"
168  .rs  .rs
169  .sp  .sp
# Line 134  another (for example, from an opening pa Line 172  another (for example, from an opening pa
172  metacharacter). By default, two-byte values are used for these offsets, leading  metacharacter). By default, two-byte values are used for these offsets, leading
173  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
174  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
175  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
176  or four-byte offsets by adding a setting such as  three-byte or four-byte offsets by adding a setting such as
177  .sp  .sp
178    --with-link-size=3    --with-link-size=3
179  .sp  .sp
# Line 143  to the \fBconfigure\fP command. The valu Line 181  to the \fBconfigure\fP command. The valu
181  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
182  additional bytes when handling them.  additional bytes when handling them.
183  .  .
184    .
185  .SH "AVOIDING EXCESSIVE STACK USAGE"  .SH "AVOIDING EXCESSIVE STACK USAGE"
186  .rs  .rs
187  .sp  .sp
# Line 166  to the \fBconfigure\fP command. With thi Line 205  to the \fBconfigure\fP command. With thi
205  \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
206  management functions. By default these point to \fBmalloc()\fP and  management functions. By default these point to \fBmalloc()\fP and
207  \fBfree()\fP, but you can replace the pointers so that your own functions are  \fBfree()\fP, but you can replace the pointers so that your own functions are
208  used.  used instead.
209  .P  .P
210  Separate functions are provided rather than using \fBpcre_malloc\fP and  Separate functions are provided rather than using \fBpcre_malloc\fP and
211  \fBpcre_free\fP because the usage is very predictable: the block sizes  \fBpcre_free\fP because the usage is very predictable: the block sizes
# Line 174  requested are always the same, and the b Line 213  requested are always the same, and the b
213  order. A calling program might be able to implement optimized functions that  order. A calling program might be able to implement optimized functions that
214  perform better than \fBmalloc()\fP and \fBfree()\fP. PCRE runs noticeably more  perform better than \fBmalloc()\fP and \fBfree()\fP. PCRE runs noticeably more
215  slowly when built in this way. This option affects only the \fBpcre_exec()\fP  slowly when built in this way. This option affects only the \fBpcre_exec()\fP
216  function; it is not relevant for the the \fBpcre_dfa_exec()\fP function.  function; it is not relevant for \fBpcre_dfa_exec()\fP.
217    .
218  .  .
219  .SH "LIMITING PCRE RESOURCE USAGE"  .SH "LIMITING PCRE RESOURCE USAGE"
220  .rs  .rs
# Line 207  constraints. However, you can set a lowe Line 247  constraints. However, you can set a lowe
247  .sp  .sp
248  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.
249  .  .
250    .
251  .SH "CREATING CHARACTER TABLES AT BUILD TIME"  .SH "CREATING CHARACTER TABLES AT BUILD TIME"
252  .rs  .rs
253  .sp  .sp
# Line 225  compiling, because \fBdftables\fP is run Line 266  compiling, because \fBdftables\fP is run
266  create alternative tables when cross compiling, you will have to do so "by  create alternative tables when cross compiling, you will have to do so "by
267  hand".)  hand".)
268  .  .
269    .
270  .SH "USING EBCDIC CODE"  .SH "USING EBCDIC CODE"
271  .rs  .rs
272  .sp  .sp
# Line 236  EBCDIC environment by adding Line 278  EBCDIC environment by adding
278    --enable-ebcdic    --enable-ebcdic
279  .sp  .sp
280  to the \fBconfigure\fP command. This setting implies  to the \fBconfigure\fP command. This setting implies
281  --enable-rebuild-chartables. You should only use it if you know that you are in  --enable-rebuild-chartables. You should only use it if you know that you are in
282  an EBCDIC environment (for example, an IBM mainframe operating system).  an EBCDIC environment (for example, an IBM mainframe operating system). The
283    --enable-ebcdic option is incompatible with --enable-utf8.
284    .
285    .
286    .SH "PCREGREP OPTIONS FOR COMPRESSED FILE SUPPORT"
287    .rs
288    .sp
289    By default, \fBpcregrep\fP reads all files as plain text. You can build it so
290    that it recognizes files whose names end in \fB.gz\fP or \fB.bz2\fP, and reads
291    them with \fBlibz\fP or \fBlibbz2\fP, respectively, by adding one or both of
292    .sp
293      --enable-pcregrep-libz
294      --enable-pcregrep-libbz2
295    .sp
296    to the \fBconfigure\fP command. These options naturally require that the
297    relevant libraries are installed on your system. Configuration will fail if
298    they are not.
299    .
300    .
301    .SH "PCREGREP BUFFER SIZE"
302    .rs
303    .sp
304    \fBpcregrep\fP uses an internal buffer to hold a "window" on the file it is
305    scanning, in order to be able to output "before" and "after" lines when it
306    finds a match. The size of the buffer is controlled by a parameter whose
307    default value is 20K. The buffer itself is three times this size, but because
308    of the way it is used for holding "before" lines, the longest line that is
309    guaranteed to be processable is the parameter size. You can change the default
310    parameter value by adding, for example,
311    .sp
312      --with-pcregrep-bufsize=50K
313    .sp
314    to the \fBconfigure\fP command. The caller of \fPpcregrep\fP can, however,
315    override this value by specifying a run-time option.
316    .
317    .
318    .SH "PCRETEST OPTION FOR LIBREADLINE SUPPORT"
319    .rs
320    .sp
321    If you add
322    .sp
323      --enable-pcretest-libreadline
324    .sp
325    to the \fBconfigure\fP command, \fBpcretest\fP is linked with the
326    \fBlibreadline\fP library, and when its input is from a terminal, it reads it
327    using the \fBreadline()\fP function. This provides line-editing and history
328    facilities. Note that \fBlibreadline\fP is GPL-licensed, so if you distribute a
329    binary of \fBpcretest\fP linked in this way, there may be licensing issues.
330    .P
331    Setting this option causes the \fB-lreadline\fP option to be added to the
332    \fBpcretest\fP build. In many operating environments with a sytem-installed
333    \fBlibreadline\fP this is sufficient. However, in some environments (e.g.
334    if an unmodified distribution version of readline is in use), some extra
335    configuration may be necessary. The INSTALL file for \fBlibreadline\fP says
336    this:
337    .sp
338      "Readline uses the termcap functions, but does not link with the
339      termcap or curses library itself, allowing applications which link
340      with readline the to choose an appropriate library."
341    .sp
342    If your environment has not been set up so that an appropriate library is
343    automatically included, you may need to add something like
344    .sp
345      LIBS="-ncurses"
346    .sp
347    immediately before the \fBconfigure\fP command.
348  .  .
349  .  .
350  .SH "SEE ALSO"  .SH "SEE ALSO"
# Line 260  Cambridge CB2 3QH, England. Line 367  Cambridge CB2 3QH, England.
367  .rs  .rs
368  .sp  .sp
369  .nf  .nf
370  Last updated: 30 July 2007  Last updated: 02 August 2011
371  Copyright (c) 1997-2007 University of Cambridge.  Copyright (c) 1997-2011 University of Cambridge.
372  .fi  .fi

Legend:
Removed from v.195  
changed lines
  Added in v.654

  ViewVC Help
Powered by ViewVC 1.1.5