| 103 |
|
|
| 104 |
For a non-Unix system, please read the comments in the file NON-UNIX-USE, |
For a non-Unix system, please read the comments in the file NON-UNIX-USE, |
| 105 |
though if your system supports the use of "configure" and "make" you may be |
though if your system supports the use of "configure" and "make" you may be |
| 106 |
able to build PCRE in the same way as for Unix-like systems. |
able to build PCRE in the same way as for Unix-like systems. PCRE can also be |
| 107 |
|
configured in many platform environments using the GUI facility of CMake's |
| 108 |
|
CMakeSetup. It creates Makefiles, solution files, etc. |
| 109 |
|
|
| 110 |
PCRE has been compiled on many different operating systems. It should be |
PCRE has been compiled on many different operating systems. It should be |
| 111 |
straightforward to build PCRE on any system that has a Standard C compiler and |
straightforward to build PCRE on any system that has a Standard C compiler and |
| 118 |
If you are using HP's ANSI C++ compiler (aCC), please see the special note |
If you are using HP's ANSI C++ compiler (aCC), please see the special note |
| 119 |
in the section entitled "Using HP's ANSI C++ compiler (aCC)" below. |
in the section entitled "Using HP's ANSI C++ compiler (aCC)" below. |
| 120 |
|
|
| 121 |
|
The following instructions assume the use of the widely used "configure, make, |
| 122 |
|
make install" process. There is also some experimental support for "cmake" in |
| 123 |
|
the PCRE distribution, but it is incomplete and not documented. However, if you |
| 124 |
|
are a "cmake" user, you might want to try it. |
| 125 |
|
|
| 126 |
To build PCRE on a Unix-like system, first run the "configure" command from the |
To build PCRE on a Unix-like system, first run the "configure" command from the |
| 127 |
PCRE distribution directory, with your current directory set to the directory |
PCRE distribution directory, with your current directory set to the directory |
| 128 |
where you want the files to be created. This command is a standard GNU |
where you want the files to be created. This command is a standard GNU |
| 171 |
supported. |
supported. |
| 172 |
|
|
| 173 |
. You can build PCRE to recognize either CR or LF or the sequence CRLF or any |
. You can build PCRE to recognize either CR or LF or the sequence CRLF or any |
| 174 |
of the Unicode newline sequences as indicating the end of a line. Whatever |
of the preceding, or any of the Unicode newline sequences as indicating the |
| 175 |
you specify at build time is the default; the caller of PCRE can change the |
end of a line. Whatever you specify at build time is the default; the caller |
| 176 |
selection at run time. The default newline indicator is a single LF character |
of PCRE can change the selection at run time. The default newline indicator |
| 177 |
(the Unix standard). You can specify the default newline indicator by adding |
is a single LF character (the Unix standard). You can specify the default |
| 178 |
--newline-is-cr or --newline-is-lf or --newline-is-crlf or --newline-is-any |
newline indicator by adding --enable-newline-is-cr or --enable-newline-is-lf |
| 179 |
to the "configure" command, respectively. |
or --enable-newline-is-crlf or --enable-newline-is-anycrlf or |
| 180 |
|
--enable-newline-is-any to the "configure" command, respectively. |
| 181 |
If you specify --newline-is-cr or --newline-is-crlf, some of the standard |
|
| 182 |
tests will fail, because the lines in the test files end with LF. Even if |
If you specify --enable-newline-is-cr or --enable-newline-is-crlf, some of |
| 183 |
the files are edited to change the line endings, there are likely to be some |
the standard tests will fail, because the lines in the test files end with |
| 184 |
failures. With --newline-is-any, many tests should succeed, but there may be |
LF. Even if the files are edited to change the line endings, there are likely |
| 185 |
some failures. |
to be some failures. With --enable-newline-is-anycrlf or |
| 186 |
|
--enable-newline-is-any, many tests should succeed, but there may be some |
| 187 |
|
failures. |
| 188 |
|
|
| 189 |
|
. By default, the sequence \R in a pattern matches any Unicode line ending |
| 190 |
|
sequence. This is independent of the option specifying what PCRE considers to |
| 191 |
|
be the end of a line (see above). However, the caller of PCRE can restrict \R |
| 192 |
|
to match only CR, LF, or CRLF. You can make this the default by adding |
| 193 |
|
--enable-bsr-anycrlf to the "configure" command (bsr = "backslash R"). |
| 194 |
|
|
| 195 |
. When called via the POSIX interface, PCRE uses malloc() to get additional |
. When called via the POSIX interface, PCRE uses malloc() to get additional |
| 196 |
storage for processing capturing parentheses if there are more than 10 of |
storage for processing capturing parentheses if there are more than 10 of |
| 258 |
|
|
| 259 |
This automatically implies --enable-rebuild-chartables (see above). |
This automatically implies --enable-rebuild-chartables (see above). |
| 260 |
|
|
| 261 |
|
. It is possible to compile pcregrep to use libz and/or libbz2, in order to |
| 262 |
|
read .gz and .bz2 files (respectively), by specifying one or both of |
| 263 |
|
|
| 264 |
|
--enable-pcregrep-libz |
| 265 |
|
--enable-pcregrep-libbz2 |
| 266 |
|
|
| 267 |
|
Of course, the relevant libraries must be installed on your system. |
| 268 |
|
|
| 269 |
|
. It is possible to compile pcretest so that it links with the libreadline |
| 270 |
|
library, by specifying |
| 271 |
|
|
| 272 |
|
--enable-pcretest-libreadline |
| 273 |
|
|
| 274 |
|
If this is done, when pcretest's input is from a terminal, it reads it using |
| 275 |
|
the readline() function. This provides line-editing and history facilities. |
| 276 |
|
Note that libreadline is GPL-licenced, so if you distribute a binary of |
| 277 |
|
pcretest linked in this way, there may be licensing issues. |
| 278 |
|
|
| 279 |
The "configure" script builds the following files for the basic C library: |
The "configure" script builds the following files for the basic C library: |
| 280 |
|
|
| 281 |
. Makefile is the makefile that builds the library |
. Makefile is the makefile that builds the library |
| 303 |
contains compiler output from tests that "configure" runs. |
contains compiler output from tests that "configure" runs. |
| 304 |
|
|
| 305 |
Once "configure" has run, you can run "make". It builds two libraries, called |
Once "configure" has run, you can run "make". It builds two libraries, called |
| 306 |
libpcre and libpcreposix, a test program called pcretest, a demonstration |
libpcre and libpcreposix, a test program called pcretest, and the pcregrep |
| 307 |
program called pcredemo, and the pcregrep command. If a C++ compiler was found |
command. If a C++ compiler was found on your system, "make" also builds the C++ |
| 308 |
on your system, "make" also builds the C++ wrapper library, which is called |
wrapper library, which is called libpcrecpp, and some test programs called |
| 309 |
libpcrecpp, and some test programs called pcrecpp_unittest, |
pcrecpp_unittest, pcre_scanner_unittest, and pcre_stringpiece_unittest. |
| 310 |
pcre_scanner_unittest, and pcre_stringpiece_unittest. Building the C++ wrapper |
Building the C++ wrapper can be disabled by adding --disable-cpp to the |
| 311 |
can be disabled by adding --disable-cpp to the "configure" command. |
"configure" command. |
| 312 |
|
|
| 313 |
The command "make check" runs all the appropriate tests. Details of the PCRE |
The command "make check" runs all the appropriate tests. Details of the PCRE |
| 314 |
tests are given below in a separate section of this document. |
tests are given below in a separate section of this document. |
| 360 |
pcretest.txt the pcretest man page |
pcretest.txt the pcretest man page |
| 361 |
pcregrep.txt the pcregrep man page |
pcregrep.txt the pcregrep man page |
| 362 |
|
|
|
Note that the pcredemo program that is built by "configure" is *not* installed |
|
|
anywhere. It is a demonstration for programmers wanting to use PCRE. |
|
|
|
|
| 363 |
If you want to remove PCRE from your system, you can run "make uninstall". |
If you want to remove PCRE from your system, you can run "make uninstall". |
| 364 |
This removes all the files that "make install" installed. However, it does not |
This removes all the files that "make install" installed. However, it does not |
| 365 |
remove any directories, because these are often shared with other programs. |
remove any directories, because these are often shared with other programs. |
| 459 |
------------------- |
------------------- |
| 460 |
|
|
| 461 |
The command "make dist" creates three PCRE tarballs, in tar.gz, tar.bz2, and |
The command "make dist" creates three PCRE tarballs, in tar.gz, tar.bz2, and |
| 462 |
zip formats. However, if you have modified any of the man page sources in the |
zip formats. The command "make distcheck" does the same, but then does a trial |
| 463 |
doc directory, you should first run the PrepareRelease script. This re-creates |
build of the new distribution to ensure that it works. |
| 464 |
the .txt and HTML forms of the documentation from the man pages. |
|
| 465 |
|
If you have modified any of the man page sources in the doc directory, you |
| 466 |
|
should first run the PrepareRelease script before making a distribution. This |
| 467 |
|
script creates the .txt and HTML forms of the documentation from the man pages. |
| 468 |
|
|
| 469 |
|
|
| 470 |
Testing PCRE |
Testing PCRE |
| 522 |
in the comparison output, it means that locale is not available on your system, |
in the comparison output, it means that locale is not available on your system, |
| 523 |
despite being listed by "locale". This does not mean that PCRE is broken. |
despite being listed by "locale". This does not mean that PCRE is broken. |
| 524 |
|
|
| 525 |
|
[If you are trying to run this test on Windows, you may be able to get it to |
| 526 |
|
work by changing "fr_FR" to "french" everywhere it occurs. Alternatively, use |
| 527 |
|
RunTest.bat. The version of RunTest.bat included with PCRE 7.4 and above uses |
| 528 |
|
Windows versions of test 2. More info on using RunTest.bat is included in the |
| 529 |
|
document entitled NON-UNIX-USE.] |
| 530 |
|
|
| 531 |
The fourth test checks the UTF-8 support. It is not run automatically unless |
The fourth test checks the UTF-8 support. It is not run automatically unless |
| 532 |
PCRE is built with UTF-8 support. To do this you must set --enable-utf8 when |
PCRE is built with UTF-8 support. To do this you must set --enable-utf8 when |
| 533 |
running "configure". This file can be also fed directly to the perltest script, |
running "configure". This file can be also fed directly to the perltest script, |
| 681 |
NON-UNIX-USE notes on building PCRE on non-Unix systems |
NON-UNIX-USE notes on building PCRE on non-Unix systems |
| 682 |
PrepareRelease script to make preparations for "make dist" |
PrepareRelease script to make preparations for "make dist" |
| 683 |
README this file |
README this file |
| 684 |
RunTest.in template for a Unix shell script for running tests |
RunTest a Unix shell script for running tests |
| 685 |
RunGrepTest.in template for a Unix shell script for pcregrep tests |
RunGrepTest a Unix shell script for pcregrep tests |
| 686 |
aclocal.m4 m4 macros (generated by "aclocal") |
aclocal.m4 m4 macros (generated by "aclocal") |
| 687 |
config.guess ) files used by libtool, |
config.guess ) files used by libtool, |
| 688 |
config.sub ) used only when building a shared library |
config.sub ) used only when building a shared library |
| 740 |
Philip Hazel |
Philip Hazel |
| 741 |
Email local part: ph10 |
Email local part: ph10 |
| 742 |
Email domain: cam.ac.uk |
Email domain: cam.ac.uk |
| 743 |
Last updated: 26 March 2007 |
Last updated: 23 January 2008 |