Skip to content

Commit

Permalink
Moved libevent_openssl validation into libevent.m4.
Browse files Browse the repository at this point in the history
Combines all libevent related header and library checks into
libevent.m4.

Review: https://reviews.apache.org/r/68915/
  • Loading branch information
tillt committed Oct 4, 2018
1 parent 2ccc37e commit 9c0d41e
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 14 deletions.
15 changes: 1 addition & 14 deletions configure.ac
Expand Up @@ -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])
Expand Down
27 changes: 27 additions & 0 deletions m4/libevent.m4
Expand Up @@ -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
Expand Down Expand Up @@ -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.
-------------------------------------------------------------------
])])
])

0 comments on commit 9c0d41e

Please sign in to comment.