summaryrefslogtreecommitdiffstats
path: root/meta/classes
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2012-04-12 14:04:18 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-04-13 13:49:35 +0100
commitb4acabea99e9f15558b26f0c85902c2af2c7948c (patch)
treef33734334448fe9c412382f2e9ef118fe7621de5 /meta/classes
parent898bee7a4e97d74e5da4381188a2f3e030d3f0e4 (diff)
downloadpoky-b4acabea99e9f15558b26f0c85902c2af2c7948c.tar.gz
base.bbclass: Fix PACKAGECONFIG issues with native and nativesdk BBCLASSEXTEND recipes (and multilib)
This patch fixes up the issues that were being seen where BBCLASSEXTEND and PACKAGECONFIG were interacting badly. It also ensures PACKAGECONFIG interacts properly with multilib builds. Ideally some of this code will be abstracted into lib/oe/classextend.py but at this point in release more invasive changes like this are inappropriate. This patch also removed empty strings from expressions rather than passing them around as this was complicating the additional code unnecessarily. The patch was verified against the OE-Core metadata where the return values of expandFilter() were sanity checked by hand for native/nativesdk and multilib combinations. [YOCTO #2225] (From OE-Core rev: 46db11c4a789034b7040faf127ab865148bedad8) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes')
-rw-r--r--meta/classes/base.bbclass36
1 files changed, 31 insertions, 5 deletions
diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass
index ef9267a126..02e1ff5b74 100644
--- a/meta/classes/base.bbclass
+++ b/meta/classes/base.bbclass
@@ -305,9 +305,32 @@ python () {
305 pkgconfigflags = d.getVarFlags("PACKAGECONFIG") or {} 305 pkgconfigflags = d.getVarFlags("PACKAGECONFIG") or {}
306 if pkgconfigflags: 306 if pkgconfigflags:
307 pkgconfig = (d.getVar('PACKAGECONFIG', True) or "").split() 307 pkgconfig = (d.getVar('PACKAGECONFIG', True) or "").split()
308 pn = d.getVar("PN", True)
309 mlprefix = d.getVar("MLPREFIX", True)
310
311 def expandFilter(appends, extension, prefix):
312 appends = bb.utils.explode_deps(d.expand(" ".join(appends)))
313 newappends = []
314 for a in appends:
315 if a.endswith("-native") or a.endswith("-cross"):
316 newappends.append(a)
317 elif a.startswith("virtual/"):
318 subs = a.split("/", 1)[1]
319 newappends.append("virtual/" + prefix + subs + extension)
320 else:
321 newappends.append(prefix + a + extension)
322 return newappends
323
308 def appendVar(varname, appends): 324 def appendVar(varname, appends):
309 if not appends: 325 if not appends:
310 return 326 return
327 if varname.find("DEPENDS") != -1:
328 if pn.endswith("-nativesdk"):
329 appends = expandFilter(appends, "-nativesdk", "")
330 if pn.endswith("-native"):
331 appends = expandFilter(appends, "-native", "")
332 if mlprefix:
333 appends = expandFilter(appends, "", mlprefix)
311 varname = d.expand(varname) 334 varname = d.expand(varname)
312 d.appendVar(varname, " " + " ".join(appends)) 335 d.appendVar(varname, " " + " ".join(appends))
313 336
@@ -324,11 +347,14 @@ python () {
324 elif len(items) == 4: 347 elif len(items) == 4:
325 enable, disable, depend, rdepend = items 348 enable, disable, depend, rdepend = items
326 if flag in pkgconfig: 349 if flag in pkgconfig:
327 extradeps.append(depend) 350 if depend:
328 extrardeps.append(rdepend) 351 extradeps.append(depend)
329 extraconf.append(enable) 352 if rdepend:
330 else: 353 extrardeps.append(rdepend)
331 extraconf.append(disable) 354 if enable:
355 extraconf.append(enable)
356 elif disable:
357 extraconf.append(disable)
332 appendVar('DEPENDS', extradeps) 358 appendVar('DEPENDS', extradeps)
333 appendVar('RDEPENDS_${PN}', extrardeps) 359 appendVar('RDEPENDS_${PN}', extrardeps)
334 appendVar('EXTRA_OECONF', extraconf) 360 appendVar('EXTRA_OECONF', extraconf)