Re-add --with-lockdir=DIR configure option
authormarkus schnalke <meillo@marmaro.de>
Tue, 3 Nov 2015 07:47:26 +0000 (08:47 +0100)
committermarkus schnalke <meillo@marmaro.de>
Wed, 4 Nov 2015 17:37:58 +0000 (18:37 +0100)
At the same time eliminate acconfig.h (and thus the autoreconf
warning).

Include the lock dir string only if we use dot locking.

INSTALL
Makefile.in
acconfig.h [deleted file]
configure.ac
sbr/lock_file.c

diff --git a/INSTALL b/INSTALL
index 8e6c177..3944343 100644 (file)
--- a/INSTALL
+++ b/INSTALL
@@ -160,3 +160,13 @@ Options for configure
      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.
      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.
index abe21a7..7ec7673 100644 (file)
@@ -143,7 +143,7 @@ stamp-h: config.h.in config.status
        ./config.status config.h stamp
 
 config.h.in: stamp-h.in
        ./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 > $@
 
        cd $(srcdir) && autoheader
        date > $@
 
diff --git a/acconfig.h b/acconfig.h
deleted file mode 100644 (file)
index 7352240..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-
-/****** 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@
index d32c30b..653acf0 100644 (file)
@@ -68,6 +68,19 @@ else
   AC_DEFINE(DOT_LOCKING)dnl
 fi
 
   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}
 
 dnl ----------------------------------------------------
 dnl Default location is /usr/local/mmh/{bin,etc,lib,share/man}
@@ -560,7 +573,7 @@ eval "nmhsysconf=${sysconfdir}"; eval "nmhsysconf=${nmhsysconf}"
 eval "nmhlib=${libdir}";         eval "nmhlib=${nmhlib}"
 eval "nmhman=${mandir}";         eval "nmhman=${nmhman}"
 
 eval "nmhlib=${libdir}";         eval "nmhlib=${nmhlib}"
 eval "nmhman=${mandir}";         eval "nmhman=${nmhman}"
 
-echo "
+cat <<!
 mmh configuration
 -----------------
 mmh version            : AC_PACKAGE_VERSION
 mmh configuration
 -----------------
 mmh version            : AC_PACKAGE_VERSION
@@ -580,4 +593,7 @@ sendmail path          : ${sendmailpath}
 mail spool             : ${mailspool}
 
 file locking type      : ${LOCKTYPE}
 mail spool             : ${mailspool}
 
 file locking type      : ${LOCKTYPE}
-"
+!
+if test x"$LOCKTYPE" = x"dot" && test x"$LOCKDIR" != x; then
+       echo "lockfile directory     : ${LOCKDIR}"
+fi
index b62604a..7309c86 100644 (file)
 #include <lockfile.h>
 #endif
 
 #include <lockfile.h>
 #endif
 
-#ifdef LOCKDIR
+#ifdef DOT_LOCKING
+# ifdef LOCKDIR
 char *lockdir = LOCKDIR;
 char *lockdir = LOCKDIR;
+# endif
 #endif
 
 /* Are we using any kernel locking? */
 #endif
 
 /* Are we using any kernel locking? */