Add rolling statistics that are collected across 10 second intervals.
[metze/ctdb/wip.git] / configure.ac
1 AC_PREREQ(2.50)
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])
8
9 if test "${libdir}" = '${exec_prefix}/lib'; then
10   case `uname -m` in
11     x86_64|ppc64|powerpc64)
12       libdir='${exec_prefix}/lib64'
13       ;;
14     *)
15       libdir='${exec_prefix}/lib'
16       ;;
17   esac
18 fi
19
20 case `uname` in
21   Linux*)
22     CTDB_SYSTEM_OBJ=common/system_linux.o
23     CTDB_SCSI_IO=bin/scsi_io
24     CTDB_PCAP_LDFLAGS=
25     ;;
26   AIX*)
27     CTDB_SYSTEM_OBJ=common/system_aix.o
28     CTDB_SCSI_IO=
29     CTDB_PCAP_LDFLAGS=-lpcap
30     ;;
31   *)
32     echo unknown system  cant configure
33     exit
34     ;;
35 esac
36
37 AC_LIBREPLACE_ALL_CHECKS
38
39 if test "$ac_cv_prog_gcc" = yes; then
40    CFLAGS="$CFLAGS -Wall -Wshadow -Wstrict-prototypes -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings"
41 fi
42
43 LOGDIR='${localstatedir}/log'
44 AC_ARG_WITH([logdir],
45         [  --with-logdir=DIR       path to log directory [[LOCALSTATEDIR/log]]],
46         LOGDIR=$withval)
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])
50   fi
51 fi
52 AC_SUBST(LOGDIR)
53
54 AC_CONFIG_HEADER(config.h)
55
56 EXTRA_OBJ=""
57
58 m4_include(libpopt.m4)
59 m4_include(libtalloc.m4)
60 m4_include(libtdb.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)
65
66 AC_CHECK_HEADERS(sched.h)
67 AC_CHECK_FUNCS(sched_setscheduler)
68 AC_CHECK_FUNCS(mlockall)
69
70 AC_CACHE_CHECK([for sin_len in sock],ctdb_cv_HAVE_SOCK_SIN_LEN,[
71 AC_TRY_COMPILE([#include <sys/types.h>
72 #include <sys/socket.h>
73 #include <netinet/in.h>],
74 [struct sockaddr_in sock; sock.sin_len = sizeof(sock);],
75 ctdb_cv_HAVE_SOCK_SIN_LEN=yes,ctdb_cv_HAVE_SOCK_SIN_LEN=no)])
76 if test x"$ctdb_cv_HAVE_SOCK_SIN_LEN" = x"yes"; then
77     AC_DEFINE(HAVE_SOCK_SIN_LEN,1,[Whether the sockaddr_in struct has a sin_len property])
78 fi
79
80 AC_SUBST(EXTRA_OBJ)
81 AC_SUBST(CTDB_SYSTEM_OBJ)
82 AC_SUBST(CTDB_SCSI_IO)
83 AC_SUBST(CTDB_PCAP_LDFLAGS)
84
85 AC_OUTPUT(Makefile ctdb.pc)