xref: /aosp_15_r20/external/pcre/README (revision 22dc650d8ae982c6770746019a6f94af92b0f024)
1*22dc650dSSadaf EbrahimiREADME file for PCRE2 (Perl-compatible regular expression library)
2*22dc650dSSadaf Ebrahimi------------------------------------------------------------------
3*22dc650dSSadaf Ebrahimi
4*22dc650dSSadaf EbrahimiPCRE2 is a re-working of the original PCRE1 library to provide an entirely new
5*22dc650dSSadaf EbrahimiAPI. Since its initial release in 2015, there has been further development of
6*22dc650dSSadaf Ebrahimithe code and it now differs from PCRE1 in more than just the API. There are new
7*22dc650dSSadaf Ebrahimifeatures, and the internals have been improved. The original PCRE1 library is
8*22dc650dSSadaf Ebrahiminow obsolete and no longer maintained. The latest release of PCRE2 is available
9*22dc650dSSadaf Ebrahimiin .tar.gz, tar.bz2, or .zip form from this GitHub repository:
10*22dc650dSSadaf Ebrahimi
11*22dc650dSSadaf Ebrahimihttps://github.com/PCRE2Project/pcre2/releases
12*22dc650dSSadaf Ebrahimi
13*22dc650dSSadaf EbrahimiThere is a mailing list for discussion about the development of PCRE2 at
14*22dc650dSSadaf Ebrahimi[email protected]. You can subscribe by sending an email to
15*22dc650dSSadaf Ebrahimi[email protected].
16*22dc650dSSadaf Ebrahimi
17*22dc650dSSadaf EbrahimiYou can access the archives and also subscribe or manage your subscription
18*22dc650dSSadaf Ebrahimihere:
19*22dc650dSSadaf Ebrahimi
20*22dc650dSSadaf Ebrahimihttps://groups.google.com/g/pcre2-dev
21*22dc650dSSadaf Ebrahimi
22*22dc650dSSadaf EbrahimiPlease read the NEWS file if you are upgrading from a previous release. The
23*22dc650dSSadaf Ebrahimicontents of this README file are:
24*22dc650dSSadaf Ebrahimi
25*22dc650dSSadaf Ebrahimi  The PCRE2 APIs
26*22dc650dSSadaf Ebrahimi  Documentation for PCRE2
27*22dc650dSSadaf Ebrahimi  Building PCRE2 on non-Unix-like systems
28*22dc650dSSadaf Ebrahimi  Building PCRE2 without using autotools
29*22dc650dSSadaf Ebrahimi  Building PCRE2 using autotools
30*22dc650dSSadaf Ebrahimi  Retrieving configuration information
31*22dc650dSSadaf Ebrahimi  Shared libraries
32*22dc650dSSadaf Ebrahimi  Cross-compiling using autotools
33*22dc650dSSadaf Ebrahimi  Making new tarballs
34*22dc650dSSadaf Ebrahimi  Testing PCRE2
35*22dc650dSSadaf Ebrahimi  Character tables
36*22dc650dSSadaf Ebrahimi  File manifest
37*22dc650dSSadaf Ebrahimi
38*22dc650dSSadaf Ebrahimi
39*22dc650dSSadaf EbrahimiThe PCRE2 APIs
40*22dc650dSSadaf Ebrahimi--------------
41*22dc650dSSadaf Ebrahimi
42*22dc650dSSadaf EbrahimiPCRE2 is written in C, and it has its own API. There are three sets of
43*22dc650dSSadaf Ebrahimifunctions, one for the 8-bit library, which processes strings of bytes, one for
44*22dc650dSSadaf Ebrahimithe 16-bit library, which processes strings of 16-bit values, and one for the
45*22dc650dSSadaf Ebrahimi32-bit library, which processes strings of 32-bit values. Unlike PCRE1, there
46*22dc650dSSadaf Ebrahimiare no C++ wrappers.
47*22dc650dSSadaf Ebrahimi
48*22dc650dSSadaf EbrahimiThe distribution does contain a set of C wrapper functions for the 8-bit
49*22dc650dSSadaf Ebrahimilibrary that are based on the POSIX regular expression API (see the pcre2posix
50*22dc650dSSadaf Ebrahimiman page). These are built into a library called libpcre2-posix. Note that this
51*22dc650dSSadaf Ebrahimijust provides a POSIX calling interface to PCRE2; the regular expressions
52*22dc650dSSadaf Ebrahimithemselves still follow Perl syntax and semantics. The POSIX API is restricted,
53*22dc650dSSadaf Ebrahimiand does not give full access to all of PCRE2's facilities.
54*22dc650dSSadaf Ebrahimi
55*22dc650dSSadaf EbrahimiThe header file for the POSIX-style functions is called pcre2posix.h. The
56*22dc650dSSadaf Ebrahimiofficial POSIX name is regex.h, but I did not want to risk possible problems
57*22dc650dSSadaf Ebrahimiwith existing files of that name by distributing it that way. To use PCRE2 with
58*22dc650dSSadaf Ebrahimian existing program that uses the POSIX API, pcre2posix.h will have to be
59*22dc650dSSadaf Ebrahimirenamed or pointed at by a link (or the program modified, of course). See the
60*22dc650dSSadaf Ebrahimipcre2posix documentation for more details.
61*22dc650dSSadaf Ebrahimi
62*22dc650dSSadaf Ebrahimi
63*22dc650dSSadaf EbrahimiDocumentation for PCRE2
64*22dc650dSSadaf Ebrahimi-----------------------
65*22dc650dSSadaf Ebrahimi
66*22dc650dSSadaf EbrahimiIf you install PCRE2 in the normal way on a Unix-like system, you will end up
67*22dc650dSSadaf Ebrahimiwith a set of man pages whose names all start with "pcre2". The one that is
68*22dc650dSSadaf Ebrahimijust called "pcre2" lists all the others. In addition to these man pages, the
69*22dc650dSSadaf EbrahimiPCRE2 documentation is supplied in two other forms:
70*22dc650dSSadaf Ebrahimi
71*22dc650dSSadaf Ebrahimi  1. There are files called doc/pcre2.txt, doc/pcre2grep.txt, and
72*22dc650dSSadaf Ebrahimi     doc/pcre2test.txt in the source distribution. The first of these is a
73*22dc650dSSadaf Ebrahimi     concatenation of the text forms of all the section 3 man pages except the
74*22dc650dSSadaf Ebrahimi     listing of pcre2demo.c and those that summarize individual functions. The
75*22dc650dSSadaf Ebrahimi     other two are the text forms of the section 1 man pages for the pcre2grep
76*22dc650dSSadaf Ebrahimi     and pcre2test commands. These text forms are provided for ease of scanning
77*22dc650dSSadaf Ebrahimi     with text editors or similar tools. They are installed in
78*22dc650dSSadaf Ebrahimi     <prefix>/share/doc/pcre2, where <prefix> is the installation prefix
79*22dc650dSSadaf Ebrahimi     (defaulting to /usr/local).
80*22dc650dSSadaf Ebrahimi
81*22dc650dSSadaf Ebrahimi  2. A set of files containing all the documentation in HTML form, hyperlinked
82*22dc650dSSadaf Ebrahimi     in various ways, and rooted in a file called index.html, is distributed in
83*22dc650dSSadaf Ebrahimi     doc/html and installed in <prefix>/share/doc/pcre2/html.
84*22dc650dSSadaf Ebrahimi
85*22dc650dSSadaf Ebrahimi
86*22dc650dSSadaf EbrahimiBuilding PCRE2 on non-Unix-like systems
87*22dc650dSSadaf Ebrahimi---------------------------------------
88*22dc650dSSadaf Ebrahimi
89*22dc650dSSadaf EbrahimiFor a non-Unix-like system, please read the file NON-AUTOTOOLS-BUILD, though if
90*22dc650dSSadaf Ebrahimiyour system supports the use of "configure" and "make" you may be able to build
91*22dc650dSSadaf EbrahimiPCRE2 using autotools in the same way as for many Unix-like systems.
92*22dc650dSSadaf Ebrahimi
93*22dc650dSSadaf EbrahimiPCRE2 can also be configured using CMake, which can be run in various ways
94*22dc650dSSadaf Ebrahimi(command line, GUI, etc). This creates Makefiles, solution files, etc. The file
95*22dc650dSSadaf EbrahimiNON-AUTOTOOLS-BUILD has information about CMake.
96*22dc650dSSadaf Ebrahimi
97*22dc650dSSadaf EbrahimiPCRE2 has been compiled on many different operating systems. It should be
98*22dc650dSSadaf Ebrahimistraightforward to build PCRE2 on any system that has a Standard C compiler and
99*22dc650dSSadaf Ebrahimilibrary, because it uses only Standard C functions.
100*22dc650dSSadaf Ebrahimi
101*22dc650dSSadaf Ebrahimi
102*22dc650dSSadaf EbrahimiBuilding PCRE2 without using autotools
103*22dc650dSSadaf Ebrahimi--------------------------------------
104*22dc650dSSadaf Ebrahimi
105*22dc650dSSadaf EbrahimiThe use of autotools (in particular, libtool) is problematic in some
106*22dc650dSSadaf Ebrahimienvironments, even some that are Unix or Unix-like. See the NON-AUTOTOOLS-BUILD
107*22dc650dSSadaf Ebrahimifile for ways of building PCRE2 without using autotools.
108*22dc650dSSadaf Ebrahimi
109*22dc650dSSadaf Ebrahimi
110*22dc650dSSadaf EbrahimiBuilding PCRE2 using autotools
111*22dc650dSSadaf Ebrahimi------------------------------
112*22dc650dSSadaf Ebrahimi
113*22dc650dSSadaf EbrahimiThe following instructions assume the use of the widely used "configure; make;
114*22dc650dSSadaf Ebrahimimake install" (autotools) process.
115*22dc650dSSadaf Ebrahimi
116*22dc650dSSadaf EbrahimiIf you have downloaded and unpacked a PCRE2 release tarball, run the
117*22dc650dSSadaf Ebrahimi"configure" command from the PCRE2 directory, with your current directory set
118*22dc650dSSadaf Ebrahimito the directory where you want the files to be created. This command is a
119*22dc650dSSadaf Ebrahimistandard GNU "autoconf" configuration script, for which generic instructions
120*22dc650dSSadaf Ebrahimiare supplied in the file INSTALL.
121*22dc650dSSadaf Ebrahimi
122*22dc650dSSadaf EbrahimiThe files in the GitHub repository do not contain "configure". If you have
123*22dc650dSSadaf Ebrahimidownloaded the PCRE2 source files from GitHub, before you can run "configure"
124*22dc650dSSadaf Ebrahimiyou must run the shell script called autogen.sh. This runs a number of
125*22dc650dSSadaf Ebrahimiautotools to create a "configure" script (you must of course have the autotools
126*22dc650dSSadaf Ebrahimicommands installed in order to do this).
127*22dc650dSSadaf Ebrahimi
128*22dc650dSSadaf EbrahimiMost commonly, people build PCRE2 within its own distribution directory, and in
129*22dc650dSSadaf Ebrahimithis case, on many systems, just running "./configure" is sufficient. However,
130*22dc650dSSadaf Ebrahimithe usual methods of changing standard defaults are available. For example:
131*22dc650dSSadaf Ebrahimi
132*22dc650dSSadaf EbrahimiCFLAGS='-O2 -Wall' ./configure --prefix=/opt/local
133*22dc650dSSadaf Ebrahimi
134*22dc650dSSadaf EbrahimiThis command specifies that the C compiler should be run with the flags '-O2
135*22dc650dSSadaf Ebrahimi-Wall' instead of the default, and that "make install" should install PCRE2
136*22dc650dSSadaf Ebrahimiunder /opt/local instead of the default /usr/local.
137*22dc650dSSadaf Ebrahimi
138*22dc650dSSadaf EbrahimiIf you want to build in a different directory, just run "configure" with that
139*22dc650dSSadaf Ebrahimidirectory as current. For example, suppose you have unpacked the PCRE2 source
140*22dc650dSSadaf Ebrahimiinto /source/pcre2/pcre2-xxx, but you want to build it in
141*22dc650dSSadaf Ebrahimi/build/pcre2/pcre2-xxx:
142*22dc650dSSadaf Ebrahimi
143*22dc650dSSadaf Ebrahimicd /build/pcre2/pcre2-xxx
144*22dc650dSSadaf Ebrahimi/source/pcre2/pcre2-xxx/configure
145*22dc650dSSadaf Ebrahimi
146*22dc650dSSadaf EbrahimiPCRE2 is written in C and is normally compiled as a C library. However, it is
147*22dc650dSSadaf Ebrahimipossible to build it as a C++ library, though the provided building apparatus
148*22dc650dSSadaf Ebrahimidoes not have any features to support this.
149*22dc650dSSadaf Ebrahimi
150*22dc650dSSadaf EbrahimiThere are some optional features that can be included or omitted from the PCRE2
151*22dc650dSSadaf Ebrahimilibrary. They are also documented in the pcre2build man page.
152*22dc650dSSadaf Ebrahimi
153*22dc650dSSadaf Ebrahimi. By default, both shared and static libraries are built. You can change this
154*22dc650dSSadaf Ebrahimi  by adding one of these options to the "configure" command:
155*22dc650dSSadaf Ebrahimi
156*22dc650dSSadaf Ebrahimi  --disable-shared
157*22dc650dSSadaf Ebrahimi  --disable-static
158*22dc650dSSadaf Ebrahimi
159*22dc650dSSadaf Ebrahimi  Setting --disable-shared ensures that PCRE2 libraries are built as static
160*22dc650dSSadaf Ebrahimi  libraries. The binaries that are then created as part of the build process
161*22dc650dSSadaf Ebrahimi  (for example, pcre2test and pcre2grep) are linked statically with one or more
162*22dc650dSSadaf Ebrahimi  PCRE2 libraries, but may also be dynamically linked with other libraries such
163*22dc650dSSadaf Ebrahimi  as libc. If you want these binaries to be fully statically linked, you can
164*22dc650dSSadaf Ebrahimi  set LDFLAGS like this:
165*22dc650dSSadaf Ebrahimi
166*22dc650dSSadaf Ebrahimi  LDFLAGS=--static ./configure --disable-shared
167*22dc650dSSadaf Ebrahimi
168*22dc650dSSadaf Ebrahimi  Note the two hyphens in --static. Of course, this works only if static
169*22dc650dSSadaf Ebrahimi  versions of all the relevant libraries are available for linking. See also
170*22dc650dSSadaf Ebrahimi  "Shared libraries" below.
171*22dc650dSSadaf Ebrahimi
172*22dc650dSSadaf Ebrahimi. By default, only the 8-bit library is built. If you add --enable-pcre2-16 to
173*22dc650dSSadaf Ebrahimi  the "configure" command, the 16-bit library is also built. If you add
174*22dc650dSSadaf Ebrahimi  --enable-pcre2-32 to the "configure" command, the 32-bit library is also
175*22dc650dSSadaf Ebrahimi  built. If you want only the 16-bit or 32-bit library, use --disable-pcre2-8
176*22dc650dSSadaf Ebrahimi  to disable building the 8-bit library.
177*22dc650dSSadaf Ebrahimi
178*22dc650dSSadaf Ebrahimi. If you want to include support for just-in-time (JIT) compiling, which can
179*22dc650dSSadaf Ebrahimi  give large performance improvements on certain platforms, add --enable-jit to
180*22dc650dSSadaf Ebrahimi  the "configure" command. This support is available only for certain hardware
181*22dc650dSSadaf Ebrahimi  architectures. If you try to enable it on an unsupported architecture, there
182*22dc650dSSadaf Ebrahimi  will be a compile time error. If in doubt, use --enable-jit=auto, which
183*22dc650dSSadaf Ebrahimi  enables JIT only if the current hardware is supported.
184*22dc650dSSadaf Ebrahimi
185*22dc650dSSadaf Ebrahimi. If you are enabling JIT under SELinux environment you may also want to add
186*22dc650dSSadaf Ebrahimi  --enable-jit-sealloc, which enables the use of an executable memory allocator
187*22dc650dSSadaf Ebrahimi  that is compatible with SELinux. Warning: this allocator is experimental!
188*22dc650dSSadaf Ebrahimi  It does not support fork() operation and may crash when no disk space is
189*22dc650dSSadaf Ebrahimi  available. This option has no effect if JIT is disabled.
190*22dc650dSSadaf Ebrahimi
191*22dc650dSSadaf Ebrahimi. If you do not want to make use of the default support for UTF-8 Unicode
192*22dc650dSSadaf Ebrahimi  character strings in the 8-bit library, UTF-16 Unicode character strings in
193*22dc650dSSadaf Ebrahimi  the 16-bit library, or UTF-32 Unicode character strings in the 32-bit
194*22dc650dSSadaf Ebrahimi  library, you can add --disable-unicode to the "configure" command. This
195*22dc650dSSadaf Ebrahimi  reduces the size of the libraries. It is not possible to configure one
196*22dc650dSSadaf Ebrahimi  library with Unicode support, and another without, in the same configuration.
197*22dc650dSSadaf Ebrahimi  It is also not possible to use --enable-ebcdic (see below) with Unicode
198*22dc650dSSadaf Ebrahimi  support, so if this option is set, you must also use --disable-unicode.
199*22dc650dSSadaf Ebrahimi
200*22dc650dSSadaf Ebrahimi  When Unicode support is available, the use of a UTF encoding still has to be
201*22dc650dSSadaf Ebrahimi  enabled by setting the PCRE2_UTF option at run time or starting a pattern
202*22dc650dSSadaf Ebrahimi  with (*UTF). When PCRE2 is compiled with Unicode support, its input can only
203*22dc650dSSadaf Ebrahimi  either be ASCII or UTF-8/16/32, even when running on EBCDIC platforms.
204*22dc650dSSadaf Ebrahimi
205*22dc650dSSadaf Ebrahimi  As well as supporting UTF strings, Unicode support includes support for the
206*22dc650dSSadaf Ebrahimi  \P, \p, and \X sequences that recognize Unicode character properties.
207*22dc650dSSadaf Ebrahimi  However, only a subset of Unicode properties are supported; see the
208*22dc650dSSadaf Ebrahimi  pcre2pattern man page for details. Escape sequences such as \d and \w in
209*22dc650dSSadaf Ebrahimi  patterns do not by default make use of Unicode properties, but can be made to
210*22dc650dSSadaf Ebrahimi  do so by setting the PCRE2_UCP option or starting a pattern with (*UCP).
211*22dc650dSSadaf Ebrahimi
212*22dc650dSSadaf Ebrahimi. You can build PCRE2 to recognize either CR or LF or the sequence CRLF, or any
213*22dc650dSSadaf Ebrahimi  of the preceding, or any of the Unicode newline sequences, or the NUL (zero)
214*22dc650dSSadaf Ebrahimi  character as indicating the end of a line. Whatever you specify at build time
215*22dc650dSSadaf Ebrahimi  is the default; the caller of PCRE2 can change the selection at run time. The
216*22dc650dSSadaf Ebrahimi  default newline indicator is a single LF character (the Unix standard). You
217*22dc650dSSadaf Ebrahimi  can specify the default newline indicator by adding --enable-newline-is-cr,
218*22dc650dSSadaf Ebrahimi  --enable-newline-is-lf, --enable-newline-is-crlf,
219*22dc650dSSadaf Ebrahimi  --enable-newline-is-anycrlf, --enable-newline-is-any, or
220*22dc650dSSadaf Ebrahimi  --enable-newline-is-nul to the "configure" command, respectively.
221*22dc650dSSadaf Ebrahimi
222*22dc650dSSadaf Ebrahimi. By default, the sequence \R in a pattern matches any Unicode line ending
223*22dc650dSSadaf Ebrahimi  sequence. This is independent of the option specifying what PCRE2 considers
224*22dc650dSSadaf Ebrahimi  to be the end of a line (see above). However, the caller of PCRE2 can
225*22dc650dSSadaf Ebrahimi  restrict \R to match only CR, LF, or CRLF. You can make this the default by
226*22dc650dSSadaf Ebrahimi  adding --enable-bsr-anycrlf to the "configure" command (bsr = "backslash R").
227*22dc650dSSadaf Ebrahimi
228*22dc650dSSadaf Ebrahimi. In a pattern, the escape sequence \C matches a single code unit, even in a
229*22dc650dSSadaf Ebrahimi  UTF mode. This can be dangerous because it breaks up multi-code-unit
230*22dc650dSSadaf Ebrahimi  characters. You can build PCRE2 with the use of \C permanently locked out by
231*22dc650dSSadaf Ebrahimi  adding --enable-never-backslash-C (note the upper case C) to the "configure"
232*22dc650dSSadaf Ebrahimi  command. When \C is allowed by the library, individual applications can lock
233*22dc650dSSadaf Ebrahimi  it out by calling pcre2_compile() with the PCRE2_NEVER_BACKSLASH_C option.
234*22dc650dSSadaf Ebrahimi
235*22dc650dSSadaf Ebrahimi. PCRE2 has a counter that limits the depth of nesting of parentheses in a
236*22dc650dSSadaf Ebrahimi  pattern. This limits the amount of system stack that a pattern uses when it
237*22dc650dSSadaf Ebrahimi  is compiled. The default is 250, but you can change it by setting, for
238*22dc650dSSadaf Ebrahimi  example,
239*22dc650dSSadaf Ebrahimi
240*22dc650dSSadaf Ebrahimi  --with-parens-nest-limit=500
241*22dc650dSSadaf Ebrahimi
242*22dc650dSSadaf Ebrahimi. PCRE2 has a counter that can be set to limit the amount of computing resource
243*22dc650dSSadaf Ebrahimi  it uses when matching a pattern. If the limit is exceeded during a match, the
244*22dc650dSSadaf Ebrahimi  match fails. The default is ten million. You can change the default by
245*22dc650dSSadaf Ebrahimi  setting, for example,
246*22dc650dSSadaf Ebrahimi
247*22dc650dSSadaf Ebrahimi  --with-match-limit=500000
248*22dc650dSSadaf Ebrahimi
249*22dc650dSSadaf Ebrahimi  on the "configure" command. This is just the default; individual calls to
250*22dc650dSSadaf Ebrahimi  pcre2_match() or pcre2_dfa_match() can supply their own value. There is more
251*22dc650dSSadaf Ebrahimi  discussion in the pcre2api man page (search for pcre2_set_match_limit).
252*22dc650dSSadaf Ebrahimi
253*22dc650dSSadaf Ebrahimi. There is a separate counter that limits the depth of nested backtracking
254*22dc650dSSadaf Ebrahimi  (pcre2_match()) or nested function calls (pcre2_dfa_match()) during a
255*22dc650dSSadaf Ebrahimi  matching process, which indirectly limits the amount of heap memory that is
256*22dc650dSSadaf Ebrahimi  used, and in the case of pcre2_dfa_match() the amount of stack as well. This
257*22dc650dSSadaf Ebrahimi  counter also has a default of ten million, which is essentially "unlimited".
258*22dc650dSSadaf Ebrahimi  You can change the default by setting, for example,
259*22dc650dSSadaf Ebrahimi
260*22dc650dSSadaf Ebrahimi  --with-match-limit-depth=5000
261*22dc650dSSadaf Ebrahimi
262*22dc650dSSadaf Ebrahimi  There is more discussion in the pcre2api man page (search for
263*22dc650dSSadaf Ebrahimi  pcre2_set_depth_limit).
264*22dc650dSSadaf Ebrahimi
265*22dc650dSSadaf Ebrahimi. You can also set an explicit limit on the amount of heap memory used by
266*22dc650dSSadaf Ebrahimi  the pcre2_match() and pcre2_dfa_match() interpreters:
267*22dc650dSSadaf Ebrahimi
268*22dc650dSSadaf Ebrahimi  --with-heap-limit=500
269*22dc650dSSadaf Ebrahimi
270*22dc650dSSadaf Ebrahimi  The units are kibibytes (units of 1024 bytes). This limit does not apply when
271*22dc650dSSadaf Ebrahimi  the JIT optimization (which has its own memory control features) is used.
272*22dc650dSSadaf Ebrahimi  There is more discussion on the pcre2api man page (search for
273*22dc650dSSadaf Ebrahimi  pcre2_set_heap_limit).
274*22dc650dSSadaf Ebrahimi
275*22dc650dSSadaf Ebrahimi. In the 8-bit library, the default maximum compiled pattern size is around
276*22dc650dSSadaf Ebrahimi  64 kibibytes. You can increase this by adding --with-link-size=3 to the
277*22dc650dSSadaf Ebrahimi  "configure" command. PCRE2 then uses three bytes instead of two for offsets
278*22dc650dSSadaf Ebrahimi  to different parts of the compiled pattern. In the 16-bit library,
279*22dc650dSSadaf Ebrahimi  --with-link-size=3 is the same as --with-link-size=4, which (in both
280*22dc650dSSadaf Ebrahimi  libraries) uses four-byte offsets. Increasing the internal link size reduces
281*22dc650dSSadaf Ebrahimi  performance in the 8-bit and 16-bit libraries. In the 32-bit library, the
282*22dc650dSSadaf Ebrahimi  link size setting is ignored, as 4-byte offsets are always used.
283*22dc650dSSadaf Ebrahimi
284*22dc650dSSadaf Ebrahimi. Lookbehind assertions in which one or more branches can match a variable
285*22dc650dSSadaf Ebrahimi  number of characters are supported only if there is a maximum matching length
286*22dc650dSSadaf Ebrahimi  for each top-level branch. There is a limit to this maximum that defaults to
287*22dc650dSSadaf Ebrahimi  255 characters. You can alter this default by a setting such as
288*22dc650dSSadaf Ebrahimi
289*22dc650dSSadaf Ebrahimi  --with-max-varlookbehind=100
290*22dc650dSSadaf Ebrahimi
291*22dc650dSSadaf Ebrahimi  The limit can be changed at runtime by calling pcre2_set_max_varlookbehind().
292*22dc650dSSadaf Ebrahimi  Lookbehind assertions in which every branch matches a fixed number of
293*22dc650dSSadaf Ebrahimi  characters (not necessarily all the same) are not constrained by this limit.
294*22dc650dSSadaf Ebrahimi
295*22dc650dSSadaf Ebrahimi. For speed, PCRE2 uses four tables for manipulating and identifying characters
296*22dc650dSSadaf Ebrahimi  whose code point values are less than 256. By default, it uses a set of
297*22dc650dSSadaf Ebrahimi  tables for ASCII encoding that is part of the distribution. If you specify
298*22dc650dSSadaf Ebrahimi
299*22dc650dSSadaf Ebrahimi  --enable-rebuild-chartables
300*22dc650dSSadaf Ebrahimi
301*22dc650dSSadaf Ebrahimi  a program called pcre2_dftables is compiled and run in the default C locale
302*22dc650dSSadaf Ebrahimi  when you obey "make". It builds a source file called pcre2_chartables.c. If
303*22dc650dSSadaf Ebrahimi  you do not specify this option, pcre2_chartables.c is created as a copy of
304*22dc650dSSadaf Ebrahimi  pcre2_chartables.c.dist. See "Character tables" below for further
305*22dc650dSSadaf Ebrahimi  information.
306*22dc650dSSadaf Ebrahimi
307*22dc650dSSadaf Ebrahimi. It is possible to compile PCRE2 for use on systems that use EBCDIC as their
308*22dc650dSSadaf Ebrahimi  character code (as opposed to ASCII/Unicode) by specifying
309*22dc650dSSadaf Ebrahimi
310*22dc650dSSadaf Ebrahimi  --enable-ebcdic --disable-unicode
311*22dc650dSSadaf Ebrahimi
312*22dc650dSSadaf Ebrahimi  This automatically implies --enable-rebuild-chartables (see above). However,
313*22dc650dSSadaf Ebrahimi  when PCRE2 is built this way, it always operates in EBCDIC. It cannot support
314*22dc650dSSadaf Ebrahimi  both EBCDIC and UTF-8/16/32. There is a second option, --enable-ebcdic-nl25,
315*22dc650dSSadaf Ebrahimi  which specifies that the code value for the EBCDIC NL character is 0x25
316*22dc650dSSadaf Ebrahimi  instead of the default 0x15.
317*22dc650dSSadaf Ebrahimi
318*22dc650dSSadaf Ebrahimi. If you specify --enable-debug, additional debugging code is included in the
319*22dc650dSSadaf Ebrahimi  build. This option is intended for use by the PCRE2 maintainers.
320*22dc650dSSadaf Ebrahimi
321*22dc650dSSadaf Ebrahimi. In environments where valgrind is installed, if you specify
322*22dc650dSSadaf Ebrahimi
323*22dc650dSSadaf Ebrahimi  --enable-valgrind
324*22dc650dSSadaf Ebrahimi
325*22dc650dSSadaf Ebrahimi  PCRE2 will use valgrind annotations to mark certain memory regions as
326*22dc650dSSadaf Ebrahimi  unaddressable. This allows it to detect invalid memory accesses, and is
327*22dc650dSSadaf Ebrahimi  mostly useful for debugging PCRE2 itself.
328*22dc650dSSadaf Ebrahimi
329*22dc650dSSadaf Ebrahimi. In environments where the gcc compiler is used and lcov is installed, if you
330*22dc650dSSadaf Ebrahimi  specify
331*22dc650dSSadaf Ebrahimi
332*22dc650dSSadaf Ebrahimi  --enable-coverage
333*22dc650dSSadaf Ebrahimi
334*22dc650dSSadaf Ebrahimi  the build process implements a code coverage report for the test suite. The
335*22dc650dSSadaf Ebrahimi  report is generated by running "make coverage". If ccache is installed on
336*22dc650dSSadaf Ebrahimi  your system, it must be disabled when building PCRE2 for coverage reporting.
337*22dc650dSSadaf Ebrahimi  You can do this by setting the environment variable CCACHE_DISABLE=1 before
338*22dc650dSSadaf Ebrahimi  running "make" to build PCRE2. There is more information about coverage
339*22dc650dSSadaf Ebrahimi  reporting in the "pcre2build" documentation.
340*22dc650dSSadaf Ebrahimi
341*22dc650dSSadaf Ebrahimi. When JIT support is enabled, pcre2grep automatically makes use of it, unless
342*22dc650dSSadaf Ebrahimi  you add --disable-pcre2grep-jit to the "configure" command.
343*22dc650dSSadaf Ebrahimi
344*22dc650dSSadaf Ebrahimi. There is support for calling external programs during matching in the
345*22dc650dSSadaf Ebrahimi  pcre2grep command, using PCRE2's callout facility with string arguments. This
346*22dc650dSSadaf Ebrahimi  support can be disabled by adding --disable-pcre2grep-callout to the
347*22dc650dSSadaf Ebrahimi  "configure" command. There are two kinds of callout: one that generates
348*22dc650dSSadaf Ebrahimi  output from inbuilt code, and another that calls an external program. The
349*22dc650dSSadaf Ebrahimi  latter has special support for Windows and VMS; otherwise it assumes the
350*22dc650dSSadaf Ebrahimi  existence of the fork() function. This facility can be disabled by adding
351*22dc650dSSadaf Ebrahimi  --disable-pcre2grep-callout-fork to the "configure" command.
352*22dc650dSSadaf Ebrahimi
353*22dc650dSSadaf Ebrahimi. The pcre2grep program currently supports only 8-bit data files, and so
354*22dc650dSSadaf Ebrahimi  requires the 8-bit PCRE2 library. It is possible to compile pcre2grep to use
355*22dc650dSSadaf Ebrahimi  libz and/or libbz2, in order to read .gz and .bz2 files (respectively), by
356*22dc650dSSadaf Ebrahimi  specifying one or both of
357*22dc650dSSadaf Ebrahimi
358*22dc650dSSadaf Ebrahimi  --enable-pcre2grep-libz
359*22dc650dSSadaf Ebrahimi  --enable-pcre2grep-libbz2
360*22dc650dSSadaf Ebrahimi
361*22dc650dSSadaf Ebrahimi  Of course, the relevant libraries must be installed on your system.
362*22dc650dSSadaf Ebrahimi
363*22dc650dSSadaf Ebrahimi. The default starting size (in bytes) of the internal buffer used by pcre2grep
364*22dc650dSSadaf Ebrahimi  can be set by, for example:
365*22dc650dSSadaf Ebrahimi
366*22dc650dSSadaf Ebrahimi  --with-pcre2grep-bufsize=51200
367*22dc650dSSadaf Ebrahimi
368*22dc650dSSadaf Ebrahimi  The value must be a plain integer. The default is 20480. The amount of memory
369*22dc650dSSadaf Ebrahimi  used by pcre2grep is actually three times this number, to allow for "before"
370*22dc650dSSadaf Ebrahimi  and "after" lines. If very long lines are encountered, the buffer is
371*22dc650dSSadaf Ebrahimi  automatically enlarged, up to a fixed maximum size.
372*22dc650dSSadaf Ebrahimi
373*22dc650dSSadaf Ebrahimi. The default maximum size of pcre2grep's internal buffer can be set by, for
374*22dc650dSSadaf Ebrahimi  example:
375*22dc650dSSadaf Ebrahimi
376*22dc650dSSadaf Ebrahimi  --with-pcre2grep-max-bufsize=2097152
377*22dc650dSSadaf Ebrahimi
378*22dc650dSSadaf Ebrahimi  The default is either 1048576 or the value of --with-pcre2grep-bufsize,
379*22dc650dSSadaf Ebrahimi  whichever is the larger.
380*22dc650dSSadaf Ebrahimi
381*22dc650dSSadaf Ebrahimi. It is possible to compile pcre2test so that it links with the libreadline
382*22dc650dSSadaf Ebrahimi  or libedit libraries, by specifying, respectively,
383*22dc650dSSadaf Ebrahimi
384*22dc650dSSadaf Ebrahimi  --enable-pcre2test-libreadline or --enable-pcre2test-libedit
385*22dc650dSSadaf Ebrahimi
386*22dc650dSSadaf Ebrahimi  If this is done, when pcre2test's input is from a terminal, it reads it using
387*22dc650dSSadaf Ebrahimi  the readline() function. This provides line-editing and history facilities.
388*22dc650dSSadaf Ebrahimi  Note that libreadline is GPL-licenced, so if you distribute a binary of
389*22dc650dSSadaf Ebrahimi  pcre2test linked in this way, there may be licensing issues. These can be
390*22dc650dSSadaf Ebrahimi  avoided by linking with libedit (which has a BSD licence) instead.
391*22dc650dSSadaf Ebrahimi
392*22dc650dSSadaf Ebrahimi  Enabling libreadline causes the -lreadline option to be added to the
393*22dc650dSSadaf Ebrahimi  pcre2test build. In many operating environments with a system-installed
394*22dc650dSSadaf Ebrahimi  readline library this is sufficient. However, in some environments (e.g. if
395*22dc650dSSadaf Ebrahimi  an unmodified distribution version of readline is in use), it may be
396*22dc650dSSadaf Ebrahimi  necessary to specify something like LIBS="-lncurses" as well. This is
397*22dc650dSSadaf Ebrahimi  because, to quote the readline INSTALL, "Readline uses the termcap functions,
398*22dc650dSSadaf Ebrahimi  but does not link with the termcap or curses library itself, allowing
399*22dc650dSSadaf Ebrahimi  applications which link with readline the option to choose an appropriate
400*22dc650dSSadaf Ebrahimi  library." If you get error messages about missing functions tgetstr, tgetent,
401*22dc650dSSadaf Ebrahimi  tputs, tgetflag, or tgoto, this is the problem, and linking with the ncurses
402*22dc650dSSadaf Ebrahimi  library should fix it.
403*22dc650dSSadaf Ebrahimi
404*22dc650dSSadaf Ebrahimi. The C99 standard defines formatting modifiers z and t for size_t and
405*22dc650dSSadaf Ebrahimi  ptrdiff_t values, respectively. By default, PCRE2 uses these modifiers in
406*22dc650dSSadaf Ebrahimi  environments other than Microsoft Visual Studio versions earlier than 2013
407*22dc650dSSadaf Ebrahimi  when __STDC_VERSION__ is defined and has a value greater than or equal to
408*22dc650dSSadaf Ebrahimi  199901L (indicating C99). However, there is at least one environment that
409*22dc650dSSadaf Ebrahimi  claims to be C99 but does not support these modifiers. If
410*22dc650dSSadaf Ebrahimi  --disable-percent-zt is specified, no use is made of the z or t modifiers.
411*22dc650dSSadaf Ebrahimi  Instead of %td or %zu, %lu is used, with a cast for size_t values.
412*22dc650dSSadaf Ebrahimi
413*22dc650dSSadaf Ebrahimi. There is a special option called --enable-fuzz-support for use by people who
414*22dc650dSSadaf Ebrahimi  want to run fuzzing tests on PCRE2. At present this applies only to the 8-bit
415*22dc650dSSadaf Ebrahimi  library. If set, it causes an extra library called libpcre2-fuzzsupport.a to
416*22dc650dSSadaf Ebrahimi  be built, but not installed. This contains a single function called
417*22dc650dSSadaf Ebrahimi  LLVMFuzzerTestOneInput() whose arguments are a pointer to a string and the
418*22dc650dSSadaf Ebrahimi  length of the string. When called, this function tries to compile the string
419*22dc650dSSadaf Ebrahimi  as a pattern, and if that succeeds, to match it. This is done both with no
420*22dc650dSSadaf Ebrahimi  options and with some random options bits that are generated from the string.
421*22dc650dSSadaf Ebrahimi  Setting --enable-fuzz-support also causes a binary called pcre2fuzzcheck to
422*22dc650dSSadaf Ebrahimi  be created. This is normally run under valgrind or used when PCRE2 is
423*22dc650dSSadaf Ebrahimi  compiled with address sanitizing enabled. It calls the fuzzing function and
424*22dc650dSSadaf Ebrahimi  outputs information about what it is doing. The input strings are specified
425*22dc650dSSadaf Ebrahimi  by arguments: if an argument starts with "=" the rest of it is a literal
426*22dc650dSSadaf Ebrahimi  input string. Otherwise, it is assumed to be a file name, and the contents
427*22dc650dSSadaf Ebrahimi  of the file are the test string.
428*22dc650dSSadaf Ebrahimi
429*22dc650dSSadaf Ebrahimi. Releases before 10.30 could be compiled with --disable-stack-for-recursion,
430*22dc650dSSadaf Ebrahimi  which caused pcre2_match() to use individual blocks on the heap for
431*22dc650dSSadaf Ebrahimi  backtracking instead of recursive function calls (which use the stack). This
432*22dc650dSSadaf Ebrahimi  is now obsolete because pcre2_match() was refactored always to use the heap
433*22dc650dSSadaf Ebrahimi  (in a much more efficient way than before). This option is retained for
434*22dc650dSSadaf Ebrahimi  backwards compatibility, but has no effect other than to output a warning.
435*22dc650dSSadaf Ebrahimi
436*22dc650dSSadaf EbrahimiThe "configure" script builds the following files for the basic C library:
437*22dc650dSSadaf Ebrahimi
438*22dc650dSSadaf Ebrahimi. Makefile             the makefile that builds the library
439*22dc650dSSadaf Ebrahimi. src/config.h         build-time configuration options for the library
440*22dc650dSSadaf Ebrahimi. src/pcre2.h          the public PCRE2 header file
441*22dc650dSSadaf Ebrahimi. pcre2-config         script that shows the building settings such as CFLAGS
442*22dc650dSSadaf Ebrahimi                         that were set for "configure"
443*22dc650dSSadaf Ebrahimi. libpcre2-8.pc        )
444*22dc650dSSadaf Ebrahimi. libpcre2-16.pc       ) data for the pkg-config command
445*22dc650dSSadaf Ebrahimi. libpcre2-32.pc       )
446*22dc650dSSadaf Ebrahimi. libpcre2-posix.pc    )
447*22dc650dSSadaf Ebrahimi. libtool              script that builds shared and/or static libraries
448*22dc650dSSadaf Ebrahimi
449*22dc650dSSadaf EbrahimiVersions of config.h and pcre2.h are distributed in the src directory of PCRE2
450*22dc650dSSadaf Ebrahimitarballs under the names config.h.generic and pcre2.h.generic. These are
451*22dc650dSSadaf Ebrahimiprovided for those who have to build PCRE2 without using "configure" or CMake.
452*22dc650dSSadaf EbrahimiIf you use "configure" or CMake, the .generic versions are not used.
453*22dc650dSSadaf Ebrahimi
454*22dc650dSSadaf EbrahimiThe "configure" script also creates config.status, which is an executable
455*22dc650dSSadaf Ebrahimiscript that can be run to recreate the configuration, and config.log, which
456*22dc650dSSadaf Ebrahimicontains compiler output from tests that "configure" runs.
457*22dc650dSSadaf Ebrahimi
458*22dc650dSSadaf EbrahimiOnce "configure" has run, you can run "make". This builds whichever of the
459*22dc650dSSadaf Ebrahimilibraries libpcre2-8, libpcre2-16 and libpcre2-32 are configured, and a test
460*22dc650dSSadaf Ebrahimiprogram called pcre2test. If you enabled JIT support with --enable-jit, another
461*22dc650dSSadaf Ebrahimitest program called pcre2_jit_test is built as well. If the 8-bit library is
462*22dc650dSSadaf Ebrahimibuilt, libpcre2-posix, pcre2posix_test, and the pcre2grep command are also
463*22dc650dSSadaf Ebrahimibuilt. Running "make" with the -j option may speed up compilation on
464*22dc650dSSadaf Ebrahimimultiprocessor systems.
465*22dc650dSSadaf Ebrahimi
466*22dc650dSSadaf EbrahimiThe command "make check" runs all the appropriate tests. Details of the PCRE2
467*22dc650dSSadaf Ebrahimitests are given below in a separate section of this document. The -j option of
468*22dc650dSSadaf Ebrahimi"make" can also be used when running the tests.
469*22dc650dSSadaf Ebrahimi
470*22dc650dSSadaf EbrahimiYou can use "make install" to install PCRE2 into live directories on your
471*22dc650dSSadaf Ebrahimisystem. The following are installed (file names are all relative to the
472*22dc650dSSadaf Ebrahimi<prefix> that is set when "configure" is run):
473*22dc650dSSadaf Ebrahimi
474*22dc650dSSadaf Ebrahimi  Commands (bin):
475*22dc650dSSadaf Ebrahimi    pcre2test
476*22dc650dSSadaf Ebrahimi    pcre2grep (if 8-bit support is enabled)
477*22dc650dSSadaf Ebrahimi    pcre2-config
478*22dc650dSSadaf Ebrahimi
479*22dc650dSSadaf Ebrahimi  Libraries (lib):
480*22dc650dSSadaf Ebrahimi    libpcre2-8      (if 8-bit support is enabled)
481*22dc650dSSadaf Ebrahimi    libpcre2-16     (if 16-bit support is enabled)
482*22dc650dSSadaf Ebrahimi    libpcre2-32     (if 32-bit support is enabled)
483*22dc650dSSadaf Ebrahimi    libpcre2-posix  (if 8-bit support is enabled)
484*22dc650dSSadaf Ebrahimi
485*22dc650dSSadaf Ebrahimi  Configuration information (lib/pkgconfig):
486*22dc650dSSadaf Ebrahimi    libpcre2-8.pc
487*22dc650dSSadaf Ebrahimi    libpcre2-16.pc
488*22dc650dSSadaf Ebrahimi    libpcre2-32.pc
489*22dc650dSSadaf Ebrahimi    libpcre2-posix.pc
490*22dc650dSSadaf Ebrahimi
491*22dc650dSSadaf Ebrahimi  Header files (include):
492*22dc650dSSadaf Ebrahimi    pcre2.h
493*22dc650dSSadaf Ebrahimi    pcre2posix.h
494*22dc650dSSadaf Ebrahimi
495*22dc650dSSadaf Ebrahimi  Man pages (share/man/man{1,3}):
496*22dc650dSSadaf Ebrahimi    pcre2grep.1
497*22dc650dSSadaf Ebrahimi    pcre2test.1
498*22dc650dSSadaf Ebrahimi    pcre2-config.1
499*22dc650dSSadaf Ebrahimi    pcre2.3
500*22dc650dSSadaf Ebrahimi    pcre2*.3 (lots more pages, all starting "pcre2")
501*22dc650dSSadaf Ebrahimi
502*22dc650dSSadaf Ebrahimi  HTML documentation (share/doc/pcre2/html):
503*22dc650dSSadaf Ebrahimi    index.html
504*22dc650dSSadaf Ebrahimi    *.html (lots more pages, hyperlinked from index.html)
505*22dc650dSSadaf Ebrahimi
506*22dc650dSSadaf Ebrahimi  Text file documentation (share/doc/pcre2):
507*22dc650dSSadaf Ebrahimi    AUTHORS
508*22dc650dSSadaf Ebrahimi    COPYING
509*22dc650dSSadaf Ebrahimi    ChangeLog
510*22dc650dSSadaf Ebrahimi    LICENCE
511*22dc650dSSadaf Ebrahimi    NEWS
512*22dc650dSSadaf Ebrahimi    README
513*22dc650dSSadaf Ebrahimi    pcre2.txt         (a concatenation of the man(3) pages)
514*22dc650dSSadaf Ebrahimi    pcre2test.txt     the pcre2test man page
515*22dc650dSSadaf Ebrahimi    pcre2grep.txt     the pcre2grep man page
516*22dc650dSSadaf Ebrahimi    pcre2-config.txt  the pcre2-config man page
517*22dc650dSSadaf Ebrahimi
518*22dc650dSSadaf EbrahimiIf you want to remove PCRE2 from your system, you can run "make uninstall".
519*22dc650dSSadaf EbrahimiThis removes all the files that "make install" installed. However, it does not
520*22dc650dSSadaf Ebrahimiremove any directories, because these are often shared with other programs.
521*22dc650dSSadaf Ebrahimi
522*22dc650dSSadaf Ebrahimi
523*22dc650dSSadaf EbrahimiRetrieving configuration information
524*22dc650dSSadaf Ebrahimi------------------------------------
525*22dc650dSSadaf Ebrahimi
526*22dc650dSSadaf EbrahimiRunning "make install" installs the command pcre2-config, which can be used to
527*22dc650dSSadaf Ebrahimirecall information about the PCRE2 configuration and installation. For example:
528*22dc650dSSadaf Ebrahimi
529*22dc650dSSadaf Ebrahimi  pcre2-config --version
530*22dc650dSSadaf Ebrahimi
531*22dc650dSSadaf Ebrahimiprints the version number, and
532*22dc650dSSadaf Ebrahimi
533*22dc650dSSadaf Ebrahimi  pcre2-config --libs8
534*22dc650dSSadaf Ebrahimi
535*22dc650dSSadaf Ebrahimioutputs information about where the 8-bit library is installed. This command
536*22dc650dSSadaf Ebrahimican be included in makefiles for programs that use PCRE2, saving the programmer
537*22dc650dSSadaf Ebrahimifrom having to remember too many details. Run pcre2-config with no arguments to
538*22dc650dSSadaf Ebrahimiobtain a list of possible arguments.
539*22dc650dSSadaf Ebrahimi
540*22dc650dSSadaf EbrahimiThe pkg-config command is another system for saving and retrieving information
541*22dc650dSSadaf Ebrahimiabout installed libraries. Instead of separate commands for each library, a
542*22dc650dSSadaf Ebrahimisingle command is used. For example:
543*22dc650dSSadaf Ebrahimi
544*22dc650dSSadaf Ebrahimi  pkg-config --libs libpcre2-16
545*22dc650dSSadaf Ebrahimi
546*22dc650dSSadaf EbrahimiThe data is held in *.pc files that are installed in a directory called
547*22dc650dSSadaf Ebrahimi<prefix>/lib/pkgconfig.
548*22dc650dSSadaf Ebrahimi
549*22dc650dSSadaf Ebrahimi
550*22dc650dSSadaf EbrahimiShared libraries
551*22dc650dSSadaf Ebrahimi----------------
552*22dc650dSSadaf Ebrahimi
553*22dc650dSSadaf EbrahimiThe default distribution builds PCRE2 as shared libraries and static libraries,
554*22dc650dSSadaf Ebrahimias long as the operating system supports shared libraries. Shared library
555*22dc650dSSadaf Ebrahimisupport relies on the "libtool" script which is built as part of the
556*22dc650dSSadaf Ebrahimi"configure" process.
557*22dc650dSSadaf Ebrahimi
558*22dc650dSSadaf EbrahimiThe libtool script is used to compile and link both shared and static
559*22dc650dSSadaf Ebrahimilibraries. They are placed in a subdirectory called .libs when they are newly
560*22dc650dSSadaf Ebrahimibuilt. The programs pcre2test and pcre2grep are built to use these uninstalled
561*22dc650dSSadaf Ebrahimilibraries (by means of wrapper scripts in the case of shared libraries). When
562*22dc650dSSadaf Ebrahimiyou use "make install" to install shared libraries, pcre2grep and pcre2test are
563*22dc650dSSadaf Ebrahimiautomatically re-built to use the newly installed shared libraries before being
564*22dc650dSSadaf Ebrahimiinstalled themselves. However, the versions left in the build directory still
565*22dc650dSSadaf Ebrahimiuse the uninstalled libraries.
566*22dc650dSSadaf Ebrahimi
567*22dc650dSSadaf EbrahimiTo build PCRE2 using static libraries only you must use --disable-shared when
568*22dc650dSSadaf Ebrahimiconfiguring it. For example:
569*22dc650dSSadaf Ebrahimi
570*22dc650dSSadaf Ebrahimi./configure --prefix=/usr/gnu --disable-shared
571*22dc650dSSadaf Ebrahimi
572*22dc650dSSadaf EbrahimiThen run "make" in the usual way. Similarly, you can use --disable-static to
573*22dc650dSSadaf Ebrahimibuild only shared libraries. Note, however, that when you build only static
574*22dc650dSSadaf Ebrahimilibraries, binary programs such as pcre2test and pcre2grep may still be
575*22dc650dSSadaf Ebrahimidynamically linked with other libraries (for example, libc) unless you set
576*22dc650dSSadaf EbrahimiLDFLAGS to --static when running "configure".
577*22dc650dSSadaf Ebrahimi
578*22dc650dSSadaf Ebrahimi
579*22dc650dSSadaf EbrahimiCross-compiling using autotools
580*22dc650dSSadaf Ebrahimi-------------------------------
581*22dc650dSSadaf Ebrahimi
582*22dc650dSSadaf EbrahimiYou can specify CC and CFLAGS in the normal way to the "configure" command, in
583*22dc650dSSadaf Ebrahimiorder to cross-compile PCRE2 for some other host. However, you should NOT
584*22dc650dSSadaf Ebrahimispecify --enable-rebuild-chartables, because if you do, the pcre2_dftables.c
585*22dc650dSSadaf Ebrahimisource file is compiled and run on the local host, in order to generate the
586*22dc650dSSadaf Ebrahimiinbuilt character tables (the pcre2_chartables.c file). This will probably not
587*22dc650dSSadaf Ebrahimiwork, because pcre2_dftables.c needs to be compiled with the local compiler,
588*22dc650dSSadaf Ebrahiminot the cross compiler.
589*22dc650dSSadaf Ebrahimi
590*22dc650dSSadaf EbrahimiWhen --enable-rebuild-chartables is not specified, pcre2_chartables.c is
591*22dc650dSSadaf Ebrahimicreated by making a copy of pcre2_chartables.c.dist, which is a default set of
592*22dc650dSSadaf Ebrahimitables that assumes ASCII code. Cross-compiling with the default tables should
593*22dc650dSSadaf Ebrahiminot be a problem.
594*22dc650dSSadaf Ebrahimi
595*22dc650dSSadaf EbrahimiIf you need to modify the character tables when cross-compiling, you should
596*22dc650dSSadaf Ebrahimimove pcre2_chartables.c.dist out of the way, then compile pcre2_dftables.c by
597*22dc650dSSadaf Ebrahimihand and run it on the local host to make a new version of
598*22dc650dSSadaf Ebrahimipcre2_chartables.c.dist. See the pcre2build section "Creating character tables
599*22dc650dSSadaf Ebrahimiat build time" for more details.
600*22dc650dSSadaf Ebrahimi
601*22dc650dSSadaf Ebrahimi
602*22dc650dSSadaf EbrahimiMaking new tarballs
603*22dc650dSSadaf Ebrahimi-------------------
604*22dc650dSSadaf Ebrahimi
605*22dc650dSSadaf EbrahimiThe command "make dist" creates three PCRE2 tarballs, in tar.gz, tar.bz2, and
606*22dc650dSSadaf Ebrahimizip formats. The command "make distcheck" does the same, but then does a trial
607*22dc650dSSadaf Ebrahimibuild of the new distribution to ensure that it works.
608*22dc650dSSadaf Ebrahimi
609*22dc650dSSadaf EbrahimiIf you have modified any of the man page sources in the doc directory, you
610*22dc650dSSadaf Ebrahimishould first run the PrepareRelease script before making a distribution. This
611*22dc650dSSadaf Ebrahimiscript creates the .txt and HTML forms of the documentation from the man pages.
612*22dc650dSSadaf Ebrahimi
613*22dc650dSSadaf Ebrahimi
614*22dc650dSSadaf EbrahimiTesting PCRE2
615*22dc650dSSadaf Ebrahimi-------------
616*22dc650dSSadaf Ebrahimi
617*22dc650dSSadaf EbrahimiTo test the basic PCRE2 library on a Unix-like system, run the RunTest script.
618*22dc650dSSadaf EbrahimiThere is another script called RunGrepTest that tests the pcre2grep command.
619*22dc650dSSadaf EbrahimiWhen the 8-bit library is built, a test program for the POSIX wrapper, called
620*22dc650dSSadaf Ebrahimipcre2posix_test, is compiled, and when JIT support is enabled, a test program
621*22dc650dSSadaf Ebrahimicalled pcre2_jit_test is built. The scripts and the program tests are all run
622*22dc650dSSadaf Ebrahimiwhen you obey "make check". For other environments, see the instructions in
623*22dc650dSSadaf EbrahimiNON-AUTOTOOLS-BUILD.
624*22dc650dSSadaf Ebrahimi
625*22dc650dSSadaf EbrahimiThe RunTest script runs the pcre2test test program (which is documented in its
626*22dc650dSSadaf Ebrahimiown man page) on each of the relevant testinput files in the testdata
627*22dc650dSSadaf Ebrahimidirectory, and compares the output with the contents of the corresponding
628*22dc650dSSadaf Ebrahimitestoutput files. RunTest uses a file called testtry to hold the main output
629*22dc650dSSadaf Ebrahimifrom pcre2test. Other files whose names begin with "test" are used as working
630*22dc650dSSadaf Ebrahimifiles in some tests.
631*22dc650dSSadaf Ebrahimi
632*22dc650dSSadaf EbrahimiSome tests are relevant only when certain build-time options were selected. For
633*22dc650dSSadaf Ebrahimiexample, the tests for UTF-8/16/32 features are run only when Unicode support
634*22dc650dSSadaf Ebrahimiis available. RunTest outputs a comment when it skips a test.
635*22dc650dSSadaf Ebrahimi
636*22dc650dSSadaf EbrahimiMany (but not all) of the tests that are not skipped are run twice if JIT
637*22dc650dSSadaf Ebrahimisupport is available. On the second run, JIT compilation is forced. This
638*22dc650dSSadaf Ebrahimitesting can be suppressed by putting "-nojit" on the RunTest command line.
639*22dc650dSSadaf Ebrahimi
640*22dc650dSSadaf EbrahimiThe entire set of tests is run once for each of the 8-bit, 16-bit and 32-bit
641*22dc650dSSadaf Ebrahimilibraries that are enabled. If you want to run just one set of tests, call
642*22dc650dSSadaf EbrahimiRunTest with either the -8, -16 or -32 option.
643*22dc650dSSadaf Ebrahimi
644*22dc650dSSadaf EbrahimiIf valgrind is installed, you can run the tests under it by putting "-valgrind"
645*22dc650dSSadaf Ebrahimion the RunTest command line. To run pcre2test on just one or more specific test
646*22dc650dSSadaf Ebrahimifiles, give their numbers as arguments to RunTest, for example:
647*22dc650dSSadaf Ebrahimi
648*22dc650dSSadaf Ebrahimi  RunTest 2 7 11
649*22dc650dSSadaf Ebrahimi
650*22dc650dSSadaf EbrahimiYou can also specify ranges of tests such as 3-6 or 3- (meaning 3 to the
651*22dc650dSSadaf Ebrahimiend), or a number preceded by ~ to exclude a test. For example:
652*22dc650dSSadaf Ebrahimi
653*22dc650dSSadaf Ebrahimi  Runtest 3-15 ~10
654*22dc650dSSadaf Ebrahimi
655*22dc650dSSadaf EbrahimiThis runs tests 3 to 15, excluding test 10, and just ~13 runs all the tests
656*22dc650dSSadaf Ebrahimiexcept test 13. Whatever order the arguments are in, the tests are always run
657*22dc650dSSadaf Ebrahimiin numerical order.
658*22dc650dSSadaf Ebrahimi
659*22dc650dSSadaf EbrahimiYou can also call RunTest with the single argument "list" to cause it to output
660*22dc650dSSadaf Ebrahimia list of tests.
661*22dc650dSSadaf Ebrahimi
662*22dc650dSSadaf EbrahimiThe test sequence starts with "test 0", which is a special test that has no
663*22dc650dSSadaf Ebrahimiinput file, and whose output is not checked. This is because it will be
664*22dc650dSSadaf Ebrahimidifferent on different hardware and with different configurations. The test
665*22dc650dSSadaf Ebrahimiexists in order to exercise some of pcre2test's code that would not otherwise
666*22dc650dSSadaf Ebrahimibe run.
667*22dc650dSSadaf Ebrahimi
668*22dc650dSSadaf EbrahimiTests 1 and 2 can always be run, as they expect only plain text strings (not
669*22dc650dSSadaf EbrahimiUTF) and make no use of Unicode properties. The first test file can be fed
670*22dc650dSSadaf Ebrahimidirectly into the perltest.sh script to check that Perl gives the same results.
671*22dc650dSSadaf EbrahimiThe only difference you should see is in the first few lines, where the Perl
672*22dc650dSSadaf Ebrahimiversion is given instead of the PCRE2 version. The second set of tests check
673*22dc650dSSadaf Ebrahimiauxiliary functions, error detection, and run-time flags that are specific to
674*22dc650dSSadaf EbrahimiPCRE2. It also uses the debugging flags to check some of the internals of
675*22dc650dSSadaf Ebrahimipcre2_compile().
676*22dc650dSSadaf Ebrahimi
677*22dc650dSSadaf EbrahimiIf you build PCRE2 with a locale setting that is not the standard C locale, the
678*22dc650dSSadaf Ebrahimicharacter tables may be different (see next paragraph). In some cases, this may
679*22dc650dSSadaf Ebrahimicause failures in the second set of tests. For example, in a locale where the
680*22dc650dSSadaf Ebrahimiisprint() function yields TRUE for characters in the range 128-255, the use of
681*22dc650dSSadaf Ebrahimi[:isascii:] inside a character class defines a different set of characters, and
682*22dc650dSSadaf Ebrahimithis shows up in this test as a difference in the compiled code, which is being
683*22dc650dSSadaf Ebrahimilisted for checking. For example, where the comparison test output contains
684*22dc650dSSadaf Ebrahimi[\x00-\x7f] the test might contain [\x00-\xff], and similarly in some other
685*22dc650dSSadaf Ebrahimicases. This is not a bug in PCRE2.
686*22dc650dSSadaf Ebrahimi
687*22dc650dSSadaf EbrahimiTest 3 checks pcre2_maketables(), the facility for building a set of character
688*22dc650dSSadaf Ebrahimitables for a specific locale and using them instead of the default tables. The
689*22dc650dSSadaf Ebrahimiscript uses the "locale" command to check for the availability of the "fr_FR",
690*22dc650dSSadaf Ebrahimi"french", or "fr" locale, and uses the first one that it finds. If the "locale"
691*22dc650dSSadaf Ebrahimicommand fails, or if its output doesn't include "fr_FR", "french", or "fr" in
692*22dc650dSSadaf Ebrahimithe list of available locales, the third test cannot be run, and a comment is
693*22dc650dSSadaf Ebrahimioutput to say why. If running this test produces an error like this:
694*22dc650dSSadaf Ebrahimi
695*22dc650dSSadaf Ebrahimi  ** Failed to set locale "fr_FR"
696*22dc650dSSadaf Ebrahimi
697*22dc650dSSadaf Ebrahimiit means that the given locale is not available on your system, despite being
698*22dc650dSSadaf Ebrahimilisted by "locale". This does not mean that PCRE2 is broken. There are three
699*22dc650dSSadaf Ebrahimialternative output files for the third test, because three different versions
700*22dc650dSSadaf Ebrahimiof the French locale have been encountered. The test passes if its output
701*22dc650dSSadaf Ebrahimimatches any one of them.
702*22dc650dSSadaf Ebrahimi
703*22dc650dSSadaf EbrahimiTests 4 and 5 check UTF and Unicode property support, test 4 being compatible
704*22dc650dSSadaf Ebrahimiwith the perltest.sh script, and test 5 checking PCRE2-specific things.
705*22dc650dSSadaf Ebrahimi
706*22dc650dSSadaf EbrahimiTests 6 and 7 check the pcre2_dfa_match() alternative matching function, in
707*22dc650dSSadaf Ebrahiminon-UTF mode and UTF-mode with Unicode property support, respectively.
708*22dc650dSSadaf Ebrahimi
709*22dc650dSSadaf EbrahimiTest 8 checks some internal offsets and code size features, but it is run only
710*22dc650dSSadaf Ebrahimiwhen Unicode support is enabled. The output is different in 8-bit, 16-bit, and
711*22dc650dSSadaf Ebrahimi32-bit modes and for different link sizes, so there are different output files
712*22dc650dSSadaf Ebrahimifor each mode and link size.
713*22dc650dSSadaf Ebrahimi
714*22dc650dSSadaf EbrahimiTests 9 and 10 are run only in 8-bit mode, and tests 11 and 12 are run only in
715*22dc650dSSadaf Ebrahimi16-bit and 32-bit modes. These are tests that generate different output in
716*22dc650dSSadaf Ebrahimi8-bit mode. Each pair are for general cases and Unicode support, respectively.
717*22dc650dSSadaf Ebrahimi
718*22dc650dSSadaf EbrahimiTest 13 checks the handling of non-UTF characters greater than 255 by
719*22dc650dSSadaf Ebrahimipcre2_dfa_match() in 16-bit and 32-bit modes.
720*22dc650dSSadaf Ebrahimi
721*22dc650dSSadaf EbrahimiTest 14 contains some special UTF and UCP tests that give different output for
722*22dc650dSSadaf Ebrahimidifferent code unit widths.
723*22dc650dSSadaf Ebrahimi
724*22dc650dSSadaf EbrahimiTest 15 contains a number of tests that must not be run with JIT. They check,
725*22dc650dSSadaf Ebrahimiamong other non-JIT things, the match-limiting features of the interpretive
726*22dc650dSSadaf Ebrahimimatcher.
727*22dc650dSSadaf Ebrahimi
728*22dc650dSSadaf EbrahimiTest 16 is run only when JIT support is not available. It checks that an
729*22dc650dSSadaf Ebrahimiattempt to use JIT has the expected behaviour.
730*22dc650dSSadaf Ebrahimi
731*22dc650dSSadaf EbrahimiTest 17 is run only when JIT support is available. It checks JIT complete and
732*22dc650dSSadaf Ebrahimipartial modes, match-limiting under JIT, and other JIT-specific features.
733*22dc650dSSadaf Ebrahimi
734*22dc650dSSadaf EbrahimiTests 18 and 19 are run only in 8-bit mode. They check the POSIX interface to
735*22dc650dSSadaf Ebrahimithe 8-bit library, without and with Unicode support, respectively.
736*22dc650dSSadaf Ebrahimi
737*22dc650dSSadaf EbrahimiTest 20 checks the serialization functions by writing a set of compiled
738*22dc650dSSadaf Ebrahimipatterns to a file, and then reloading and checking them.
739*22dc650dSSadaf Ebrahimi
740*22dc650dSSadaf EbrahimiTests 21 and 22 test \C support when the use of \C is not locked out, without
741*22dc650dSSadaf Ebrahimiand with UTF support, respectively. Test 23 tests \C when it is locked out.
742*22dc650dSSadaf Ebrahimi
743*22dc650dSSadaf EbrahimiTests 24 and 25 test the experimental pattern conversion functions, without and
744*22dc650dSSadaf Ebrahimiwith UTF support, respectively.
745*22dc650dSSadaf Ebrahimi
746*22dc650dSSadaf EbrahimiTest 26 checks Unicode property support using tests that are generated
747*22dc650dSSadaf Ebrahimiautomatically from the Unicode data tables.
748*22dc650dSSadaf Ebrahimi
749*22dc650dSSadaf Ebrahimi
750*22dc650dSSadaf EbrahimiCharacter tables
751*22dc650dSSadaf Ebrahimi----------------
752*22dc650dSSadaf Ebrahimi
753*22dc650dSSadaf EbrahimiFor speed, PCRE2 uses four tables for manipulating and identifying characters
754*22dc650dSSadaf Ebrahimiwhose code point values are less than 256. By default, a set of tables that is
755*22dc650dSSadaf Ebrahimibuilt into the library is used. The pcre2_maketables() function can be called
756*22dc650dSSadaf Ebrahimiby an application to create a new set of tables in the current locale. This are
757*22dc650dSSadaf Ebrahimipassed to PCRE2 by calling pcre2_set_character_tables() to put a pointer into a
758*22dc650dSSadaf Ebrahimicompile context.
759*22dc650dSSadaf Ebrahimi
760*22dc650dSSadaf EbrahimiThe source file called pcre2_chartables.c contains the default set of tables.
761*22dc650dSSadaf EbrahimiBy default, this is created as a copy of pcre2_chartables.c.dist, which
762*22dc650dSSadaf Ebrahimicontains tables for ASCII coding. However, if --enable-rebuild-chartables is
763*22dc650dSSadaf Ebrahimispecified for ./configure, a new version of pcre2_chartables.c is built by the
764*22dc650dSSadaf Ebrahimiprogram pcre2_dftables (compiled from pcre2_dftables.c), which uses the ANSI C
765*22dc650dSSadaf Ebrahimicharacter handling functions such as isalnum(), isalpha(), isupper(),
766*22dc650dSSadaf Ebrahimiislower(), etc. to build the table sources. This means that the default C
767*22dc650dSSadaf Ebrahimilocale that is set for your system will control the contents of these default
768*22dc650dSSadaf Ebrahimitables. You can change the default tables by editing pcre2_chartables.c and
769*22dc650dSSadaf Ebrahimithen re-building PCRE2. If you do this, you should take care to ensure that the
770*22dc650dSSadaf Ebrahimifile does not get automatically re-generated. The best way to do this is to
771*22dc650dSSadaf Ebrahimimove pcre2_chartables.c.dist out of the way and replace it with your customized
772*22dc650dSSadaf Ebrahimitables.
773*22dc650dSSadaf Ebrahimi
774*22dc650dSSadaf EbrahimiWhen the pcre2_dftables program is run as a result of specifying
775*22dc650dSSadaf Ebrahimi--enable-rebuild-chartables, it uses the default C locale that is set on your
776*22dc650dSSadaf Ebrahimisystem. It does not pay attention to the LC_xxx environment variables. In other
777*22dc650dSSadaf Ebrahimiwords, it uses the system's default locale rather than whatever the compiling
778*22dc650dSSadaf Ebrahimiuser happens to have set. If you really do want to build a source set of
779*22dc650dSSadaf Ebrahimicharacter tables in a locale that is specified by the LC_xxx variables, you can
780*22dc650dSSadaf Ebrahimirun the pcre2_dftables program by hand with the -L option. For example:
781*22dc650dSSadaf Ebrahimi
782*22dc650dSSadaf Ebrahimi  ./pcre2_dftables -L pcre2_chartables.c.special
783*22dc650dSSadaf Ebrahimi
784*22dc650dSSadaf EbrahimiThe second argument names the file where the source code for the tables is
785*22dc650dSSadaf Ebrahimiwritten. The first two 256-byte tables provide lower casing and case flipping
786*22dc650dSSadaf Ebrahimifunctions, respectively. The next table consists of a number of 32-byte bit
787*22dc650dSSadaf Ebrahimimaps which identify certain character classes such as digits, "word"
788*22dc650dSSadaf Ebrahimicharacters, white space, etc. These are used when building 32-byte bit maps
789*22dc650dSSadaf Ebrahimithat represent character classes for code points less than 256. The final
790*22dc650dSSadaf Ebrahimi256-byte table has bits indicating various character types, as follows:
791*22dc650dSSadaf Ebrahimi
792*22dc650dSSadaf Ebrahimi    1   white space character
793*22dc650dSSadaf Ebrahimi    2   letter
794*22dc650dSSadaf Ebrahimi    4   lower case letter
795*22dc650dSSadaf Ebrahimi    8   decimal digit
796*22dc650dSSadaf Ebrahimi   16   alphanumeric or '_'
797*22dc650dSSadaf Ebrahimi
798*22dc650dSSadaf EbrahimiYou can also specify -b (with or without -L) when running pcre2_dftables. This
799*22dc650dSSadaf Ebrahimicauses the tables to be written in binary instead of as source code. A set of
800*22dc650dSSadaf Ebrahimibinary tables can be loaded into memory by an application and passed to
801*22dc650dSSadaf Ebrahimipcre2_compile() in the same way as tables created dynamically by calling
802*22dc650dSSadaf Ebrahimipcre2_maketables(). The tables are just a string of bytes, independent of
803*22dc650dSSadaf Ebrahimihardware characteristics such as endianness. This means they can be bundled
804*22dc650dSSadaf Ebrahimiwith an application that runs in different environments, to ensure consistent
805*22dc650dSSadaf Ebrahimibehaviour.
806*22dc650dSSadaf Ebrahimi
807*22dc650dSSadaf EbrahimiSee also the pcre2build section "Creating character tables at build time".
808*22dc650dSSadaf Ebrahimi
809*22dc650dSSadaf Ebrahimi
810*22dc650dSSadaf EbrahimiFile manifest
811*22dc650dSSadaf Ebrahimi-------------
812*22dc650dSSadaf Ebrahimi
813*22dc650dSSadaf EbrahimiThe distribution should contain the files listed below.
814*22dc650dSSadaf Ebrahimi
815*22dc650dSSadaf Ebrahimi(A) Source files for the PCRE2 library functions and their headers are found in
816*22dc650dSSadaf Ebrahimi    the src directory:
817*22dc650dSSadaf Ebrahimi
818*22dc650dSSadaf Ebrahimi  src/pcre2_dftables.c     auxiliary program for building pcre2_chartables.c
819*22dc650dSSadaf Ebrahimi                           when --enable-rebuild-chartables is specified
820*22dc650dSSadaf Ebrahimi
821*22dc650dSSadaf Ebrahimi  src/pcre2_chartables.c.dist  a default set of character tables that assume
822*22dc650dSSadaf Ebrahimi                           ASCII coding; unless --enable-rebuild-chartables is
823*22dc650dSSadaf Ebrahimi                           specified, used by copying to pcre2_chartables.c
824*22dc650dSSadaf Ebrahimi
825*22dc650dSSadaf Ebrahimi  src/pcre2posix.c         )
826*22dc650dSSadaf Ebrahimi  src/pcre2_auto_possess.c )
827*22dc650dSSadaf Ebrahimi  src/pcre2_chkdint.c      )
828*22dc650dSSadaf Ebrahimi  src/pcre2_compile.c      )
829*22dc650dSSadaf Ebrahimi  src/pcre2_config.c       )
830*22dc650dSSadaf Ebrahimi  src/pcre2_context.c      )
831*22dc650dSSadaf Ebrahimi  src/pcre2_convert.c      )
832*22dc650dSSadaf Ebrahimi  src/pcre2_dfa_match.c    )
833*22dc650dSSadaf Ebrahimi  src/pcre2_error.c        )
834*22dc650dSSadaf Ebrahimi  src/pcre2_extuni.c       )
835*22dc650dSSadaf Ebrahimi  src/pcre2_find_bracket.c )
836*22dc650dSSadaf Ebrahimi  src/pcre2_jit_compile.c  )
837*22dc650dSSadaf Ebrahimi  src/pcre2_jit_match.c    ) sources for the functions in the library,
838*22dc650dSSadaf Ebrahimi  src/pcre2_jit_misc.c     )   and some internal functions that they use
839*22dc650dSSadaf Ebrahimi  src/pcre2_maketables.c   )
840*22dc650dSSadaf Ebrahimi  src/pcre2_match.c        )
841*22dc650dSSadaf Ebrahimi  src/pcre2_match_data.c   )
842*22dc650dSSadaf Ebrahimi  src/pcre2_newline.c      )
843*22dc650dSSadaf Ebrahimi  src/pcre2_ord2utf.c      )
844*22dc650dSSadaf Ebrahimi  src/pcre2_pattern_info.c )
845*22dc650dSSadaf Ebrahimi  src/pcre2_script_run.c   )
846*22dc650dSSadaf Ebrahimi  src/pcre2_serialize.c    )
847*22dc650dSSadaf Ebrahimi  src/pcre2_string_utils.c )
848*22dc650dSSadaf Ebrahimi  src/pcre2_study.c        )
849*22dc650dSSadaf Ebrahimi  src/pcre2_substitute.c   )
850*22dc650dSSadaf Ebrahimi  src/pcre2_substring.c    )
851*22dc650dSSadaf Ebrahimi  src/pcre2_tables.c       )
852*22dc650dSSadaf Ebrahimi  src/pcre2_ucd.c          )
853*22dc650dSSadaf Ebrahimi  src/pcre2_ucptables.c    )
854*22dc650dSSadaf Ebrahimi  src/pcre2_valid_utf.c    )
855*22dc650dSSadaf Ebrahimi  src/pcre2_xclass.c       )
856*22dc650dSSadaf Ebrahimi
857*22dc650dSSadaf Ebrahimi  src/pcre2_printint.c     debugging function that is used by pcre2test,
858*22dc650dSSadaf Ebrahimi  src/pcre2_fuzzsupport.c  function for (optional) fuzzing support
859*22dc650dSSadaf Ebrahimi
860*22dc650dSSadaf Ebrahimi  src/config.h.in          template for config.h, when built by "configure"
861*22dc650dSSadaf Ebrahimi  src/pcre2.h.in           template for pcre2.h when built by "configure"
862*22dc650dSSadaf Ebrahimi  src/pcre2posix.h         header for the external POSIX wrapper API
863*22dc650dSSadaf Ebrahimi  src/pcre2_internal.h     header for internal use
864*22dc650dSSadaf Ebrahimi  src/pcre2_intmodedep.h   a mode-specific internal header
865*22dc650dSSadaf Ebrahimi  src/pcre2_jit_neon_inc.h header used by JIT
866*22dc650dSSadaf Ebrahimi  src/pcre2_jit_simd_inc.h header used by JIT
867*22dc650dSSadaf Ebrahimi  src/pcre2_ucp.h          header for Unicode property handling
868*22dc650dSSadaf Ebrahimi
869*22dc650dSSadaf Ebrahimi  sljit/*                  source files for the JIT compiler
870*22dc650dSSadaf Ebrahimi
871*22dc650dSSadaf Ebrahimi(B) Source files for programs that use PCRE2:
872*22dc650dSSadaf Ebrahimi
873*22dc650dSSadaf Ebrahimi  src/pcre2demo.c          simple demonstration of coding calls to PCRE2
874*22dc650dSSadaf Ebrahimi  src/pcre2grep.c          source of a grep utility that uses PCRE2
875*22dc650dSSadaf Ebrahimi  src/pcre2test.c          comprehensive test program
876*22dc650dSSadaf Ebrahimi  src/pcre2_jit_test.c     JIT test program
877*22dc650dSSadaf Ebrahimi  src/pcre2posix_test.c    POSIX wrapper API test program
878*22dc650dSSadaf Ebrahimi
879*22dc650dSSadaf Ebrahimi(C) Auxiliary files:
880*22dc650dSSadaf Ebrahimi
881*22dc650dSSadaf Ebrahimi  132html                  script to turn "man" pages into HTML
882*22dc650dSSadaf Ebrahimi  AUTHORS                  information about the author of PCRE2
883*22dc650dSSadaf Ebrahimi  ChangeLog                log of changes to the code
884*22dc650dSSadaf Ebrahimi  CleanTxt                 script to clean nroff output for txt man pages
885*22dc650dSSadaf Ebrahimi  Detrail                  script to remove trailing spaces
886*22dc650dSSadaf Ebrahimi  HACKING                  some notes about the internals of PCRE2
887*22dc650dSSadaf Ebrahimi  INSTALL                  generic installation instructions
888*22dc650dSSadaf Ebrahimi  LICENCE                  conditions for the use of PCRE2
889*22dc650dSSadaf Ebrahimi  COPYING                  the same, using GNU's standard name
890*22dc650dSSadaf Ebrahimi  Makefile.in              ) template for Unix Makefile, which is built by
891*22dc650dSSadaf Ebrahimi                           )   "configure"
892*22dc650dSSadaf Ebrahimi  Makefile.am              ) the automake input that was used to create
893*22dc650dSSadaf Ebrahimi                           )   Makefile.in
894*22dc650dSSadaf Ebrahimi  NEWS                     important changes in this release
895*22dc650dSSadaf Ebrahimi  NON-AUTOTOOLS-BUILD      notes on building PCRE2 without using autotools
896*22dc650dSSadaf Ebrahimi  PrepareRelease           script to make preparations for "make dist"
897*22dc650dSSadaf Ebrahimi  README                   this file
898*22dc650dSSadaf Ebrahimi  RunTest                  a Unix shell script for running tests
899*22dc650dSSadaf Ebrahimi  RunGrepTest              a Unix shell script for pcre2grep tests
900*22dc650dSSadaf Ebrahimi  aclocal.m4               m4 macros (generated by "aclocal")
901*22dc650dSSadaf Ebrahimi  config.guess             ) files used by libtool,
902*22dc650dSSadaf Ebrahimi  config.sub               )   used only when building a shared library
903*22dc650dSSadaf Ebrahimi  configure                a configuring shell script (built by autoconf)
904*22dc650dSSadaf Ebrahimi  configure.ac             ) the autoconf input that was used to build
905*22dc650dSSadaf Ebrahimi                           )   "configure" and config.h
906*22dc650dSSadaf Ebrahimi  depcomp                  ) script to find program dependencies, generated by
907*22dc650dSSadaf Ebrahimi                           )   automake
908*22dc650dSSadaf Ebrahimi  doc/*.3                  man page sources for PCRE2
909*22dc650dSSadaf Ebrahimi  doc/*.1                  man page sources for pcre2grep and pcre2test
910*22dc650dSSadaf Ebrahimi  doc/index.html.src       the base HTML page
911*22dc650dSSadaf Ebrahimi  doc/html/*               HTML documentation
912*22dc650dSSadaf Ebrahimi  doc/pcre2.txt            plain text version of the man pages
913*22dc650dSSadaf Ebrahimi  doc/pcre2test.txt        plain text documentation of test program
914*22dc650dSSadaf Ebrahimi  install-sh               a shell script for installing files
915*22dc650dSSadaf Ebrahimi  libpcre2-8.pc.in         template for libpcre2-8.pc for pkg-config
916*22dc650dSSadaf Ebrahimi  libpcre2-16.pc.in        template for libpcre2-16.pc for pkg-config
917*22dc650dSSadaf Ebrahimi  libpcre2-32.pc.in        template for libpcre2-32.pc for pkg-config
918*22dc650dSSadaf Ebrahimi  libpcre2-posix.pc.in     template for libpcre2-posix.pc for pkg-config
919*22dc650dSSadaf Ebrahimi  ltmain.sh                file used to build a libtool script
920*22dc650dSSadaf Ebrahimi  missing                  ) common stub for a few missing GNU programs while
921*22dc650dSSadaf Ebrahimi                           )   installing, generated by automake
922*22dc650dSSadaf Ebrahimi  mkinstalldirs            script for making install directories
923*22dc650dSSadaf Ebrahimi  perltest.sh              Script for running a Perl test program
924*22dc650dSSadaf Ebrahimi  pcre2-config.in          source of script which retains PCRE2 information
925*22dc650dSSadaf Ebrahimi  testdata/testinput*      test data for main library tests
926*22dc650dSSadaf Ebrahimi  testdata/testoutput*     expected test results
927*22dc650dSSadaf Ebrahimi  testdata/grep*           input and output for pcre2grep tests
928*22dc650dSSadaf Ebrahimi  testdata/*               other supporting test files
929*22dc650dSSadaf Ebrahimi
930*22dc650dSSadaf Ebrahimi(D) Auxiliary files for cmake support
931*22dc650dSSadaf Ebrahimi
932*22dc650dSSadaf Ebrahimi  cmake/COPYING-CMAKE-SCRIPTS
933*22dc650dSSadaf Ebrahimi  cmake/FindPackageHandleStandardArgs.cmake
934*22dc650dSSadaf Ebrahimi  cmake/FindEditline.cmake
935*22dc650dSSadaf Ebrahimi  cmake/FindReadline.cmake
936*22dc650dSSadaf Ebrahimi  CMakeLists.txt
937*22dc650dSSadaf Ebrahimi  config-cmake.h.in
938*22dc650dSSadaf Ebrahimi
939*22dc650dSSadaf Ebrahimi(E) Auxiliary files for building PCRE2 "by hand"
940*22dc650dSSadaf Ebrahimi
941*22dc650dSSadaf Ebrahimi  src/pcre2.h.generic     ) a version of the public PCRE2 header file
942*22dc650dSSadaf Ebrahimi                          )   for use in non-"configure" environments
943*22dc650dSSadaf Ebrahimi  src/config.h.generic    ) a version of config.h for use in non-"configure"
944*22dc650dSSadaf Ebrahimi                          )   environments
945*22dc650dSSadaf Ebrahimi
946*22dc650dSSadaf Ebrahimi(F) Auxiliary files for building PCRE2 under OpenVMS
947*22dc650dSSadaf Ebrahimi
948*22dc650dSSadaf Ebrahimi  vms/configure.com       )
949*22dc650dSSadaf Ebrahimi  vms/openvms_readme.txt  ) These files were contributed by a PCRE2 user.
950*22dc650dSSadaf Ebrahimi  vms/pcre2.h_patch       )
951*22dc650dSSadaf Ebrahimi  vms/stdint.h            )
952*22dc650dSSadaf Ebrahimi
953*22dc650dSSadaf EbrahimiPhilip Hazel
954*22dc650dSSadaf EbrahimiEmail local part: Philip.Hazel
955*22dc650dSSadaf EbrahimiEmail domain: gmail.com
956*22dc650dSSadaf EbrahimiLast updated: 15 April 2024
957