Does the zlib shipped MacOS 12.2.1 have debug logging capability?

I see that MacOS 12.2.1 ships in its dynamic libraries cache the zlib 1.2.11 version. The zlib library has the ability to log messages (at runtime) if it was configured during compilation with the --debug/-d option[1] (which internally sets the ZLIB_DEBUG compiler flag).

How does one go about finding the config options that were used to build this system library (or any system library for that matter that's shipped in MacOS)? Is the current one shipped enabled for this option?

[1] https://github.com/madler/zlib/blob/v1.2.11/configure#L139

[2] https://github.com/madler/zlib/blob/v1.2.11/configure#L202

I found some snippet in an unrelated forum/question where someone had shown how to find the compiler flags at runtime that were passed to zlib. This is a zlib specific API and looks something like:

zlibCompileFlags();

The API is here https://github.com/madler/zlib/blob/cacf7f1d4e3d44d871b605da3b647f07d718623f/zlib.h#L1174. This can then be combined with flags of your choice (the flags are noted in the doc of that API). So in my case I added something like:

printf("compiler flags %lu\n", zlibCompileFlags());
if ((zlibCompileFlags() & (1 << 9))) {
    printf("Compiled with ASMV or ASMINF, uses ASM code\n");
} else {
    printf("No ASM code\n");
}
if ((zlibCompileFlags() & (1 << 8))) {
    printf("Compiled with ZLIB_DEBUG\n");
} else {
    printf("No ZLIB_DEBUG\n");
}
if ((zlibCompileFlags() & (1 << 10))) {
    printf("Compiled with ZLIB_WINAPI\n");
} else {
    printf("No ZLIB_WINAPI\n");
}

to verify the flags of my interest. The output of that code against MacOS 12.2.1 shows that the ZLIB_DEBUG wasn't enabled while building this library. So essentially, I won't be seeing any logging output from this library at runtime.

Having said that, this is a very "intrusive" way since I had to write some C code and link it against this zlib library to invoke this API and get the output.

It would help if there was a way to just know what set of commands and options were used to build this zlib library that's shipped in MacOS. Anyone has any ideas?

Does the zlib shipped MacOS 12.2.1 have debug logging capability?
 
 
Q