Cannot compile mongo-c-driver-1.12.0 with libressl 2.6.5 (downstream bug https://bugs.gentoo.org/662654)
cmake -DENABLE_SSL=LIBRESSL . -- The C compiler identification is ;GNU 7.3.0 -- Check for working C compiler: /usr/bin/cc -- Check for working C compiler: /usr/bin/cc -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Detecting C compile features -- Detecting C compile features - done -- Using bundled libbson libbson version (from VERSION_CURRENT file): 1.12.0 -- Check if the system is big endian -- Searching 16 bit integer -- Looking for sys/types.h -- Looking for sys/types.h - found -- Looking for stdint.h -- Looking for stdint.h - found -- Looking for stddef.h -- Looking for stddef.h - found -- Check size of unsigned short -- Check size of unsigned short - done -- Using unsigned short -- Check if the system is big endian - little endian -- Looking for snprintf -- Looking for snprintf - found -- Looking for reallocf -- Looking for reallocf - not found -- Performing Test BSON_HAVE_TIMESPEC -- Performing Test BSON_HAVE_TIMESPEC - Success -- struct timespec found -- Looking for gmtime_r -- Looking for gmtime_r - found -- Looking for rand_r -- Looking for rand_r - found -- Looking for strings.h -- Looking for strings.h - found -- Looking for clock_gettime -- Looking for clock_gettime - found -- Looking for strnlen -- Looking for strnlen - found -- Looking for stdbool.h -- Looking for stdbool.h - found -- Looking for SYS_gettid -- Looking for SYS_gettid - found -- Looking for syscall -- Looking for syscall - found -- Performing Test HAVE_ATOMIC_32_ADD_AND_FETCH -- Performing Test HAVE_ATOMIC_32_ADD_AND_FETCH - Success -- Performing Test HAVE_ATOMIC_64_ADD_AND_FETCH -- Performing Test HAVE_ATOMIC_64_ADD_AND_FETCH - Success -- Looking for pthread.h -- Looking for pthread.h - found -- Looking for pthread_create -- Looking for pthread_create - not found -- Check if compiler accepts -pthread -- Check if compiler accepts -pthread - yes -- Found Threads: TRUE libmongoc version (from VERSION_CURRENT file): 1.12.0 -- Searching for zlib CMake packages -- Found ZLIB: /usr/lib/libz.so (found version "1.2.11") -- zlib found version "1.2.11" -- zlib include path "/usr/include" -- zlib libraries "/usr/lib/libz.so" -- Looking for include file unistd.h -- Looking for include file unistd.h - found -- Looking for include file stdarg.h -- Looking for include file stdarg.h - found -- Found PkgConfig: /usr/bin/pkg-config (found version "0.29.2") -- Searching for LibreSSL/libtls -- Checking for module 'libtls' -- Found libtls, version 2.6.5 -- Found tls CMake Error at src/libmongoc/CMakeLists.txt:112 (include_directories): include_directories given empty-string as include directory. -- Searching for sasl/sasl.h -- Not found (specify -DCMAKE_INCLUDE_PATH=/path/to/sasl/include for SASL support) -- Searching for libsasl2 -- Not found (specify -DCMAKE_LIBRARY_PATH=/path/to/sasl/lib for SASL support) -- Check size of socklen_t -- Check size of socklen_t - done -- Looking for res_nsearch -- Looking for res_nsearch - found -- Looking for res_ndestroy -- Looking for res_ndestroy - not found -- Looking for res_nclose -- Looking for res_nclose - found -- Looking for sched_getcpu -- Looking for sched_getcpu - not found -- Detected parameters: accept (int, struct sockaddr *, socklen_t *) -- Searching for compression library header snappy-c.h -- Found in /usr/include -- Searching for libsnappy -- Found /usr/lib/libsnappy.so -- No ICU library found, SASLPrep disabled for SCRAM-SHA-256 authentication. -- If ICU is installed in a non-standard directory, define ICU_ROOT as the ICU installation path. -- Compiling against LibreSSL -- SASL disabled -- Configuring incomplete, errors occurred! See also "/tmp/mongo-c-driver/mongo-c-driver-1.12.0/CMakeFiles/CMakeOutput.log". See also "/tmp/mongo-c-driver/mongo-c-driver-1.12.0/CMakeFiles/CMakeError.log".
Using the following patch it works
diff --git a/src/libmongoc/CMakeLists.txt b/src/libmongoc/CMakeLists.txt index d09d706..5d84225 100644 --- a/src/libmongoc/CMakeLists.txt +++ b/src/libmongoc/CMakeLists.txt @@ -109,7 +109,9 @@ if (NOT ENABLE_SSL STREQUAL OFF) if (LIBRESSL_FOUND) message ("-- Found ${LIBRESSL_LIBRARIES}") set (SSL_LIBRARIES ${LIBRESSL_LIBRARIES}) - include_directories ("${LIBRESSL_INCLUDE_DIRS}") + if (${LIBRESSL_INCLUDE_DIRS}) + include_directories ("${LIBRESSL_INCLUDE_DIRS}") + endif () link_directories ("${LIBRESSL_LIBRARY_DIRS}") set (LIBRESSL 1) else ()