-
Type: Improvement
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
None
The Autotools build system searches for LibreSSL using pkg-config. If the build system finds LibreSSL, it adds the library's include path to SSL_CFLAGS like so:
AS_IF([test "$enable_ssl" = "libressl"],[ PKG_CHECK_MODULES(SSL, [libtls], [enable_ssl=libressl], [ AC_CHECK_LIB([tls],[tls_init],[ SSL_LIBS="-ltls -lcrypto" enable_ssl=libressl ]) ]) ])
The call to PKG_CHECK_MODULES with the prefix string "SSL" means that LibreSSL's include path is added to SSL_CFLAGS, which is used later when building libmongoc.
CMake needs similar logic to ensure it adds LibreSSL's include path to libmongoc's include directories. Currently it only handles OpenSSL's include path. We should use CMake's pkg_check_modules to get LibreSSL's include path and library path using pkg-config, then fall back to the current behavior if pkg-config fails.