]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
Update SSL support a bit. 8106/head
authorMarcus Watts <mwatts@redhat.com>
Fri, 25 Mar 2016 10:11:34 +0000 (06:11 -0400)
committerMarcus Watts <mwatts@redhat.com>
Fri, 25 Mar 2016 10:18:56 +0000 (06:18 -0400)
Use cmake's FindOpenSSL.  Actually use the library definitions that
come out of it.  Also use the include path.  If SSL is disabled,
then build without any of this.  The result will be a version
of civetweb that includes openssl support using dlopen() - ie,
what we used to do.  This is probably a bit silly, and I hope
nobody actually expects to use it that way, but it's mostly harmless.

Signed-off-by: Marcus Watts <mwatts@redhat.com>
CMakeLists.txt
cmake/modules/FindOpenSSL.cmake [deleted file]
src/CMakeLists.txt

index 0ae5530c1435acd524c7c2305a28ae00d6aa057a..bb9e28b67116fa3c59521482d33e88ddaadc63cc 100644 (file)
@@ -145,8 +145,11 @@ endif(${WITH_OPENLDAP})
 option(WITH_OPENSSL "OPENSSL is here" ON)
 if(${WITH_OPENSSL})
 find_package(OpenSSL REQUIRED)
-set(HAVE_OPENSSL ${OPENSSL_FOUND})
-message(STATUS "${OPENSSL_LIBS}")
+set(HAVE_OPENSSL ON)
+#message(STATUS "${OPENSSL_LIBRARIES}")
+else(${WITH_OPENSSL})
+set(HAVE_OPENSSL OFF)
+set(OPENSSL_LIBRARIES)
 endif(${WITH_OPENSSL})
 
 option(WITH_FUSE "Fuse is here" ON)
diff --git a/cmake/modules/FindOpenSSL.cmake b/cmake/modules/FindOpenSSL.cmake
deleted file mode 100644 (file)
index 517e1f6..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-# - Find OpenSSL Header and Libraries
-#
-# OPENSSL_PREFIX - where to find ssl.h and libraries
-# OPENSSL_FOUND - True if found.
-
-set(OPENSSL_LIB_DIR "${OPENSSL_PREFIX}/lib")
-
-find_path(OPENSSL_INCLUDE_DIR ssl/ssl.h NO_DEFAULT_PATH PATHS
-  /usr/include
-  /opt/local/include
-  /usr/local/include
-  "${OPENSSL_PREFIX}/include"
-  )
-
-find_library(LIBSSL NAMES ssl)
-
-if (OPENSSL_INCLUDE_DIR AND LIBSSL)
-  set(OPENSSL_FOUND TRUE)
-else (OPENSSL_INCLUDE_DIR AND LIBSSL)
-  set(OPENSSL_FOUND FALSE)
-endif (OPENSSL_INCLUDE_DIR AND LIBSSL)
-
-if (OPENSSL_FOUND)
-  message(STATUS "Found ldap: ${OPENSSL_INCLUDE_DIR}")
-else (OPENSSL_FOUND)
-  if (NOT OPENSSL_INCLUDE_DIR)
-    message(FATAL_ERROR "Missing required ssl/ssl.h (openssl-devel)")
-  else (NOT OPENSSL_INCLUDE_DIR)
-    message (FATAL_ERROR "Missing required OpenSSL libraries")
-  endif (NOT OPENSSL_INCLUDE_DIR)
-endif (OPENSSL_FOUND)
-
-set(OPENSSL_LIBS ${LIBSSL})
-
-mark_as_advanced(
-  OPENSSL_INCLUDE_DIR OPENSSL_LIB_DIR OPENSSL_LIBRARIES
-)
index 46f5bd14589150a0095098cdd1a5d07d3886800e..a032662776a731d23c1fa124bdbbdf4d09a3b0f1 100644 (file)
@@ -1203,8 +1203,13 @@ if(${WITH_RADOSGW})
   add_library(civetweb_common_objs OBJECT ${civetweb_common_files})
   target_include_directories(civetweb_common_objs PUBLIC
        "${CMAKE_SOURCE_DIR}/src/civetweb/include")
+  if(HAVE_OPENSSL)
   set_property(TARGET civetweb_common_objs
               APPEND PROPERTY COMPILE_DEFINITIONS NO_SSL_DL=1)
+  target_include_directories(civetweb_common_objs PUBLIC
+       "${OPENSSL_INCLUDE_DIR}")
+  else(HAVE_OPENSSL)
+  endif(HAVE_OPENSSL)
 
   add_library(rgw_a STATIC ${rgw_a_srcs})
   target_link_libraries(rgw_a librados cls_rgw_client cls_refcount_client
@@ -1267,7 +1272,7 @@ if(${WITH_RADOSGW})
     cls_rgw_client cls_lock_client cls_refcount_client
     cls_log_client cls_statelog_client cls_timeindex_client
     cls_version_client cls_replica_log_client cls_user_client
-    curl expat global fcgi resolv ssl crypto ${BLKID_LIBRARIES} ${OPENLDAP_LIBS}
+    curl expat global fcgi resolv ${OPENSSL_LIBRARIES} ${BLKID_LIBRARIES} ${OPENLDAP_LIBS}
     ${ALLOC_LIBS})
   install(TARGETS radosgw DESTINATION bin)
 
@@ -1276,7 +1281,7 @@ if(${WITH_RADOSGW})
     cls_rgw_client cls_lock_client cls_refcount_client
     cls_log_client cls_statelog_client cls_timeindex_client
     cls_version_client cls_replica_log_client cls_user_client
-    curl expat global fcgi resolv ssl crypto ${BLKID_LIBRARIES})
+    curl expat global fcgi resolv ${OPENSSL_LIBRARIES} ${BLKID_LIBRARIES})
 
   install(TARGETS radosgw-admin DESTINATION bin)