summaryrefslogtreecommitdiffstats
path: root/source-builder/sb/linux.py
diff options
context:
space:
mode:
authorChris Johns <chrisj@rtems.org>2013-04-03 14:31:41 +1100
committerChris Johns <chrisj@rtems.org>2013-04-03 14:31:41 +1100
commit0add2eaa706665552af694b9fbb75f42d37044b8 (patch)
treee2647e21c715c6e071387c114ad90f9638f73de0 /source-builder/sb/linux.py
parentReport the exit code on a shell macro failure. (diff)
downloadrtems-source-builder-0add2eaa706665552af694b9fbb75f42d37044b8.tar.bz2
PR 2108, PR 2109. Add --jobs and --always-clean.
Refactor the options handling in defaults.py to allow the --jobs option have varing specific parameters. The option supports 'none', 'max' and 'half' or a fraction to divide the number of CPUs or an integer value which is the number of jobs. The --no-smp has been removed. The host specific modules have been changed to set the number of CPUs in the defaults table. Fixed the --keep-going to clean up is --always-clean is provided even if the build has an error.
Diffstat (limited to 'source-builder/sb/linux.py')
-rw-r--r--source-builder/sb/linux.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/source-builder/sb/linux.py b/source-builder/sb/linux.py
index 7e01149..66a3d5b 100644
--- a/source-builder/sb/linux.py
+++ b/source-builder/sb/linux.py
@@ -35,23 +35,23 @@ def load():
processors = '/bin/grep processor /proc/cpuinfo'
e = execute.capture_execution()
exit_code, proc, output = e.shell(processors)
+ ncpus = 0
if exit_code == 0:
- cpus = 0
try:
for l in output.split('\n'):
count = l.split(':')[1].strip()
if count > cpus:
- cpus = int(count)
- if cpus > 0:
- smp_mflags = '-j%d' % (cpus + 1)
+ ncpus = int(count)
except:
pass
+ ncpus = str(ncpus + 1)
if uname[4].startswith('arm'):
cpu = 'arm'
else:
cpu = uname[4]
defines = {
+ '_ncpus': ('none', 'none', ncpus),
'_os': ('none', 'none', 'linux'),
'_host': ('triplet', 'required', cpu + '-linux-gnu'),
'_host_vendor': ('none', 'none', 'gnu'),
@@ -62,7 +62,6 @@ def load():
'_usr': ('dir', 'required', '/usr'),
'_var': ('dir', 'required', '/var'),
'optflags': ('none', 'none', '-O2 -pipe'),
- '_smp_mflags': ('none', 'none', smp_mflags),
'__bzip2': ('exe', 'required', '/usr/bin/bzip2'),
'__gzip': ('exe', 'required', '/bin/gzip'),
'__tar': ('exe', 'required', '/bin/tar')