summaryrefslogtreecommitdiff
path: root/debian/patches/0100-parallel_build.patch
blob: 3af9a90028a56383b6621abd95a334f1d5a23fed (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
Description:    Disable parallel build on sparc machines
Origin:         Debian
Bug-Debian:     http://bugs.debian.org/632228
Forwarded:      no

Index: scons/engine/SCons/Job.py
===================================================================
--- scons.orig/engine/SCons/Job.py	2011-07-02 13:09:20.281651892 +0200
+++ scons/engine/SCons/Job.py	2011-07-02 13:12:49.925651735 +0200
@@ -83,7 +83,7 @@
         """
 
         self.job = None
-        if num > 1:
+        if num > 1 and not self._check_sparc_machine():
             stack_size = explicit_stack_size
             if stack_size is None:
                 stack_size = default_stack_size
@@ -163,6 +163,19 @@
         except AttributeError:
             pass
 
+    def _check_sparc_machine(self):
+        """ Check whether machine is sparc"""
+        try:
+            from platform import machine
+        except ImportError:
+            pass
+        else:
+            if 'sparc' in machine():
+                SCons.Warnings.warn(SCons.Warnings.StackSizeWarning,
+                                    'Parallel build disabled on sparc, '
+                                    'see Debian bug #632228')
+                return True
+
 class Serial(object):
     """This class is used to execute tasks in series, and is more efficient
     than Parallel, but is only appropriate for non-parallel builds. Only