From e33f555048c61927bf5089ca9cf3327dddef46cd Mon Sep 17 00:00:00 2001 From: Ralf Wildenhues Date: Sun, 19 Apr 2009 12:46:36 +0200 Subject: [PATCH] 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. Signed-off-by: Ralf Wildenhues --- ChangeLog | 4 ++++ lib/Automake/XFile.pm | 8 +++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 633e039..6841864 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2009-04-19 Ralf Wildenhues + 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. diff --git a/lib/Automake/XFile.pm b/lib/Automake/XFile.pm index 27f2455..6e5005f 100644 --- a/lib/Automake/XFile.pm +++ b/lib/Automake/XFile.pm @@ -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; -- 2.7.4