]> diplodocus.org Git - nmh/blobdiff - m4/locking.m4
Use Nmh-Attach for attach header field name, and accept Attach.
[nmh] / m4 / locking.m4
index e013790a5de6e2e0e12794db0f637026b447c3dc..e5b143b5c8c335682ca3184339ce29c5079cbee8 100644 (file)
@@ -11,7 +11,7 @@ AC_DEFUN([NMH_LOCKING],
 AS_CASE(["$host_os"],
   [aix*|cygwin*|linux*],
     [default_locktype="fcntl"],
 AS_CASE(["$host_os"],
   [aix*|cygwin*|linux*],
     [default_locktype="fcntl"],
-  [freebsd*|openbsd*|darwin*], [default_locktype="flock"],
+  [freebsd*|*netbsd*|openbsd*|darwin*], [default_locktype="flock"],
   [default_locktype="dot"])
 
 AC_MSG_CHECKING([default locking method for the mail spool])
   [default_locktype="dot"])
 
 AC_MSG_CHECKING([default locking method for the mail spool])
@@ -33,11 +33,19 @@ AS_CASE([$with_locking],
     [AC_MSG_ERROR([--without-locking not supported])],
   [AC_MSG_ERROR([Unknown locking type $with_locking])])
 
     [AC_MSG_ERROR([--without-locking not supported])],
   [AC_MSG_ERROR([Unknown locking type $with_locking])])
 
-AC_DEFINE_UNQUOTED([DEFAULT_LOCKING], [$with_locking],
+AC_DEFINE_UNQUOTED([DEFAULT_LOCKING], ["$with_locking"],
   [The default lock type for the mail spool file])
   [The default lock type for the mail spool file])
+AC_SUBST([default_locking], [$with_locking])
 
 AC_MSG_RESULT([$with_locking])
 
 
 AC_MSG_RESULT([$with_locking])
 
+supported_locks="fcntl dot"
+AS_IF([test x"$ac_cv_func_flock" = x"yes"],
+  [supported_locks="$supported_locks flock"])
+AS_IF([test x"$ac_cv_func_lockf" = x"yes"],
+  [supported_locks="$supported_locks lockf"])
+AC_SUBST([supported_locks])
+
 dnl Should we use a locking directory?
 AC_ARG_ENABLE([lockdir],
   [AS_HELP_STRING([--enable-lockdir=dir], [Store dot-lock files in "dir"])], [
 dnl Should we use a locking directory?
 AC_ARG_ENABLE([lockdir],
   [AS_HELP_STRING([--enable-lockdir=dir], [Store dot-lock files in "dir"])], [