I'm not convinced my change to CMakeLists is the correct way to squelch
the json-c version error when building on a system with version
numbers greater than 0.12.1. 0.13.x+ is supposed to be backwards
compatible. Rest of the changes involve replacing int with size_t
where necessary to suppress -Werror=sign-compare on gcc 8.
The default max nesting depth of json-c is 32, which can cause some valid trees to fail to be parsed, so increase that. Also instead of segfaulting, just abort and print the error returned by json-c.
Increase _POSIX_SOURCE value where needed.
Increase _XOPEN_SOURCE value where needed.
Conditionally link to libcap (only on Linux).
Possibly some trailing whitespace fixes (automatic).