add additional logging when tdb_chainunlock() fails
[sahlberg/ctdb.git] / configure.ac
index d552eed00b44bf1f02edbcb6608ba21f61f0f79a..d4098a6a5ac0d5a16115b0377ffde38498eec3f1 100644 (file)
@@ -1,4 +1,5 @@
 AC_PREREQ(2.50)
+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']))
 AC_DEFUN([AC_CHECK_LIB_EXT], [
        AC_CHECK_LIB([$1],[$3],[$4],[$5],[$7])
        ac_cv_lib_ext_$1_$3=$ac_cv_lib_$1_$3
@@ -11,9 +12,19 @@ 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 ""])
-AC_INIT(ctdb.h)
 AC_CONFIG_SRCDIR([server/ctdbd.c])
 
+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
+
 case `uname` in
   Linux*)
     CTDB_SYSTEM_OBJ=common/system_linux.o
@@ -37,6 +48,17 @@ if test "$ac_cv_prog_gcc" = yes; then
    CFLAGS="$CFLAGS -Wall -Wshadow -Wstrict-prototypes -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings"
 fi
 
+LOGDIR='${localstatedir}/log'
+AC_ARG_WITH([logdir],
+       [  --with-logdir=DIR       path to log directory [[LOCALSTATEDIR/log]]],
+       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)
+
 AC_CONFIG_HEADER(config.h)
 
 EXTRA_OBJ=""
@@ -47,16 +69,9 @@ m4_include(libtdb.m4)
 m4_include(libevents.m4)
 m4_include(ib/config.m4)
 
-AC_CHECK_HEADERS(libipq.h linux/netfilter.h)
-
-IPQ_LIBS=""
-if test x"$ac_cv_header_libipq_h" = x"yes"; then
-   IPQ_LIBS="-lipq"
-fi
-AC_SUBST(IPQ_LIBS)
-
 AC_CHECK_HEADERS(sched.h)
 AC_CHECK_FUNCS(sched_setscheduler)
+AC_CHECK_FUNCS(mlockall)
 
 AC_CACHE_CHECK([for sin_len in sock],ctdb_cv_HAVE_SOCK_SIN_LEN,[
 AC_TRY_COMPILE([#include <sys/types.h>
@@ -73,4 +88,4 @@ AC_SUBST(CTDB_SYSTEM_OBJ)
 AC_SUBST(CTDB_SCSI_IO)
 AC_SUBST(CTDB_PCAP_LDFLAGS)
 
-AC_OUTPUT(Makefile)
+AC_OUTPUT(Makefile ctdb.pc)