2 AC_INIT(ctdb, m4_esyscmd([grep 'Version:' ./packaging/RPM/ctdb.spec 2>/dev/null | head -1 | sed -e 's/[ \t]*Version:[ \t]*\([^ \t]*\)[ \t]*.*/\1/' | tr -d '\n']))
3 AC_DEFUN([SMB_MODULE_DEFAULT], [echo -n ""])
4 AC_DEFUN([SMB_LIBRARY_ENABLE], [echo -n ""])
5 AC_DEFUN([SMB_EXT_LIB], [echo -n ""])
6 AC_DEFUN([SMB_ENABLE], [echo -n ""])
7 AC_CONFIG_SRCDIR([server/ctdbd.c])
9 if test "${libdir}" = '${exec_prefix}/lib'; then
11 x86_64|ppc64|powerpc64)
12 libdir='${exec_prefix}/lib64'
15 libdir='${exec_prefix}/lib'
22 CTDB_SYSTEM_OBJ=common/system_linux.o
23 CTDB_SCSI_IO=bin/scsi_io
27 CTDB_SYSTEM_OBJ=common/system_aix.o
29 CTDB_PCAP_LDFLAGS=-lpcap
32 CTDB_SYSTEM_OBJ=common/system_kfreebsd.o
34 CTDB_PCAP_LDFLAGS=-lpcap
37 CTDB_SYSTEM_OBJ=common/system_gnu.o
39 CTDB_PCAP_LDFLAGS=-lpcap
42 echo unknown system cant configure
47 AC_LIBREPLACE_ALL_CHECKS
48 AC_LIBREPLACE_NETWORK_CHECKS
50 if test "$ac_cv_prog_gcc" = yes; then
51 CFLAGS="$CFLAGS -Wall -Wshadow -Wstrict-prototypes -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings"
54 LOGDIR='${localstatedir}/log'
56 [ --with-logdir=DIR path to log directory [[LOCALSTATEDIR/log]]],
58 if test ! -z "$LOGDIR"; then
59 if test "$LOGDIR" = "yes" -o "$LOGDIR" = "no"; then
60 AC_MSG_ERROR([--with-logdir must specify a path])
65 AC_CONFIG_HEADER(config.h)
69 m4_include(libpopt.m4)
70 m4_include(libtalloc.m4)
72 m4_include(libtevent.m4)
73 m4_include(ib/config.m4)
74 m4_include(lib/util/signal.m4)
75 m4_include(lib/util/fault.m4)
76 m4_include(lib/socket_wrapper/config.m4)
78 AC_CHECK_HEADERS(sched.h)
79 AC_CHECK_HEADERS(pcp/pmapi.h pcp/impl.h pcp/pmda.h, [], [],
80 [[#ifdef HAVE_PCP_PMAPI_H
81 # include <pcp/pmapi.h>
83 #ifdef HAVE_PCP_IMPL_H
84 # include <pcp/impl.h>
88 AC_CHECK_FUNCS(sched_setscheduler)
89 AC_CHECK_FUNCS(mlockall)
91 AC_CACHE_CHECK([for sin_len in sock],ctdb_cv_HAVE_SOCK_SIN_LEN,[
92 AC_TRY_COMPILE([#include <sys/types.h>
93 #include <sys/socket.h>
94 #include <netinet/in.h>],
95 [struct sockaddr_in sock; sock.sin_len = sizeof(sock);],
96 ctdb_cv_HAVE_SOCK_SIN_LEN=yes,ctdb_cv_HAVE_SOCK_SIN_LEN=no)])
97 if test x"$ctdb_cv_HAVE_SOCK_SIN_LEN" = x"yes"; then
98 AC_DEFINE(HAVE_SOCK_SIN_LEN,1,[Whether the sockaddr_in struct has a sin_len property])
101 if test x"$ac_cv_header_pcp_pmda_h" = x"yes"; then
102 CTDB_PMDA=bin/pmdactdb
103 CTDB_PMDA_INSTALL=install_pmda
111 AC_SUBST(CTDB_SYSTEM_OBJ)
112 AC_SUBST(CTDB_SCSI_IO)
113 AC_SUBST(CTDB_PCAP_LDFLAGS)
115 AC_SUBST(CTDB_PMDA_INSTALL)
117 AC_OUTPUT(Makefile ctdb.pc)