/[pcre]/code/trunk/NON-UNIX-USE
ViewVC logotype

Diff of /code/trunk/NON-UNIX-USE

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 77 by nigel, Sat Feb 24 21:40:45 2007 UTC revision 96 by nigel, Fri Mar 2 13:10:43 2007 UTC
# Line 11  the Contrib directory on the ftp site th Line 11  the Contrib directory on the ftp site th
11    
12  If you want to compile PCRE for a non-Unix system (or perhaps, more strictly,  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  for a system that does not support "configure" and "make" files), note that
14  PCRE consists entirely of code written in Standard C, and so should compile  the basic PCRE library consists entirely of code written in Standard C, and so
15  successfully on any system that has a Standard C compiler and library.  should compile successfully on any system that has a Standard C compiler and
16    library. The C++ wrapper functions are a separate issue (see below).
17    
18    
19  GENERIC INSTRUCTIONS  GENERIC INSTRUCTIONS FOR THE C LIBRARY
20    
21  The following are generic comments about building PCRE. The interspersed  The following are generic comments about building PCRE. The interspersed
22  indented commands are suggestions from Mark Tetrode as to which commands you  indented commands are suggestions from Mark Tetrode as to which commands you
23  might use on a Windows system to build a static library.  might use on a Windows system to build a static library.
24    
25  (1) Copy or rename the file config.in as config.h, and change the macros that  (1) Copy or rename the file config.h.in as config.h, and change the macros that
26  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.
27  Unfortunately, because of the way Unix autoconf works, the default setting has  Unfortunately, because of the way Unix autoconf works, the default setting has
28  to be 0. You may also want to make changes to other macros in config.h. In  to be 0. You may also want to make changes to other macros in config.h. In
# Line 30  the NEWLINE macro. The default is to use Line 31  the NEWLINE macro. The default is to use
31  your compiler gives to '\n'.  your compiler gives to '\n'.
32    
33    rem Mark Tetrode's commands    rem Mark Tetrode's commands
34    copy config.in config.h    copy config.h.in config.h
35    rem Use write, because notepad cannot handle UNIX files. Change values.    rem Use write, because notepad cannot handle UNIX files. Change values.
36    write config.h    write config.h
37    
38  (2) Copy or rename the file pcre.in as pcre.h, and change the macro definitions  (2) Compile dftables.c as a stand-alone program, and then run it with
39  for PCRE_MAJOR, PCRE_MINOR, and PCRE_DATE near its start to the values set in  the single argument "pcre_chartables.c". This generates a set of standard
 configure.in.  
   
   rem Mark Tetrode's commands  
   copy pcre.in pcre.h  
   rem Read values from configure.in  
   write configure.in  
   rem Change values  
   write pcre.h  
   
 (3) Compile dftables.c as a stand-alone program, and then run it with  
 the single argument "chartables.c". This generates a set of standard  
