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 CPPFLAGS="$CPPFLAGS -D_AIX_=1"
30 CTDB_PCAP_LDFLAGS=-lpcap
33 CTDB_SYSTEM_OBJ=common/system_kfreebsd.o
35 CTDB_PCAP_LDFLAGS=-lpcap
38 CTDB_SYSTEM_OBJ=common/system_freebsd.o
40 CTDB_PCAP_LDFLAGS=-lpcap
41 LDFLAGS="$LDFLAGS -L/usr/local/lib -lexecinfo"
43 CPPFLAGS="$CPPFLAGS -I/usr/local/include -D_FREEBSD_=1"
47 CTDB_SYSTEM_OBJ=common/system_gnu.o
49 CTDB_PCAP_LDFLAGS=-lpcap
52 echo unknown system cant configure
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'
66 [ --with-logdir=DIR path to log directory [[LOCALSTATEDIR/log]]],
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])
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]]],
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])
86 AC_CONFIG_HEADER(config.h)
90 m4_include(libpopt.m4)
91 m4_include(libtalloc.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])], [
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])
122 AC_SUBST(CTDB_SYSTEM_OBJ)
123 AC_SUBST(CTDB_SCSI_IO)
124 AC_SUBST(CTDB_PCAP_LDFLAGS)
126 AC_OUTPUT(Makefile ctdb.pc)