Blame doc/pcrebuild.3

Packit 78a954
.TH PCREBUILD 3 "12 May 2013" "PCRE 8.33"
Packit 78a954
.SH NAME
Packit 78a954
PCRE - Perl-compatible regular expressions
Packit 78a954
.
Packit 78a954
.
Packit 78a954
.SH "BUILDING PCRE"
Packit 78a954
.rs
Packit 78a954
.sp
Packit 78a954
PCRE is distributed with a \fBconfigure\fP script that can be used to build the
Packit 78a954
library in Unix-like environments using the applications known as Autotools.
Packit 78a954
Also in the distribution are files to support building using \fBCMake\fP
Packit 78a954
instead of \fBconfigure\fP. The text file
Packit 78a954
.\" HTML 
Packit 78a954
.\" 
Packit 78a954
\fBREADME\fP
Packit 78a954
.\"
Packit 78a954
contains general information about building with Autotools (some of which is
Packit 78a954
repeated below), and also has some comments about building on various operating
Packit 78a954
systems. There is a lot more information about building PCRE without using
Packit 78a954
Autotools (including information about using \fBCMake\fP and building "by
Packit 78a954
hand") in the text file called
Packit 78a954
.\" HTML 
Packit 78a954
.\" 
Packit 78a954
\fBNON-AUTOTOOLS-BUILD\fP.
Packit 78a954
.\"
Packit 78a954
You should consult this file as well as the
Packit 78a954
.\" HTML 
Packit 78a954
.\" 
Packit 78a954
\fBREADME\fP
Packit 78a954
.\"
Packit 78a954
file if you are building in a non-Unix-like environment.
Packit 78a954
.
Packit 78a954
.
Packit 78a954
.SH "PCRE BUILD-TIME OPTIONS"
Packit 78a954
.rs
Packit 78a954
.sp
Packit 78a954
The rest of this document describes the optional features of PCRE that can be
Packit 78a954
selected when the library is compiled. It assumes use of the \fBconfigure\fP
Packit 78a954
script, where the optional features are selected or deselected by providing
Packit 78a954
options to \fBconfigure\fP before running the \fBmake\fP command. However, the
Packit 78a954
same options can be selected in both Unix-like and non-Unix-like environments
Packit 78a954
using the GUI facility of \fBcmake-gui\fP if you are using \fBCMake\fP instead
Packit 78a954
of \fBconfigure\fP to build PCRE.
Packit 78a954
.P
Packit 78a954
If you are not using Autotools or \fBCMake\fP, option selection can be done by
Packit 78a954
editing the \fBconfig.h\fP file, or by passing parameter settings to the
Packit 78a954
compiler, as described in
Packit 78a954
.\" HTML 
Packit 78a954
.\" 
Packit 78a954
\fBNON-AUTOTOOLS-BUILD\fP.
Packit 78a954
.\"
Packit 78a954
.P
Packit 78a954
The complete list of options for \fBconfigure\fP (which includes the standard
Packit 78a954
ones such as the selection of the installation directory) can be obtained by
Packit 78a954
running
Packit 78a954
.sp
Packit 78a954
  ./configure --help
Packit 78a954
.sp
Packit 78a954
The following sections include descriptions of options whose names begin with
Packit 78a954
--enable or --disable. These settings specify changes to the defaults for the
Packit 78a954
\fBconfigure\fP command. Because of the way that \fBconfigure\fP works,
Packit 78a954
--enable and --disable always come in pairs, so the complementary option always
Packit 78a954
exists as well, but as it specifies the default, it is not described.
Packit 78a954
.
Packit 78a954
.
Packit 78a954
.SH "BUILDING 8-BIT, 16-BIT AND 32-BIT LIBRARIES"
Packit 78a954
.rs
Packit 78a954
.sp
Packit 78a954
By default, a library called \fBlibpcre\fP is built, containing functions that
Packit 78a954
take string arguments contained in vectors of bytes, either as single-byte
Packit 78a954
characters, or interpreted as UTF-8 strings. You can also build a separate
Packit 78a954
library, called \fBlibpcre16\fP, in which strings are contained in vectors of
Packit 78a954
16-bit data units and interpreted either as single-unit characters or UTF-16
Packit 78a954
strings, by adding
Packit 78a954
.sp
Packit 78a954
  --enable-pcre16
Packit 78a954
.sp
Packit 78a954
to the \fBconfigure\fP command. You can also build yet another separate
Packit 78a954
library, called \fBlibpcre32\fP, in which strings are contained in vectors of
Packit 78a954
32-bit data units and interpreted either as single-unit characters or UTF-32
Packit 78a954
strings, by adding
Packit 78a954
.sp
Packit 78a954
  --enable-pcre32
Packit 78a954
.sp
Packit 78a954
to the \fBconfigure\fP command. If you do not want the 8-bit library, add
Packit 78a954
.sp
Packit 78a954
  --disable-pcre8
Packit 78a954
.sp
Packit 78a954
as well. At least one of the three libraries must be built. Note that the C++
Packit 78a954
and POSIX wrappers are for the 8-bit library only, and that \fBpcregrep\fP is
Packit 78a954
an 8-bit program. None of these are built if you select only the 16-bit or
Packit 78a954
32-bit libraries.
Packit 78a954
.
Packit 78a954
.
Packit 78a954
.SH "BUILDING SHARED AND STATIC LIBRARIES"
Packit 78a954
.rs
Packit 78a954
.sp
Packit 78a954
The Autotools PCRE building process uses \fBlibtool\fP to build both shared and
Packit 78a954
static libraries by default. You can suppress one of these by adding one of
Packit 78a954
.sp
Packit 78a954
  --disable-shared
Packit 78a954
  --disable-static
Packit 78a954
.sp
Packit 78a954
to the \fBconfigure\fP command, as required.
Packit 78a954
.
Packit 78a954
.
Packit 78a954
.SH "C++ SUPPORT"
Packit 78a954
.rs
Packit 78a954
.sp
Packit 78a954
By default, if the 8-bit library is being built, the \fBconfigure\fP script
Packit 78a954
will search for a C++ compiler and C++ header files. If it finds them, it
Packit 78a954
automatically builds the C++ wrapper library (which supports only 8-bit
Packit 78a954
strings). You can disable this by adding
Packit 78a954
.sp
Packit 78a954
  --disable-cpp
Packit 78a954
.sp
Packit 78a954
to the \fBconfigure\fP command.
Packit 78a954
.
Packit 78a954
.
Packit 78a954
.SH "UTF-8, UTF-16 AND UTF-32 SUPPORT"
Packit 78a954
.rs
Packit 78a954
.sp
Packit 78a954
To build PCRE with support for UTF Unicode character strings, add
Packit 78a954
.sp
Packit 78a954
  --enable-utf
Packit 78a954
.sp
Packit 78a954
to the \fBconfigure\fP command. This setting applies to all three libraries,
Packit 78a954
adding support for UTF-8 to the 8-bit library, support for UTF-16 to the 16-bit
Packit 78a954
library, and support for UTF-32 to the to the 32-bit library. There are no
Packit 78a954
separate options for enabling UTF-8, UTF-16 and UTF-32 independently because
Packit 78a954
that would allow ridiculous settings such as requesting UTF-16 support while
Packit 78a954
building only the 8-bit library. It is not possible to build one library with
Packit 78a954
UTF support and another without in the same configuration. (For backwards
Packit 78a954
compatibility, --enable-utf8 is a synonym of --enable-utf.)
Packit 78a954
.P
Packit 78a954
Of itself, this setting does not make PCRE treat strings as UTF-8, UTF-16 or
Packit 78a954
UTF-32. As well as compiling PCRE with this option, you also have have to set
Packit 78a954
the PCRE_UTF8, PCRE_UTF16 or PCRE_UTF32 option (as appropriate) when you call
Packit 78a954
one of the pattern compiling functions.
Packit 78a954
.P
Packit 78a954
If you set --enable-utf when compiling in an EBCDIC environment, PCRE expects
Packit 78a954
its input to be either ASCII or UTF-8 (depending on the run-time option). It is
Packit 78a954
not possible to support both EBCDIC and UTF-8 codes in the same version of the
Packit 78a954
library. Consequently, --enable-utf and --enable-ebcdic are mutually
Packit 78a954
exclusive.
Packit 78a954
.
Packit 78a954
.
Packit 78a954
.SH "UNICODE CHARACTER PROPERTY SUPPORT"
Packit 78a954
.rs
Packit 78a954
.sp
Packit 78a954
UTF support allows the libraries to process character codepoints up to 0x10ffff
Packit 78a954
in the strings that they handle. On its own, however, it does not provide any
Packit 78a954
facilities for accessing the properties of such characters. If you want to be
Packit 78a954
able to use the pattern escapes \eP, \ep, and \eX, which refer to Unicode
Packit 78a954
character properties, you must add
Packit 78a954
.sp
Packit 78a954
  --enable-unicode-properties
Packit 78a954
.sp
Packit 78a954
to the \fBconfigure\fP command. This implies UTF support, even if you have
Packit 78a954
not explicitly requested it.
Packit 78a954
.P
Packit 78a954
Including Unicode property support adds around 30K of tables to the PCRE
Packit 78a954
library. Only the general category properties such as \fILu\fP and \fINd\fP are
Packit 78a954
supported. Details are given in the
Packit 78a954
.\" HREF
Packit 78a954
\fBpcrepattern\fP
Packit 78a954
.\"
Packit 78a954
documentation.
Packit 78a954
.
Packit 78a954
.
Packit 78a954
.SH "JUST-IN-TIME COMPILER SUPPORT"
Packit 78a954
.rs
Packit 78a954
.sp
Packit 78a954
Just-in-time compiler support is included in the build by specifying
Packit 78a954
.sp
Packit 78a954
  --enable-jit
Packit 78a954
.sp
Packit 78a954
This support is available only for certain hardware architectures. If this
Packit 78a954
option is set for an unsupported architecture, a compile time error occurs.
Packit 78a954
See the
Packit 78a954
.\" HREF
Packit 78a954
\fBpcrejit\fP
Packit 78a954
.\"
Packit 78a954
documentation for a discussion of JIT usage. When JIT support is enabled,
Packit 78a954
pcregrep automatically makes use of it, unless you add
Packit 78a954
.sp
Packit 78a954
  --disable-pcregrep-jit
Packit 78a954
.sp
Packit 78a954
to the "configure" command.
Packit 78a954
.
Packit 78a954
.
Packit 78a954
.SH "CODE VALUE OF NEWLINE"
Packit 78a954
.rs
Packit 78a954
.sp
Packit 78a954
By default, PCRE interprets the linefeed (LF) character as indicating the end
Packit 78a954
of a line. This is the normal newline character on Unix-like systems. You can
Packit 78a954
compile PCRE to use carriage return (CR) instead, by adding
Packit 78a954
.sp
Packit 78a954
  --enable-newline-is-cr
Packit 78a954
.sp
Packit 78a954
to the \fBconfigure\fP command. There is also a --enable-newline-is-lf option,
Packit 78a954
which explicitly specifies linefeed as the newline character.
Packit 78a954
.sp
Packit 78a954
Alternatively, you can specify that line endings are to be indicated by the two
Packit 78a954
character sequence CRLF. If you want this, add
Packit 78a954
.sp
Packit 78a954
  --enable-newline-is-crlf
Packit 78a954
.sp
Packit 78a954
to the \fBconfigure\fP command. There is a fourth option, specified by
Packit 78a954
.sp
Packit 78a954
  --enable-newline-is-anycrlf
Packit 78a954
.sp
Packit 78a954
which causes PCRE to recognize any of the three sequences CR, LF, or CRLF as
Packit 78a954
indicating a line ending. Finally, a fifth option, specified by
Packit 78a954
.sp
Packit 78a954
  --enable-newline-is-any
Packit 78a954
.sp
Packit 78a954
causes PCRE to recognize any Unicode newline sequence.
Packit 78a954
.P
Packit 78a954
Whatever line ending convention is selected when PCRE is built can be
Packit 78a954
overridden when the library functions are called. At build time it is
Packit 78a954
conventional to use the standard for your operating system.
Packit 78a954
.
Packit 78a954
.
Packit 78a954
.SH "WHAT \eR MATCHES"
Packit 78a954
.rs
Packit 78a954
.sp
Packit 78a954
By default, the sequence \eR in a pattern matches any Unicode newline sequence,
Packit 78a954
whatever has been selected as the line ending sequence. If you specify
Packit 78a954
.sp
Packit 78a954
  --enable-bsr-anycrlf
Packit 78a954
.sp
Packit 78a954
the default is changed so that \eR matches only CR, LF, or CRLF. Whatever is
Packit 78a954
selected when PCRE is built can be overridden when the library functions are
Packit 78a954
called.
Packit 78a954
.
Packit 78a954
.
Packit 78a954
.SH "POSIX MALLOC USAGE"
Packit 78a954
.rs
Packit 78a954
.sp
Packit 78a954
When the 8-bit library is called through the POSIX interface (see the
Packit 78a954
.\" HREF
Packit 78a954
\fBpcreposix\fP
Packit 78a954
.\"
Packit 78a954
documentation), additional working storage is required for holding the pointers
Packit 78a954
to capturing substrings, because PCRE requires three integers per substring,
Packit 78a954
whereas the POSIX interface provides only two. If the number of expected
Packit 78a954
substrings is small, the wrapper function uses space on the stack, because this
Packit 78a954
is faster than using \fBmalloc()\fP for each call. The default threshold above
Packit 78a954
which the stack is no longer used is 10; it can be changed by adding a setting
Packit 78a954
such as
Packit 78a954
.sp
Packit 78a954
  --with-posix-malloc-threshold=20
Packit 78a954
.sp
Packit 78a954
to the \fBconfigure\fP command.
Packit 78a954
.
Packit 78a954
.
Packit 78a954
.SH "HANDLING VERY LARGE PATTERNS"
Packit 78a954
.rs
Packit 78a954
.sp
Packit 78a954
Within a compiled pattern, offset values are used to point from one part to
Packit 78a954
another (for example, from an opening parenthesis to an alternation
Packit 78a954
metacharacter). By default, in the 8-bit and 16-bit libraries, two-byte values
Packit 78a954
are used for these offsets, leading to a maximum size for a compiled pattern of
Packit 78a954
around 64K. This is sufficient to handle all but the most gigantic patterns.
Packit 78a954
Nevertheless, some people do want to process truly enormous patterns, so it is
Packit 78a954
possible to compile PCRE to use three-byte or four-byte offsets by adding a
Packit 78a954
setting such as
Packit 78a954
.sp
Packit 78a954
  --with-link-size=3
Packit 78a954
.sp
Packit 78a954
to the \fBconfigure\fP command. The value given must be 2, 3, or 4. For the
Packit 78a954
16-bit library, a value of 3 is rounded up to 4. In these libraries, using
Packit 78a954
longer offsets slows down the operation of PCRE because it has to load
Packit 78a954
additional data when handling them. For the 32-bit library the value is always
Packit 78a954
4 and cannot be overridden; the value of --with-link-size is ignored.
Packit 78a954
.
Packit 78a954
.
Packit 78a954
.SH "AVOIDING EXCESSIVE STACK USAGE"
Packit 78a954
.rs
Packit 78a954
.sp
Packit 78a954
When matching with the \fBpcre_exec()\fP function, PCRE implements backtracking
Packit 78a954
by making recursive calls to an internal function called \fBmatch()\fP. In
Packit 78a954
environments where the size of the stack is limited, this can severely limit
Packit 78a954
PCRE's operation. (The Unix environment does not usually suffer from this
Packit 78a954
problem, but it may sometimes be necessary to increase the maximum stack size.
Packit 78a954
There is a discussion in the
Packit 78a954
.\" HREF
Packit 78a954
\fBpcrestack\fP
Packit 78a954
.\"
Packit 78a954
documentation.) An alternative approach to recursion that uses memory from the
Packit 78a954
heap to remember data, instead of using recursive function calls, has been
Packit 78a954
implemented to work round the problem of limited stack size. If you want to
Packit 78a954
build a version of PCRE that works this way, add
Packit 78a954
.sp
Packit 78a954
  --disable-stack-for-recursion
