Skip to content

Commit 783b5f8

Browse files
authored
Update docs for z/OS support
1 parent fc1b4f2 commit 783b5f8

File tree

5 files changed

+94
-34
lines changed

5 files changed

+94
-34
lines changed

NON-AUTOTOOLS-BUILD

Lines changed: 40 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ This document contains the following sections:
1212
Building PCRE2 on Windows with CMake
1313
Building PCRE2 on Windows with Visual Studio
1414
Testing with RunTest.bat
15-
Building PCRE2 on native z/OS and z/VM
15+
Building PCRE2 on z/OS and z/VM
1616
Building PCRE2 under VMS
1717

1818

@@ -419,23 +419,47 @@ Otherwise:
419419
To independently test the just-in-time compiler, run pcre2_jit_test.exe.
420420

421421

422-
Building PCRE2 on native z/OS and z/VM
423-
--------------------------------------
422+
Building PCRE2 on z/OS and z/VM
423+
-------------------------------
424424

425425
z/OS and z/VM are operating systems for mainframe computers, produced by IBM.
426426
The character code used is EBCDIC, not ASCII or Unicode. In z/OS, UNIX APIs and
427-
applications can be supported through UNIX System Services, and in such an
428-
environment it should be possible to build PCRE2 in the same way as in other
429-
systems, with the EBCDIC related configuration settings, but it is not known if
430-
anybody has tried this.
431-
432-
In native z/OS (without UNIX System Services) and in z/VM, special ports are
433-
required. For details, please see file 939 on this web site:
427+
applications can be supported through UNIX System Services.
428+
429+
The PCRE2 codebase compiles and runs with native EBCDIC support on modern z/OS
430+
systems, using the pre-installed tools (/bin/sh, ./configure, and the XLC or
431+
IBM-Clang compilers). PCRE2 supports z/OS using both Autoconf (./configure) and
432+
CMake (which IBM distributes via "zopen install cmake"). Any EBCDIC codepage
433+
should work (PCRE2 does not assume or require IBM-1047).
434+
435+
After unpacking the PCRE2 tarball, you must subsequently tag the files as ASCII
436+
in order for the z/OS shell and compiler to interpret them correctly:
437+
chtag -R -tc ISO8859-1 <directory>
438+
439+
Some unusual features on the IBM platform are:
440+
- The _ALL_SOURCE macro must be provided. Unlike on Linux or macOS, even quite
441+
standard POSIX APIs are not made visible by default. PCRE2's Autoconf and
442+
CMake system both provide this for you.
443+
- The `cc`, `c89`, and even `c99` compilers provided by IBM do not default to
444+
the same argument ordering as other Unix platforms.
445+
- The XLC compiler requires `-qhaltonmsg=CCN3296`, otherwise it will treat any
446+
preprocessor #include errors as a warning rather than an error. Needless to
447+
say this default wrecks Autoconf and CMake's feature-detection tests.
448+
PCRE2's build system is aware of this.
449+
- The test suite (in the testdata/ directory) is entirely in ASCII/UTF-8.
450+
When running the tests, you must ensure that the EBCDIC-native build of
451+
pcre2test receives an EBCDIC version of these files. The easiest way to
452+
achieve this is via filesystem tagging (chtag). Alternatively, you could
453+
manually re-encode the testdata files as EBCDIC, and tag them as EBCDIC.
454+
(Latin-1 and EBCDIC are one-to-one convertible encodings, a simple
455+
byte-by-byte permutation of the 256 values.)
456+
457+
In native z/OS (without UNIX System Services) and in z/VM, a user has provided a
458+
special port of PCRE2. For details, please see file 939 on this web site:
434459

435460
http://www.cbttape.org
436461

437-
Everything in that location, source and executable, is in EBCDIC and native
438-
z/OS file formats. The port provides an API for LE languages such as COBOL and
462+
The user-provided port also provides an API for LE languages such as COBOL and
439463
for the z/OS and z/VM versions of the Rexx languages.
440464

441465

@@ -447,6 +471,10 @@ OpenVMS. They are in the "vms" directory in the distribution tarball. Please
447471
read the file called vms/openvms_readme.txt. The pcre2test and pcre2grep
448472
programs contain some VMS-specific code.
449473

474+
This has not been tested for some time. The PCRE2 maintainers would be grateful
475+
to learn whether it still works (or if anyone still uses it).
476+
477+
450478
===========================
451479
Last updated: 24 March 2025
452480
===========================

README

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,15 +88,17 @@ Building PCRE2 on non-Unix-like systems
8888

