>>> "Bruno" == Bruno Haible <[EMAIL PROTECTED]> writes: [...] Bruno> $(am__ELCFILES): elc-stamp Bruno> ## Recover from the removal of [EMAIL PROTECTED] Bruno> ## Bruno> ! ## Do not call `make elc-stamp' if emacs is not available, because it would Bruno> ! ## be useless. Bruno> @if test "$(EMACS)" != no && test ! -f $@; then \ Bruno> ! ## Mutual exclusion locking to ensure that if multiple processes need to Bruno> ! ## rebuild elc-stamp, only the first one does it, and the followers wait. Bruno> ! trap 'rm -rf elc-lock elc-stamp' 1 2 3 15; \ Bruno> ! if mkdir elc-lock 2>/dev/null; then \ Bruno> ! ## This code is being executed by the first process. Bruno> ! rm -f elc-stamp; \ Bruno> ! $(MAKE) $(AM_MAKEFLAGS) elc-stamp; \ Bruno> ! rmdir elc-lock; \ Bruno> ! else \ Bruno> ! ## This code is being executed by the follower processes. Bruno> ! ## Wait until the first process is done. Bruno> ! while test -d elc-lock; do sleep 1; done; \ Bruno> ! ## Succeed if and only if the first process succeeded. Bruno> ! test -f elc-stamp; exit $$?; \ Bruno> ! fi; \ Bruno> else : ; fi This code still has a race if one of the followers gets signaled after its trap has been set. Then it will erase elc-lock, and another follower can create it.
Any idea? -- Alexandre Duret-Lutz