summaryrefslogtreecommitdiffstats
path: root/patches/gpsd-2.39/0006-fix-parallel-build.patch
blob: 1ee26f2c078bfc674540589fe04667630bd5caa2 (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
From: Robert Schwebel <r.schwebel@pengutronix.de>
Date: Sun, 30 Oct 2011 22:33:40 +0100
Subject: [PATCH] fix parallel build

The build system has a race with the creation of the python bindings; if
both targets of the "gpspacket.so gpslib.so:" rule are started at the
same time, the build "sometimes" breaks; this can be triggered with only
a few cycles when built with -j16 on a 8-way box.

Signed-off-by: Robert Schwebel <r.schwebel@pengutronix.de>
---
 Makefile.am |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 05e31f0..818c57a 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -187,12 +187,17 @@ if HAVE_PYTHON
 PYEXTENSIONS = gpspacket.so gpslib.so
 noinst_SCRIPTS = gpspacket.so gpslib.so setup.py
 
-gpspacket.so gpslib.so: gpspacket.c gpslib.c libgps.la
+.PHONY: build_python_ext
+build_python_ext: gpspacket.c gpslib.c libgps.la
 	(pwd="`pwd`"; cd $(srcdir) && $(PYTHON) setup.py build_ext --build-lib "$$pwd" --build-temp "$$pwd/build" --include-dirs "$$pwd")
-endif
+
+gpspacket.so: build_python_ext
+gpslib.so: build_python_ext
+
 # Clean up after Python
 clean-local:
 	rm -rf build
+endif
 
 #
 # Build test_gpsmm