summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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)