Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -2638,6 +2638,16 @@ AC_ARG_ENABLE(redis_tests,
)
AM_CONDITIONAL(ENABLE_REDIS_TESTS, test x$enable_redis_tests = xyes)

AC_ARG_ENABLE(redis_ssl,
[AS_HELP_STRING([--enable-redis-ssl],[Enable redis ssl support @<:@default=no@:>@])],
[case "${enableval}" in
yes) enable_redis_ssl="yes" ;;
no) enable_redis_ssl="no" ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-redis-ssl) ;;
esac],
[enable_redis_ssl=no]
)

if test "x$enable_omhiredis" = "xyes" -o "x$enable_imhiredis" = "xyes" ; then
PKG_CHECK_MODULES(HIREDIS, hiredis >= 0.10.1, [],
[AC_SEARCH_LIBS(redisConnectWithTimeout, hiredis,
Expand All @@ -2662,6 +2672,39 @@ if test "x$enable_omhiredis" = "xyes" -o "x$enable_imhiredis" = "xyes" ; then
[AC_MSG_ERROR([hiredis not found])]
)]
)
if test "x$enable_redis_ssl" = "xyes"; then
PKG_CHECK_MODULES(HIREDIS_SSL, hiredis_ssl >= 1.0.0,
# hiredis_ssl found using pkg-config
[
AC_DEFINE(HIREDIS_SSL, 1, [TLS support enabled in hiredis])
],
# hiredis_ssl not found with pkg-static, searching for it manually
[AC_SEARCH_LIBS(redisCreateSSLContext, hiredis_ssl,
[AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[[ #include <hiredis/hiredis.h>
#include <hiredis/hiredis_ssl.h>
]],
[[ #define major 1
#define minor 0
#define patch 0
#if (( HIREDIS_MAJOR > major ) || \
(( HIREDIS_MAJOR == major ) && ( HIREDIS_MINOR > minor )) || \
(( HIREDIS_MAJOR == major ) && ( HIREDIS_MINOR == minor ) && ( HIREDIS_PATCH >= patch ))) \
/* OK */
#else
# error Hiredis version must be >= major.minor.path for SSL support
#endif
]]
)],
[],
[AC_MSG_ERROR([hiredis version must be >= 1.0.0 for SSL support])]
)],
[AC_MSG_ERROR([hiredis_ssl not found, no TLS support in hiredis])]
)]
)
fi

fi

if test "x$enable_imhiredis" = "xyes" ; then
Expand All @@ -2672,6 +2715,7 @@ if test "x$enable_imhiredis" = "xyes" ; then
],
# libevent not found
[AC_MSG_ERROR([no libevent >= 2.0 found with pthreads support, imhiredis cannot use pub/sub])])

fi

if test "x$enable_imhiredis" = "xyes" || test "x$enable_omhiredis" = "xyes"; then
Expand Down Expand Up @@ -3080,6 +3124,7 @@ echo " GnuTLS network stream driver enabled: $enable_gnutls"
echo " GSSAPI Kerberos 5 support enabled: $enable_gssapi_krb5"
echo " RELP support enabled: $enable_relp"
echo " SNMP support enabled: $enable_snmp"
echo " redis ssl support enabled: $enable_redis_ssl"
echo
echo "---{ function modules }---"
echo " fmhttp enabled: $enable_fmhttp"
Expand Down
4 changes: 2 additions & 2 deletions contrib/imhiredis/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
pkglib_LTLIBRARIES = imhiredis.la
imhiredis_la_SOURCES = imhiredis.c
imhiredis_la_CPPFLAGS = $(RSRT_CFLAGS) $(PTHREADS_CFLAGS) $(HIREDIS_CFLAGS)
imhiredis_la_CPPFLAGS = $(RSRT_CFLAGS) $(PTHREADS_CFLAGS) $(HIREDIS_CFLAGS) $(HIREDIS_SSL_CFLAGS)
imhiredis_la_LDFLAGS = -module -avoid-version
imhiredis_la_LIBADD = $(HIREDIS_LIBS)
imhiredis_la_LIBADD = $(HIREDIS_LIBS) $(HIREDIS_SSL_LIBS)

EXTRA_DIST =
Loading
Loading