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 echo unknown system cant configure
37 AC_LIBREPLACE_ALL_CHECKS
38 AC_LIBREPLACE_NETWORK_CHECKS
40 if test "$ac_cv_prog_gcc" = yes; then
41 CFLAGS="$CFLAGS -Wall -Wshadow -Wstrict-prototypes -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings"
44 LOGDIR='${localstatedir}/log'
46 [ --with-logdir=DIR path to log directory [[LOCALSTATEDIR/log]]],
48 if test ! -z "$LOGDIR"; then
49 if test "$LOGDIR" = "yes" -o "$LOGDIR" = "no"; then
50 AC_MSG_ERROR([--with-logdir must specify a path])
55 AC_CONFIG_HEADER(config.h)
59 m4_include(libpopt.m4)
60 m4_include(libtalloc.m4)
62 m4_include(libtevent.m4)
63 m4_include(ib/config.m4)
64 m4_include(lib/util/signal.m4)
65 m4_include(lib/util/fault.m4)
66 m4_include(lib/socket_wrapper/config.m4)
68 AC_CHECK_HEADERS(sched.h)
69 AC_CHECK_HEADERS(pcp/pmapi.h pcp/impl.h pcp/pmda.h, [], [],
70 [[#ifdef HAVE_PCP_PMAPI_H
71 # include <pcp/pmapi.h>
73 #ifdef HAVE_PCP_IMPL_H
74 # include <pcp/impl.h>
78 AC_CHECK_FUNCS(sched_setscheduler)
79 AC_CHECK_FUNCS(mlockall)
81 AC_CACHE_CHECK([for sin_len in sock],ctdb_cv_HAVE_SOCK_SIN_LEN,[
82 AC_TRY_COMPILE([#include <sys/types.h>
83 #include <sys/socket.h>
84 #include <netinet/in.h>],
85 [struct sockaddr_in sock; sock.sin_len = sizeof(sock);],
86 ctdb_cv_HAVE_SOCK_SIN_LEN=yes,ctdb_cv_HAVE_SOCK_SIN_LEN=no)])
87 if test x"$ctdb_cv_HAVE_SOCK_SIN_LEN" = x"yes"; then
88 AC_DEFINE(HAVE_SOCK_SIN_LEN,1,[Whether the sockaddr_in struct has a sin_len property])
91 if test x"$ac_cv_header_pcp_pmda_h" = x"yes"; then
92 CTDB_PMDA=bin/pmdactdb
93 CTDB_PMDA_INSTALL=install_pmda
101 AC_SUBST(CTDB_SYSTEM_OBJ)
102 AC_SUBST(CTDB_SCSI_IO)
103 AC_SUBST(CTDB_PCAP_LDFLAGS)
105 AC_SUBST(CTDB_PMDA_INSTALL)
107 AC_OUTPUT(Makefile ctdb.pc)