waf.bbclass: filter out non -j from PARALLEL_MAKE

'waf' supports only simple '-j' and fails when parallel make flags
contain extended options like '--load-average'.

Patch uses the method from 'boost.inc' to filter '-j'.

(From OE-Core rev: bc394e1dd229845a315a97704beca43fbb8976ee)

Signed-off-by: Enrico Scholz <enrico.scholz@sigma-chemnitz.de>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Enrico Scholz 2015-09-10 18:54:33 +02:00 committed by Richard Purdie
parent 95719b00fb
commit 0cc4eef515
1 changed files with 23 additions and 1 deletions

View File

@ -1,9 +1,31 @@
def get_waf_parallel_make(bb, d):
pm = d.getVar('PARALLEL_MAKE', True)
if pm:
# look for '-j' and throw other options (e.g. '-l') away
# because they might have different meaning in bjam
pm = pm.split()
while pm:
v = None
opt = pm.pop(0)
if opt == '-j':
v = pm.pop(0)
elif opt.startswith('-j'):
v = opt[2:].strip()
else:
v = None
if v:
v = min(64, int(v))
return '-j' + str(v)
return ""
waf_do_configure() {
${S}/waf configure --prefix=${prefix} ${EXTRA_OECONF}
}
waf_do_compile() {
${S}/waf build ${PARALLEL_MAKE}
${S}/waf build ${@get_waf_parallel_make('PARALLEL_MAKE', d)}
}
waf_do_install() {