summaryrefslogtreecommitdiff
path: root/meta/classes
diff options
context:
space:
mode:
authorChristopher Larson <kergoth@gmail.com>2012-04-26 23:32:31 -0500
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-05-03 15:00:24 +0100
commit164df0708d9add81be7d1fd56d487253062756d8 (patch)
tree1147595373e7be9eead442ba4ecafc4a53217d8e /meta/classes
parentaf593b5a3a8e1e552b34ca2785894ac468763024 (diff)
downloadopenembedded-core-164df0708d9add81be7d1fd56d487253062756d8.tar.gz
openembedded-core-164df0708d9add81be7d1fd56d487253062756d8.tar.bz2
openembedded-core-164df0708d9add81be7d1fd56d487253062756d8.tar.xz
openembedded-core-164df0708d9add81be7d1fd56d487253062756d8.zip
bitbake.conf: shift build config summary control to here
Signed-off-by: Christopher Larson <kergoth@gmail.com>
Diffstat (limited to 'meta/classes')
-rw-r--r--meta/classes/base.bbclass50
1 files changed, 34 insertions, 16 deletions
diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass
index a984eae5b..07ef9a231 100644
--- a/meta/classes/base.bbclass
+++ b/meta/classes/base.bbclass
@@ -225,6 +225,27 @@ def get_layers_branch_rev(d):
return layers_branch_rev
+BUILDCFG_FUNCS ??= "buildcfg_vars get_layers_branch_rev buildcfg_neededvars"
+BUILDCFG_FUNCS[type] = "list"
+
+def buildcfg_vars(d):
+ statusvars = oe.data.typed_value('BUILDCFG_VARS', d)
+ for var in statusvars:
+ value = d.getVar(var, True)
+ if value is not None:
+ yield '%-17s = "%s"' % (var, value)
+
+def buildcfg_neededvars(d):
+ needed_vars = oe.data.typed_value("BUILDCFG_NEEDEDVARS", d)
+ pesteruser = []
+ for v in needed_vars:
+ val = d.getVar(v, True)
+ if not val or val == 'INVALID':
+ pesteruser.append(v)
+
+ if pesteruser:
+ bb.fatal('The following variable(s) were not set: %s\nPlease set them directly, or choose a MACHINE or DISTRO that sets them.' % ', '.join(pesteruser))
+
addhandler base_eventhandler
python base_eventhandler() {
from bb.event import getName
@@ -232,22 +253,19 @@ python base_eventhandler() {
name = getName(e)
if name.startswith("BuildStarted"):
- e.data.setVar( 'BB_VERSION', bb.__version__)
- statusvars = ['BB_VERSION', 'TARGET_ARCH', 'TARGET_OS', 'MACHINE', 'DISTRO', 'DISTRO_VERSION','TUNE_FEATURES', 'TARGET_FPU']
- statuslines = ["%-17s = \"%s\"" % (i, e.data.getVar(i, True) or '') for i in statusvars]
-
- statuslines += get_layers_branch_rev(e.data)
- statusmsg = "\nOE Build Configuration:\n%s\n" % '\n'.join(statuslines)
- bb.plain(statusmsg)
-
- needed_vars = [ "TARGET_ARCH", "TARGET_OS" ]
- pesteruser = []
- for v in needed_vars:
- val = e.data.getVar(v, True)
- if not val or val == 'INVALID':
- pesteruser.append(v)
- if pesteruser:
- bb.fatal('The following variable(s) were not set: %s\nPlease set them directly, or choose a MACHINE or DISTRO that sets them.' % ', '.join(pesteruser))
+ e.data.setVar('BB_VERSION', bb.__version__)
+ statuslines = []
+ for func in oe.data.typed_value('BUILDCFG_FUNCS', e.data):
+ g = globals()
+ if func not in g:
+ bb.warn("Build configuration function '%s' does not exist" % func)
+ else:
+ flines = g[func](e.data)
+ if flines:
+ statuslines.extend(flines)
+
+ statusheader = e.data.getVar('BUILDCFG_HEADER', True)
+ bb.plain('\n%s\n%s\n' % (statusheader, '\n'.join(statuslines)))
if name == "ConfigParsed":
generate_git_config(e)