1 dnl modules enabled in this directory by default
3 dnl APACHE_MODULE(name, helptext[, objects[, structname[, default[, config]]]])
5 APACHE_MODPATH_INIT(cache)
7 APACHE_MODULE(file_cache, File cache, , , most)
9 dnl # list of object files for mod_cache
15 cache_disk_objs="mod_cache_disk.lo"
19 # OS/2 DLLs must resolve all symbols at build time
20 # and we need some from main cache module
21 cache_disk_objs="$cache_disk_objs mod_cache.la"
25 APACHE_MODULE(cache, dynamic file caching. At least one storage management module (e.g. mod_cache_disk) is also necessary., $cache_objs, , most)
26 APACHE_MODULE(cache_disk, disk caching module, $cache_disk_objs, , most)
29 dnl APACHE_CHECK_DISTCACHE
31 dnl Configure for the detected distcache installation, giving
32 dnl preference to "--with-distcache=<path>" if it was specified.
34 AC_DEFUN(APACHE_CHECK_DISTCACHE,[
35 if test "x$ap_distcache_configured" = "x"; then
36 dnl initialise the variables we use
40 ap_distcache_ldflags=""
43 dnl Determine the distcache base directory, if any
44 AC_MSG_CHECKING([for user-provided distcache base])
45 AC_ARG_WITH(distcache, APACHE_HELP_STRING(--with-distcache=DIR, Distcache installation directory), [
46 dnl If --with-distcache specifies a directory, we use that directory or fail
47 if test "x$withval" != "xyes" -a "x$withval" != "x"; then
48 dnl This ensures $withval is actually a directory and that it is absolute
49 ap_distcache_with="yes"
50 ap_distcache_base="`cd $withval ; pwd`"
53 if test "x$ap_distcache_base" = "x"; then
56 AC_MSG_RESULT($ap_distcache_base)
59 dnl Run header and version checks
60 saved_CPPFLAGS="$CPPFLAGS"
62 saved_LDFLAGS="$LDFLAGS"
64 if test "x$ap_distcache_base" != "x"; then
65 APR_ADDTO(CPPFLAGS, [-I$ap_distcache_base/include])
66 APR_ADDTO(INCLUDES, [-I$ap_distcache_base/include])
67 APR_ADDTO(LDFLAGS, [-L$ap_distcache_base/lib])
68 APR_ADDTO(ap_distcache_ldflags, [-L$ap_distcache_base/lib])
69 if test "x$ap_platform_runtime_link_flag" != "x"; then
70 APR_ADDTO(LDFLAGS, [$ap_platform_runtime_link_flag$ap_distcache_base/lib])
71 APR_ADDTO(ap_distcache_ldflags, [$ap_platform_runtime_link_flag$ap_distcache_base/lib])
74 dnl First check for mandatory headers
75 AC_CHECK_HEADERS([distcache/dc_client.h], [ap_distcache_found="yes"], [])
76 if test "$ap_distcache_found" = "yes"; then
77 dnl test for a good version
78 AC_MSG_CHECKING(for distcache version)
79 AC_TRY_COMPILE([#include <distcache/dc_client.h>],[
80 #if DISTCACHE_CLIENT_API != 0x0001
81 #error "distcache API version is unrecognised"
84 [ap_distcache_found="no"])
85 AC_MSG_RESULT($ap_distcache_found)
87 if test "$ap_distcache_found" != "yes"; then
88 if test "x$ap_distcache_with" = "x"; then
89 AC_MSG_WARN([...No distcache detected])
91 AC_MSG_ERROR([...No distcache detected])
94 dnl Run library and function checks
95 AC_MSG_CHECKING(for distcache libraries)
96 ap_distcache_libs="-ldistcache -lnal"
97 APR_ADDTO(LIBS, [$ap_distcache_libs])
100 [#include <distcache/dc_client.h>],
101 [DC_CTX *foo = DC_CTX_new((const char *)0,0);],
103 [ap_distcache_found="no"])
104 AC_MSG_RESULT($ap_distcache_found)
105 if test "$ap_distcache_found" != "yes"; then
106 if test "x$ap_distcache_base" = "x"; then
107 AC_MSG_WARN([... Error, distcache libraries were missing or unusable])
109 AC_MSG_ERROR([... Error, distcache libraries were missing or unusable])
115 CPPFLAGS="$saved_CPPFLAGS"
117 LDFLAGS="$saved_LDFLAGS"
119 dnl Adjust apache's configuration based on what we found above.
120 if test "$ap_distcache_found" = "yes"; then
121 APR_ADDTO(MOD_SOCACHE_DC_LDADD, [$ap_distcache_ldflags $ap_distcache_libs])
122 AC_DEFINE(HAVE_DISTCACHE, 1, [Define if distcache support is enabled])
126 ap_distcache_configured="yes"
130 APACHE_MODULE(socache_shmcb, shmcb small object cache provider, , , most)
131 APACHE_MODULE(socache_dbm, dbm small object cache provider, , , most)
132 APACHE_MODULE(socache_memcache, memcache small object cache provider, , , most)
133 APACHE_MODULE(socache_dc, distcache small object cache provider, , , no, [
134 APACHE_CHECK_DISTCACHE
137 APR_ADDTO(INCLUDES, [-I\$(top_srcdir)/$modpath_current])
139 APACHE_MODPATH_FINISH