diff options
| -rw-r--r-- | meta/classes/base.bbclass | 50 | ||||
| -rw-r--r-- | meta/conf/bitbake.conf | 7 |
2 files changed, 41 insertions, 16 deletions
diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass index a984eae5bc..07ef9a2316 100644 --- a/meta/classes/base.bbclass +++ b/meta/classes/base.bbclass | |||
| @@ -225,6 +225,27 @@ def get_layers_branch_rev(d): | |||
| 225 | return layers_branch_rev | 225 | return layers_branch_rev |
| 226 | 226 | ||
| 227 | 227 | ||
| 228 | BUILDCFG_FUNCS ??= "buildcfg_vars get_layers_branch_rev buildcfg_neededvars" | ||
| 229 | BUILDCFG_FUNCS[type] = "list" | ||
| 230 | |||
| 231 | def buildcfg_vars(d): | ||
| 232 | statusvars = oe.data.typed_value('BUILDCFG_VARS', d) | ||
| 233 | for var in statusvars: | ||
| 234 | value = d.getVar(var, True) | ||
| 235 | if value is not None: | ||
| 236 | yield '%-17s = "%s"' % (var, value) | ||
| 237 | |||
| 238 | def buildcfg_neededvars(d): | ||
| 239 | needed_vars = oe.data.typed_value("BUILDCFG_NEEDEDVARS", d) | ||
| 240 | pesteruser = [] | ||
| 241 | for v in needed_vars: | ||
| 242 | val = d.getVar(v, True) | ||
| 243 | if not val or val == 'INVALID': | ||
| 244 | pesteruser.append(v) | ||
| 245 | |||
| 246 | if pesteruser: | ||
| 247 | 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)) | ||
| 248 | |||
| 228 | addhandler base_eventhandler | 249 | addhandler base_eventhandler |
| 229 | python base_eventhandler() { | 250 | python base_eventhandler() { |
| 230 | from bb.event import getName | 251 | from bb.event import getName |
| @@ -232,22 +253,19 @@ python base_eventhandler() { | |||
| 232 | name = getName(e) | 253 | name = getName(e) |
| 233 | 254 | ||
| 234 | if name.startswith("BuildStarted"): | 255 | if name.startswith("BuildStarted"): |
| 235 | e.data.setVar( 'BB_VERSION', bb.__version__) | 256 | e.data.setVar('BB_VERSION', bb.__version__) |
| 236 | statusvars = ['BB_VERSION', 'TARGET_ARCH', 'TARGET_OS', 'MACHINE', 'DISTRO', 'DISTRO_VERSION','TUNE_FEATURES', 'TARGET_FPU'] | 257 | statuslines = [] |
| 237 | statuslines = ["%-17s = \"%s\"" % (i, e.data.getVar(i, True) or '') for i in statusvars] | 258 | for func in oe.data.typed_value('BUILDCFG_FUNCS', e.data): |
| 238 | 259 | g = globals() | |
| 239 | statuslines += get_layers_branch_rev(e.data) | 260 | if func not in g: |
| 240 | statusmsg = "\nOE Build Configuration:\n%s\n" % '\n'.join(statuslines) | 261 | bb.warn("Build configuration function '%s' does not exist" % func) |
| 241 | bb.plain(statusmsg) | 262 | else: |
| 242 | 263 | flines = g[func](e.data) | |
| 243 | needed_vars = [ "TARGET_ARCH", "TARGET_OS" ] | 264 | if flines: |
| 244 | pesteruser = [] | 265 | statuslines.extend(flines) |
| 245 | for v in needed_vars: | 266 | |
| 246 | val = e.data.getVar(v, True) | 267 | statusheader = e.data.getVar('BUILDCFG_HEADER', True) |
| 247 | if not val or val == 'INVALID': | 268 | bb.plain('\n%s\n%s\n' % (statusheader, '\n'.join(statuslines))) |
| 248 | pesteruser.append(v) | ||
| 249 | if pesteruser: | ||
| 250 | 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)) | ||
| 251 | 269 | ||
| 252 | if name == "ConfigParsed": | 270 | if name == "ConfigParsed": |
| 253 | generate_git_config(e) | 271 | generate_git_config(e) |
diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf index 9f4e4d4449..dc68690a39 100644 --- a/meta/conf/bitbake.conf +++ b/meta/conf/bitbake.conf | |||
| @@ -609,6 +609,13 @@ export PATCH_GET="0" | |||
| 609 | # Not sure about the rest of this yet. | 609 | # Not sure about the rest of this yet. |
| 610 | ################################################################## | 610 | ################################################################## |
| 611 | 611 | ||
| 612 | # Pre-build configuration output | ||
| 613 | BUILDCFG_HEADER = "Build Configuration:" | ||
| 614 | BUILDCFG_VARS = "BB_VERSION TARGET_ARCH TARGET_OS MACHINE DISTRO DISTRO_VERSION TUNE_FEATURES TARGET_FPU" | ||
| 615 | BUILDCFG_VARS[type] = "list" | ||
| 616 | BUILDCFG_NEEDEDVARS = "TARGET_ARCH TARGET_OS" | ||
| 617 | BUILDCFG_NEEDEDVARS[type] = "list" | ||
| 618 | |||
| 612 | # Other | 619 | # Other |
| 613 | 620 | ||
| 614 | export PKG_CONFIG_DIR = "${STAGING_DIR_HOST}/${libdir}/pkgconfig" | 621 | export PKG_CONFIG_DIR = "${STAGING_DIR_HOST}/${libdir}/pkgconfig" |
