Blame NON-AUTOTOOLS-BUILD

Packit Service 02e2fd
Building PCRE2 without using autotools
Packit Service 02e2fd
--------------------------------------
Packit Service 02e2fd
Packit Service 02e2fd
This document contains the following sections:
Packit Service 02e2fd
Packit Service 02e2fd
  General
Packit Service 02e2fd
  Generic instructions for the PCRE2 C library
Packit Service 02e2fd
  Stack size in Windows environments
Packit Service 02e2fd
  Linking programs in Windows environments
Packit Service 02e2fd
  Calling conventions in Windows environments
Packit Service 02e2fd
  Comments about Win32 builds
Packit Service 02e2fd
  Building PCRE2 on Windows with CMake
Packit Service 02e2fd
  Building PCRE2 on Windows with Visual Studio
Packit Service 02e2fd
  Testing with RunTest.bat
Packit Service 02e2fd
  Building PCRE2 on native z/OS and z/VM
Packit Service 02e2fd
Packit Service 02e2fd
Packit Service 02e2fd
GENERAL
Packit Service 02e2fd
Packit Service 02e2fd
The basic PCRE2 library consists entirely of code written in Standard C, and so
Packit Service 02e2fd
should compile successfully on any system that has a Standard C compiler and
Packit Service 02e2fd
library.
Packit Service 02e2fd
Packit Service 02e2fd
The PCRE2 distribution includes a "configure" file for use by the
Packit Service 02e2fd
configure/make (autotools) build system, as found in many Unix-like
Packit Service 02e2fd
environments. The README file contains information about the options for
Packit Service 02e2fd
"configure".
Packit Service 02e2fd
Packit Service 02e2fd
There is also support for CMake, which some users prefer, especially in Windows
Packit Service 02e2fd
environments, though it can also be run in Unix-like environments. See the
Packit Service 02e2fd
section entitled "Building PCRE2 on Windows with CMake" below.
Packit Service 02e2fd
Packit Service 02e2fd
Versions of src/config.h and src/pcre2.h are distributed in the PCRE2 tarballs
Packit Service 02e2fd
under the names src/config.h.generic and src/pcre2.h.generic. These are
Packit Service 02e2fd
provided for those who build PCRE2 without using "configure" or CMake. If you
Packit Service 02e2fd
use "configure" or CMake, the .generic versions are not used.
Packit Service 02e2fd
Packit Service 02e2fd
Packit Service 02e2fd
GENERIC INSTRUCTIONS FOR THE PCRE2 C LIBRARY
Packit Service 02e2fd
Packit Service 02e2fd
The following are generic instructions for building the PCRE2 C library "by
Packit Service 02e2fd
hand". If you are going to use CMake, this section does not apply to you; you
Packit Service 02e2fd
can skip ahead to the CMake section.
Packit Service 02e2fd
Packit Service 02e2fd
 (1) Copy or rename the file src/config.h.generic as src/config.h, and edit the
Packit Service 02e2fd
     macro settings that it contains to whatever is appropriate for your
Packit Service 02e2fd
     environment. In particular, you can alter the definition of the NEWLINE
Packit Service 02e2fd
     macro to specify what character(s) you want to be interpreted as line
Packit Service 02e2fd
     terminators by default.
Packit Service 02e2fd
Packit Service 02e2fd
     When you compile any of the PCRE2 modules, you must specify
Packit Service 02e2fd
     -DHAVE_CONFIG_H to your compiler so that src/config.h is included in the
Packit Service 02e2fd
     sources.
Packit Service 02e2fd
Packit Service 02e2fd
     An alternative approach is not to edit src/config.h, but to use -D on the
Packit Service 02e2fd
     compiler command line to make any changes that you need to the
Packit Service 02e2fd
     configuration options. In this case -DHAVE_CONFIG_H must not be set.
Packit Service 02e2fd
Packit Service 02e2fd
     NOTE: There have been occasions when the way in which certain parameters
Packit Service 02e2fd
     in src/config.h are used has changed between releases. (In the
Packit Service 02e2fd
     configure/make world, this is handled automatically.) When upgrading to a
