From 11c5062539a42b939727a3f0f8a6fbacc1b238be Mon Sep 17 00:00:00 2001 From: gregory guy Date: Fri, 5 Jun 2020 15:35:30 +0200 Subject: Drop automake build support. Add basic cmake build instructions. Delete empty file NEWS and rpm spec files. Better detection for OpenSSL headers and libraries. Write a README file. Rework of the help page. Some cosmetics. Signed-off-by: gregory guy --- ConfigureChecks.cmake | 29 +++++++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) (limited to 'ConfigureChecks.cmake') diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake index 09af851..213e8ba 100644 --- a/ConfigureChecks.cmake +++ b/ConfigureChecks.cmake @@ -27,7 +27,28 @@ endif( WITH_GCC_VISIBILITY ) ##### check for OpenSSL -find_package( OpenSSL ) -if( NOT OPENSSL_FOUND ) - tde_message_fatal( "SSL support is required but OpenSSL was not found on your system" ) -endif( NOT OPENSSL_FOUND ) +pkg_search_module( SSL openssl ) + +if( NOT SSL_FOUND ) + check_include_file( openssl/ssl.h HAVE_OPENSSL_H ) + check_library_exists( ssl OPENSSL_init_ssl "" HAVE_LIBSSL_11 ) + check_library_exists( crypto EVP_EncryptInit_ex "" HAVE_LIBCRYPTO ) + + if( NOT HAVE_LIBSSL_11 ) + check_library_exists( ssl SSL_library_init "" HAVE_LIBSSL ) + endif() + + if( HAVE_OPENSSL_H AND HAVE_LIBCRYPTO AND (HAVE_LIBSSL_11 OR HAVE_LIBSSL) ) + set( SSL_FOUND 1 CACHE INTERNAL "" FORCE ) + find_file( OPENSSLV_H openssl/opensslv.h ) + file( STRINGS "${OPENSSLV_H}" SSL_VERSION REGEX "#[ \t]*define[ \t]*OPENSSL_VERSION_TEXT" ) + string( REGEX REPLACE "# *define[ \t]*OPENSSL_VERSION_TEXT[ \t]*\"[^0-9 ]* *([^ ]*).*" "\\1" SSL_VERSION "${SSL_VERSION}" ) + set( SSL_VERSION "${SSL_VERSION}" CACHE INTERNAL "" FORCE ) + message( STATUS "Found OpenSSL: version ${SSL_VERSION}" ) + set( SSL_LIBRARIES "ssl;crypto" CACHE INTERNAL "ssl and crypto libs" FORCE ) + endif() +endif( NOT SSL_FOUND ) + +if( NOT SSL_FOUND ) + tde_message_fatal( "SSL support is required but OpenSSL was not found on your system" ) +endif( NOT SSL_FOUND ) -- cgit v1.2.1