diff --git a/lib/am/texi-vers.am b/lib/am/texi-vers.am
index b3a8d12..0910da7 100644
--- a/lib/am/texi-vers.am
+++ b/lib/am/texi-vers.am
@@ -32,6 +32,13 @@ DIST_COMMON += %VTEXI% %STAMPVTI%
 ## should never be dependent upon a non-distributed built file.
 ## Therefore we ensure that %DIRSTAMP% exists in the rule.
 ?DIRSTAMP?	@test -f %DIRSTAMP% || $(MAKE) $(AM_MAKEFLAGS) %DIRSTAMP%
+## During parallel builds the recipe could be called twice.
+## Then one process might already have deleted the tmp file while
+## the other tries to copy the tmp file. The following line works as a
+## semaphore such that only one process at a time can use the tmp file.
+## When the following waiting process executes nothing will happen,
+## because then the texi file is already up to date.
+	trap 'rm -f %VTI%.tmp' 1 2 13 15; while test -f %VTI%.tmp; do sleep 1; done;
 	@(dir=.; test -f ./%TEXI% || dir=$(srcdir); \
 	set `$(SHELL) %MDDIR%mdate-sh $$dir/%TEXI%`; \
 	echo "@set UPDATED $$1 $$2 $$3"; \
