| 1 |
Compiling PCRE on non-Unix systems |
Compiling PCRE on non-Unix systems |
| 2 |
---------------------------------- |
---------------------------------- |
| 3 |
|
|
| 4 |
See below for comments on Cygwin or MinGW usage. |
See below for comments on Cygwin or MinGW usage. I (Philip Hazel) have no |
| 5 |
|
knowledge of Windows sytems and how their libraries work. The items in the |
| 6 |
If you want to compile PCRE for a non-Unix system, note that it consists |
PCRE Makefile that relate to anything other than Unix-like systems have been |
| 7 |
entirely of code written in Standard C, and so should compile successfully |
contributed by PCRE users. There are some other comments and files in the |
| 8 |
on any machine with a Standard C compiler and library, using normal compiling |
Contrib directory on the ftp site that you may find useful. |
| 9 |
commands to do the following: |
|
| 10 |
|
The following are generic comments about building PCRE: |
| 11 |
|
|
| 12 |
|
If you want to compile PCRE for a non-Unix system (or perhaps, more strictly, |
| 13 |
|
for a system that does not support "configure" and make files), note that PCRE |
| 14 |
|
consists entirely of code written in Standard C, and so should compile |
| 15 |
|
successfully on any machine with a Standard C compiler and library, using |
| 16 |
|
normal compiling commands to do the following: |
| 17 |
|
|
| 18 |
(1) Copy or rename the file config.in as config.h, and change the macros that |
(1) Copy or rename the file config.in as config.h, and change the macros that |
| 19 |
define HAVE_STRERROR and HAVE_MEMMOVE to define them as 1 rather than 0. |
define HAVE_STRERROR and HAVE_MEMMOVE to define them as 1 rather than 0. |
| 28 |
configure.in. |
configure.in. |
| 29 |
|
|
| 30 |
(3) Compile dftables.c as a stand-alone program, and then run it with |
(3) Compile dftables.c as a stand-alone program, and then run it with |
| 31 |
the standard output sent to chartables.c. This generates a set of standard |
the single argument "chartables.c". This generates a set of standard |
| 32 |
character tables. |
character tables and writes them to that file. |
| 33 |
|
|
| 34 |
(4) Compile maketables.c, get.c, study.c and pcre.c and link them all |
(4) Compile maketables.c, get.c, study.c and pcre.c and link them all |
| 35 |
together into an object library in whichever form your system keeps such |
together into an object library in whichever form your system keeps such |
| 36 |
libraries. This is the pcre library (chartables.c is included by means of an |
libraries. This is the pcre library (chartables.c is included by means of an |
| 37 |
#include directive). |
#include directive). If your system has static and shared libraries, you may |
| 38 |
|
have to do this once for each type. |
| 39 |
|
|
| 40 |
(5) Similarly, compile pcreposix.c and link it as the pcreposix library. |
(5) Similarly, compile pcreposix.c and link it (on its own) as the pcreposix |
| 41 |
|
library. |
| 42 |
|
|
| 43 |
(6) Compile the test program pcretest.c. This needs the functions in the |
(6) Compile the test program pcretest.c. This needs the functions in the |
| 44 |
pcre and pcreposix libraries when linking. |
pcre and pcreposix libraries when linking. |
| 88 |
were contributed before Fred Cox's changes were made, so it is possible that |
were contributed before Fred Cox's changes were made, so it is possible that |
| 89 |
they may no longer be relevant. |
they may no longer be relevant. |
| 90 |
|
|
| 91 |
The documentation for Win32 builds is a bit shy. Under MSVC6 I |
"The documentation for Win32 builds is a bit shy. Under MSVC6 I |
| 92 |
followed their instructions to the letter, but there were still |
followed their instructions to the letter, but there were still |
| 93 |
some things missing. |
some things missing. |
| 94 |
|
|
| 98 |
|
|
| 99 |
(2) Missing some #ifdefs relating to the function pointers |
(2) Missing some #ifdefs relating to the function pointers |
| 100 |
pcre_malloc and pcre_free. See my solution below. (The stubs |
pcre_malloc and pcre_free. See my solution below. (The stubs |
| 101 |
may not be mandatory but they made me feel better.) |
may not be mandatory but they made me feel better.)" |
| 102 |
|
|
| 103 |
========================= |
========================= |
| 104 |
#ifdef _WIN32 |
#ifdef _WIN32 |