Repository: mesos
Updated Branches:
  refs/heads/master 4edf475f2 -> 6e2dae154


Add configure flag to enable SSL.

Review: https://reviews.apache.org/r/28763


Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/bd6e2f98
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/bd6e2f98
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/bd6e2f98

Branch: refs/heads/master
Commit: bd6e2f98ff77bbda71f35c91e319f37df3982fcd
Parents: 4edf475
Author: Joris Van Remoortere <[email protected]>
Authored: Sun Jun 14 03:09:39 2015 -0700
Committer: Benjamin Hindman <[email protected]>
Committed: Sun Jun 14 03:09:39 2015 -0700

----------------------------------------------------------------------
 3rdparty/libprocess/configure.ac | 67 ++++++++++++++++++++++++++++++-----
 1 file changed, 58 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/bd6e2f98/3rdparty/libprocess/configure.ac
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/configure.ac b/3rdparty/libprocess/configure.ac
index 710490b..de260d3 100644
--- a/3rdparty/libprocess/configure.ac
+++ b/3rdparty/libprocess/configure.ac
@@ -76,6 +76,12 @@ AC_ARG_ENABLE([libevent],
                              [use libevent instead of libev default: no]),
               [enable_libevent=yes], [])
 
+AC_ARG_ENABLE([ssl],
+              AS_HELP_STRING([--enable-ssl],
+                             [use ssl for libprocess communication
+                             default: no]),
+              [enable_ssl=yes], [])
+
 AC_ARG_WITH([boost],
             AS_HELP_STRING([--with-boost@<:@=DIR@:>@],
                            [excludes building and using the bundled Boost
@@ -575,40 +581,83 @@ fi
 
 AM_CONDITIONAL([ENABLE_LIBEVENT], [test x"$enable_libevent" = "xyes"])
 
+AM_CONDITIONAL([ENABLE_SSL], [test x"$enable_ssl" = "xyes"])
+
 if test "x$enable_libevent" = "xyes"; then
   AC_CHECK_HEADERS([event2/event.h],
                    [AC_CHECK_LIB([event],
                                  [event_base_new],
-                                 [found_libevent=yes],
+                                 [],
                                  [AC_MSG_ERROR([cannot find libevent
 -------------------------------------------------------------------
 libevent is required for libprocess to build.
 -------------------------------------------------------------------
-                          ])])], [AC_MSG_ERROR([cannot find libevent headers
+                                 ])])],
+                   [AC_MSG_ERROR([cannot find libevent headers
 -------------------------------------------------------------------
 libevent is required for libprocess to build.
 -------------------------------------------------------------------
   ])])
-  if test "x$found_libevent" = "xyes"; then
-    AC_DEFINE([USE_LIBEVENT], [1])
-  fi
+
   AC_CHECK_HEADERS([event2/thread.h],
                    [AC_CHECK_LIB([event_pthreads],
                                  [evthread_use_pthreads],
-                                 [found_libevent_thread=yes],
+                                 [],
                                  [AC_MSG_ERROR([cannot find libevent_pthreads
 -------------------------------------------------------------------
 libevent_pthreads is required for libprocess to build.
 -------------------------------------------------------------------
-                          ])],
-                                 [-levent])],
-                                 [AC_MSG_ERROR([cannot find libevent_pthreads 
headers
+                                 ])])],
+                   [AC_MSG_ERROR([cannot find libevent_pthreads headers
 -------------------------------------------------------------------
 libevent_pthreads is required for libprocess to build.
 -------------------------------------------------------------------
   ])])
 fi
 
+if test "x$enable_ssl" = "xyes"; then
+  AC_CHECK_HEADERS([openssl/ssl.h],
+                   [AC_CHECK_LIB([ssl],
+                                 [SSL_CTX_new],
+                                 [],
+                                 [AC_MSG_ERROR([cannot find libssl
+-------------------------------------------------------------------
+libssl is required for an SSL-enabled build.
+-------------------------------------------------------------------
+                                 ])])],
+                   [AC_MSG_ERROR([cannot find libssl headers
+-------------------------------------------------------------------
+libssl is required for an SSL-enabled build.
+-------------------------------------------------------------------
+  ])])
+
+  AC_CHECK_LIB([crypto], [RAND_poll], [], [AC_MSG_ERROR([cannot find libcrypto
+-------------------------------------------------------------------
+libcrypto is required for an SSL-enabled build.
+-------------------------------------------------------------------
+  ])])
+
+  if test "x$enable_libevent" = "xyes"; then
+    AC_CHECK_HEADERS([event2/bufferevent_ssl.h],
+                     [AC_CHECK_LIB([event_openssl],
+                                   [bufferevent_openssl_get_ssl],
+                                   [],
+                                   [AC_MSG_ERROR([cannot find libevent_openssl
+-------------------------------------------------------------------
+libevent_openssl is required for an SSL-enabled build.
+-------------------------------------------------------------------
+                                   ])])],
+                     [AC_MSG_ERROR([cannot find libevent_openssl headers
+-------------------------------------------------------------------
+libevent_openssl is required for an SSL-enabled build.
+-------------------------------------------------------------------
+    ])])
+  else
+    AC_MSG_ERROR([SSL is currently only supported with libevent])
+  fi
+  AC_DEFINE([USE_SSL_SOCKET], [1])
+fi
+
 AS_IF([test "x${ac_cv_env_CFLAGS_set}" = "x"],
       [CFLAGS="$debug_flags $optimize_flags"])
 AS_IF([test "x${ac_cv_env_CXXFLAGS_set}" = "x"],

Reply via email to