|PCREBUILD(3)||Library Functions Manual||PCREBUILD(3)|
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
The following sections include descriptions of options whose names begin with --enable or --disable. These settings specify changes to the defaults for the configure command. Because of the way that configure works, --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.
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
to the configure command. If you do not want the 8-bit library, add
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.
to the configure command, as required.
to the configure command.
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, 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 its input to be either ASCII or UTF-8 (depending on the run-time option). It is not possible to support both EBCDIC and UTF-8 codes in the same version of the library. Consequently, --enable-utf and --enable-ebcdic are mutually exclusive.
to the configure command. This implies UTF support, even if you have not explicitly requested it.
Including Unicode property support adds around 30K of tables to the PCRE library. Only the general category properties such as Lu and Nd are supported. Details are given in the pcrepattern documentation.
This support is available only for certain hardware architectures. If this option is set for an unsupported architecture, a compile time error occurs. See the pcrejit documentation for a discussion of JIT usage. When JIT support is enabled, pcregrep automatically makes use of it, unless you add
to the "configure" command.
to the configure command. There is also a --enable-newline-is-lf option, which explicitly specifies linefeed as the newline character.
Alternatively, you can specify that line endings are to be indicated by the two character sequence CRLF. If you want this, add
to the configure command. There is a fourth option, specified by
which causes PCRE to recognize any of the three sequences CR, LF, or CRLF as indicating a line ending. Finally, a fifth option, specified by
causes PCRE to recognize any Unicode newline sequence.
Whatever line ending convention is selected when PCRE is built can be overridden when the library functions are called. At build time it is conventional to use the standard for your operating system.
the default is changed so that \R matches only CR, LF, or CRLF. Whatever is selected when PCRE is built can be overridden when the library functions are called.
to the configure command.
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. 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.
to the configure command. With this configuration, PCRE will use the pcre_stack_malloc and pcre_stack_free variables to call memory management functions. By default these point to malloc() and free(), but you can replace the pointers so that your own functions are used instead.
Separate functions are provided rather than using pcre_malloc and pcre_free because the usage is very predictable: the block sizes requested are always the same, and the blocks are always freed in reverse order. A calling program might be able to implement optimized functions that perform better than malloc() and free(). PCRE runs noticeably more slowly when built in this way. This option affects only the pcre_exec() function; it is not relevant for pcre_dfa_exec().
to the configure command. This setting has no effect on the pcre_dfa_exec() matching function.
In some environments it is desirable to limit the depth of recursive calls of match() more strictly than the total number of calls, in order to restrict the maximum amount of stack (or heap, if --disable-stack-for-recursion is specified) that is used. A second limit controls this; it defaults to the value that is set for --with-match-limit, which imposes no additional constraints. However, you can set a lower limit by adding, for example,
to the configure command. This value can also be overridden at run time.
to the configure command, the distributed tables are no longer used. Instead, a program called dftables is compiled and run. This outputs the source for new set of tables, created in the default locale of your C run-time system. (This method of replacing the tables does not work if you are cross compiling, because dftables is run on the local host. If you need to create alternative tables when cross compiling, you will have to do so "by hand".)
to the configure command. This setting implies --enable-rebuild-chartables. You should only use it if you know that you are in an EBCDIC environment (for example, an IBM mainframe operating system). The --enable-ebcdic option is incompatible with --enable-utf.
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
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.
to the configure command. These options naturally require that the relevant libraries are installed on your system. Configuration will fail if they are not.
to the configure command. The caller of pcregrep can, however, override this value by specifying a run-time option.
to the configure command, pcretest is linked with the libreadline library, and when its input is from a terminal, it reads it using the readline() function. This provides line-editing and history facilities. Note that libreadline is GPL-licensed, so if you distribute a binary of pcretest linked in this way, there may be licensing issues.
Setting this option causes the -lreadline option to be added to the pcretest build. In many operating environments with a sytem-installed libreadline this is sufficient. However, in some environments (e.g. if an unmodified distribution version of readline is in use), some extra configuration may be necessary. The INSTALL file for libreadline says this:
"Readline uses the termcap functions, but does not link with the termcap or curses library itself, allowing applications which link with readline the to choose an appropriate library."
If your environment has not been set up so that an appropriate library is automatically included, you may need to add something like
immediately before the configure command.
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.
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
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:
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".
This zeroes the coverage counters, but does nothing else.
This captures baseline coverage information.
This creates the coverage report.
This removes the generated coverage report without cleaning the coverage data itself.
This removes the captured coverage data without removing the coverage files created at compile time (*.gcno).
This cleans all coverage data including the generated coverage report. For more information about code coverage, see the gcov and lcov documentation.
Philip Hazel University Computing Service Cambridge CB2 3QH, England.
Last updated: 12 May 2013 Copyright (c) 1997-2013 University of Cambridge.
|12 May 2013||PCRE 8.33|