Packit Service 02e2fd
     new release, you are strongly advised to review src/config.h.generic
Packit Service 02e2fd
     before re-using what you had previously.
Packit Service 02e2fd
Packit Service 02e2fd
 (2) Copy or rename the file src/pcre2.h.generic as src/pcre2.h.
Packit Service 02e2fd
Packit Service 02e2fd
 (3) EITHER:
Packit Service 02e2fd
       Copy or rename file src/pcre2_chartables.c.dist as
Packit Service 02e2fd
       src/pcre2_chartables.c.
Packit Service 02e2fd
Packit Service 02e2fd
     OR:
Packit Service 02e2fd
       Compile src/dftables.c as a stand-alone program (using -DHAVE_CONFIG_H
Packit Service 02e2fd
       if you have set up src/config.h), and then run it with the single
Packit Service 02e2fd
       argument "src/pcre2_chartables.c". This generates a set of standard
Packit Service 02e2fd
       character tables and writes them to that file. The tables are generated
Packit Service 02e2fd
       using the default C locale for your system. If you want to use a locale
Packit Service 02e2fd
       that is specified by LC_xxx environment variables, add the -L option to
Packit Service 02e2fd
       the dftables command. You must use this method if you are building on a
Packit Service 02e2fd
       system that uses EBCDIC code.
Packit Service 02e2fd
Packit Service 02e2fd
     The tables in src/pcre2_chartables.c are defaults. The caller of PCRE2 can
Packit Service 02e2fd
     specify alternative tables at run time.
Packit Service 02e2fd
Packit Service 02e2fd
 (4) For an 8-bit library, compile the following source files from the src
Packit Service 02e2fd
     directory, setting -DPCRE2_CODE_UNIT_WIDTH=8 as a compiler option. Also
Packit Service 02e2fd
     set -DHAVE_CONFIG_H if you have set up src/config.h with your
Packit Service 02e2fd
     configuration, or else use other -D settings to change the configuration
Packit Service 02e2fd
     as required.
Packit Service 02e2fd
Packit Service 02e2fd
       pcre2_auto_possess.c
Packit Service 02e2fd
       pcre2_chartables.c
Packit Service 02e2fd
       pcre2_compile.c
Packit Service 02e2fd
       pcre2_config.c
Packit Service 02e2fd
       pcre2_context.c
Packit Service 02e2fd
       pcre2_convert.c
Packit Service 02e2fd
       pcre2_dfa_match.c
Packit Service 02e2fd
       pcre2_error.c
Packit Service 02e2fd
       pcre2_extuni.c
Packit Service 02e2fd
       pcre2_find_bracket.c
Packit Service 02e2fd
       pcre2_jit_compile.c
Packit Service 02e2fd
       pcre2_maketables.c
Packit Service 02e2fd
       pcre2_match.c
Packit Service 02e2fd
       pcre2_match_data.c
Packit Service 02e2fd
       pcre2_newline.c
Packit Service 02e2fd
       pcre2_ord2utf.c
Packit Service 02e2fd
       pcre2_pattern_info.c
Packit Service 02e2fd
       pcre2_serialize.c
Packit Service 02e2fd
       pcre2_string_utils.c
Packit Service 02e2fd
       pcre2_study.c
Packit Service 02e2fd
       pcre2_substitute.c
Packit Service 02e2fd
       pcre2_substring.c
Packit Service 02e2fd
       pcre2_tables.c
Packit Service 02e2fd
       pcre2_ucd.c
Packit Service 02e2fd
       pcre2_valid_utf.c
Packit Service 02e2fd
       pcre2_xclass.c
Packit Service 02e2fd
Packit Service 02e2fd
     Make sure that you include -I. in the compiler command (or equivalent for
Packit Service 02e2fd
     an unusual compiler) so that all included PCRE2 header files are first
Packit Service 02e2fd
     sought in the src directory under the current directory. Otherwise you run
Packit Service 02e2fd
     the risk of picking up a previously-installed file from somewhere else.
