From 2337d83d410d6a64ad7707fe7f093fc654f66e4f Mon Sep 17 00:00:00 2001 From: David Levine Date: Sun, 6 May 2012 21:53:18 -0500 Subject: [PATCH] Default to fcntl locking for AIX, Cygwin, and Linux. Without it on Cygwin, nmh is unusable on FAT32 filesystems. Default to flock on FreeBSD. --- MACHINES | 3 +++ configure.ac | 10 ++++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/MACHINES b/MACHINES index ba36863..482941a 100644 --- a/MACHINES +++ b/MACHINES @@ -27,6 +27,9 @@ Be sure to install these Cygwin packages: libncurses10 libncurses-devel +Note that the -link switch to refile cannot be used on FAT32 and +similar filesystems. + -------------------------------------- HPUX: diff --git a/configure.ac b/configure.ac index 70490ca..ece8090 100644 --- a/configure.ac +++ b/configure.ac @@ -71,6 +71,12 @@ AC_DEFINE_UNQUOTED([BACKUP_PREFIX], "$backup_prefix", [The prefix that is prepended to the name of message files when they are "removed" by rmm. This should typically be `,' or `#'.])dnl dnl What method of locking to use? +AS_CASE(["$host_os"], + [aix*|cygwin*|linux*], + [default_locktype="fcntl"; default_locking=FCNTL_LOCKING], + [freebsd*], [default_locktype="flock"; default_locking=FLOCK_LOCKING], + [default_locktype="dot"; default_locking=DOT_LOCKING]) + AC_ARG_WITH(locking, AS_HELP_STRING([--with-locking=@<:@dot|fcntl|flock|lockf@:>@], [specify the file locking method])) @@ -88,8 +94,8 @@ elif test x"$with_locking" = x"fcntl"; then LOCKTYPE="fcntl" AC_DEFINE(FCNTL_LOCKING, 1, [Define to use fnctl() based locking.])dnl else - LOCKTYPE="dot" - AC_DEFINE(DOT_LOCKING)dnl + LOCKTYPE="$default_locktype" + AC_DEFINE_UNQUOTED($default_locking, 1)dnl fi dnl Should we use a locking directory? -- 1.7.10.4