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
39 if test "$ac_cv_prog_gcc" = yes; then
40 CFLAGS="$CFLAGS -Wall -Wshadow -Wstrict-prototypes -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings"
43 LOGDIR='${localstatedir}/log'
45 [ --with-logdir=DIR path to log directory [[LOCALSTATEDIR/log]]],
47 if test ! -z "$LOGDIR"; then
48 if test "$LOGDIR" = "yes" -o "$LOGDIR" = "no"; then
49 AC_MSG_ERROR([--with-logdir must specify a path])
54 AC_CONFIG_HEADER(config.h)
58 m4_include(libpopt.m4)
59 m4_include(libtalloc.m4)
61 m4_include(libtevent.m4)
62 m4_include(ib/config.m4)
63 m4_include(lib/util/signal.m4)
64 m4_include(lib/util/fault.m4)
66 AC_CHECK_HEADERS(sched.h)
67 AC_CHECK_HEADERS(pcp/pmapi.h pcp/impl.h pcp/pmda.h, [], [],
68 [[#ifdef HAVE_PCP_PMAPI_H
69 # include <pcp/pmapi.h>
71 #ifdef HAVE_PCP_IMPL_H
72 # include <pcp/impl.h>
76 AC_CHECK_FUNCS(sched_setscheduler)
77 AC_CHECK_FUNCS(mlockall)
79 AC_CACHE_CHECK([for sin_len in sock],ctdb_cv_HAVE_SOCK_SIN_LEN,[
80 AC_TRY_COMPILE([#include <sys/types.h>
81 #include <sys/socket.h>
82 #include <netinet/in.h>],
83 [struct sockaddr_in sock; sock.sin_len = sizeof(sock);],
84 ctdb_cv_HAVE_SOCK_SIN_LEN=yes,ctdb_cv_HAVE_SOCK_SIN_LEN=no)])
85 if test x"$ctdb_cv_HAVE_SOCK_SIN_LEN" = x"yes"; then
86 AC_DEFINE(HAVE_SOCK_SIN_LEN,1,[Whether the sockaddr_in struct has a sin_len property])
89 if test x"$ac_cv_header_pcp_pmda_h" = x"yes"; then
90 CTDB_PMDA=bin/pmdactdb
91 CTDB_PMDA_INSTALL=install_pmda
99 AC_SUBST(CTDB_SYSTEM_OBJ)
100 AC_SUBST(CTDB_SCSI_IO)
101 AC_SUBST(CTDB_PCAP_LDFLAGS)
103 AC_SUBST(CTDB_PMDA_INSTALL)
105 AC_OUTPUT(Makefile ctdb.pc)