Packit Service 02e2fd
Packit Service 02e2fd
     Note that you must compile pcre2_jit_compile.c, even if you have not
Packit Service 02e2fd
     defined SUPPORT_JIT in src/config.h, because when JIT support is not
Packit Service 02e2fd
     configured, dummy functions are compiled. When JIT support IS configured,
Packit Service 02e2fd
     pcre2_jit_compile.c #includes other files from the sljit subdirectory,
Packit Service 02e2fd
     all of whose names begin with "sljit". It also #includes
Packit Service 02e2fd
     src/pcre2_jit_match.c and src/pcre2_jit_misc.c, so you should not compile
Packit Service 02e2fd
     these yourself.
Packit Service 02e2fd
Packit Service 02e2fd
     Note also that the pcre2_fuzzsupport.c file contains special code that is
Packit Service 02e2fd
     useful to those who want to run fuzzing tests on the PCRE2 library. Unless
Packit Service 02e2fd
     you are doing that, you can ignore it.
Packit Service 02e2fd
Packit Service 02e2fd
 (5) Now link all the compiled code into an object library in whichever form
Packit Service 02e2fd
     your system keeps such libraries. This is the basic PCRE2 C 8-bit library.
Packit Service 02e2fd
     If your system has static and shared libraries, you may have to do this
Packit Service 02e2fd
     once for each type.
Packit Service 02e2fd
Packit Service 02e2fd
 (6) If you want to build a 16-bit library or 32-bit library (as well as, or
Packit Service 02e2fd
     instead of the 8-bit library) just supply 16 or 32 as the value of
Packit Service 02e2fd
     -DPCRE2_CODE_UNIT_WIDTH when you are compiling.
Packit Service 02e2fd
Packit Service 02e2fd
 (7) If you want to build the POSIX wrapper functions (which apply only to the
Packit Service 02e2fd
     8-bit library), ensure that you have the src/pcre2posix.h file and then
Packit Service 02e2fd
     compile src/pcre2posix.c. Link the result (on its own) as the pcre2posix
Packit Service 02e2fd
     library.
Packit Service 02e2fd
Packit Service 02e2fd
 (8) The pcre2test program can be linked with any combination of the 8-bit,
Packit Service 02e2fd
     16-bit and 32-bit libraries (depending on what you selected in
Packit Service 02e2fd
     src/config.h). Compile src/pcre2test.c; don't forget -DHAVE_CONFIG_H if
Packit Service 02e2fd
     necessary, but do NOT define PCRE2_CODE_UNIT_WIDTH. Then link with the
Packit Service 02e2fd
     appropriate library/ies. If you compiled an 8-bit library, pcre2test also
Packit Service 02e2fd
     needs the pcre2posix wrapper library.
Packit Service 02e2fd
Packit Service 02e2fd
 (9) Run pcre2test on the testinput files in the testdata directory, and check
Packit Service 02e2fd
     that the output matches the corresponding testoutput files. There are
Packit Service 02e2fd
     comments about what each test does in the section entitled "Testing PCRE2"
Packit Service 02e2fd
     in the README file. If you compiled more than one of the 8-bit, 16-bit and
Packit Service 02e2fd
     32-bit libraries, you need to run pcre2test with the -16 option to do
Packit Service 02e2fd
     16-bit tests and with the -32 option to do 32-bit tests.
Packit Service 02e2fd
Packit Service 02e2fd
     Some tests are relevant only when certain build-time options are selected.
Packit Service 02e2fd
     For example, test 4 is for Unicode support, and will not run if you have
Packit Service 02e2fd
     built PCRE2 without it. See the comments at the start of each testinput
Packit Service 02e2fd
     file. If you have a suitable Unix-like shell, the RunTest script will run
Packit Service 02e2fd
     the appropriate tests for you. The command "RunTest list" will output a
Packit Service 02e2fd
     list of all the tests.
Packit Service 02e2fd
Packit Service 02e2fd
     Note that the supplied files are in Unix format, with just LF characters
Packit Service 02e2fd
     as line terminators. You may need to edit them to change this if your
Packit Service 02e2fd
     system uses a different convention.
