diff --git a/configure.ac b/configure.ac index cee59ba5fec..1caab4d0630 100644 --- a/configure.ac +++ b/configure.ac @@ -1971,20 +1971,7 @@ libcrypto is required for an SSL-enabled build. if test "x$enable_libevent" = "xyes"; then if test "x$with_bundled_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 version 2+ is required for an SSL-enabled build. -------------------------------------------------------------------- - ])])], - [AC_MSG_ERROR([cannot find libevent_openssl headers -------------------------------------------------------------------- -libevent_openssl version 2+ headers are required for an SSL-enabled build. -------------------------------------------------------------------- - ])]) + MESOS_HAVE_LIBEVENT_SSL() fi else AC_MSG_ERROR([SSL is currently only supported with libevent]) diff --git a/m4/libevent.m4 b/m4/libevent.m4 index 35242a11f71..0caa16dc9c4 100644 --- a/m4/libevent.m4 +++ b/m4/libevent.m4 @@ -25,6 +25,16 @@ # Validates if we have a usable libevent. # +# +# SYNOPSIS +# +# MESOS_HAVE_LIBEVENT_SSL() +# +# DESCRIPTION +# +# Validates if we have a usable libevent_openssl. +# + AC_DEFUN([MESOS_HAVE_LIBEVENT],[ AC_CHECK_HEADERS([event2/event.h], [], [ AC_MSG_ERROR([cannot find libevent headers @@ -54,3 +64,20 @@ libevent_pthreads version 2+ is required for libprocess to build. ------------------------------------------------------------------- ])]) ]) + +AC_DEFUN([MESOS_HAVE_LIBEVENT_SSL],[ + 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 version 2+ is required for an SSL-enabled build. +------------------------------------------------------------------- + ])])], + [AC_MSG_ERROR([cannot find libevent_openssl headers +------------------------------------------------------------------- +libevent_openssl version 2+ headers are required for an SSL-enabled build. +------------------------------------------------------------------- + ])]) +])