Let XFile::lock warn and fail with parallel non-GNU make, too.
authorRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Sun, 19 Apr 2009 10:46:36 +0000 (12:46 +0200)
committerRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Sun, 19 Apr 2009 10:46:36 +0000 (12:46 +0200)
* lib/Automake/XFile.pm (lock): Also match `-j' for parallel BSD
make, and `-P' for parallel HP-UX make.

Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
ChangeLog
lib/Automake/XFile.pm

index 633e039..6841864 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2009-04-19  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
 
+       Let XFile::lock warn and fail with parallel non-GNU make, too.
+       * lib/Automake/XFile.pm (lock): Also match `-j' for parallel BSD
+       make, and `-P' for parallel HP-UX make.
+
        Fix AM_PROG_VALAC version requirement detection.
        * m4/vala.m4 (AM_PROG_VALAC): Remove `Vala ' from valac
        --version string before comparing versions.
index 27f2455..6e5005f 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (C) 2001, 2003, 2004, 2006, 2008 Free Software Foundation,
+# Copyright (C) 2001, 2003, 2004, 2006, 2008, 2009 Free Software Foundation,
 # Inc.
 
 # This program is free software; you can redistribute it and/or modify
@@ -222,16 +222,18 @@ sub lock
   # first of flock(2), fcntl(2), or lockf(3) that works.  These can fail on
   # NFS-backed files, with ENOLCK (GNU/Linux) or EOPNOTSUPP (FreeBSD); we
   # usually ignore these errors.  If $ENV{MAKEFLAGS} suggests that a parallel
-  # invocation of GNU `make' has invoked the tool we serve, report all locking
+  # invocation of `make' has invoked the tool we serve, report all locking
   # failures and abort.
   #
   # On Unicos, flock(2) and fcntl(2) over NFS hang indefinitely when `lockd' is
   # not running.  NetBSD NFS clients silently grant all locks.  We do not
   # attempt to defend against these dangers.
+  #
+  # -j is for parallel BSD make, -P is for parallel HP-UX make.
   if (!flock ($fh, $mode))
     {
       my $make_j = (exists $ENV{'MAKEFLAGS'}
-                   && " -$ENV{'MAKEFLAGS'}" =~ / (-[BdeikrRsSw]*j|---?jobs)/);
+                   && " -$ENV{'MAKEFLAGS'}" =~ / (-[BdeikrRsSw]*[jP]|--[jP]|---?jobs)/);
       my $note = "\nforgo `make -j' or use a file system that supports locks";
       my $file = $fh->name;