summaryrefslogtreecommitdiff
path: root/Build/source/utils/xindy-new/xindy-2.4-pre2-PATCHES/patch-12-parallel
blob: 2a8f57745548b4616e301719fcc3c59d7db377fc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
	More problems with aggressive parallel builds (make -j).

	The three rules:
		%-test.xdy : %.pl
			$(PERL) -I$(srcdir) $< $*
		%-doc.tex : %.pl
			$(PERL) -I$(srcdir) $< $*
		%.xdy :	%.pl
			$(PERL) -I$(srcdir) $< $*
	must not run simultaneously or %-test.xdy could be destroyed.

diff -ur -x Makefile.in xindy.orig/make-rules/alphabets/Makefile.am xindy/make-rules/alphabets/Makefile.am
--- xindy/make-rules/alphabets/Makefile.am	2009-12-17 14:53:07.000000000 +0100
+++ xindy/make-rules/alphabets/Makefile.am	2009-12-02 20:34:28.000000000 +0100
@@ -892,14 +892,24 @@
 %-lang.xdy : %-test.xdy
 	sed -n '1,10 p' <$< >$@
 
+# Running "$(PERL) -I$(srcdir) $< $*" creates %-test.xdy, %-doc.tex, %.raw,
+# and %.xdy; %-test.xdy is finished first.  We must not run this command
+# several times simultaneously (for details see Automake manual 27.9).
 %-test.xdy : %.pl
 	$(PERL) -I$(srcdir) $< $*
 
-%-doc.tex : %.pl
-	$(PERL) -I$(srcdir) $< $*
-
-%.xdy :	%.pl
-	$(PERL) -I$(srcdir) $< $*
+%-doc.tex %.xdy : %-test.xdy
+	@if test -f $@; then :; else \
+	  trap 'rm -rf $*.lock $<' 1 2 13 15; \
+	  if mkdir $*.lock 2>/dev/null; then \
+	    rm -f $<; \
+	    $(MAKE) $(AM_MAKEFLAGS) $<; \
+	    result=$$?; rm -rf $*.lock; exit $$result; \
+	  else \
+	    while test -d $*.lock; do sleep 1; done; \
+	    test -f $<; \
+	  fi; \
+	fi
 
 SUBDIRS = \
 	albanian \
@@ -1264,5 +1274,3 @@
 
 CLEANFILES = $(ALPHABETS) $(DOC_CLEAN)
 
-.NOTPARALLEL:
-