--- embedaddon/pcre/doc/html/pcrebuild.html 2012/10/09 09:19:18 1.1.1.3 +++ embedaddon/pcre/doc/html/pcrebuild.html 2013/07/22 08:25:57 1.1.1.4 @@ -13,45 +13,65 @@ from the original man page. If there is any nonsense i man page, in case the conversion went wrong.
-
PCRE BUILD-TIME OPTIONS
+
BUILDING PCRE

-This document describes the optional features of PCRE that can be selected when -the library is compiled. It assumes use of the configure script, where -the optional features are selected or deselected by providing options to -configure before running the make command. However, the same -options can be selected in both Unix-like and non-Unix-like environments using -the GUI facility of cmake-gui if you are using CMake instead of -configure to build PCRE. +PCRE is distributed with a configure script that can be used to build the +library in Unix-like environments using the applications known as Autotools. +Also in the distribution are files to support building using CMake +instead of configure. The text file +README +contains general information about building with Autotools (some of which is +repeated below), and also has some comments about building on various operating +systems. There is a lot more information about building PCRE without using +Autotools (including information about using CMake and building "by +hand") in the text file called +NON-AUTOTOOLS-BUILD. +You should consult this file as well as the +README +file if you are building in a non-Unix-like environment.

+
PCRE BUILD-TIME OPTIONS

-There is a lot more information about building PCRE in non-Unix-like -environments in the file called NON_UNIX_USE, which is part of the PCRE -distribution. You should consult this file as well as the README file if -you are building in a non-Unix-like environment. +The rest of this document describes the optional features of PCRE that can be +selected when the library is compiled. It assumes use of the configure +script, where the optional features are selected or deselected by providing +options to configure before running the make command. However, the +same options can be selected in both Unix-like and non-Unix-like environments +using the GUI facility of cmake-gui if you are using CMake instead +of configure to build PCRE.

+If you are not using Autotools or CMake, option selection can be done by +editing the config.h file, or by passing parameter settings to the +compiler, as described in +NON-AUTOTOOLS-BUILD. +

+

The complete list of options for configure (which includes the standard ones such as the selection of the installation directory) can be obtained by running @@ -64,7 +84,7 @@ The following sections include descriptions of options --enable and --disable always come in pairs, so the complementary option always exists as well, but as it specifies the default, it is not described.

-
BUILDING 8-BIT and 16-BIT LIBRARIES
+
BUILDING 8-BIT, 16-BIT AND 32-BIT LIBRARIES

By default, a library called libpcre is built, containing functions that take string arguments contained in vectors of bytes, either as single-byte @@ -75,25 +95,33 @@ strings, by adding

   --enable-pcre16
 
+to the configure command. You can also build yet another separate +library, called libpcre32, in which strings are contained in vectors of +32-bit data units and interpreted either as single-unit characters or UTF-32 +strings, by adding +
+  --enable-pcre32
+
to the configure command. If you do not want the 8-bit library, add
   --disable-pcre8
 
-as well. At least one of the two libraries must be built. Note that the C++ and -POSIX wrappers are for the 8-bit library only, and that pcregrep is an -8-bit program. None of these are built if you select only the 16-bit library. +as well. At least one of the three libraries must be built. Note that the C++ +and POSIX wrappers are for the 8-bit library only, and that pcregrep is +an 8-bit program. None of these are built if you select only the 16-bit or +32-bit libraries.

-
BUILDING SHARED AND STATIC LIBRARIES
+
BUILDING SHARED AND STATIC LIBRARIES

-The PCRE building process uses libtool to build both shared and static -Unix libraries by default. You can suppress one of these by adding one of +The Autotools PCRE building process uses libtool to build both shared and +static libraries by default. You can suppress one of these by adding one of

   --disable-shared
   --disable-static
 
to the configure command, as required.

-
C++ SUPPORT
+
C++ SUPPORT

By default, if the 8-bit library is being built, the configure script will search for a C++ compiler and C++ header files. If it finds them, it @@ -104,26 +132,26 @@ strings). You can disable this by adding to the configure command.

-
UTF-8 and UTF-16 SUPPORT
+
UTF-8, UTF-16 AND UTF-32 SUPPORT

To build PCRE with support for UTF Unicode character strings, add

   --enable-utf
 
-to the configure command. This setting applies to both libraries, adding -support for UTF-8 to the 8-bit library and support for UTF-16 to the 16-bit -library. There are no separate options for enabling UTF-8 and UTF-16 -independently because that would allow ridiculous settings such as requesting -UTF-16 support while building only the 8-bit library. It is not possible to -build one library with UTF support and the other without in the same -configuration. (For backwards compatibility, --enable-utf8 is a synonym of ---enable-utf.) +to the configure command. This setting applies to all three libraries, +adding support for UTF-8 to the 8-bit library, support for UTF-16 to the 16-bit +library, and support for UTF-32 to the to the 32-bit library. There are no +separate options for enabling UTF-8, UTF-16 and UTF-32 independently because +that would allow ridiculous settings such as requesting UTF-16 support while +building only the 8-bit library. It is not possible to build one library with +UTF support and another without in the same configuration. (For backwards +compatibility, --enable-utf8 is a synonym of --enable-utf.)

