reason not to use dot-locking is if the mail spool directory
is not world- or user-writeable, and thus a lock file cannot
be created.
+
+--with-lockdir=DIR
+ If you have defined "dot" locking, then the default is to
+ place the lock files in the same directory as the file that
+ is to be locked. Alternately, if you use this option, you can
+ specify that all lock files go in the specified directory.
+ Don't define this unless you know you need it.
+
+ This option is only relevant if "dot" locking is used.
+ In the other cases, it is ignored.
./config.status config.h stamp
config.h.in: stamp-h.in
-stamp-h.in: configure.ac acconfig.h
+stamp-h.in: configure.ac
cd $(srcdir) && autoheader
date > $@
+++ /dev/null
-
-/****** BEGIN USER CONFIGURATION SECTION *****/
-
-/*
- * IMPORTANT: You should no longer need to edit this file to handle
- * your operating system. That should be handled and set correctly by
- * configure now.
- *
- * These are slowly being phased out, but currently
- * not everyone is auto-configured. Then decide if you
- * wish to change the features that are compiled into nmh.
- */
-
-/*
- * If you have defined DOT_LOCKING, then the default is to
- * place the lock files in the same directory as the file that
- * is to be locked. Alternately, if you define LOCKDIR, you
- * can specify that all lock files go in a specific directory.
- * Don't define this unless you know you need it.
- */
-/* #define LOCKDIR "/usr/spool/locks" */
-
-
-/***** END USER CONFIGURATION SECTION *****/
-@TOP@
AC_DEFINE(DOT_LOCKING)dnl
fi
+dnl Should we use a locking directory?
+AC_ARG_WITH(lockdir,
+ AS_HELP_STRING([--with-lockdir=dir], [Store dot-lock files in "dir"]), [
+ AS_IF([test "x$with_lockdir" = xyes],[
+ AC_MSG_ERROR([--with-lockdir requires an argument])])
+])
+
+if test x"$with_lockdir" != x; then
+ LOCKDIR="$with_lockdir"
+ AC_DEFINE_UNQUOTED(LOCKDIR, ["$with_lockdir"],
+ [Directory to store dot-locking lock files.])dnl
+fi
+
dnl ----------------------------------------------------
dnl Default location is /usr/local/mmh/{bin,etc,lib,share/man}
eval "nmhlib=${libdir}"; eval "nmhlib=${nmhlib}"
eval "nmhman=${mandir}"; eval "nmhman=${nmhman}"
-echo "
+cat <<!
mmh configuration
-----------------
mmh version : AC_PACKAGE_VERSION
mail spool : ${mailspool}
file locking type : ${LOCKTYPE}
-"
+!
+if test x"$LOCKTYPE" = x"dot" && test x"$LOCKDIR" != x; then
+ echo "lockfile directory : ${LOCKDIR}"
+fi
#include <lockfile.h>
#endif
-#ifdef LOCKDIR
+#ifdef DOT_LOCKING
+# ifdef LOCKDIR
char *lockdir = LOCKDIR;
+# endif
#endif
/* Are we using any kernel locking? */