3 AC_REVISION($Revision$)
4 AC_DEFUN(modname,[rlm_rest])
5 AC_CONFIG_HEADER(config.h)
6 m4_include([m4/libcurl_check_config.m4])
8 if test x$with_[]modname != xno; then
13 dnl put configuration checks here.
14 dnl set $fail to what's missing, on fatal errors.
15 dnl use AC_MSG_WARN() on important messages.
17 dnl ############################################################
19 dnl ############################################################
21 LIBCURL_CHECK_CONFIG([], [7.19.1])
23 if test "x$libcurl_cv_lib_curl_usable" != "xyes"; then
26 if test x$libcurl_protocol_HTTP != xyes; then
27 fail="$fail libcurl_protocol_http"
30 if test x$libcurl_protocol_HTTPS != xyes || test x$libcurl_feature_SSL != xyes; then
31 AC_MSG_WARN([silently building without HTTPS support. requires: libcurl_protocol_https.])
35 dnl ############################################################
36 dnl # Check for json-c
37 dnl ############################################################
39 dnl extra argument: --with-jsonc-include-dir=DIR
41 AC_ARG_WITH(jsonc-include-dir,
42 [AS_HELP_STRING([--with-jsonc-include-dir=DIR],
43 [Directory where the json-c includes may be found])],
46 AC_MSG_ERROR(Need jsonc-include-dir)
51 jsonc_include_dir="$withval"
55 dnl extra argument: --with-jsonc-lib-dir=DIR
57 AC_ARG_WITH(jsonc-lib-dir,
58 [AS_HELP_STRING([--with-jsonc-lib-dir=DIR],
59 [Directory where the json-c libraries may be found])],
62 AC_MSG_ERROR(Need jsonc-lib-dir)
67 jsonc_lib_dir="$withval"
71 dnl extra argument: --with-jsonc-dir=DIR
72 AC_ARG_WITH(jsonc-dir,
73 [AS_HELP_STRING([--with-jsonc-dir=DIR],
74 [Base directory where json-c is installed])],
77 AC_MSG_ERROR(Need json-c-dir)
82 jsonc_lib_dir="$withval/lib"
83 jsonc_include_dir="$withval/include"
88 dnl ############################################################
89 dnl # Check for json-c header files
90 dnl ############################################################
92 smart_try_dir="$jsonc_include_dir"
93 FR_SMART_CHECK_INCLUDE([json/json.h])
94 if test "x$ac_cv_header_json_json_h" != "xyes"; then
96 AC_MSG_WARN([json-c headers not found. Use --with-jsonc-include-dir=<path>.])
99 dnl ############################################################
100 dnl # Check for json-c libraries
101 dnl ############################################################
104 smart_try_dir="$jsonc_lib_dir"
105 FR_SMART_CHECK_LIB([json-c], [json_c_version])
106 if test "x$ac_cv_lib_json_c_json_c_version" != "xyes"
109 AC_MSG_WARN([json-c libraries not found. Use --with-jsonc-lib-dir=<path>.])
112 if test "x$have_json" = "xyes"; then
113 AC_DEFINE([HAVE_JSON],[1],[Build with JSON support from json-c])
115 AC_MSG_WARN([silently building without JSON support. requires: json-c])
118 targetname=modname # keep this! Don't change!
120 targetname= # keep this! Don't change!
121 echo \*\*\* module modname is disabled. # keep this! Don't change!
124 dnl Don't change this section.
125 if test x"$fail" != x""; then
126 if test x"${enable_strict_dependencies}" = x"yes"; then
127 AC_MSG_ERROR([set --without-]modname[ to disable it explicitly.])
129 AC_MSG_WARN([silently not building ]modname[.])
130 AC_MSG_WARN([FAILURE: ]modname[ requires: $fail.]);
135 rest_ldflags="${LIBCURL} ${SMART_LIBS}"
136 rest_cflags="${SMART_CFLAGS}"
138 AC_SUBST(rest_cflags)
139 AC_SUBST(rest_ldflags)