This adds a new configure option "--with-logdir".
logdir defaults to "${localstatedir}/log" .
It is important to have logdir configurable for debian systems,
where localstatedir is set to "/var/lib" and not "/var".
Signed-off-by: Michael Adam <obnox@samba.org>
sbindir = @sbindir@
mandir = @mandir@
localstatedir = @localstatedir@
+logdir = @LOGDIR@
VPATH = @srcdir@:@tdbdir@:@tallocdir@:@libreplacedir@:@poptdir@
srcdir = @srcdir@
etcdir = @sysconfdir@
CFLAGS=-g -I$(srcdir)/include -Iinclude -Ilib -Ilib/util -I$(srcdir) \
-I@tallocdir@ -I@tdbdir@/include -I@libreplacedir@ \
-DVARDIR=\"$(localstatedir)\" -DETCDIR=\"$(etcdir)\" \
+ -DLOGDIR=\"$(logdir)\" \
-DUSE_MMAP=1 @CFLAGS@ $(POPT_CFLAGS)
LIB_FLAGS=@LDFLAGS@ -Llib @LIBS@ $(POPT_LIBS) @INFINIBAND_LIBS@ @CTDB_PCAP_LDFLAGS@
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],
+ 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=""
.nlist = ETCDIR "/ctdb/nodes",
.transport = "tcp",
.event_script_dir = ETCDIR "/ctdb/events.d",
- .logfile = VARDIR "/log/log.ctdb",
+ .logfile = LOGDIR "/log.ctdb",
.db_dir = VARDIR "/ctdb",
.db_dir_persistent = VARDIR "/ctdb/persistent",
.script_log_level = DEBUG_ERR,