Our Autotools build system's approach to providing zlib on systems where it is not already installed, is to vendor its source files, then build the library and install it in the system library path along with libmongoc at build time. This is eccentric, and makes problems for users who might install zlib themselves later on.
Let's completely vendor zlib into libmongoc if not provided by the system - compile its code into libmongoc with no link-time visible changes to programs that link to libmongoc.
Once this is done, don't set ZLIB_LIBRARIES to "-lz" when with_zlib=bundled in CheckZlib.m4.
It appears to me that the CMake build system already handles this correctly, so if we do CDRIVER-1349 then this problem might go away.
- is related to
-
CDRIVER-1349 Delete Autotools build system, use CMake only
- Closed
- related to
-
CDRIVER-2293 Add zlib and snappy linker flags if needed in CMake and pkg-config files
- Closed