Both the Autoconf and CMake build systems are updated to detect linker support for symbol versioning.
Currently, Linux, Solaris, and FreeBSD are tested and working. Windows (COFF) and macOS (Mach-O) have no symbol versioning.
There is an Autoconf/CMake flag to opt out of the versioning behaviour.
Fixes to enable the code to build with a simple `CC=xlc ./configure --enable-ebcdic --disable-unicode`.
Fixes to the tests, so that `make check` passes on EBCDIC platforms.
Add a CI job to do z/OS testing.
Part of #651
* Use much stricter windows warnings (`/W3` rather than `/W1`). This requires quite a few fixes for all the sloppy places where we do implicit assignment of 64-bit values to 32-bit storage.
* Use and test CMake build & install on FreeBSD and Solaris
* Add 64 bit Solaris build (`cc -m64`) and fix existing Solaris warnings
* Make compile flags used in CI consistent across platforms. Previously Mac & Linux were building with different warning flags.
* Add `--enable-Werror` to `configure.ac`. This means that you can build with `-Werror` in a clean way. Previously, you had to hackily override the CPPFLAGS when calling `make` since you can't pass `-Werror` as a CFLAG into `./configure` (it messes with compiler feature detection).
Move them out from the public API header and improve detection
by making sure the code used wouldn't trigger false positives.
While at it, migrate two more opem coded assertions and avoid
use of -Werror on AIX with xlc as well as clear a warning
triggered in Windows since the original commit.
Assume that a compatible `-fvisibility=hidden` option is available
and that the compiler handles correctly `#warning` macros.
Restrict the visibility test if `-Werror` is unrealiable to protect
for compilers like xlc or systems like cygwin that might allow the
compiler flag without errors but wouldn't work.
While at it, lower the minimum autoconf required to the one that
introduced the latest macros and tested in OpenBSD 7.5 with automake
1.9.
Since a8a875e (windows: integrate visibility attributes without
conflicts (#249), 2023-05-16), PCRE2_EXPORT was meant to be
defined as an empty value for compilers that don't support
-fvisibility in *NIX, but a branch was left uncovered by mistake
resulting in compilation issues with propietary compilers in at
least Solaris and AIX.
define PCRE2_EXPORT even if the compiler is not GCC compatible.
When using a DLL in Windows, the function declarations (and definitions)
that are public are decorated with attributes but those declarations would
conflict with the ones that are selected when the compiler supports the
visibility feature.
Define instead a new macro that would be added to the corresponding
macros independently and while at it allow setting visibility with cmake.