Uploaded image for project: 'C Driver'
  1. C Driver
  2. CDRIVER-2585

Set include path with CMake for LibreSSL

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 1.10.0
    • Affects Version/s: None
    • Component/s: cmake, tls
    • Labels:
      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.

            Assignee:
            jesse@mongodb.com A. Jesse Jiryu Davis
            Reporter:
            jesse@mongodb.com A. Jesse Jiryu Davis
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: