1 AC_DEFUN([DOVECOT_WANT_CASSANDRA], [
2     AS_IF([test "$want_cassandra" != no], [
3          AC_CHECK_LIB([cassandra], [cass_session_new], [
4                  AC_CHECK_HEADER([cassandra.h], [
5                          CASSANDRA_LIBS="$CASSANDRA_LIBS -lcassandra"
6                          AC_DEFINE(HAVE_CASSANDRA,, [Build with Cassandra support])
7                          found_sql_drivers="$found_sql_drivers cassandra"
8                          AC_CHECK_LIB(cassandra, cass_cluster_set_constant_speculative_execution_policy, [
9                                       AC_DEFINE(HAVE_CASSANDRA_SPECULATIVE_POLICY, 1, [Cassandra supports speculative execution policy])
10                          ],, $CASSANDRA_LIBS)
11                          AC_CHECK_LIB(cassandra, cass_cluster_set_use_hostname_resolution, [
12                                      AC_DEFINE(HAVE_CASS_CLUSTER_SET_USE_HOSTNAME_RESOLUTION,, [Build with cass_cluster_set_use_hostname_resolution() support])
13                          ],, $CASSANDRA_LIBS)
14                          AC_CHECK_DECLS([CASS_SSL_VERIFY_PEER_IDENTITY_DNS], [], [], [[#include <cassandra.h>]])
15                  ], [
16                    AS_IF([test "$want_cassandra" = yes], [
17                      AC_ERROR([Can't build with Cassandra support: cassandra.h not found])
18                    ])
19                  ])
20          ], [AS_IF([test "$want_cassandra" = yes], [
21              AC_ERROR([Can't build with Cassandra support: libcassandra not found])
22          ])
23	])
24     ])
25])
26