The code taken from rpmvercmp in pkg-config returns -1 if a is less than
b, 0 if a is equal to b, and 1 if a is greater than b. This matches the
expectations of the comparison operators that use this function.
However, the tilde handling, the NULL handling, and the docstring all do
the opposite.
This fixes the tilde handling, the NULL handling, and the docstring to
match the behavior of the rpmvercmp code and the expectations of the
comparison operators.
Given the following .pc fragment:
includedir=/mingw64/include
Cflags: -I${includedir} -I${includedir}/taglib
Should includedir be assigned the value 'C:/Program\ Files/Git/mingw64/include', the expansion of ${includedir} will be chopped off after the first space:
Cflags: -IC:/Program\
With this patch, the expansion is corrected:
Cflags: -IC:/Program\ Files/Git/mingw64/include -IC:/Program\ Files/Git/mingw64/include/taglib
Create spaces-in-paths.pc
otherwise a buffer overflow occurs.
this has been a bug in pkgconf since the beginning, it seems.
instead of disclosing the bug correctly, a "hotshot" developer
decided to blog about it instead. sigh.
https://nullprogram.com/blog/2023/01/18/
This allows tests to be autodetected gracefully, which is particularly
convenient for kyua and atf_sh which are fairly painful to build and
install by hand. Those who want to ensure tests are enabled or disabled
may pass `-Dtests=enabled` or `-Dtests=disabled` respectively.
This does require a modest bump in the required meson version to 0.49,
which was released at the end of 2018, so roughly 4 years ago.
It turns out there was already a check for PKG_CFLAGS being requested,
but the check was busted because PKG_CFLAGS is a combined-or of all of
the various --cflags flags.
Check that PKG_CFLAGS bits are set at all on want_flags instead.