build: Make log-directory configurable indepently of VARDIR
[sahlberg/ctdb.git] / configure.ac
index d552eed00b44bf1f02edbcb6608ba21f61f0f79a..88c82f0308ecf8be99a617730764c0ad49579e5c 100644 (file)
@@ -37,6 +37,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],
+       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=""