Packit 78a954
.sp
Packit 78a954
to the \fBconfigure\fP command. With this configuration, PCRE will use the
Packit 78a954
\fBpcre_stack_malloc\fP and \fBpcre_stack_free\fP variables to call memory
Packit 78a954
management functions. By default these point to \fBmalloc()\fP and
Packit 78a954
\fBfree()\fP, but you can replace the pointers so that your own functions are
Packit 78a954
used instead.
Packit 78a954
.P
Packit 78a954
Separate functions are provided rather than using \fBpcre_malloc\fP and
Packit 78a954
\fBpcre_free\fP because the usage is very predictable: the block sizes
Packit 78a954
requested are always the same, and the blocks are always freed in reverse
Packit 78a954
order. A calling program might be able to implement optimized functions that
Packit 78a954
perform better than \fBmalloc()\fP and \fBfree()\fP. PCRE runs noticeably more
Packit 78a954
slowly when built in this way. This option affects only the \fBpcre_exec()\fP
Packit 78a954
function; it is not relevant for \fBpcre_dfa_exec()\fP.
Packit 78a954
.
Packit 78a954
.
Packit 78a954
.SH "LIMITING PCRE RESOURCE USAGE"
Packit 78a954
.rs
Packit 78a954
.sp
Packit 78a954
Internally, PCRE has a function called \fBmatch()\fP, which it calls repeatedly
Packit 78a954
(sometimes recursively) when matching a pattern with the \fBpcre_exec()\fP
Packit 78a954
function. By controlling the maximum number of times this function may be
Packit 78a954
called during a single matching operation, a limit can be placed on the
Packit 78a954
resources used by a single call to \fBpcre_exec()\fP. The limit can be changed
Packit 78a954
at run time, as described in the
Packit 78a954
.\" HREF
Packit 78a954
\fBpcreapi\fP
Packit 78a954
.\"
Packit 78a954
documentation. The default is 10 million, but this can be changed by adding a
Packit 78a954
setting such as
Packit 78a954
.sp
Packit 78a954
  --with-match-limit=500000
