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_version_ok" != "xyes"; then
24 fail="$fail libcurl >= 7.19.2"
25 elif test "x$libcurl_cv_lib_curl_usable" != "xyes"; then
28 if test x$libcurl_protocol_HTTP != xyes; then
29 fail="$fail libcurl_protocol_http"
32 if test x$libcurl_protocol_HTTPS != xyes || test x$libcurl_feature_SSL != xyes; then
33 AC_MSG_WARN([silently building without HTTPS support. requires: libcurl_protocol_https.])
37 dnl ############################################################
38 dnl # Check for json-c
39 dnl ############################################################
41 dnl extra argument: --with-jsonc-include-dir=DIR
43 AC_ARG_WITH(jsonc-include-dir,
44 [AS_HELP_STRING([--with-jsonc-include-dir=DIR],
45 [Directory where the json-c includes may be found])],
48 AC_MSG_ERROR(Need jsonc-include-dir)
53 jsonc_include_dir="$withval"
57 dnl extra argument: --with-jsonc-lib-dir=DIR
59 AC_ARG_WITH(jsonc-lib-dir,
60 [AS_HELP_STRING([--with-jsonc-lib-dir=DIR],
61 [Directory where the json-c libraries may be found])],
64 AC_MSG_ERROR(Need jsonc-lib-dir)
69 jsonc_lib_dir="$withval"
73 dnl extra argument: --with-jsonc-dir=DIR
74 AC_ARG_WITH(jsonc-dir,
75 [AS_HELP_STRING([--with-jsonc-dir=DIR],
76 [Base directory where json-c is installed])],
79 AC_MSG_ERROR(Need json-c-dir)
84 jsonc_lib_dir="$withval/lib"
85 jsonc_include_dir="$withval/include"
90 dnl ############################################################
91 dnl # Check for json-c header files
92 dnl ############################################################
95 smart_try_dir="$jsonc_include_dir"
96 FR_SMART_CHECK_INCLUDE([json/json.h])
97 if test "x$ac_cv_header_json_json_h" != "xyes"; then
99 AC_MSG_WARN([json-c headers not found. Use --with-jsonc-include-dir=<path>.])
102 dnl ############################################################
103 dnl # Check for json-c libraries
104 dnl ############################################################
106 smart_try_dir="$jsonc_lib_dir"
107 dnl # Use a json-c specific function which is only
108 dnl # available in newer versions.
109 FR_SMART_CHECK_LIB([json-c], [json_c_version])
110 if test "x$ac_cv_lib_json_c_json_c_version" != "xyes"
112 dnl # Use a function which is included in legacy versions
113 dnl # but which may be available in other json libraries
114 FR_SMART_CHECK_LIB([json], [json_tokener_new])
115 if test "x$ac_cv_lib_json_json_tokener_new" != "xyes"
121 if test "x$have_json" = "xyes"; then
122 dnl # Ensure we use the library we just found the rest of the checks
123 LDFLAGS="$SMART_LIBS"
125 dnl # Add any optional functions here
131 AC_DEFINE([HAVE_JSON],[1],[Build with JSON support from json-c])
133 AC_MSG_WARN([json-c libraries not found. Use --with-jsonc-lib-dir=<path>.])
134 AC_MSG_WARN([silently building without JSON support. requires: json-c])
140 echo \*\*\* module modname is disabled.
143 dnl Don't change this section.
144 if test x"$fail" != x""; then
145 if test x"${enable_strict_dependencies}" = x"yes"; then
146 AC_MSG_ERROR([set --without-]modname[ to disable it explicitly.])
148 AC_MSG_WARN([silently not building ]modname[.])
149 AC_MSG_WARN([FAILURE: ]modname[ requires: $fail.]);
154 mod_ldflags="$LIBCURL $SMART_LIBS"
155 mod_cflags="$SMART_CPPFLAGS"
158 AC_SUBST(mod_ldflags)