/[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 93 by nigel, Sat Feb 24 21:41:42 2007 UTC revision 128 by ph10, Tue Mar 20 11:46:50 2007 UTC
# Line 1  Line 1 
1  Compiling PCRE on non-Unix systems  Compiling PCRE on non-Unix systems
2  ----------------------------------  ----------------------------------
3    
4  See below for comments on Cygwin or MinGW and OpenVMS usage. I (Philip Hazel)  I (Philip Hazel) have no knowledge of Windows or VMS sytems and how their
5  have no knowledge of Windows or VMS sytems and how their libraries work. The  libraries work. The items in the PCRE distribution and Makefile that relate to
6  items in the PCRE Makefile that relate to anything other than Unix-like systems  anything other than Unix-like systems are untested by me.
7  have been contributed by PCRE users. There are some other comments and files in  
8  the Contrib directory on the ftp site that you may find useful. See  There are some other comments and files in the Contrib directory on the ftp
9    site that you may find useful. See
10    
11    ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/Contrib    ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/Contrib
12    
# Line 18  library. The C++ wrapper functions are a Line 19  library. The C++ wrapper functions are a
19    
20  GENERIC INSTRUCTIONS FOR THE C LIBRARY  GENERIC INSTRUCTIONS FOR THE C LIBRARY
21    
22  The following are generic comments about building PCRE. The interspersed  The following are generic comments about building the PCRE C library "by hand".
 indented commands are suggestions from Mark Tetrode as to which commands you  
 might use on a Windows system to build a static library.  
   
 (1) Copy or rename the file config.h.in as config.h, and change the macros that  
 define HAVE_STRERROR and HAVE_MEMMOVE to define them as 1 rather than 0.  
 Unfortunately, because of the way Unix autoconf works, the default setting has  
 to be 0. You may also want to make changes to other macros in config.h. In  
 particular, if you want to force a specific value for newline, you can define  
 the NEWLINE macro. The default is to use '\n', thereby using whatever value  
 your compiler gives to '\n'.  
   
   rem Mark Tetrode's commands  
   copy config.h.in config.h  
   rem Use write, because notepad cannot handle UNIX files. Change values.  
   write config.h  
   
 (2) Compile dftables.c as a stand-alone program, and then run it with  
 the single argument "pcre_chartables.c". This generates a set of standard  
 character tables and writes them to that file.  
   
   rem Mark Tetrode's commands  
   rem Compile & run  
   cl -DSUPPORT_UTF8 -DSUPPORT_UCP dftables.c  
   dftables.exe pcre_chartables.c  
   
 (3) Compile the following source files:  
   
   pcre_chartables.c  
   pcre_compile.c  
   pcre_config.c  
   pcre_dfa_exec.c  
   pcre_exec.c  
   pcre_fullinfo.c  
   pcre_get.c  
   pcre_globals.c  
   pcre_info.c  
   pcre_maketables.c  
   pcre_newline.c  
   pcre_ord2utf8.c  
   pcre_refcount.c  
   pcre_study.c  
   pcre_tables.c  
   pcre_try_flipped.c  
   pcre_ucp_searchfuncs.c  
   pcre_valid_utf8.c  
   pcre_version.c  
   pcre_xclass.c  
   
 and link them all together into an object library in whichever form your system  
 keeps such libraries. This is the pcre C library. If your system has static and  
 shared libraries, you may have to do this once for each type.  
   
   rem These comments are out-of-date, referring to a previous release which  
   rem had fewer source files. Replace with the file names from above.  
   rem Mark Tetrode's commands, for a static library  
   rem Compile & lib  
   cl -DSUPPORT_UTF8 -DSUPPORT_UCP -DPOSIX_MALLOC_THRESHOLD=10 /c maketables.c get.c study.c pcre.c  
   lib /OUT:pcre.lib maketables.obj get.obj study.obj pcre.obj  
   
 (4) Similarly, compile pcreposix.c and link it (on its own) as the pcreposix  
 library.  
   
   rem Mark Tetrode's commands, for a static library  
   rem Compile & lib  
   cl -DSUPPORT_UTF8 -DSUPPORT_UCP -DPOSIX_MALLOC_THRESHOLD=10 /c pcreposix.c  
   lib /OUT:pcreposix.lib pcreposix.obj  
   
 (5) Compile the test program pcretest.c. This needs the functions in the  
 pcre and pcreposix libraries when linking.  
   
   rem Mark Tetrode's commands  
   rem compile & link  
   cl /F0x400000 pcretest.c pcre.lib pcreposix.lib  
   
 (6) Run pcretest on the testinput files in the testdata directory, and check  
 that the output matches the corresponding testoutput files. Note that the  
 supplied files are in Unix format, with just LF characters as line terminators.  
 You may need to edit them to change this if your system uses a different  
 convention.  
   
   rem Mark Tetrode's commands  
   pcretest testdata\testinput1 testdata\myoutput1  
   windiff testdata\testoutput1 testdata\myoutput1  
   pcretest -i testdata\testinput2 testdata\myoutput2  
   windiff testdata\testoutput2 testdata\myoutput2  
   pcretest testdata\testinput3 testdata\myoutput3  
   windiff testdata\testoutput3 testdata\myoutput3  
   pcretest testdata\testinput4 testdata\myoutput4  
   windiff testdata\testoutput4 testdata\myoutput4  
   pcretest testdata\testinput5 testdata\myoutput5  
   windiff testdata\testoutput5 testdata\myoutput5  
   pcretest testdata\testinput6 testdata\myoutput6  
   windiff testdata\testoutput6 testdata\myoutput6  
23    
24  Note that there are now three more tests (7, 8, 9) that did not exist when Mark  (1) Copy or rename the file config.h.generic as config.h, and edit the macro
25  wrote those comments. The test the new pcre_dfa_exec() function.      settings that it contains to whatever is appropriate for your environment.
26        In particular, if you want to force a specific value for newline, you can
27        define the NEWLINE macro.
28    
29        An alternative approach is not to edit config.h, but to use -D on the
30        compiler command line to make any changes that you need.
31    
32    (2) Copy or rename the file pcre.h.generic as pcre.h.
33    
34    (3) EITHER:
35          Copy or rename file pcre_chartables.c.dist as pcre_chartables.c.
36    
37        OR:
38          Compile dftables.c as a stand-alone program, and then run it with the
39          single argument "pcre_chartables.c". This generates a set of standard
40          character tables and writes them to that file. The tables are generated
41          using the default C locale for your system. If you want to use a locale
42          that is specified by LC_xxx environment variables, add the -L option to
43          the dftables command. You must use this method if you are building on
44          a system that uses EBCDIC code.
45    
46        The tables in pcre_chartables.c are defaults. The caller of PCRE can
47        specify alternative tables at run time.
48    
49    (4) Compile the following source files:
50    
51          pcre_chartables.c
52          pcre_compile.c
53          pcre_config.c
54          pcre_dfa_exec.c
55          pcre_exec.c
56          pcre_fullinfo.c
57          pcre_get.c
58          pcre_globals.c
59          pcre_info.c
60          pcre_maketables.c
61          pcre_newline.c
62          pcre_ord2utf8.c
63          pcre_refcount.c
64          pcre_study.c
65          pcre_tables.c
66          pcre_try_flipped.c
67          pcre_ucp_searchfuncs.c
68          pcre_valid_utf8.c
69          pcre_version.c
70          pcre_xclass.c
71    
72        Now link them all together into an object library in whichever form your
73        system keeps such libraries. This is the basic PCRE C library. If your
74        system has static and shared libraries, you may have to do this once for
75        each type.
76    
77    (5) Similarly, compile pcreposix.c and link it (on its own) as the pcreposix
78        library.
79    
80    (6) Compile the test program pcretest.c. This needs the functions in the
81        pcre and pcreposix libraries when linking.
82    
83    (7) Run pcretest on the testinput files in the testdata directory, and check
84        that the output matches the corresponding testoutput files. Note that the
85        supplied files are in Unix format, with just LF characters as line
86        terminators. You may need to edit them to change this if your system uses a
87        different convention.
88    
89  (7) If you want to use the pcregrep command, compile and link pcregrep.c; it  (8) If you want to use the pcregrep command, compile and link pcregrep.c; it
90  uses only the basic PCRE library.      uses only the basic PCRE library (it does not need the pcreposix library).
91    
92    
93  THE C++ WRAPPER FUNCTIONS  THE C++ WRAPPER FUNCTIONS
94    
95  The PCRE distribution now contains some C++ wrapper functions and tests,  The PCRE distribution also contains some C++ wrapper functions and tests,
96  contributed by Google Inc. On a system that can use "configure" and "make",  contributed by Google Inc. On a system that can use "configure" and "make",
97  the functions are automatically built into a library called pcrecpp. It should  the functions are automatically built into a library called pcrecpp. It should
98  be straightforward to compile the .cc files manually on other systems. The  be straightforward to compile the .cc files manually on other systems. The
# Line 130  files called xxx_unittest.cc are test pr Line 100  files called xxx_unittest.cc are test pr
100  xxx.cc files.  xxx.cc files.
101    
102    
103  FURTHER REMARKS  BUILDING FOR VIRTUAL PASCAL
104    
105    A script for building PCRE using Borland's C++ compiler for use with VPASCAL
106    was contributed by Alexander Tokarev. Stefan Weber updated the script and added
107    additional files. The following files in the distribution are for building PCRE
108    for use with VP/Borland: makevp-compile.txt, makevp-linklib.txt, makevp.bat,
109    pcregexp.pas.
110    
111  If you have a system without "configure" but where you can use a Makefile, edit  
112  Makefile.in to create Makefile, substituting suitable values for the variables  BUILDING UNDER WINDOWS WITH BCC5.5
 at the head of the file.  
113    
114  Michael Roy sent these comments about building PCRE under Windows with BCC5.5:  Michael Roy sent these comments about building PCRE under Windows with BCC5.5:
115    
# Line 147  Michael Roy sent these comments about bu Line 122  Michael Roy sent these comments about bu
122    the libraries cw32.lib, cw32i.lib, cw32mt.lib, and cw32mti.lib on the command    the libraries cw32.lib, cw32i.lib, cw32mt.lib, and cw32mti.lib on the command
123    line.    line.
124    
125    
126    OUT-OF-DATE COMMENTS ABOUT WIN32 BUILDS
127    
128    [These comments need looking at by someone who knows about Windows.]
129    
130  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
131  contributed by Paul Sokolovsky. These environments are Mingw32  contributed by Paul Sokolovsky. These environments are Mingw32
132  (http://www.xraylith.wisc.edu/~khan/software/gnu-win32/) and CygWin  (http://www.xraylith.wisc.edu/~khan/software/gnu-win32/) and CygWin
# Line 175  Changes to do MinGW with autoconf 2.50 w Line 155  Changes to do MinGW with autoconf 2.50 w
155  characters as line terminators. You will have to edit them to change to CR LF  characters as line terminators. You will have to edit them to change to CR LF
156  terminators.  terminators.
157    
 A script for building PCRE using Borland's C++ compiler for use with VPASCAL  
 was contributed by Alexander Tokarev. It is called makevp.bat.  
   
158  These are some further comments about Win32 builds from Mark Evans. They  These are some further comments about Win32 builds from Mark Evans. They
159  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
160  they may no longer be relevant.  they may no longer be relevant.
# Line 278  $!   Locale could not be set to fr Line 255  $!   Locale could not be set to fr
255  $!  $!
256  =========================  =========================
257    
258    Last Updated: 20 March 2007
259  ****  ****

Legend:
Removed from v.93  
changed lines
  Added in v.128

  ViewVC Help
Powered by ViewVC 1.1.5