Lines Matching +full:- +full:- +full:enable +full:- +full:shared
1 README file for PCRE2 (Perl-compatible regular expression library)
2 ------------------------------------------------------------------
4 PCRE2 is a re-working of the original PCRE1 library to provide an entirely new
14 pcre2-dev@googlegroups.com. You can subscribe by sending an email to
15 pcre2-dev+subscribe@googlegroups.com.
20 https://groups.google.com/g/pcre2-dev
27 Building PCRE2 on non-Unix-like systems
31 Shared libraries
32 Cross-compiling using autotools
40 --------------
43 functions, one for the 8-bit library, which processes strings of bytes, one for
44 the 16-bit library, which processes strings of 16-bit values, and one for the
45 32-bit library, which processes strings of 32-bit values. Unlike PCRE1, there
48 The distribution does contain a set of C wrapper functions for the 8-bit
50 man page). These are built into a library called libpcre2-posix. Note that this
55 The header file for the POSIX-style functions is called pcre2posix.h. The
64 -----------------------
66 If you install PCRE2 in the normal way on a Unix-like system, you will end up
86 Building PCRE2 on non-Unix-like systems
87 ---------------------------------------
89 For a non-Unix-like system, please read the file NON-AUTOTOOLS-BUILD, though if
91 PCRE2 using autotools in the same way as for many Unix-like systems.
95 NON-AUTOTOOLS-BUILD has information about CMake.
103 --------------------------------------
106 environments, even some that are Unix or Unix-like. See the NON-AUTOTOOLS-BUILD
111 ------------------------------
132 CFLAGS='-O2 -Wall' ./configure --prefix=/opt/local
134 This command specifies that the C compiler should be run with the flags '-O2
135 -Wall' instead of the default, and that "make install" should install PCRE2
140 into /source/pcre2/pcre2-xxx, but you want to build it in
141 /build/pcre2/pcre2-xxx:
143 cd /build/pcre2/pcre2-xxx
144 /source/pcre2/pcre2-xxx/configure
153 . By default, both shared and static libraries are built. You can change this
156 --disable-shared
157 --disable-static
159 Setting --disable-shared ensures that PCRE2 libraries are built as static
166 LDFLAGS=--static ./configure --disable-shared
168 Note the two hyphens in --static. Of course, this works only if static
170 "Shared libraries" below.
172 . By default, only the 8-bit library is built. If you add --enable-pcre2-16 to
173 the "configure" command, the 16-bit library is also built. If you add
174 --enable-pcre2-32 to the "configure" command, the 32-bit library is also
175 built. If you want only the 16-bit or 32-bit library, use --disable-pcre2-8
176 to disable building the 8-bit library.
178 . If you want to include support for just-in-time (JIT) compiling, which can
179 give large performance improvements on certain platforms, add --enable-jit to
181 architectures. If you try to enable it on an unsupported architecture, there
182 will be a compile time error. If in doubt, use --enable-jit=auto, which
186 --enable-jit-sealloc, which enables the use of an executable memory allocator
191 . If you do not want to make use of the default support for UTF-8 Unicode
192 character strings in the 8-bit library, UTF-16 Unicode character strings in
193 the 16-bit library, or UTF-32 Unicode character strings in the 32-bit
194 library, you can add --disable-unicode to the "configure" command. This
197 It is also not possible to use --enable-ebcdic (see below) with Unicode
198 support, so if this option is set, you must also use --disable-unicode.
203 either be ASCII or UTF-8/16/32, even when running on EBCDIC platforms.
217 can specify the default newline indicator by adding --enable-newline-is-cr,
218 --enable-newline-is-lf, --enable-newline-is-crlf,
219 --enable-newline-is-anycrlf, --enable-newline-is-any, or
220 --enable-newline-is-nul to the "configure" command, respectively.
226 adding --enable-bsr-anycrlf to the "configure" command (bsr = "backslash R").
229 UTF mode. This can be dangerous because it breaks up multi-code-unit
231 adding --enable-never-backslash-C (note the upper case C) to the "configure"
240 --with-parens-nest-limit=500
247 --with-match-limit=500000
260 --with-match-limit-depth=5000
268 --with-heap-limit=500
275 . In the 8-bit library, the default maximum compiled pattern size is around
276 64 kibibytes. You can increase this by adding --with-link-size=3 to the
278 to different parts of the compiled pattern. In the 16-bit library,
279 --with-link-size=3 is the same as --with-link-size=4, which (in both
280 libraries) uses four-byte offsets. Increasing the internal link size reduces
281 performance in the 8-bit and 16-bit libraries. In the 32-bit library, the
282 link size setting is ignored, as 4-byte offsets are always used.
286 for each top-level branch. There is a limit to this maximum that defaults to
289 --with-max-varlookbehind=100
299 --enable-rebuild-chartables
310 --enable-ebcdic --disable-unicode
312 This automatically implies --enable-rebuild-chartables (see above). However,
314 both EBCDIC and UTF-8/16/32. There is a second option, --enable-ebcdic-nl25,
318 . If you specify --enable-debug, additional debugging code is included in the
323 --enable-valgrind
332 --enable-coverage
342 you add --disable-pcre2grep-jit to the "configure" command.
346 support can be disabled by adding --disable-pcre2grep-callout to the
351 --disable-pcre2grep-callout-fork to the "configure" command.
353 . The pcre2grep program currently supports only 8-bit data files, and so
354 requires the 8-bit PCRE2 library. It is possible to compile pcre2grep to use
358 --enable-pcre2grep-libz
359 --enable-pcre2grep-libbz2
366 --with-pcre2grep-bufsize=51200
376 --with-pcre2grep-max-bufsize=2097152
378 The default is either 1048576 or the value of --with-pcre2grep-bufsize,
384 --enable-pcre2test-libreadline or --enable-pcre2test-libedit
387 the readline() function. This provides line-editing and history facilities.
388 Note that libreadline is GPL-licenced, so if you distribute a binary of
392 Enabling libreadline causes the -lreadline option to be added to the
393 pcre2test build. In many operating environments with a system-installed
396 necessary to specify something like LIBS="-lncurses" as well. This is
410 --disable-percent-zt is specified, no use is made of the z or t modifiers.
413 . There is a special option called --enable-fuzz-support for use by people who
414 want to run fuzzing tests on PCRE2. At present this applies only to the 8-bit
415 library. If set, it causes an extra library called libpcre2-fuzzsupport.a to
421 Setting --enable-fuzz-support also causes a binary called pcre2fuzzcheck to
429 . Releases before 10.30 could be compiled with --disable-stack-for-recursion,
439 . src/config.h build-time configuration options for the library
441 . pcre2-config script that shows the building settings such as CFLAGS
443 . libpcre2-8.pc )
444 . libpcre2-16.pc ) data for the pkg-config command
445 . libpcre2-32.pc )
446 . libpcre2-posix.pc )
447 . libtool script that builds shared and/or static libraries
459 libraries libpcre2-8, libpcre2-16 and libpcre2-32 are configured, and a test
460 program called pcre2test. If you enabled JIT support with --enable-jit, another
461 test program called pcre2_jit_test is built as well. If the 8-bit library is
462 built, libpcre2-posix, pcre2posix_test, and the pcre2grep command are also
463 built. Running "make" with the -j option may speed up compilation on
467 tests are given below in a separate section of this document. The -j option of
476 pcre2grep (if 8-bit support is enabled)
477 pcre2-config
480 libpcre2-8 (if 8-bit support is enabled)
481 libpcre2-16 (if 16-bit support is enabled)
482 libpcre2-32 (if 32-bit support is enabled)
483 libpcre2-posix (if 8-bit support is enabled)
486 libpcre2-8.pc
487 libpcre2-16.pc
488 libpcre2-32.pc
489 libpcre2-posix.pc
498 pcre2-config.1
516 pcre2-config.txt the pcre2-config man page
520 remove any directories, because these are often shared with other programs.
524 ------------------------------------
526 Running "make install" installs the command pcre2-config, which can be used to
529 pcre2-config --version
533 pcre2-config --libs8
535 outputs information about where the 8-bit library is installed. This command
537 from having to remember too many details. Run pcre2-config with no arguments to
540 The pkg-config command is another system for saving and retrieving information
544 pkg-config --libs libpcre2-16
550 Shared libraries
551 ----------------
553 The default distribution builds PCRE2 as shared libraries and static libraries,
554 as long as the operating system supports shared libraries. Shared library
558 The libtool script is used to compile and link both shared and static
561 libraries (by means of wrapper scripts in the case of shared libraries). When
562 you use "make install" to install shared libraries, pcre2grep and pcre2test are
563 automatically re-built to use the newly installed shared libraries before being
567 To build PCRE2 using static libraries only you must use --disable-shared when
570 ./configure --prefix=/usr/gnu --disable-shared
572 Then run "make" in the usual way. Similarly, you can use --disable-static to
573 build only shared libraries. Note, however, that when you build only static
576 LDFLAGS to --static when running "configure".
579 Cross-compiling using autotools
580 -------------------------------
583 order to cross-compile PCRE2 for some other host. However, you should NOT
584 specify --enable-rebuild-chartables, because if you do, the pcre2_dftables.c
590 When --enable-rebuild-chartables is not specified, pcre2_chartables.c is
592 tables that assumes ASCII code. Cross-compiling with the default tables should
595 If you need to modify the character tables when cross-compiling, you should
603 -------------------
615 -------------
617 To test the basic PCRE2 library on a Unix-like system, run the RunTest script.
619 When the 8-bit library is built, a test program for the POSIX wrapper, called
623 NON-AUTOTOOLS-BUILD.
632 Some tests are relevant only when certain build-time options were selected. For
633 example, the tests for UTF-8/16/32 features are run only when Unicode support
638 testing can be suppressed by putting "-nojit" on the RunTest command line.
640 The entire set of tests is run once for each of the 8-bit, 16-bit and 32-bit
642 RunTest with either the -8, -16 or -32 option.
644 If valgrind is installed, you can run the tests under it by putting "-valgrind"
650 You can also specify ranges of tests such as 3-6 or 3- (meaning 3 to the
653 Runtest 3-15 ~10
673 auxiliary functions, error detection, and run-time flags that are specific to
680 isprint() function yields TRUE for characters in the range 128-255, the use of
684 [\x00-\x7f] the test might contain [\x00-\xff], and similarly in some other
704 with the perltest.sh script, and test 5 checking PCRE2-specific things.
707 non-UTF mode and UTF-mode with Unicode property support, respectively.
710 when Unicode support is enabled. The output is different in 8-bit, 16-bit, and
711 32-bit modes and for different link sizes, so there are different output files
714 Tests 9 and 10 are run only in 8-bit mode, and tests 11 and 12 are run only in
715 16-bit and 32-bit modes. These are tests that generate different output in
716 8-bit mode. Each pair are for general cases and Unicode support, respectively.
718 Test 13 checks the handling of non-UTF characters greater than 255 by
719 pcre2_dfa_match() in 16-bit and 32-bit modes.
725 among other non-JIT things, the match-limiting features of the interpretive
732 partial modes, match-limiting under JIT, and other JIT-specific features.
734 Tests 18 and 19 are run only in 8-bit mode. They check the POSIX interface to
735 the 8-bit library, without and with Unicode support, respectively.
751 ----------------
762 contains tables for ASCII coding. However, if --enable-rebuild-chartables is
769 then re-building PCRE2. If you do this, you should take care to ensure that the
770 file does not get automatically re-generated. The best way to do this is to
775 --enable-rebuild-chartables, it uses the default C locale that is set on your
780 run the pcre2_dftables program by hand with the -L option. For example:
782 ./pcre2_dftables -L pcre2_chartables.c.special
785 written. The first two 256-byte tables provide lower casing and case flipping
786 functions, respectively. The next table consists of a number of 32-byte bit
788 characters, white space, etc. These are used when building 32-byte bit maps
790 256-byte table has bits indicating various character types, as follows:
798 You can also specify -b (with or without -L) when running pcre2_dftables. This
811 -------------
819 when --enable-rebuild-chartables is specified
822 ASCII coding; unless --enable-rebuild-chartables is
864 src/pcre2_intmodedep.h a mode-specific internal header
895 NON-AUTOTOOLS-BUILD notes on building PCRE2 without using autotools
902 config.sub ) used only when building a shared library
914 install-sh a shell script for installing files
915 libpcre2-8.pc.in template for libpcre2-8.pc for pkg-config
916 libpcre2-16.pc.in template for libpcre2-16.pc for pkg-config
917 libpcre2-32.pc.in template for libpcre2-32.pc for pkg-config
918 libpcre2-posix.pc.in template for libpcre2-posix.pc for pkg-config
924 pcre2-config.in source of script which retains PCRE2 information
932 cmake/COPYING-CMAKE-SCRIPTS
937 config-cmake.h.in
942 ) for use in non-"configure" environments
943 src/config.h.generic ) a version of config.h for use in non-"configure"