-dnl Copyright (C) 2011 Brian Aker (brian@tangent.org)
+# Copyright (C) 2011 Brian Aker (brian@tangent.org)
+#
+# serial 2
-AC_DEFUN([_SEARCH_LIBHIREDIS],[
- AC_REQUIRE([AX_CHECK_LIBRARY])
+AC_DEFUN([_SEARCH_HIREDIS],
+ [AC_REQUIRE([AX_CHECK_LIBRARY])
- AS_IF([test "x$ac_enable_hires" = "xyes"],[
- AX_CHECK_LIBRARY([LIBHIREDIS], [hiredis/hiredis.h], [hiredis],
- [
- LIBHIREDIS_LDFLAGS="-lhiredis"
- AC_DEFINE([HAVE_HIREDIS], [1], [If Hiredis available])
- ],
- [
- AC_DEFINE([HAVE_HIREDIS], [0], [If Hiredis is available])
- ac_enable_hires="no"
- ])
+ AS_IF([test "x$ac_enable_hiredis" = "xyes"],
+ [hiredis_header="hiredis/hiredis.h"],
+ [hiredis_header="does_not_exist"])
- ],
- [
- AC_DEFINE([HAVE_HIREDIS], [0], [If Hiredis is available])
- ])
+ AX_CHECK_LIBRARY([HIREDIS],[$hiredis_header],[hiredis],,
+ [AC_DEFINE([HAVE_HIREDIS],[0],[Define to 1 if HIREDIS is found])])
- AM_CONDITIONAL(HAVE_HIREDIS, [test "x$ac_cv_lib_hiredis_main" = "xyes"])
- ])
+ AS_IF([test "x$ax_cv_have_HIREDIS" = xno],[ac_enable_hiredis="no"])
+ ])
-AC_DEFUN([AX_HAVE_LIBHIREDIS],[
+ AC_DEFUN([AX_ENABLE_LIBHIREDIS],
+ [AC_ARG_ENABLE([hiredis],
+ [AS_HELP_STRING([--disable-hiredis],
+ [Build with hiredis support @<:@default=on@:>@])],
+ [ac_enable_hiredis="$enableval"],
+ [ac_enable_hiredis="yes"])
- AC_ARG_ENABLE([hires],
- [AS_HELP_STRING([--disable-hires],
- [Build with hires support @<:@default=on@:>@])],
- [ac_enable_hires="$enableval"],
- [ac_enable_hires="yes"])
-
- _SEARCH_LIBHIREDIS
-])
+ _SEARCH_HIREDIS
+ ])