X-Git-Url: http://git.indexdata.com/?p=yaz-moved-to-github.git;a=blobdiff_plain;f=configure.ac;h=049b3cab863ea619046621a872f267b1b34fd37d;hp=b9a0398f96489d99be0d54fa0a1957d4683efcff;hb=118a28603418dfc84a5c91463a1d02219e7e9941;hpb=f33b7979ed1553753c5c54819ea2b4038c783d43 diff --git a/configure.ac b/configure.ac index b9a0398..049b3ca 100644 --- a/configure.ac +++ b/configure.ac @@ -92,24 +92,55 @@ if test "$libgcryptpath" != "no"; then AC_MSG_RESULT([no]) fi fi +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_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 + fi + else + AC_MSG_RESULT([no]) + if test "$hiredis" != "default"; then + AC_MSG_ERROR([hiredis libraries missing]) + fi + fi +fi dnl ------ memcached memcached=default AC_SUBST([MEMCACHED_LIBS]) AC_ARG_WITH([memcached], [ --with-memcached Memcached library], [memcached=$withval]) -if test "$memcached" != "no" -a -n "$libgcryptversion"; then - AC_CHECK_LIB([memcached],[memcached_get], [MEMCACHED_LIBS="-lmemcached"]) - if test "$ac_cv_lib_memcached_memcached_get" = "yes"; then - AC_CHECK_HEADERS([libmemcached/memcached.h]) - if test "$ac_cv_header_libmemcached_memcached_h" = "yes"; then - AC_CHECK_LIB([memcached],[memcached], [ - AC_DEFINE([HAVE_MEMCACHED_FUNC],[1],[Define to 1 if memcached function is defined])]) - AC_TRY_COMPILE( - [ -#include - ],[ - memcached_return_t x; - ],[AC_DEFINE([HAVE_MEMCACHED_RETURN_T],[1],[Define to 1 if memcached_return_t is defined])] - ) +if test "$memcached" != "no" -a -n "$libgcryptversion" -a "$pkgconfigpath" != "NONE"; then + AC_MSG_CHECKING([for libmemcached]) + if $pkgconfigpath --cflags libmemcached >/dev/null 2>&1 ; then + if $pkgconfigpath --atleast-version 1.0 libmemcached; then + AC_MSG_RESULT([yes]) + CFLAGS="$CFLAGS `$pkgconfigpath --cflags libmemcached`" + MEMCACHED_LIBS="`$pkgconfigpath --libs libmemcached`" + AC_DEFINE([HAVE_LIBMEMCACHED_MEMCACHED_H],[1],[Define to 1 if memcached header]) + AC_DEFINE([HAVE_MEMCACHED_FUNC],[1],[Define to 1 if memcached function is defined]) + AC_DEFINE([HAVE_MEMCACHED_RETURN_T],[1],[Define to 1 if memcached_return_t is defined]) + else + AC_MSG_RESULT([no. Version 1.0 required]) + if test "$memcached" != "default"; then + AC_MSG_ERROR([libmemcached libraries missing]) + fi + fi + else + AC_MSG_RESULT([no]) + if test "$memcached" != "default"; then + AC_MSG_ERROR([libmemcached libraries missing]) fi fi fi