Conditional compilation with libevent-openssl

Require Libevent-openssl 2.0.8 because we use
evconnlistener_set_error_cb().
This commit is contained in:
Tatsuhiro Tsujikawa 2012-06-07 01:36:49 +09:00
parent b189e291a9
commit 18f557f743
2 changed files with 12 additions and 2 deletions

View File

@ -96,12 +96,15 @@ if test "x${have_openssl}" = "xno"; then
fi
# libevent_openssl
PKG_CHECK_MODULES([LIBEVENT_OPENSSL], [libevent_openssl >= 2.0.6],
# 2.0.8 is required because we use evconnlistener_set_error_cb()
PKG_CHECK_MODULES([LIBEVENT_OPENSSL], [libevent_openssl >= 2.0.8],
[have_libevent_openssl=yes], [have_libevent_openssl=no])
if test "x${have_libevent_openssl}" = "xno"; then
AC_MSG_NOTICE($LIBEVENT_OPENSSL_PKG_ERRORS)
AC_MSG_NOTICE([Shrpx example program will not be built.])
fi
AM_CONDITIONAL([HAVE_LIBEVENT_OPENSSL],
[ test "x${have_libevent_openssl}" = "xyes" ])
# libxml2 (for examples/spdycat)
AM_PATH_XML2(2.7.7, [have_libxml2=yes], [have_libxml2=no])
@ -186,5 +189,6 @@ AC_MSG_NOTICE([summary of build options:
CUnit: ${have_cunit}
OpenSSL: ${have_openssl}
Libxml2: ${have_libxml2}
Libevent(SSL): ${have_libevent_openssl}
Examples: ${enable_examples}
])

View File

@ -29,7 +29,11 @@ AM_CPPFLAGS = -Wall -I$(srcdir)/../lib/includes -I$(builddir)/../lib/includes \
AM_LDFLAGS = @OPENSSL_LIBS@ @XML_LIBS@ @LIBEVENT_OPENSSL_LIBS@
LDADD = $(top_builddir)/lib/libspdylay.la
bin_PROGRAMS = spdycat spdyd shrpx
bin_PROGRAMS = spdycat spdyd
if HAVE_LIBEVENT_OPENSSL
bin_PROGRAMS += shrpx
endif # HAVE_LIBEVENT_OPENSSL
HELPER_OBJECTS = uri.cc util.cc spdylay_ssl.cc
HELPER_HFILES = uri.h util.h spdylay_ssl.h
@ -65,6 +69,7 @@ spdyd_SOURCES = ${HELPER_OBJECTS} ${HELPER_HFILES} \
${SPDY_SERVER_OBJECTS} ${SPDY_SERVER_HFILES} \
spdyd.cc
if HAVE_LIBEVENT_OPENSSL
shrpx_SOURCES = ${HELPER_OBJECTS} ${HELPER_HFILES} \
shrpx_config.cc shrpx_config.h \
shrpx.cc \
@ -82,6 +87,7 @@ shrpx_SOURCES = ${HELPER_OBJECTS} ${HELPER_HFILES} \
shrpx_thread_event_receiver.cc shrpx_thread_event_receiver.h \
shrpx_worker.cc shrpx_worker.h \
htparse/htparse.c htparse/htparse.h
endif # HAVE_LIBEVENT_OPENSSL
noinst_PROGRAMS = spdycli
spdycli_SOURCES = spdycli.c