summaryrefslogtreecommitdiffstats
path: root/ConfigureChecks.cmake
diff options
context:
space:
mode:
authorgregory guy <[email protected]>2020-06-05 15:35:30 +0200
committerMichele Calgaro <[email protected]>2020-06-06 18:15:42 +0900
commit879d11940771d832e987da215de9f0f396786a3f (patch)
tree0dfc1203b24de78dc4ed21333c85cd5604988e8e /ConfigureChecks.cmake
parent3d4cc752db088f4f692d7422a29b4c534add17e4 (diff)
downloadkasablanca-879d11940771d832e987da215de9f0f396786a3f.tar.gz
kasablanca-879d11940771d832e987da215de9f0f396786a3f.zip
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 <[email protected]> (cherry picked from commit 11c5062539a42b939727a3f0f8a6fbacc1b238be)
Diffstat (limited to 'ConfigureChecks.cmake')
-rw-r--r--ConfigureChecks.cmake29
1 files changed, 25 insertions, 4 deletions
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 )