summaryrefslogtreecommitdiffstats
path: root/bitbake
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake')
-rw-r--r--bitbake/lib/bb/parse/ast.py24
1 files changed, 21 insertions, 3 deletions
diff --git a/bitbake/lib/bb/parse/ast.py b/bitbake/lib/bb/parse/ast.py
index bf70ad2658..e41bb74f40 100644
--- a/bitbake/lib/bb/parse/ast.py
+++ b/bitbake/lib/bb/parse/ast.py
@@ -427,13 +427,31 @@ def multi_finalize(fn, d):
427 427
428 extended = d.getVar("BBCLASSEXTEND", True) or "" 428 extended = d.getVar("BBCLASSEXTEND", True) or ""
429 if extended: 429 if extended:
430 # the following is to support bbextends with argument, for e.g. multilib
431 # an example is as follow:
432 # BBCLASSEXTEND = "multilib:lib32"
433 # it will create foo-lib32, inheriting multilib.bbclass and set
434 # CURRENTEXTEND to "lib32"
435 extendedmap = {}
436
437 for ext in extended.split():
438 eext = ext.split(':')
439 if len(eext) > 1:
440 extendedmap[eext[1]] = eext[0]
441 else:
442 extendedmap[ext] = ext
443
430 pn = d.getVar("PN", True) 444 pn = d.getVar("PN", True)
431 def extendfunc(name, d): 445 def extendfunc(name, d):
432 d.setVar("PN", "%s-%s" % (pn, name)) 446 if name != extendedmap[name]:
433 bb.parse.BBHandler.inherit([name], d) 447 d.setVar("BBEXTENDCURR", extendedmap[name])
448 d.setVar("BBEXTENDVARIANT", name)
449 else:
450 d.setVar("PN", "%s-%s" % (pn, name))
451 bb.parse.BBHandler.inherit([extendedmap[name]], d)
434 452
435 safe_d.setVar("BBCLASSEXTEND", extended) 453 safe_d.setVar("BBCLASSEXTEND", extended)
436 _create_variants(datastores, extended.split(), extendfunc) 454 _create_variants(datastores, extendedmap.keys(), extendfunc)
437 455
438 for variant, variant_d in datastores.iteritems(): 456 for variant, variant_d in datastores.iteritems():
439 if variant: 457 if variant: