X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=m4%2Fhiredis.m4;h=6db092789ed24a51c20bbd491d47e8c882f5ca21;hb=1f483f29cd415fdb749a5571d9e1483dd11a2ab0;hp=068041780f617ed4a54621007b0f10c602ff3b73;hpb=535cb0763dff986a148356bf58dd91f15ad8ed39;p=awesomized%2Flibmemcached diff --git a/m4/hiredis.m4 b/m4/hiredis.m4 index 06804178..6db09278 100644 --- a/m4/hiredis.m4 +++ b/m4/hiredis.m4 @@ -1,34 +1,26 @@ -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 + ])