Packit 78a954
.sp
Packit 78a954
to the \fBconfigure\fP command. This setting has no effect on the
Packit 78a954
\fBpcre_dfa_exec()\fP matching function.
Packit 78a954
.P
Packit 78a954
In some environments it is desirable to limit the depth of recursive calls of
Packit 78a954
\fBmatch()\fP more strictly than the total number of calls, in order to
Packit 78a954
restrict the maximum amount of stack (or heap, if --disable-stack-for-recursion
Packit 78a954
is specified) that is used. A second limit controls this; it defaults to the
Packit 78a954
value that is set for --with-match-limit, which imposes no additional
Packit 78a954
constraints. However, you can set a lower limit by adding, for example,
Packit 78a954
.sp
Packit 78a954
  --with-match-limit-recursion=10000
Packit 78a954
.sp
Packit 78a954
to the \fBconfigure\fP command. This value can also be overridden at run time.
Packit 78a954
.
Packit 78a954
.
Packit 78a954
.SH "CREATING CHARACTER TABLES AT BUILD TIME"
Packit 78a954
.rs
Packit 78a954
.sp
Packit 78a954
PCRE uses fixed tables for processing characters whose code values are less
Packit 78a954
than 256. By default, PCRE is built with a set of tables that are distributed
Packit 78a954
in the file \fIpcre_chartables.c.dist\fP. These tables are for ASCII codes
Packit 78a954
only. If you add
Packit 78a954
.sp
Packit 78a954
  --enable-rebuild-chartables