-Of itself, this setting does not make PCRE treat strings as UTF-8 or UTF-16. As -well as compiling PCRE with this option, you also have have to set the -PCRE_UTF8 or PCRE_UTF16 option when you call one of the pattern compiling -functions. +Of itself, this setting does not make PCRE treat strings as UTF-8, UTF-16 or +UTF-32. As well as compiling PCRE with this option, you also have have to set +the PCRE_UTF8, PCRE_UTF16 or PCRE_UTF32 option (as appropriate) when you call +one of the pattern compiling functions.

If you set --enable-utf when compiling in an EBCDIC environment, PCRE expects @@ -132,7 +160,7 @@ not possible to support both EBCDIC and UTF-8 codes in library. Consequently, --enable-utf and --enable-ebcdic are mutually exclusive.

-
UNICODE CHARACTER PROPERTY SUPPORT
+
UNICODE CHARACTER PROPERTY SUPPORT

UTF support allows the libraries to process character codepoints up to 0x10ffff in the strings that they handle. On its own, however, it does not provide any @@ -152,7 +180,7 @@ supported. Details are given in the pcrepattern documentation.

-
JUST-IN-TIME COMPILER SUPPORT
+
JUST-IN-TIME COMPILER SUPPORT

Just-in-time compiler support is included in the build by specifying

@@ -169,7 +197,7 @@ pcregrep automatically makes use of it, unless you add
 
to the "configure" command.

-
CODE VALUE OF NEWLINE
+
CODE VALUE OF NEWLINE

By default, PCRE interprets the linefeed (LF) character as indicating the end of a line. This is the normal newline character on Unix-like systems. You can @@ -202,7 +230,7 @@ Whatever line ending convention is selected when PCRE overridden when the library functions are called. At build time it is conventional to use the standard for your operating system.

-
WHAT \R MATCHES
+
WHAT \R MATCHES

By default, the sequence \R in a pattern matches any Unicode newline sequence, whatever has been selected as the line ending sequence. If you specify @@ -213,7 +241,7 @@ the default is changed so that \R matches only CR, LF, selected when PCRE is built can be overridden when the library functions are called.

-
POSIX MALLOC USAGE
+
POSIX MALLOC USAGE

When the 8-bit library is called through the POSIX interface (see the pcreposix @@ -229,24 +257,26 @@ such as to the configure command.

-
HANDLING VERY LARGE PATTERNS
+
HANDLING VERY LARGE PATTERNS

Within a compiled pattern, offset values are used to point from one part to another (for example, from an opening parenthesis to an alternation -metacharacter). By default, two-byte values are used for these offsets, leading -to a maximum size for a compiled pattern of around 64K. This is sufficient to -handle all but the most gigantic patterns. Nevertheless, some people do want to -process truly enormous patterns, so it is possible to compile PCRE to use -three-byte or four-byte offsets by adding a setting such as +metacharacter). By default, in the 8-bit and 16-bit libraries, two-byte values +are used for these offsets, leading to a maximum size for a compiled pattern of +around 64K. This is sufficient to handle all but the most gigantic patterns. +Nevertheless, some people do want to process truly enormous patterns, so it is +possible to compile PCRE to use three-byte or four-byte offsets by adding a +setting such as

   --with-link-size=3
 
to the configure command. The value given must be 2, 3, or 4. For the -16-bit library, a value of 3 is rounded up to 4. Using longer offsets slows -down the operation of PCRE because it has to load additional data when handling -them. +16-bit library, a value of 3 is rounded up to 4. In these libraries, using +longer offsets slows down the operation of PCRE because it has to load +additional data when handling them. For the 32-bit library the value is always +4 and cannot be overridden; the value of --with-link-size is ignored.

-
AVOIDING EXCESSIVE STACK USAGE
+
AVOIDING EXCESSIVE STACK USAGE

When matching with the pcre_exec() function, PCRE implements backtracking by making recursive calls to an internal function called match(). In @@ -277,7 +307,7 @@ perform better than malloc() and free(). slowly when built in this way. This option affects only the pcre_exec() function; it is not relevant for pcre_dfa_exec().

-
LIMITING PCRE RESOURCE USAGE
+
LIMITING PCRE RESOURCE USAGE

Internally, PCRE has a function called match(), which it calls repeatedly (sometimes recursively) when matching a pattern with the pcre_exec() @@ -306,7 +336,7 @@ constraints. However, you can set a lower limit by add to the configure command. This value can also be overridden at run time.

