The -lm was missing in the pkgconfig file that was generated. This adds that similar to the CMake build system's output.
Signed-off-by: Tyler Erickson <tyler.erickson@seagate.com>
Signed-off-by: Sam James <sam@gentoo.org>
Fix includedir and libdir to have proper paths (not just relative ones
to prefix).
Using Meson's native pkgconfig module is the best way of doing this.
Signed-off-by: Sam James <sam@gentoo.org>
Tests will now be built at `meson test`-time, so there's no cost if the
user isn't going to run them.
This is better than guarding on build type, as distros may want to test production
builds before shipping.
Signed-off-by: Sam James <sam@gentoo.org>
This is more elegant as a meson feature option because feature options
propagate in a useful way to `dependency(..., required: ...)`.
Without this, the option was ignored. Wiring it up naively meant that
disabling it still searched for libbsd as well, so a feature option
is the best fit.
Also, mark it as a dependency of `arc4random`.
Signed-off-by: Sam James <sam@gentoo.org>
This commit fixes the install path for json-c headers when running `meson install`.
Previously some showed in /usr/include/ rather than /usr/include/json-c
This also adds generating the pkgconfig .pc file for this project.
Signed-off-by: Tyler Erickson <tyler.erickson@seagate.com>
Something in the configure stage goes wrong where it believe strncasecmp
is present but the header defining it is not. Work around this.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
That include line wasn't valid code, so that resulted in:
Checking for size of "size_t" : -1
And later on:
json-c/json_patch.c:28:2: error: #error Unable to determine size of size_t
All of these are effectively the same. No point in duplicating it
everywhere.
Remove prefix from has_function. Apparently having the prefix in there
changes behavior.
Also fix an error on MinGW where SSIZE_T_MAX is undefined.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
Adding meson build files for json-c that work similarly to the cmake build files.
Where it made sense, I reused existing cmake .h.in files or generated entirely from meson.
All tests were done with GCC and Clang in ubuntu 24.04, Windows using MSVC 2022 and Clang-cl from llvm's repo using version 21.1.3
Signed-off-by: Tyler Erickson <tyler.erickson@seagate.com>