diff options
-rw-r--r-- | meta/classes/base.bbclass | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass index 7cd6efad1d..f5397446dd 100644 --- a/meta/classes/base.bbclass +++ b/meta/classes/base.bbclass | |||
@@ -291,6 +291,44 @@ do_build () { | |||
291 | python () { | 291 | python () { |
292 | import exceptions, string, re | 292 | import exceptions, string, re |
293 | 293 | ||
294 | # Handle PACKAGECONFIG | ||
295 | # | ||
296 | # These take the form: | ||
297 | # | ||
298 | # PACKAGECONFIG ?? = "<default options>" | ||
299 | # PACKAGECONFIG[foo] = "--enable-foo,--disable-foo,foo_depends,foo_runtime_depends" | ||
300 | pkgconfig = (d.getVar('PACKAGECONFIG', True) or "").split() | ||
301 | if pkgconfig: | ||
302 | def appendVar(varname, appends): | ||
303 | if not appends: | ||
304 | return | ||
305 | varname = bb.data.expand(varname, d) | ||
306 | content = d.getVar(varname, False) or "" | ||
307 | content = content + " " + " ".join(appends) | ||
308 | d.setVar(varname, content) | ||
309 | |||
310 | extradeps = [] | ||
311 | extrardeps = [] | ||
312 | extraconf = [] | ||
313 | for flag, flagval in (d.getVarFlags("PACKAGECONFIG") or {}).items(): | ||
314 | if flag == "defaultval": | ||
315 | continue | ||
316 | items = flagval.split(",") | ||
317 | if len(items) == 3: | ||
318 | enable, disable, depend = items | ||
319 | rdepend = "" | ||
320 | elif len(items) == 4: | ||
321 | enable, disable, depend, rdepend = items | ||
322 | if flag in pkgconfig: | ||
323 | extradeps.append(depend) | ||
324 | extrardeps.append(rdepend) | ||
325 | extraconf.append(enable) | ||
326 | else: | ||
327 | extraconf.append(disable) | ||
328 | appendVar('DEPENDS', extradeps) | ||
329 | appendVar('RDEPENDS_${PN}', extrardeps) | ||
330 | appendVar('EXTRA_OECONF', extraconf) | ||
331 | |||
294 | # If PRINC is set, try and increase the PR value by the amount specified | 332 | # If PRINC is set, try and increase the PR value by the amount specified |
295 | princ = bb.data.getVar('PRINC', d, True) | 333 | princ = bb.data.getVar('PRINC', d, True) |
296 | if princ: | 334 | if princ: |