2 AC_INIT(rlm_rediswho.c)
3 AC_REVISION($Revision$)
4 AC_DEFUN(modname,[rlm_rediswho])
9 if test x$with_[]modname != xno; then
11 dnl ############################################################
12 dnl # Check for command line options
13 dnl ############################################################
15 dnl extra argument: --with-redis-include-dir=DIR
17 AC_ARG_WITH(redis-include-dir,
18 [AS_HELP_STRING([--with-redis-include-dir=DIR],
19 [Directory where the redis includes may be found])],
22 AC_MSG_ERROR(Need redis-include-dir)
27 redis_include_dir="$withval"
31 dnl extra argument: --with-redis-lib-dir=DIR
33 AC_ARG_WITH(redis-lib-dir,
34 [AS_HELP_STRING([--with-redis-lib-dir=DIR],
35 [Directory where the redis libraries may be found])],
38 AC_MSG_ERROR(Need redis-lib-dir)
43 redis_lib_dir="$withval"
47 dnl extra argument: --with-redis-dir=DIR
48 AC_ARG_WITH(redis-dir,
49 [AS_HELP_STRING([--with-redis-dir=DIR],
50 [Base directory where redis is installed])],
53 AC_MSG_ERROR(Need redis-dir)
58 redis_lib_dir="$withval/lib"
59 redis_include_dir="$withval/include"
63 dnl ############################################################
64 dnl # Check for programs
65 dnl ############################################################
69 dnl ############################################################
70 dnl # Check for header files
71 dnl ############################################################
73 smart_try_dir="${redis_include_dir}"
74 FR_SMART_CHECK_INCLUDE([hiredis/hiredis.h])
75 if test "x$ac_cv_header_hiredis_hiredis_h" != "xyes"; then
76 AC_MSG_WARN([hiredis headers not found. Use --with-redis-include-dir=<path>.])
77 fail="$fail hiredis.h"
80 dnl ############################################################
81 dnl # Check for libraries
82 dnl ############################################################
84 smart_try_dir="$redis_lib_dir"
85 FR_SMART_CHECK_LIB(hiredis, redisConnect)
86 if test "x$ac_cv_lib_hiredis_redisConnect" != "xyes"
88 AC_MSG_WARN([hiredis libraries not found. Use --with-redis-lib-dir=<path>.])
89 fail="$fail libhiredis"
95 echo \*\*\* module modname is disabled.
98 dnl Don't change this section.
99 if test "x$fail" != x; then
100 if test "x${enable_strict_dependencies}" = xyes; then
101 AC_MSG_ERROR([set --without-]modname[ to disable it explicitly.])
103 AC_MSG_WARN([silently not building ]modname[.])
104 AC_MSG_WARN([FAILURE: ]modname[ requires:$fail.]);
109 mod_ldflags="$SMART_LIBS"
110 mod_cflags="$SMART_CPPFLAGS"
111 AC_SUBST(mod_ldflags)