switch to a 60 bit hash
[httpd-crcsyncproxy.git] / modules / cache / config.m4
bloba750b9677ccefc054abba724da0b34a20a74f14a
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
10 cache_objs="dnl
11 mod_cache.lo dnl
12 cache_storage.lo dnl
13 cache_util.lo dnl
15 APACHE_MODULE(cache, dynamic file caching, $cache_objs, , most)
16 APACHE_MODULE(disk_cache, disk caching module, , , most)
18 AC_DEFUN([CHECK_DISTCACHE], [
19   AC_MSG_CHECKING(whether Distcache is required)
20   ap_ssltk_dc="no"
21   tmp_nomessage=""
22   tmp_forced="no"
23   AC_ARG_ENABLE(distcache,
24     APACHE_HELP_STRING(--enable-distcache,Enable distcache support),
25     ap_ssltk_dc="$enableval"
26     tmp_nomessage=""
27     tmp_forced="yes"
28     if test "x$ap_ssltk_dc" = "x"; then
29       ap_ssltk_dc="yes"
30       dnl our "error"s become "tests revealed that..."
31       tmp_forced="no"
32     fi
33     if test "$ap_ssltk_dc" != "yes" -a "$ap_ssltk_dc" != "no"; then
34       tmp_nomessage="--enable-distcache had illegal syntax - disabling"
35       ap_ssltk_dc="no"
36     fi)
37   if test "$tmp_forced" = "no"; then
38     AC_MSG_RESULT($ap_ssltk_dc (default))
39   else
40     AC_MSG_RESULT($ap_ssltk_dc (specified))
41   fi
42   if test "$tmp_forced" = "yes" -a "x$ap_ssltk_dc" = "xno" -a "x$tmp_nomessage" != "x"; then
43     AC_MSG_ERROR(distcache support failed: $tmp_nomessage)
44   fi
45   if test "$ap_ssltk_dc" = "yes"; then
46     AC_CHECK_HEADER(
47       [distcache/dc_client.h],
48       [],
49       [tmp_nomessage="can't include distcache headers"
50       ap_ssltk_dc="no"])
51     if test "$tmp_forced" = "yes" -a "x$ap_ssltk_dc" = "xno"; then
52       AC_MSG_ERROR(distcache support failed: $tmp_nomessage)
53     fi
54   fi
55   if test "$ap_ssltk_dc" = "yes"; then
56     AC_MSG_CHECKING(for Distcache version)
57     AC_TRY_COMPILE(
58 [#include <distcache/dc_client.h>],
59 [#if DISTCACHE_CLIENT_API != 0x0001
60 #error "distcache API version is unrecognised"
61 #endif],
62 [],
63 [tmp_nomessage="distcache has an unsupported API version"
64 ap_ssltk_dc="no"])
65     AC_MSG_RESULT($ap_ssltk_dc)
66     if test "$tmp_forced" = "yes" -a "x$ap_ssltk_dc" = "xno"; then
67       AC_MSG_ERROR(distcache support failed: $tmp_nomessage)
68     fi
69   fi
70   if test "$ap_ssltk_dc" = "yes"; then
71     AC_MSG_CHECKING(for Distcache libraries)
72     save_libs=$LIBS
73     LIBS="$LIBS -ldistcache -lnal"
74     AC_TRY_LINK(
75       [#include <distcache/dc_client.h>],
76       [DC_CTX *foo = DC_CTX_new((const char *)0,0);],
77       [],
78       [tmp_no_message="failed to link with distcache libraries"
79       ap_ssltk_dc="no"])
80     LIBS=$save_libs
81     AC_MSG_RESULT($ap_ssltk_dc)
82     if test "$tmp_forced" = "yes" -a "x$ap_ssltk_dc" = "xno"; then
83       AC_MSG_ERROR(distcache support failed: $tmp_nomessage)
84     else
85       APR_ADDTO(MOD_SOCACHE_LDADD, [-ldistcache -lnal])
86       AC_DEFINE(HAVE_DISTCACHE, 1, [Define if distcache support is enabled])
87     fi
88   fi
91 APACHE_MODULE(socache_shmcb,  shmcb small object cache provider, , , most)
92 APACHE_MODULE(socache_dbm, dbm small object cache provider, , , most)
93 APACHE_MODULE(socache_memcache, memcache small object cache provider, , , most)
94 APACHE_MODULE(socache_dc, distcache small object cache provider, , , no, [
95    CHECK_DISTCACHE
98 APR_ADDTO(INCLUDES, [-I\$(top_srcdir)/$modpath_current])
100 APACHE_MODPATH_FINISH