talloc: check for TALLOC_GET_TYPE_ABORT_NOOP
[Samba.git] / ctdb / configure.ac
blob9621f42a658339db6c9ff9ee6cf9038b98d752af
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])
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
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     CPPFLAGS="$CPPFLAGS -D_AIX_=1"
30     CTDB_PCAP_LDFLAGS=-lpcap
31     ;;
32   GNU/kFreeBSD)
33     CTDB_SYSTEM_OBJ=common/system_kfreebsd.o
34     CTDB_SCSI_IO=
35     CTDB_PCAP_LDFLAGS=-lpcap
36     ;;
37   FreeBSD)
38     CTDB_SYSTEM_OBJ=common/system_freebsd.o
39     CTDB_SCSI_IO=
40     CTDB_PCAP_LDFLAGS=-lpcap
41     LDFLAGS="$LDFLAGS -L/usr/local/lib -lexecinfo"
42     AC_SUBST(LDFLAGS)
43     CPPFLAGS="$CPPFLAGS -I/usr/local/include -D_FREEBSD_=1"
44     AC_SUBST(CPPFLAGS)
45     ;;
46   GNU)
47     CTDB_SYSTEM_OBJ=common/system_gnu.o
48     CTDB_SCSI_IO=
49     CTDB_PCAP_LDFLAGS=-lpcap
50     ;;
51   *)
52     echo unknown system  cant configure
53     exit
54     ;;
55 esac
57 AC_LIBREPLACE_ALL_CHECKS
58 AC_LIBREPLACE_NETWORK_CHECKS
60 if test "$ac_cv_prog_gcc" = yes; then
61    CFLAGS="$CFLAGS -Wall -Wshadow -Wstrict-prototypes -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings"
64 LOGDIR='${localstatedir}/log'
65 AC_ARG_WITH([logdir],
66         [  --with-logdir=DIR       path to log directory [[LOCALSTATEDIR/log]]],
67         LOGDIR=$withval)
68 if test ! -z "$LOGDIR"; then
69   if test "$LOGDIR" = "yes" -o "$LOGDIR" = "no"; then
70     AC_MSG_ERROR([--with-logdir must specify a path])
71   fi
73 AC_SUBST(LOGDIR)
75 SOCKPATH='${localstatedir}/run/ctdb/ctdbd.socket'
76 AC_ARG_WITH([socketpath],
77         [  --with-socketpath=FILE       path to CTDB daemon socket [[LOCALSTATEDIR/run/ctdb/ctdbd.socket]]],
78         SOCKPATH=$withval)
79 if test ! -z "$SOCKPATH"; then
80   if test "$SOCKPATH" = "yes" -o "$SOCKPATH" = "no"; then
81           AC_MSG_ERROR([--with-socketpath must specify a file path])
82   fi
84 AC_SUBST(SOCKPATH)
86 AC_CONFIG_HEADER(config.h)
88 EXTRA_OBJ=""
90 m4_include(libpopt.m4)
91 m4_include(libtalloc.m4)
92 m4_include(libtdb.m4)
93 m4_include(libtevent.m4)
94 m4_include(ib/config.m4)
95 m4_include(lib/util/signal.m4)
96 m4_include(lib/util/fault.m4)
97 m4_include(lib/socket_wrapper/config.m4)
98 m4_include(utils/pmda/config.m4)
100 AC_CHECK_HEADERS(sched.h)
101 AC_CHECK_HEADERS(procinfo.h)
103 AC_CHECK_DECL([ETIME], [],[AC_DEFINE([ETIME], ETIMEDOUT, [ETIME on non-supporting platforms])], [
104 #include <errno.h>
107 AC_CHECK_FUNCS(sched_setscheduler)
108 AC_CHECK_FUNCS(thread_setsched)
109 AC_CHECK_FUNCS(mlockall)
111 AC_CACHE_CHECK([for sin_len in sock],ctdb_cv_HAVE_SOCK_SIN_LEN,[
112 AC_TRY_COMPILE([#include <sys/types.h>
113 #include <sys/socket.h>
114 #include <netinet/in.h>],
115 [struct sockaddr_in sock; sock.sin_len = sizeof(sock);],
116 ctdb_cv_HAVE_SOCK_SIN_LEN=yes,ctdb_cv_HAVE_SOCK_SIN_LEN=no)])
117 if test x"$ctdb_cv_HAVE_SOCK_SIN_LEN" = x"yes"; then
118     AC_DEFINE(HAVE_SOCK_SIN_LEN,1,[Whether the sockaddr_in struct has a sin_len property])
121 AC_SUBST(EXTRA_OBJ)
122 AC_SUBST(CTDB_SYSTEM_OBJ)
123 AC_SUBST(CTDB_SCSI_IO)
124 AC_SUBST(CTDB_PCAP_LDFLAGS)
126 AC_OUTPUT(Makefile ctdb.pc)