-
-dnl ------ OpenSSL
-AC_SUBST([SSL_CFLAGS])
-AC_SUBST([SSL_LIBS])
-openssl=no
-sslver=no
-AC_ARG_WITH([openssl], [ --with-openssl[=PREFIX] OpenSSL library in PREFIX], [openssl=$withval])
-SSL_CFLAGS=""
-SSL_LIBPATH=""
-if test "$openssl" != "no"; then
- if test "$openssl" != "yes" -a "$openssl" != "default"; then
- if test -x $openssl/bin/pkg-config; then
- if $openssl/bin/pkg-config --exists openssl; then
- SSL_CFLAGS=`$openssl/bin/pkg-config --cflags openssl`
- SSL_LIBS="`$openssl/bin/pkg-config --libs openssl`"
- sslver=`$openssl/bin/pkg-config --modversion openssl`
- fi
- fi
- if test "$sslver" = "no"; then
- SSL_CFLAGS="-I$openssl/include -I$openssl/include/openssl"
- SSL_LIBPATH="-L$openssl/lib"
+dnl ------ redis
+hiredis=default
+AC_SUBST([HIREDIS_LIBS])
+AC_ARG_WITH([redis], [ --with-redis hiredis library], [hiredis=$withval])
+if test "$hiredis" != "no" -a "$pkgconfigpath" != "NONE"; then
+ AC_CHECK_LIB([hiredis],[redisCommandArgv],[HIREDIS_LIBS=-lhiredis])
+ AC_MSG_CHECKING([for redis])
+ if $pkgconfigpath --cflags hiredis >/dev/null 2>&1 ; then
+ if $pkgconfigpath --atleast-version 0.10 hiredis; then
+ AC_MSG_RESULT([yes])
+ CFLAGS="$CFLAGS `$pkgconfigpath --cflags hiredis`"
+ HIREDIS_LIBS="`$pkgconfigpath --libs hiredis`"
+ AC_DEFINE([HAVE_HIREDIS],[1],[Define to 1 if hiredis is enabled])
+ else
+ AC_MSG_RESULT([no. Version 0.10 required])
+ if test "$hiredis" != "default"; then
+ AC_MSG_ERROR([hiredis libraries missing])
+ fi