calog/vendor/pcre2/NOTICE.calog

45 lines
2.5 KiB
Text
Vendored

PCRE2 (vendored into calog)
===========================
PCRE2, the Perl Compatible Regular Expressions library (10.x series) by Philip
Hazel and contributors (https://github.com/PCRE2Project/pcre2). calog builds the
8-bit library from source into vendor/pcre2/build/libpcre2-8.a as its regular-
expression backend, so the build is reproducible and depends on no system PCRE2.
Vendored from PCRE2 10.45 (release date 2025-02-05; the pristine upstream release
tarball, sha256 0e138387df7835d7403b8351e2226c1377da804e0737db0e071b48f07c9d12ee).
Unlike the object-rule deps (zlib, bzip2, ...), PCRE2's pcre2.h and config.h are
GENERATED by its build from pcre2.h.in / config.h.in (they bake in the version and
the feature configuration). So, like Tcl and XZ Utils, this is an out-of-tree CMake
build: the vendored source stays pristine and everything generated lands under
vendor/pcre2/build/ (which is .gitignore'd). The generated pcre2.h that a consumer
includes is therefore vendor/pcre2/build/pcre2.h, not a file in src/.
Build (static, 8-bit only, NO JIT), as done by the Makefile:
cmake -S vendor/pcre2 -B vendor/pcre2/build -DCMAKE_BUILD_TYPE=Release \
-DBUILD_SHARED_LIBS=OFF -DPCRE2_BUILD_PCRE2_8=ON -DPCRE2_BUILD_PCRE2_16=OFF \
-DPCRE2_BUILD_PCRE2_32=OFF -DPCRE2_SUPPORT_JIT=OFF -DPCRE2_BUILD_TESTS=OFF \
-DPCRE2_BUILD_PCRE2GREP=OFF
cmake --build vendor/pcre2/build --target pcre2-8-static
Only the 8-bit code-unit width is built; the 16- and 32-bit libraries are off. JIT
is OFF on purpose: the just-in-time compiler needs writable-then-executable memory
(W^X) that calog does not want. JIT is an optional feature the library fully works
without (the interpreted matcher is used). Because JIT is permanently off, the
just-in-time compiler's bundled sljit assembler (upstream deps/) is not needed and
was removed from the vendored subtree, so no executable-memory allocator code is
even present. A consumer selects the width by defining PCRE2_CODE_UNIT_WIDTH before
including the header:
#define PCRE2_CODE_UNIT_WIDTH 8
#include <pcre2.h> // compiled with -Ivendor/pcre2/build
Removed from the upstream subtree (not needed for a static, no-JIT, no-tests build):
deps/ (the JIT-only sljit assembler, per above), doc/ (documentation; install only),
and testdata/ (test corpus; tests are disabled). The autotools and CMake files are
kept, since calog builds via the pristine CMakeLists.
License: BSD-3-Clause WITH PCRE2-exception (permissive; the one exemption concerns
certain binary redistributions of the JIT, which is not built here). See LICENCE.md.