8989
For a non-Unix-like system, please read the file NON-AUTOTOOLS-BUILD, though if
9090
your system supports the use of "configure" and "make" you may be able to build
91-
PCRE2 using autotools in the same way as for many Unix-like systems.
91+
PCRE2 using autotools in the same way as for many Unix-like systems. This file
92+
also contains useful information on building for some unusual Unix environments
93+
(such as EBCDIC mainframes).
9294

9395
PCRE2 can also be configured using CMake, which can be run in various ways
9496
(command line, GUI, etc). This creates Makefiles, solution files, etc. The file
9597
NON-AUTOTOOLS-BUILD has information about CMake.
9698

9799
PCRE2 has been compiled on many different operating systems. It should be
98-
straightforward to build PCRE2 on any system that has a Standard C compiler and
99-
library, because it uses only Standard C functions.
100+
straightforward to build PCRE2 on any system that has a C99 or later compiler
101+
and library.
100102

101103

102104
Building PCRE2 without using autotools

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ https://pcre2project.github.io/pcre2/
4040
<th align="left">Testing</th>
4141
<td>
4242

43-
[![Codecov](https://img.shields.io/codecov/c/github/PCRE2Project/pcre2?style=flat-square&logo=codecov&label=Coverage&color=009400)](https://app.codecov.io/gh/PCRE2Project/pcre2/components)&nbsp;
43+
[![Codecov](https://img.shields.io/codecov/c/github/PCRE2Project/pcre2?component=library&style=flat-square&logo=codecov&label=Coverage&color=009400)](https://app.codecov.io/gh/PCRE2Project/pcre2/components)&nbsp;
4444
[![Clang Sanitizers](https://img.shields.io/badge/Clang-Sanitizers-262D3A?style=flat-square&logo=llvm&color=006094)](https://github.com/PCRE2Project/pcre2/actions/workflows/dev.yml)&nbsp;
4545
[![Clang Static Analyzer](https://img.shields.io/badge/Clang-Static%20Analyzer-262D3A?style=flat-square&logo=llvm&color=006094)](https://github.com/PCRE2Project/pcre2/actions/workflows/clang-analyzer.yml)&nbsp;
4646
[![Valgrind](https://img.shields.io/badge/Valgrind-006094?style=flat-square)](https://github.com/PCRE2Project/pcre2/actions/workflows/dev.yml)&nbsp;
@@ -53,8 +53,8 @@ https://pcre2project.github.io/pcre2/
5353
</tr>
5454
<tr>
5555
<th align="left">Platforms</th>
56-
<td>Tested continuously on Linux, Windows, macOS, FreeBSD, Solaris;<br />
57-
x86, ARM, RISC-V, POWER, S390X; many others known to work
56+
<td>Tested continuously on Linux, Windows, macOS, FreeBSD, Solaris, z/OS;<br />
57+
x86, ARM, RISC-V, POWER, S390X; others known to work
5858
</td>
5959
</tr>
6060
</tbody>
@@ -238,7 +238,7 @@ PCRE2 is portable C code, and is likely to work on any system with a C99 compile
238238
<dl>
239239
<dt>Operating systems</dt>
240240
<dd>
241-
Our continuous integration tests on <strong>Linux</strong> (GCC and Clang, glibc and musl), <strong>Windows</strong> (MSVC and MinGW-x64), and <strong>macOS</strong> (Clang), as well as <strong>FreeBSD</strong>, and <strong>Solaris</strong> (Oracle Studio <code>cc</code>).
241+
Our continuous integration tests on <strong>Linux</strong> (GCC and Clang, glibc and musl), <strong>Windows</strong> (MSVC and MinGW-x64), and <strong>macOS</strong> (Clang), as well as <strong>FreeBSD</strong>, <strong>Solaris</strong> (Oracle Studio <code>cc</code>), and <strong>z/OS</strong> (<code>xlc</code> and <code>ibm-clang</code>).
242242
</dd>
243243
<dt>Processors</dt>
244244
<dd>

doc/html/NON-AUTOTOOLS-BUILD.txt

Lines changed: 40 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ This document contains the following sections:
1212
Building PCRE2 on Windows with CMake
1313
Building PCRE2 on Windows with Visual Studio
1414
Testing with RunTest.bat
15-
Building PCRE2 on native z/OS and z/VM
15+
Building PCRE2 on z/OS and z/VM
1616
Building PCRE2 under VMS
1717

1818

@@ -419,23 +419,47 @@ Otherwise:
419419
To independently test the just-in-time compiler, run pcre2_jit_test.exe.
420420

421421

422-
Building PCRE2 on native z/OS and z/VM
423-
--------------------------------------
422+
Building PCRE2 on z/OS and z/VM
423+
-------------------------------
424424

425425
z/OS and z/VM are operating systems for mainframe computers, produced by IBM.
426426
The character code used is EBCDIC, not ASCII or Unicode. In z/OS, UNIX APIs and
427-
applications can be supported through UNIX System Services, and in such an
428-
environment it should be possible to build PCRE2 in the same way as in other
429-
systems, with the EBCDIC related configuration settings, but it is not known if
430-
anybody has tried this.
431-
432-
In native z/OS (without UNIX System Services) and in z/VM, special ports are
433-
required. For details, please see file 939 on this web site:
427+
applications can be supported through UNIX System Services.
428+
429+
The PCRE2 codebase compiles and runs with native EBCDIC support on modern z/OS
430+
systems, using the pre-installed tools (/bin/sh, ./configure, and the XLC or
431+
IBM-Clang compilers). PCRE2 supports z/OS using both Autoconf (./configure) and
432+
CMake (which IBM distributes via "zopen install cmake"). Any EBCDIC codepage
433+
should work (PCRE2 does not assume or require IBM-1047).
434+
435+
After unpacking the PCRE2 tarball, you must subsequently tag the files as ASCII
436+
in order for the z/OS shell and compiler to interpret them correctly:
437+
chtag -R -tc ISO8859-1 <directory>
438+
439+
Some unusual features on the IBM platform are:
440+
- The _ALL_SOURCE macro must be provided. Unlike on Linux or macOS, even quite
441+
standard POSIX APIs are not made visible by default. PCRE2's Autoconf and
442+
CMake system both provide this for you.
443+
- The `cc`, `c89`, and even `c99` compilers provided by IBM do not default to
444+
the same argument ordering as other Unix platforms.
445+
- The XLC compiler requires `-qhaltonmsg=CCN3296`, otherwise it will treat any
446+
preprocessor #include errors as a warning rather than an error. Needless to
447+
say this default wrecks Autoconf and CMake's feature-detection tests.
448+
PCRE2's build system is aware of this.
449+
- The test suite (in the testdata/ directory) is entirely in ASCII/UTF-8.
450+
When running the tests, you must ensure that the EBCDIC-native build of
451+
pcre2test receives an EBCDIC version of these files. The easiest way to
452+
achieve this is via filesystem tagging (chtag). Alternatively, you could
453+
manually re-encode the testdata files as EBCDIC, and tag them as EBCDIC.
454+
(Latin-1 and EBCDIC are one-to-one convertible encodings, a simple
455+
byte-by-byte permutation of the 256 values.)
456+
457+
In native z/OS (without UNIX System Services) and in z/VM, a user has provided a
458+
special port of PCRE2. For details, please see file 939 on this web site:
434459

435460
http://www.cbttape.org
436461

437-
Everything in that location, source and executable, is in EBCDIC and native
438-
z/OS file formats. The port provides an API for LE languages such as COBOL and
462+
The user-provided port also provides an API for LE languages such as COBOL and
439463
for the z/OS and z/VM versions of the Rexx languages.
440464

441465

@@ -447,6 +471,10 @@ OpenVMS. They are in the "vms" directory in the distribution tarball. Please
447471
read the file called vms/openvms_readme.txt. The pcre2test and pcre2grep
448472
programs contain some VMS-specific code.
449473

474+
This has not been tested for some time. The PCRE2 maintainers would be grateful
475+
to learn whether it still works (or if anyone still uses it).
476+
477+
450478
===========================
451479
Last updated: 24 March 2025
452480
===========================

doc/html/README.txt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,15 +88,17 @@ Building PCRE2 on non-Unix-like systems
8888

8989
For a non-Unix-like system, please read the file NON-AUTOTOOLS-BUILD, though if
9090
your system supports the use of "configure" and "make" you may be able to build
91-
PCRE2 using autotools in the same way as for many Unix-like systems.
91+
PCRE2 using autotools in the same way as for many Unix-like systems. This file
92+
also contains useful information on building for some unusual Unix environments
93+
(such as EBCDIC mainframes).
9294

9395
PCRE2 can also be configured using CMake, which can be run in various ways
9496
(command line, GUI, etc). This creates Makefiles, solution files, etc. The file
9597
NON-AUTOTOOLS-BUILD has information about CMake.
9698

9799
PCRE2 has been compiled on many different operating systems. It should be
98-
straightforward to build PCRE2 on any system that has a Standard C compiler and
99-
library, because it uses only Standard C functions.
100+
straightforward to build PCRE2 on any system that has a C99 or later compiler
101+
and library.
100102

101103

102104
Building PCRE2 without using autotools

0 commit comments

Comments
 (0)