2006-11-18 02:41:20 +03:00
AC_PREREQ(2.50)
2009-05-12 02:59:49 +04:00
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']))
2006-11-18 02:41:20 +03:00
AC_DEFUN([SMB_MODULE_DEFAULT], [echo -n ""])
AC_DEFUN([SMB_LIBRARY_ENABLE], [echo -n ""])
AC_DEFUN([SMB_EXT_LIB], [echo -n ""])
AC_DEFUN([SMB_ENABLE], [echo -n ""])
2007-06-07 16:35:14 +04:00
AC_CONFIG_SRCDIR([server/ctdbd.c])
2006-11-18 02:41:20 +03:00
2009-05-06 04:29:07 +04:00
if test "${libdir}" = '${exec_prefix}/lib'; then
case `uname -m` in
x86_64|ppc64|powerpc64)
libdir='${exec_prefix}/lib64'
;;
*)
libdir='${exec_prefix}/lib'
;;
esac
fi
2009-04-08 04:45:00 +04:00
2007-07-14 09:16:52 +04:00
case `uname` in
Linux*)
CTDB_SYSTEM_OBJ=common/system_linux.o
CTDB_SCSI_IO=bin/scsi_io
CTDB_PCAP_LDFLAGS=
;;
AIX*)
CTDB_SYSTEM_OBJ=common/system_aix.o
CTDB_SCSI_IO=
CTDB_PCAP_LDFLAGS=-lpcap
;;
2011-12-07 01:26:42 +04:00
GNU/kFreeBSD)
CTDB_SYSTEM_OBJ=common/system_kfreebsd.o
CTDB_SCSI_IO=
CTDB_PCAP_LDFLAGS=-lpcap
;;
2012-02-06 15:50:05 +04:00
FreeBSD)
CTDB_SYSTEM_OBJ=common/system_freebsd.o
CTDB_SCSI_IO=
CTDB_PCAP_LDFLAGS=-lpcap
LDFLAGS="$LDFLAGS -L/usr/local/lib -lexecinfo"
AC_SUBST(LDFLAGS)
2012-02-18 15:29:49 +04:00
CPPFLAGS="$CPPFLAGS -I/usr/local/include -D_FREEBSD_=1"
2012-02-06 15:50:05 +04:00
AC_SUBST(CPPFLAGS)
;;
2011-11-25 23:58:49 +04:00
GNU)
CTDB_SYSTEM_OBJ=common/system_gnu.o
CTDB_SCSI_IO=
CTDB_PCAP_LDFLAGS=-lpcap
;;
2007-07-14 09:16:52 +04:00
*)
echo unknown system cant configure
exit
;;
esac
2006-11-18 02:41:20 +03:00
AC_LIBREPLACE_ALL_CHECKS
2011-11-25 19:29:44 +04:00
AC_LIBREPLACE_NETWORK_CHECKS
2006-11-18 02:41:20 +03:00
if test "$ac_cv_prog_gcc" = yes; then
CFLAGS="$CFLAGS -Wall -Wshadow -Wstrict-prototypes -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings"
fi
2009-02-04 02:15:57 +03:00
LOGDIR='${localstatedir}/log'
AC_ARG_WITH([logdir],
2009-02-04 02:28:16 +03:00
[ --with-logdir=DIR path to log directory [[LOCALSTATEDIR/log]]],
2009-02-04 02:15:57 +03:00
LOGDIR=$withval)
if test ! -z "$LOGDIR"; then
if test "$LOGDIR" = "yes" -o "$LOGDIR" = "no"; then
AC_MSG_ERROR([--with-logdir must specify a path])
fi
fi
AC_SUBST(LOGDIR)
2006-11-18 02:41:20 +03:00
AC_CONFIG_HEADER(config.h)
EXTRA_OBJ=""
2007-05-02 23:21:14 +04:00
m4_include(libpopt.m4)
2006-11-18 02:41:20 +03:00
m4_include(libtalloc.m4)
m4_include(libtdb.m4)
2010-08-18 03:46:31 +04:00
m4_include(libtevent.m4)
2006-12-15 18:02:45 +03:00
m4_include(ib/config.m4)
2009-12-18 14:32:38 +03:00
m4_include(lib/util/signal.m4)
m4_include(lib/util/fault.m4)
2011-10-20 16:17:45 +04:00
m4_include(lib/socket_wrapper/config.m4)
2006-11-18 02:41:20 +03:00
2007-05-24 08:52:10 +04:00
AC_CHECK_HEADERS(sched.h)
2011-07-13 20:11:23 +04:00
AC_CHECK_HEADERS(pcp/pmapi.h pcp/impl.h pcp/pmda.h, [], [],
[[#ifdef HAVE_PCP_PMAPI_H
# include <pcp/pmapi.h>
#endif
#ifdef HAVE_PCP_IMPL_H
# include <pcp/impl.h>
#endif
]])
2011-12-07 01:24:26 +04:00
AC_CHECK_DECL([ETIME], [],[AC_DEFINE([ETIME], ETIMEDOUT, [ETIME on non-supporting platforms])], [
#include <errno.h>
])
2007-05-24 08:52:10 +04:00
AC_CHECK_FUNCS(sched_setscheduler)
2009-12-16 13:27:20 +03:00
AC_CHECK_FUNCS(mlockall)
2007-05-24 08:52:10 +04:00
2007-05-15 03:42:52 +04:00
AC_CACHE_CHECK([for sin_len in sock],ctdb_cv_HAVE_SOCK_SIN_LEN,[
AC_TRY_COMPILE([#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>],
[struct sockaddr_in sock; sock.sin_len = sizeof(sock);],
ctdb_cv_HAVE_SOCK_SIN_LEN=yes,ctdb_cv_HAVE_SOCK_SIN_LEN=no)])
if test x"$ctdb_cv_HAVE_SOCK_SIN_LEN" = x"yes"; then
AC_DEFINE(HAVE_SOCK_SIN_LEN,1,[Whether the sockaddr_in struct has a sin_len property])
fi
2011-07-13 20:11:23 +04:00
if test x"$ac_cv_header_pcp_pmda_h" = x"yes"; then
CTDB_PMDA=bin/pmdactdb
CTDB_PMDA_INSTALL=install_pmda
else
CTDB_PMDA=
CTDB_PMDA_INSTALL=
fi
2006-11-18 02:41:20 +03:00
AC_SUBST(EXTRA_OBJ)
2007-07-14 09:16:52 +04:00
AC_SUBST(CTDB_SYSTEM_OBJ)
AC_SUBST(CTDB_SCSI_IO)
AC_SUBST(CTDB_PCAP_LDFLAGS)
2011-07-13 20:11:23 +04:00
AC_SUBST(CTDB_PMDA)
AC_SUBST(CTDB_PMDA_INSTALL)
2006-11-18 02:41:20 +03:00
2009-04-08 03:21:11 +04:00
AC_OUTPUT(Makefile ctdb.pc)