Packit Service 02e2fd
Packit Service 02e2fd
(10) If you have built PCRE2 with SUPPORT_JIT, the JIT features can be tested
Packit Service 02e2fd
     by running pcre2test with the -jit option. This is done automatically by
Packit Service 02e2fd
     the RunTest script. You might also like to build and run the freestanding
Packit Service 02e2fd
     JIT test program, src/pcre2_jit_test.c.
Packit Service 02e2fd
Packit Service 02e2fd
(11) If you want to use the pcre2grep command, compile and link
Packit Service 02e2fd
     src/pcre2grep.c; it uses only the basic 8-bit PCRE2 library (it does not
Packit Service 02e2fd
     need the pcre2posix library). If you have built the PCRE2 library with JIT
Packit Service 02e2fd
     support by defining SUPPORT_JIT in src/config.h, you can also define
Packit Service 02e2fd
     SUPPORT_PCRE2GREP_JIT, which causes pcre2grep to make use of JIT (unless
Packit Service 02e2fd
     it is run with --no-jit). If you define SUPPORT_PCRE2GREP_JIT without
Packit Service 02e2fd
     defining SUPPORT_JIT, pcre2grep does not try to make use of JIT.
Packit Service 02e2fd
Packit Service 02e2fd
Packit Service 02e2fd
STACK SIZE IN WINDOWS ENVIRONMENTS
Packit Service 02e2fd
Packit Service 02e2fd
Prior to release 10.30 the default system stack size of 1MiB in some Windows
Packit Service 02e2fd
environments caused issues with some tests. This should no longer be the case
Packit Service 02e2fd
for 10.30 and later releases.
Packit Service 02e2fd
Packit Service 02e2fd
Packit Service 02e2fd
LINKING PROGRAMS IN WINDOWS ENVIRONMENTS
Packit Service 02e2fd
Packit Service 02e2fd
If you want to statically link a program against a PCRE2 library in the form of
Packit Service 02e2fd
a non-dll .a file, you must define PCRE2_STATIC before including src/pcre2.h.
Packit Service 02e2fd
Packit Service 02e2fd
Packit Service 02e2fd
CALLING CONVENTIONS IN WINDOWS ENVIRONMENTS
Packit Service 02e2fd
Packit Service 02e2fd
It is possible to compile programs to use different calling conventions using
Packit Service 02e2fd
MSVC. Search the web for "calling conventions" for more information. To make it
Packit Service 02e2fd
easier to change the calling convention for the exported functions in the
Packit Service 02e2fd
PCRE2 library, the macro PCRE2_CALL_CONVENTION is present in all the external
Packit Service 02e2fd
definitions. It can be set externally when compiling (e.g. in CFLAGS). If it is
Packit Service 02e2fd
not set, it defaults to empty; the default calling convention is then used
Packit Service 02e2fd
(which is what is wanted most of the time).
Packit Service 02e2fd
Packit Service 02e2fd
Packit Service 02e2fd
COMMENTS ABOUT WIN32 BUILDS (see also "BUILDING PCRE2 ON WINDOWS WITH CMAKE")
Packit Service 02e2fd
Packit Service 02e2fd
There are two ways of building PCRE2 using the "configure, make, make install"
Packit Service 02e2fd
paradigm on Windows systems: using MinGW or using Cygwin. These are not at all
Packit Service 02e2fd
the same thing; they are completely different from each other. There is also
Packit Service 02e2fd
support for building using CMake, which some users find a more straightforward
Packit Service 02e2fd
way of building PCRE2 under Windows.
Packit Service 02e2fd
Packit Service 02e2fd
The MinGW home page (http://www.mingw.org/) says this:
Packit Service 02e2fd
Packit Service 02e2fd
  MinGW: A collection of freely available and freely distributable Windows
Packit Service 02e2fd
  specific header files and import libraries combined with GNU toolsets that
Packit Service 02e2fd
  allow one to produce native Windows programs that do not rely on any
Packit Service 02e2fd
  3rd-party C runtime DLLs.
Packit Service 02e2fd
Packit Service 02e2fd
The Cygwin home page (http://www.cygwin.com/) says this:
Packit Service 02e2fd
Packit Service 02e2fd
  Cygwin is a Linux-like environment for Windows. It consists of two parts:
Packit Service 02e2fd
Packit Service 02e2fd
  . A DLL (cygwin1.dll) which acts as a Linux API emulation layer providing
Packit Service 02e2fd
    substantial Linux API functionality
Packit Service 02e2fd
Packit Service 02e2fd
  . A collection of tools which provide Linux look and feel.
Packit Service 02e2fd
Packit Service 02e2fd
On both MinGW and Cygwin, PCRE2 should build correctly using:
Packit Service 02e2fd
Packit Service 02e2fd
  ./configure && make && make install
Packit Service 02e2fd
Packit Service 02e2fd
This should create two libraries called libpcre2-8 and libpcre2-posix. These
Packit Service 02e2fd
are independent libraries: when you link with libpcre2-posix you must also link
Packit Service 02e2fd
with libpcre2-8, which contains the basic functions.
Packit Service 02e2fd
Packit Service 02e2fd
Using Cygwin's compiler generates libraries and executables that depend on
Packit Service 02e2fd
cygwin1.dll. If a library that is generated this way is distributed,
Packit Service 02e2fd
cygwin1.dll has to be distributed as well. Since cygwin1.dll is under the GPL
Packit Service 02e2fd
licence, this forces not only PCRE2 to be under the GPL, but also the entire
Packit Service 02e2fd
application. A distributor who wants to keep their own code proprietary must
Packit Service 02e2fd
purchase an appropriate Cygwin licence.
Packit Service 02e2fd
Packit Service 02e2fd
MinGW has no such restrictions. The MinGW compiler generates a library or
Packit Service 02e2fd
executable that can run standalone on Windows without any third party dll or
Packit Service 02e2fd
licensing issues.
Packit Service 02e2fd
Packit Service 02e2fd
But there is more complication:
Packit Service 02e2fd
Packit Service 02e2fd
If a Cygwin user uses the -mno-cygwin Cygwin gcc flag, what that really does is
Packit Service 02e2fd
to tell Cygwin's gcc to use the MinGW gcc. Cygwin's gcc is only acting as a
Packit Service 02e2fd
front end to MinGW's gcc (if you install Cygwin's gcc, you get both Cygwin's
Packit Service 02e2fd
gcc and MinGW's gcc). So, a user can:
Packit Service 02e2fd
Packit Service 02e2fd
. Build native binaries by using MinGW or by getting Cygwin and using
Packit Service 02e2fd
  -mno-cygwin.
Packit Service 02e2fd
Packit Service 02e2fd
. Build binaries that depend on cygwin1.dll by using Cygwin with the normal
Packit Service 02e2fd
  compiler flags.
Packit Service 02e2fd
Packit Service 02e2fd
The test files that are supplied with PCRE2 are in UNIX format, with LF
Packit Service 02e2fd
characters as line terminators. Unless your PCRE2 library uses a default
Packit Service 02e2fd
newline option that includes LF as a valid newline, it may be necessary to
Packit Service 02e2fd
change the line terminators in the test files to get some of the tests to work.
Packit Service 02e2fd
Packit Service 02e2fd
Packit Service 02e2fd
BUILDING PCRE2 ON WINDOWS WITH CMAKE
Packit Service 02e2fd
Packit Service 02e2fd
CMake is an alternative configuration facility that can be used instead of
Packit Service 02e2fd
"configure". CMake creates project files (make files, solution files, etc.)
Packit Service 02e2fd
tailored to numerous development environments, including Visual Studio,
Packit Service 02e2fd
Borland, Msys, MinGW, NMake, and Unix. If possible, use short paths with no
Packit Service 02e2fd
spaces in the names for your CMake installation and your PCRE2 source and build
Packit Service 02e2fd
directories.
Packit Service 02e2fd
Packit Service 02e2fd
The following instructions were contributed by a PCRE1 user, but they should
Packit Service 02e2fd
also work for PCRE2. If they are not followed exactly, errors may occur. In the
Packit Service 02e2fd
event that errors do occur, it is recommended that you delete the CMake cache
Packit Service 02e2fd
before attempting to repeat the CMake build process. In the CMake GUI, the
Packit Service 02e2fd
cache can be deleted by selecting "File > Delete Cache".
Packit Service 02e2fd
Packit Service 02e2fd
1.  Install the latest CMake version available from http://www.cmake.org/, and
Packit Service 02e2fd
    ensure that cmake\bin is on your path.
Packit Service 02e2fd
Packit Service 02e2fd
2.  Unzip (retaining folder structure) the PCRE2 source tree into a source
Packit Service 02e2fd
    directory such as C:\pcre2. You should ensure your local date and time
Packit Service 02e2fd
    is not earlier than the file dates in your source dir if the release is
Packit Service 02e2fd
    very new.
Packit Service 02e2fd
Packit Service 02e2fd
3.  Create a new, empty build directory, preferably a subdirectory of the
Packit Service 02e2fd
    source dir. For example, C:\pcre2\pcre2-xx\build.
Packit Service 02e2fd
Packit Service 02e2fd
4.  Run cmake-gui from the Shell envirornment of your build tool, for example,
Packit Service 02e2fd
    Msys for Msys/MinGW or Visual Studio Command Prompt for VC/VC++. Do not try
Packit Service 02e2fd
    to start Cmake from the Windows Start menu, as this can lead to errors.
Packit Service 02e2fd
Packit Service 02e2fd
5.  Enter C:\pcre2\pcre2-xx and C:\pcre2\pcre2-xx\build for the source and
Packit Service 02e2fd
    build directories, respectively.
Packit Service 02e2fd
Packit Service 02e2fd
6.  Hit the "Configure" button.
Packit Service 02e2fd
Packit Service 02e2fd
7.  Select the particular IDE / build tool that you are using (Visual
Packit Service 02e2fd
    Studio, MSYS makefiles, MinGW makefiles, etc.)
Packit Service 02e2fd
Packit Service 02e2fd
8.  The GUI will then list several configuration options. This is where
Packit Service 02e2fd
    you can disable Unicode support or select other PCRE2 optional features.
Packit Service 02e2fd
Packit Service 02e2fd
9.  Hit "Configure" again. The adjacent "Generate" button should now be
Packit Service 02e2fd
    active.
Packit Service 02e2fd
Packit Service 02e2fd
10. Hit "Generate".
Packit Service 02e2fd
Packit Service 02e2fd
11. The build directory should now contain a usable build system, be it a
Packit Service 02e2fd
    solution file for Visual Studio, makefiles for MinGW, etc. Exit from
Packit Service 02e2fd
    cmake-gui and use the generated build system with your compiler or IDE.
Packit Service 02e2fd
    E.g., for MinGW you can run "make", or for Visual Studio, open the PCRE2
Packit Service 02e2fd
    solution, select the desired configuration (Debug, or Release, etc.) and
Packit Service 02e2fd
    build the ALL_BUILD project.
Packit Service 02e2fd
Packit Service 02e2fd
12. If during configuration with cmake-gui you've elected to build the test
Packit Service 02e2fd
    programs, you can execute them by building the test project. E.g., for
Packit Service 02e2fd
    MinGW: "make test"; for Visual Studio build the RUN_TESTS project. The
Packit Service 02e2fd
    most recent build configuration is targeted by the tests. A summary of
Packit Service 02e2fd
    test results is presented. Complete test output is subsequently
Packit Service 02e2fd
    available for review in Testing\Temporary under your build dir.
Packit Service 02e2fd
Packit Service 02e2fd
Packit Service 02e2fd
BUILDING PCRE2 ON WINDOWS WITH VISUAL STUDIO
Packit Service 02e2fd
Packit Service 02e2fd
The code currently cannot be compiled without a stdint.h header, which is
Packit Service 02e2fd
available only in relatively recent versions of Visual Studio. However, this
Packit Service 02e2fd
portable and permissively-licensed implementation of the header worked without
Packit Service 02e2fd
issue:
Packit Service 02e2fd
Packit Service 02e2fd
  http://www.azillionmonkeys.com/qed/pstdint.h
Packit Service 02e2fd
Packit Service 02e2fd
Just rename it and drop it into the top level of the build tree.
Packit Service 02e2fd
Packit Service 02e2fd
Packit Service 02e2fd
TESTING WITH RUNTEST.BAT
Packit Service 02e2fd
Packit Service 02e2fd
If configured with CMake, building the test project ("make test" or building
Packit Service 02e2fd
ALL_TESTS in Visual Studio) creates (and runs) pcre2_test.bat (and depending
Packit Service 02e2fd
on your configuration options, possibly other test programs) in the build
Packit Service 02e2fd
directory. The pcre2_test.bat script runs RunTest.bat with correct source and
Packit Service 02e2fd
exe paths.
Packit Service 02e2fd
Packit Service 02e2fd
For manual testing with RunTest.bat, provided the build dir is a subdirectory
Packit Service 02e2fd
of the source directory: Open command shell window. Chdir to the location
Packit Service 02e2fd
of your pcre2test.exe and pcre2grep.exe programs. Call RunTest.bat with
Packit Service 02e2fd
"..\RunTest.Bat" or "..\..\RunTest.bat" as appropriate.
Packit Service 02e2fd
Packit Service 02e2fd
To run only a particular test with RunTest.Bat provide a test number argument.
Packit Service 02e2fd
Packit Service 02e2fd
Otherwise:
Packit Service 02e2fd
Packit Service 02e2fd
1. Copy RunTest.bat into the directory where pcre2test.exe and pcre2grep.exe
Packit Service 02e2fd
   have been created.
Packit Service 02e2fd
Packit Service 02e2fd
2. Edit RunTest.bat to indentify the full or relative location of
Packit Service 02e2fd
   the pcre2 source (wherein which the testdata folder resides), e.g.:
Packit Service 02e2fd
Packit Service 02e2fd
   set srcdir=C:\pcre2\pcre2-10.00
Packit Service 02e2fd
Packit Service 02e2fd
3. In a Windows command environment, chdir to the location of your bat and
Packit Service 02e2fd
   exe programs.
Packit Service 02e2fd
Packit Service 02e2fd
4. Run RunTest.bat. Test outputs will automatically be compared to expected
Packit Service 02e2fd
   results, and discrepancies will be identified in the console output.
Packit Service 02e2fd
Packit Service 02e2fd
To independently test the just-in-time compiler, run pcre2_jit_test.exe.
Packit Service 02e2fd
Packit Service 02e2fd
Packit Service 02e2fd
BUILDING PCRE2 ON NATIVE Z/OS AND Z/VM
Packit Service 02e2fd
Packit Service 02e2fd
z/OS and z/VM are operating systems for mainframe computers, produced by IBM.
Packit Service 02e2fd
The character code used is EBCDIC, not ASCII or Unicode. In z/OS, UNIX APIs and
Packit Service 02e2fd
applications can be supported through UNIX System Services, and in such an
Packit Service 02e2fd
environment it should be possible to build PCRE2 in the same way as in other
Packit Service 02e2fd
systems, with the EBCDIC related configuration settings, but it is not known if
Packit Service 02e2fd
anybody has tried this.
Packit Service 02e2fd
Packit Service 02e2fd
In native z/OS (without UNIX System Services) and in z/VM, special ports are
Packit Service 02e2fd
required. For details, please see file 939 on this web site:
Packit Service 02e2fd
Packit Service 02e2fd
  http://www.cbttape.org
Packit Service 02e2fd
Packit Service 02e2fd
Everything in that location, source and executable, is in EBCDIC and native
Packit Service 02e2fd
z/OS file formats. The port provides an API for LE languages such as COBOL and
Packit Service 02e2fd
for the z/OS and z/VM versions of the Rexx languages.
Packit Service 02e2fd
Packit Service 02e2fd
===========================
Packit Service 02e2fd
Last Updated: 19 April 2018
Packit Service 02e2fd
===========================