]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
m4: Detect OpenSSL version 1.0.2
authorAki Tuomi <aki.tuomi@dovecot.fi>
Mon, 28 Nov 2016 11:32:16 +0000 (13:32 +0200)
committerTimo Sirainen <timo.sirainen@dovecot.fi>
Tue, 29 Nov 2016 12:46:34 +0000 (14:46 +0200)
valgrind cannot work in all cases if openssl
version is 1.0.2, so we need to know this to
selectively disable valgrind.

configure.ac

index 64e61c454c072b8cdd7016e068e4e4eac19cfedc..9a6f27b3eeb289b5d283276cc3222fd19ac1be5c 100644 (file)
@@ -1706,6 +1706,17 @@ if test $want_openssl != no && test $have_ssl = no; then
     have_ssl="yes (OpenSSL)"
     build_dcrypt_openssl="no"
 
+    AC_MSG_CHECKING([if OpenSSL version is 1.0.2 or better])
+
+    AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+      #include <openssl/opensslv.h>
+      #if OPENSSL_VERSION_NUMBER < 0x10002000L
+      #error "fail-compile"
+      #endif]], [[ return 0; ]])], [ssl_version_ge_102=true], [ssl_version_ge_102=false])
+    AC_MSG_RESULT([$ssl_version_ge_102])
+
+    AM_CONDITIONAL([SSL_VERSION_GE_102], [test x$ssl_version_ge_102 = xtrue])
+
     # SSL_clear_options introduced in openssl 0.9.8m but may be backported to
     # older versions in "enterprise" OS releases; originally implemented as a
     # macro but as a function in more recent openssl versions