Packit 78a954
.sp
Packit 78a954
to the \fBconfigure\fP command, the distributed tables are no longer used.
Packit 78a954
Instead, a program called \fBdftables\fP is compiled and run. This outputs the
Packit 78a954
source for new set of tables, created in the default locale of your C run-time
Packit 78a954
system. (This method of replacing the tables does not work if you are cross
Packit 78a954
compiling, because \fBdftables\fP is run on the local host. If you need to
Packit 78a954
create alternative tables when cross compiling, you will have to do so "by
Packit 78a954
hand".)
Packit 78a954
.
Packit 78a954
.
Packit 78a954
.SH "USING EBCDIC CODE"
Packit 78a954
.rs
Packit 78a954
.sp
Packit 78a954
PCRE assumes by default that it will run in an environment where the character
Packit 78a954
code is ASCII (or Unicode, which is a superset of ASCII). This is the case for
Packit 78a954
most computer operating systems. PCRE can, however, be compiled to run in an
Packit 78a954
EBCDIC environment by adding
Packit 78a954
.sp
Packit 78a954
  --enable-ebcdic
Packit 78a954
.sp
Packit 78a954
to the \fBconfigure\fP command. This setting implies
Packit 78a954
--enable-rebuild-chartables. You should only use it if you know that you are in
Packit 78a954
an EBCDIC environment (for example, an IBM mainframe operating system). The
Packit 78a954
--enable-ebcdic option is incompatible with --enable-utf.
Packit 78a954
.P
Packit 78a954
The EBCDIC character that corresponds to an ASCII LF is assumed to have the
Packit 78a954
value 0x15 by default. However, in some EBCDIC environments, 0x25 is used. In
Packit 78a954
such an environment you should use
Packit 78a954
.sp
Packit 78a954
  --enable-ebcdic-nl25
Packit 78a954
.sp
Packit 78a954
as well as, or instead of, --enable-ebcdic. The EBCDIC character for CR has the
Packit 78a954
same value as in ASCII, namely, 0x0d. Whichever of 0x15 and 0x25 is \fInot\fP
Packit 78a954
chosen as LF is made to correspond to the Unicode NEL character (which, in
Packit 78a954
Unicode, is 0x85).
Packit 78a954
.P
Packit 78a954
The options that select newline behaviour, such as --enable-newline-is-cr,
Packit 78a954
and equivalent run-time options, refer to these character values in an EBCDIC
Packit 78a954
environment.
Packit 78a954
.
Packit 78a954
.
Packit 78a954
.SH "PCREGREP OPTIONS FOR COMPRESSED FILE SUPPORT"
Packit 78a954
.rs
Packit 78a954
.sp
Packit 78a954
By default, \fBpcregrep\fP reads all files as plain text. You can build it so
Packit 78a954
that it recognizes files whose names end in \fB.gz\fP or \fB.bz2\fP, and reads
Packit 78a954
them with \fBlibz\fP or \fBlibbz2\fP, respectively, by adding one or both of
Packit 78a954
.sp
Packit 78a954
  --enable-pcregrep-libz
Packit 78a954
  --enable-pcregrep-libbz2
Packit 78a954
.sp
Packit 78a954
to the \fBconfigure\fP command. These options naturally require that the
Packit 78a954
relevant libraries are installed on your system. Configuration will fail if
Packit 78a954
they are not.
Packit 78a954
.
Packit 78a954
.
Packit 78a954
.SH "PCREGREP BUFFER SIZE"
Packit 78a954
.rs
Packit 78a954
.sp
Packit 78a954
\fBpcregrep\fP uses an internal buffer to hold a "window" on the file it is
Packit 78a954
scanning, in order to be able to output "before" and "after" lines when it
Packit 78a954
finds a match. The size of the buffer is controlled by a parameter whose
Packit 78a954
default value is 20K. The buffer itself is three times this size, but because
Packit 78a954
of the way it is used for holding "before" lines, the longest line that is
Packit 78a954
guaranteed to be processable is the parameter size. You can change the default
Packit 78a954
parameter value by adding, for example,
Packit 78a954
.sp
Packit 78a954
  --with-pcregrep-bufsize=50K
Packit 78a954
.sp
Packit 78a954
to the \fBconfigure\fP command. The caller of \fPpcregrep\fP can, however,
Packit 78a954
override this value by specifying a run-time option.
Packit 78a954
.
Packit 78a954
.
Packit 78a954
.SH "PCRETEST OPTION FOR LIBREADLINE SUPPORT"
Packit 78a954
.rs
Packit 78a954
.sp
Packit 78a954
If you add
Packit 78a954
.sp
Packit 78a954
  --enable-pcretest-libreadline
Packit 78a954
.sp
Packit 78a954
to the \fBconfigure\fP command, \fBpcretest\fP is linked with the
Packit 78a954
\fBlibreadline\fP library, and when its input is from a terminal, it reads it
Packit 78a954
using the \fBreadline()\fP function. This provides line-editing and history
Packit 78a954
facilities. Note that \fBlibreadline\fP is GPL-licensed, so if you distribute a
Packit 78a954
binary of \fBpcretest\fP linked in this way, there may be licensing issues.
Packit 78a954
.P
Packit 78a954
Setting this option causes the \fB-lreadline\fP option to be added to the
Packit 78a954
\fBpcretest\fP build. In many operating environments with a sytem-installed
Packit 78a954
\fBlibreadline\fP this is sufficient. However, in some environments (e.g.
Packit 78a954
if an unmodified distribution version of readline is in use), some extra
Packit 78a954
configuration may be necessary. The INSTALL file for \fBlibreadline\fP says
Packit 78a954
this:
Packit 78a954
.sp
Packit 78a954
  "Readline uses the termcap functions, but does not link with the
Packit 78a954
  termcap or curses library itself, allowing applications which link
Packit 78a954
  with readline the to choose an appropriate library."
Packit 78a954
.sp
Packit 78a954
If your environment has not been set up so that an appropriate library is
Packit 78a954
automatically included, you may need to add something like
Packit 78a954
.sp
Packit 78a954
  LIBS="-ncurses"
Packit 78a954
.sp
Packit 78a954
immediately before the \fBconfigure\fP command.
Packit 78a954
.
Packit 78a954
.
Packit 78a954
.SH "DEBUGGING WITH VALGRIND SUPPORT"
Packit 78a954
.rs
Packit 78a954
.sp
Packit 78a954
By adding the
Packit 78a954
.sp
Packit 78a954
  --enable-valgrind
Packit 78a954
.sp
Packit 78a954
option to to the \fBconfigure\fP command, PCRE will use valgrind annotations
Packit 78a954
to mark certain memory regions as unaddressable. This allows it to detect
Packit 78a954
invalid memory accesses, and is mostly useful for debugging PCRE itself.
Packit 78a954
.
Packit 78a954
.
Packit 78a954
.SH "CODE COVERAGE REPORTING"
Packit 78a954
.rs
Packit 78a954
.sp
Packit 78a954
If your C compiler is gcc, you can build a version of PCRE that can generate a
Packit 78a954
code coverage report for its test suite. To enable this, you must install
Packit 78a954
\fBlcov\fP version 1.6 or above. Then specify
Packit 78a954
.sp
Packit 78a954
  --enable-coverage
Packit 78a954
.sp
Packit 78a954
to the \fBconfigure\fP command and build PCRE in the usual way.
Packit 78a954
.P
Packit 78a954
Note that using \fBccache\fP (a caching C compiler) is incompatible with code
Packit 78a954
coverage reporting. If you have configured \fBccache\fP to run automatically
Packit 78a954
on your system, you must set the environment variable
Packit 78a954
.sp
Packit 78a954
  CCACHE_DISABLE=1
Packit 78a954
.sp
Packit 78a954
before running \fBmake\fP to build PCRE, so that \fBccache\fP is not used.
Packit 78a954
.P
Packit 78a954
When --enable-coverage is used, the following addition targets are added to the
Packit 78a954
\fIMakefile\fP:
Packit 78a954
.sp
Packit 78a954
  make coverage
Packit 78a954
.sp
Packit 78a954
This creates a fresh coverage report for the PCRE test suite. It is equivalent
Packit 78a954
to running "make coverage-reset", "make coverage-baseline", "make check", and
Packit 78a954
then "make coverage-report".
Packit 78a954
.sp
Packit 78a954
  make coverage-reset
Packit 78a954
.sp
Packit 78a954
This zeroes the coverage counters, but does nothing else.
Packit 78a954
.sp
Packit 78a954
  make coverage-baseline
Packit 78a954
.sp
Packit 78a954
This captures baseline coverage information.
Packit 78a954
.sp
Packit 78a954
  make coverage-report
Packit 78a954
.sp
Packit 78a954
This creates the coverage report.
Packit 78a954
.sp
Packit 78a954
  make coverage-clean-report
Packit 78a954
.sp
Packit 78a954
This removes the generated coverage report without cleaning the coverage data
Packit 78a954
itself.
Packit 78a954
.sp
Packit 78a954
  make coverage-clean-data
Packit 78a954
.sp
Packit 78a954
This removes the captured coverage data without removing the coverage files
Packit 78a954
created at compile time (*.gcno).
Packit 78a954
.sp
Packit 78a954
  make coverage-clean
Packit 78a954
.sp
Packit 78a954
This cleans all coverage data including the generated coverage report. For more
Packit 78a954
information about code coverage, see the \fBgcov\fP and \fBlcov\fP
Packit 78a954
documentation.
Packit 78a954
.
Packit 78a954
.
Packit 78a954
.SH "SEE ALSO"
Packit 78a954
.rs
Packit 78a954
.sp
Packit 78a954
\fBpcreapi\fP(3), \fBpcre16\fP, \fBpcre32\fP, \fBpcre_config\fP(3).
Packit 78a954
.
Packit 78a954
.
Packit 78a954
.SH AUTHOR
Packit 78a954
.rs
Packit 78a954
.sp
Packit 78a954
.nf
Packit 78a954
Philip Hazel
Packit 78a954
University Computing Service
Packit 78a954
Cambridge CB2 3QH, England.
Packit 78a954
.fi
Packit 78a954
.
Packit 78a954
.
Packit 78a954
.SH REVISION
Packit 78a954
.rs
Packit 78a954
.sp
Packit 78a954
.nf
Packit 78a954
Last updated: 12 May 2013
Packit 78a954
Copyright (c) 1997-2013 University of Cambridge.
Packit 78a954
.fi