| 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, |
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 |
make install" process. There is also support for CMake in the PCRE |
| 123 |
the PCRE distribution, but it is incomplete and not documented. However, if you |
distribution; there are some comments about using CMake in the NON-UNIX-USE |
| 124 |
are a "cmake" user, you might want to try it. |
file, though it can also be used in Unix-like systems. |
| 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 |
| 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 |
|
Setting this option causes the -lreadline option to be added to the pcretest |
| 280 |
|
build. In many operating environments with a sytem-installed readline |
| 281 |
|
library this is sufficient. However, in some environments (e.g. if an |
| 282 |
|
unmodified distribution version of readline is in use), it may be necessary |
| 283 |
|
to specify something like LIBS="-lncurses" as well. This is because, to quote |
| 284 |
|
the readline INSTALL, "Readline uses the termcap functions, but does not link |
| 285 |
|
with the termcap or curses library itself, allowing applications which link |
| 286 |
|
with readline the to choose an appropriate library." |
| 287 |
|
|
| 288 |
The "configure" script builds the following files for the basic C library: |
The "configure" script builds the following files for the basic C library: |
| 289 |
|
|
| 290 |
. Makefile is the makefile that builds the library |
. Makefile is the makefile that builds the library |
| 312 |
contains compiler output from tests that "configure" runs. |
contains compiler output from tests that "configure" runs. |
| 313 |
|
|
| 314 |
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 |
| 315 |
libpcre and libpcreposix, a test program called pcretest, a demonstration |
libpcre and libpcreposix, a test program called pcretest, and the pcregrep |
| 316 |
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++ |
| 317 |
on your system, "make" also builds the C++ wrapper library, which is called |
wrapper library, which is called libpcrecpp, and some test programs called |
| 318 |
libpcrecpp, and some test programs called pcrecpp_unittest, |
pcrecpp_unittest, pcre_scanner_unittest, and pcre_stringpiece_unittest. |
| 319 |
pcre_scanner_unittest, and pcre_stringpiece_unittest. Building the C++ wrapper |
Building the C++ wrapper can be disabled by adding --disable-cpp to the |
| 320 |
can be disabled by adding --disable-cpp to the "configure" command. |
"configure" command. |
| 321 |
|
|
| 322 |
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 |
| 323 |
tests are given below in a separate section of this document. |
tests are given below in a separate section of this document. |
| 369 |
pcretest.txt the pcretest man page |
pcretest.txt the pcretest man page |
| 370 |
pcregrep.txt the pcregrep man page |
pcregrep.txt the pcregrep man page |
| 371 |
|
|
|
Note that the pcredemo program that is built by "configure" is *not* installed |
|
|
anywhere. It is a demonstration for programmers wanting to use PCRE. |
|
|
|
|
| 372 |
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". |
| 373 |
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 |
| 374 |
remove any directories, because these are often shared with other programs. |
remove any directories, because these are often shared with other programs. |
| 749 |
Philip Hazel |
Philip Hazel |
| 750 |
Email local part: ph10 |
Email local part: ph10 |
| 751 |
Email domain: cam.ac.uk |
Email domain: cam.ac.uk |
| 752 |
Last updated: 21 September 2007 |
Last updated: 13 April 2008 |