40  character tables and writes them to that file.  character tables and writes them to that file.
41    
42    rem Mark Tetrode's commands    rem Mark Tetrode's commands
43    rem Compile & run    rem Compile & run
44    cl -DSUPPORT_UTF8 -DSUPPORT_UCP dftables.c    cl -DSUPPORT_UTF8 -DSUPPORT_UCP dftables.c
45    dftables.exe chartables.c    dftables.exe pcre_chartables.c
46    
47  (4) Compile maketables.c, get.c, study.c and pcre.c and link them all  (3) Compile the following source files:
 together into an object library in whichever form your system keeps such  
 libraries. This is the pcre library (chartables.c is included by means of an  
 #include directive). If your system has static and shared libraries, you may  
 have to do this once for each type.  
48    
49      pcre_chartables.c
50      pcre_compile.c
51      pcre_config.c
52      pcre_dfa_exec.c
53      pcre_exec.c
54      pcre_fullinfo.c
55      pcre_get.c
56      pcre_globals.c
57      pcre_info.c
58      pcre_maketables.c
59      pcre_newline.c
60      pcre_ord2utf8.c
61      pcre_refcount.c
62      pcre_study.c
63      pcre_tables.c
64      pcre_try_flipped.c
65      pcre_ucp_searchfuncs.c
66      pcre_valid_utf8.c
67      pcre_version.c
68      pcre_xclass.c
69    
70    and link them all together into an object library in whichever form your system
71    keeps such libraries. This is the pcre C library. If your system has static and
72    shared libraries, you may have to do this once for each type.
73    
74      rem These comments are out-of-date, referring to a previous release which
75      rem had fewer source files. Replace with the file names from above.
76    rem Mark Tetrode's commands, for a static library    rem Mark Tetrode's commands, for a static library
77    rem Compile & lib    rem Compile & lib
78    cl -DSUPPORT_UTF8 -DSUPPORT_UCP -DPOSIX_MALLOC_THRESHOLD=10 /c maketables.c get.c study.c pcre.c    cl -DSUPPORT_UTF8 -DSUPPORT_UCP -DPOSIX_MALLOC_THRESHOLD=10 /c maketables.c get.c study.c pcre.c
79    lib /OUT:pcre.lib maketables.obj get.obj study.obj pcre.obj    lib /OUT:pcre.lib maketables.obj get.obj study.obj pcre.obj
80    
81  (5) Similarly, compile pcreposix.c and link it (on its own) as the pcreposix  (4) Similarly, compile pcreposix.c and link it (on its own) as the pcreposix
82  library.  library.
83    
84    rem Mark Tetrode's commands, for a static library    rem Mark Tetrode's commands, for a static library
# Line 73  library. Line 86  library.
86    cl -DSUPPORT_UTF8 -DSUPPORT_UCP -DPOSIX_MALLOC_THRESHOLD=10 /c pcreposix.c    cl -DSUPPORT_UTF8 -DSUPPORT_UCP -DPOSIX_MALLOC_THRESHOLD=10 /c pcreposix.c
87    lib /OUT:pcreposix.lib pcreposix.obj    lib /OUT:pcreposix.lib pcreposix.obj
88    
89  (6) Compile the test program pcretest.c. This needs the functions in the  (5) Compile the test program pcretest.c. This needs the functions in the
90  pcre and pcreposix libraries when linking.  pcre and pcreposix libraries when linking.
91    
92    rem Mark Tetrode's commands    rem Mark Tetrode's commands
93    rem compile & link    rem compile & link
94    cl /F0x400000 pcretest.c pcre.lib pcreposix.lib    cl /F0x400000 pcretest.c pcre.lib pcreposix.lib
95    
96  (7) Run pcretest on the testinput files in the testdata directory, and check  (6) Run pcretest on the testinput files in the testdata directory, and check
97  that the output matches the corresponding testoutput files. You must use the  that the output matches the corresponding testoutput files. Note that the
98  -i option when checking testinput2. Note that the supplied files are in Unix  supplied files are in Unix format, with just LF characters as line terminators.
99  format, with just LF characters as line terminators. You may need to edit them  You may need to edit them to change this if your system uses a different
100  to change this if your system uses a different convention.  convention.
101    
102    rem Mark Tetrode's commands    rem Mark Tetrode's commands
103    pcretest testdata\testinput1 testdata\myoutput1    pcretest testdata\testinput1 testdata\myoutput1
# Line 100  to change this if your system uses a dif Line 113  to change this if your system uses a dif
113    pcretest testdata\testinput6 testdata\myoutput6    pcretest testdata\testinput6 testdata\myoutput6
114    windiff testdata\testoutput6 testdata\myoutput6    windiff testdata\testoutput6 testdata\myoutput6
115    
116    Note that there are now three more tests (7, 8, 9) that did not exist when Mark
117    wrote those comments. The test the new pcre_dfa_exec() function.
118    
119    (7) If you want to use the pcregrep command, compile and link pcregrep.c; it
120    uses only the basic PCRE library.
121    
122    
123    THE C++ WRAPPER FUNCTIONS
124    
125    The PCRE distribution now contains some C++ wrapper functions and tests,
126    contributed by Google Inc. On a system that can use "configure" and "make",
127    the functions are automatically built into a library called pcrecpp. It should
128    be straightforward to compile the .cc files manually on other systems. The
129    files called xxx_unittest.cc are test programs for each of the corresponding
130    xxx.cc files.
131    
132    
133  FURTHER REMARKS  FURTHER REMARKS
134    
# Line 107  If you have a system without "configure" Line 136  If you have a system without "configure"
136  Makefile.in to create Makefile, substituting suitable values for the variables  Makefile.in to create Makefile, substituting suitable values for the variables
137  at the head of the file.  at the head of the file.
138    
139    Michael Roy sent these comments about building PCRE under Windows with BCC5.5:
140    
141      Some of the core BCC libraries have a version of PCRE from 1998 built in,
142      which can lead to pcre_exec() giving an erroneous PCRE_ERROR_NULL from a
143      version mismatch. I'm including an easy workaround below, if you'd like to
144      include it in the non-unix instructions:
145    
146      When linking a project with BCC5.5, pcre.lib must be included before any of
147      the libraries cw32.lib, cw32i.lib, cw32mt.lib, and cw32mti.lib on the command
148      line.
149    
150  Some help in building a Win32 DLL of PCRE in GnuWin32 environments was  Some help in building a Win32 DLL of PCRE in GnuWin32 environments was
151  contributed by Paul Sokolovsky. These environments are Mingw32  contributed by Paul Sokolovsky. These environments are Mingw32
152  (http://www.xraylith.wisc.edu/~khan/software/gnu-win32/) and CygWin  (http://www.xraylith.wisc.edu/~khan/software/gnu-win32/) and CygWin
# Line 176  void (*pcre_free)(void *) = free; Line 216  void (*pcre_free)(void *) = free;
216    
217  BUILDING PCRE ON OPENVMS  BUILDING PCRE ON OPENVMS
218    
219  Dan Mooney sent the following comments about building PCRE on OpenVMS:  Dan Mooney sent the following comments about building PCRE on OpenVMS. They
220    relate to an older version of PCRE that used fewer source files, so the exact
221    commands will need changing. See the current list of source files above.
222    
223  "It was quite easy to compile and link the library. I don't have a formal  "It was quite easy to compile and link the library. I don't have a formal
224  make file but the attached file [reproduced below] contains the OpenVMS DCL  make file but the attached file [reproduced below] contains the OpenVMS DCL

Legend:
Removed from v.77  
changed lines
  Added in v.96

webmaster@exim.org
ViewVC Help
Powered by ViewVC 1.1.12