]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
configure.ac: Add SSL_CTX_set_min_proto_version detection
authorMartti Rannanjärvi <martti.rannanjarvi@dovecot.fi>
Thu, 30 Nov 2017 09:15:50 +0000 (11:15 +0200)
committerTimo Sirainen <timo.sirainen@dovecot.fi>
Mon, 19 Feb 2018 14:29:57 +0000 (16:29 +0200)
configure.ac

index dae6db948e19892e48158a4e2d498491788c6e4e..d22a2e094e977dfd47289b727c5382aa3be0efb4 100644 (file)
@@ -1771,6 +1771,25 @@ if test $want_openssl != no && test $have_ssl = no; then
       AC_DEFINE(HAVE_SSL_NEW_MEM_FUNCS,, [Define if CRYPTO_set_mem_functions has new style parameters])
     fi
 
+    # SSL_CTX_set_min_proto_version is also a macro so AC_CHECK_LIB fails here.
+    AC_CACHE_CHECK([whether SSL_CTX_set_min_proto_version exists],i_cv_have_ssl_ctx_set_min_proto_version,[
+      old_LIBS=$LIBS
+      LIBS="$LIBS -lssl"
+      AC_TRY_LINK([
+        #include <openssl/ssl.h>
+      ], [
+        SSL_CTX_set_min_proto_version((void*)0, 0);
+      ], [
+        i_cv_have_ssl_ctx_set_min_proto_version=yes
+      ], [
+        i_cv_have_ssl_ctx_set_min_proto_version=no
+      ])
+      LIBS=$old_LIBS
+    ])
+    if test $i_cv_have_ssl_ctx_set_min_proto_version = yes; then
+      AC_DEFINE(HAVE_SSL_CTX_SET_MIN_PROTO_VERSION,, [Define if you have SSL_CTX_set_min_proto_version])
+    fi
+
     AC_CHECK_LIB(ssl, ERR_remove_thread_state, [
       AC_DEFINE(HAVE_OPENSSL_ERR_REMOVE_THREAD_STATE,, [Define if you have ERR_remove_thread_state])
     ],, $SSL_LIBS)