-
CREATING CHARACTER TABLES AT BUILD TIME
+
CREATING CHARACTER TABLES AT BUILD TIME

PCRE uses fixed tables for processing characters whose code values are less than 256. By default, PCRE is built with a set of tables that are distributed @@ -323,7 +353,7 @@ compiling, because dftables is run on the local create alternative tables when cross compiling, you will have to do so "by hand".)

-
USING EBCDIC CODE
+
USING EBCDIC CODE

PCRE assumes by default that it will run in an environment where the character code is ASCII (or Unicode, which is a superset of ASCII). This is the case for @@ -337,8 +367,25 @@ to the configure command. This setting implies an EBCDIC environment (for example, an IBM mainframe operating system). The --enable-ebcdic option is incompatible with --enable-utf.

-
PCREGREP OPTIONS FOR COMPRESSED FILE SUPPORT

+The EBCDIC character that corresponds to an ASCII LF is assumed to have the +value 0x15 by default. However, in some EBCDIC environments, 0x25 is used. In +such an environment you should use +

+  --enable-ebcdic-nl25
+
+as well as, or instead of, --enable-ebcdic. The EBCDIC character for CR has the +same value as in ASCII, namely, 0x0d. Whichever of 0x15 and 0x25 is not +chosen as LF is made to correspond to the Unicode NEL character (which, in +Unicode, is 0x85). +

+

+The options that select newline behaviour, such as --enable-newline-is-cr, +and equivalent run-time options, refer to these character values in an EBCDIC +environment. +

+
PCREGREP OPTIONS FOR COMPRESSED FILE SUPPORT
+

By default, pcregrep reads all files as plain text. You can build it so that it recognizes files whose names end in .gz or .bz2, and reads them with libz or libbz2, respectively, by adding one or both of @@ -350,7 +397,7 @@ to the configure command. These options natural relevant libraries are installed on your system. Configuration will fail if they are not.

-
PCREGREP BUFFER SIZE
+
PCREGREP BUFFER SIZE

pcregrep uses an internal buffer to hold a "window" on the file it is scanning, in order to be able to output "before" and "after" lines when it @@ -365,7 +412,7 @@ parameter value by adding, for example, to the configure command. The caller of \fPpcregrep\fP can, however, override this value by specifying a run-time option.

-
PCRETEST OPTION FOR LIBREADLINE SUPPORT
+
PCRETEST OPTION FOR LIBREADLINE SUPPORT

If you add

@@ -396,12 +443,79 @@ automatically included, you may need to add something 
 
immediately before the configure command.

-
SEE ALSO
+
DEBUGGING WITH VALGRIND SUPPORT

-pcreapi(3), pcre16, pcre_config(3). +By adding the +

+  --enable-valgrind
+
+option to to the configure command, PCRE will use valgrind annotations +to mark certain memory regions as unaddressable. This allows it to detect +invalid memory accesses, and is mostly useful for debugging PCRE itself.

-
AUTHOR
+
CODE COVERAGE REPORTING

+If your C compiler is gcc, you can build a version of PCRE that can generate a +code coverage report for its test suite. To enable this, you must install +lcov version 1.6 or above. Then specify +

+  --enable-coverage
+
+to the configure command and build PCRE in the usual way. +

+

+Note that using ccache (a caching C compiler) is incompatible with code +coverage reporting. If you have configured ccache to run automatically +on your system, you must set the environment variable +

+  CCACHE_DISABLE=1
+
+before running make to build PCRE, so that ccache is not used. +

+

+When --enable-coverage is used, the following addition targets are added to the +Makefile: +

+  make coverage
+
+This creates a fresh coverage report for the PCRE test suite. It is equivalent +to running "make coverage-reset", "make coverage-baseline", "make check", and +then "make coverage-report". +
+  make coverage-reset
+
+This zeroes the coverage counters, but does nothing else. +
+  make coverage-baseline
+
+This captures baseline coverage information. +
+  make coverage-report
+
+This creates the coverage report. +
+  make coverage-clean-report
+
+This removes the generated coverage report without cleaning the coverage data +itself. +
+  make coverage-clean-data
+
+This removes the captured coverage data without removing the coverage files +created at compile time (*.gcno). +
+  make coverage-clean
+
+This cleans all coverage data including the generated coverage report. For more +information about code coverage, see the gcov and lcov +documentation. +

+
SEE ALSO
+

+pcreapi(3), pcre16, pcre32, pcre_config(3). +

+
AUTHOR
+

Philip Hazel
University Computing Service @@ -409,11 +523,11 @@ University Computing Service Cambridge CB2 3QH, England.

-
REVISION
+
REVISION

-Last updated: 07 January 2012 +Last updated: 12 May 2013
-Copyright © 1997-2012 University of Cambridge. +Copyright © 1997-2013 University of Cambridge.

Return to the PCRE index page.