summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta/classes/base.bbclass22
-rw-r--r--meta/conf/bitbake.conf18
-rw-r--r--meta/conf/layer.conf2
3 files changed, 42 insertions, 0 deletions
diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass
index 14293f83c4..fec351a890 100644
--- a/meta/classes/base.bbclass
+++ b/meta/classes/base.bbclass
@@ -119,6 +119,25 @@ def get_lic_checksum_file_list(d):
119 bb.fatal(d.getVar('PN') + ": LIC_FILES_CHKSUM contains an invalid URL: " + url) 119 bb.fatal(d.getVar('PN') + ": LIC_FILES_CHKSUM contains an invalid URL: " + url)
120 return " ".join(filelist) 120 return " ".join(filelist)
121 121
122def setup_hosttools_dir(dest, toolsvar, d, fatal=True):
123 tools = d.getVar(toolsvar).split()
124 origbbenv = d.getVar("BB_ORIGENV", False)
125 path = origbbenv.getVar("PATH")
126 bb.utils.mkdirhier(dest)
127 notfound = []
128 for tool in tools:
129 desttool = os.path.join(dest, tool)
130 if not os.path.exists(desttool):
131 srctool = bb.utils.which(path, tool)
132 if "ccache" in srctool:
133 srctool = bb.utils.which(path, tool, direction=1)
134 if srctool:
135 os.symlink(srctool, desttool)
136 else:
137 notfound.append(tool)
138 if notfound and fatal:
139 bb.fatal("These tools appear to be unavailable in PATH, please install them in order to proceed:\n%s" % " ".join(notfound))
140
122addtask fetch 141addtask fetch
123do_fetch[dirs] = "${DL_DIR}" 142do_fetch[dirs] = "${DL_DIR}"
124do_fetch[file-checksums] = "${@bb.fetch.get_checksum_file_list(d)}" 143do_fetch[file-checksums] = "${@bb.fetch.get_checksum_file_list(d)}"
@@ -219,6 +238,9 @@ python base_eventhandler() {
219 pkgarch_mapping(e.data) 238 pkgarch_mapping(e.data)
220 oe.utils.features_backfill("DISTRO_FEATURES", e.data) 239 oe.utils.features_backfill("DISTRO_FEATURES", e.data)
221 oe.utils.features_backfill("MACHINE_FEATURES", e.data) 240 oe.utils.features_backfill("MACHINE_FEATURES", e.data)
241 # Works with the line in layer.conf which changes PATH to point here
242 setup_hosttools_dir(d.expand('${TMPDIR}/hosttools'), 'HOSTTOOLS', d)
243 setup_hosttools_dir(d.expand('${TMPDIR}/hosttools'), 'HOSTTOOLS_NONFATAL', d, fatal=False)
222 244
223 if isinstance(e, bb.event.BuildStarted): 245 if isinstance(e, bb.event.BuildStarted):
224 localdata = bb.data.createCopy(e.data) 246 localdata = bb.data.createCopy(e.data)
diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
index f9df7cacd1..bc115117c9 100644
--- a/meta/conf/bitbake.conf
+++ b/meta/conf/bitbake.conf
@@ -453,6 +453,24 @@ export PATH
453# Build utility info. 453# Build utility info.
454################################################################## 454##################################################################
455 455
456# Tools needed to run builds with OE-Core
457HOSTTOOLS += " \
458 bash sh cut sed gcc ld git rm install which find xargs cat true mktemp \
459 grep tar gzip touch cp mv basename dirname tr getopt sort awk head tail \
460 mkdir patch uniq perl python chmod python3 ar strip expr ls make as \
461 ranlib egrep echo chown cpio tee wc wget bzip2 stat date rmdir od diff \
462 md5sum dd chrpath file pod2man gunzip python2.7 ln g++ [ false true \
463 uname test hostname nm objdump objcopy cmp printf env readlink gawk fgrep \
464 expand pwd sleep diffstat chgrp flock ldd strings rpcgen du makeinfo \
465 getconf mknod cpp readelf split \
466"
467
468# Tools needed to run testimage runtime image testing
469HOSTTOOLS += "ps stty ip ssh scp ping vi"
470
471# Link to these if present
472HOSTTOOLS_NONFATAL += "ccache pip3 ld.bfd ld.gold gcc-ar gpg sftp"
473
456CCACHE ??= "" 474CCACHE ??= ""
457# Disable ccache explicitly if CCACHE is null since gcc may be a symlink 475# Disable ccache explicitly if CCACHE is null since gcc may be a symlink
458# of ccache some distributions (e.g., Fedora 17). 476# of ccache some distributions (e.g., Fedora 17).
diff --git a/meta/conf/layer.conf b/meta/conf/layer.conf
index 87c235fe12..739d82ea56 100644
--- a/meta/conf/layer.conf
+++ b/meta/conf/layer.conf
@@ -59,3 +59,5 @@ SIGGEN_EXCLUDE_SAFE_RECIPE_DEPS += " \
59 oprofile->virtual/kernel \ 59 oprofile->virtual/kernel \
60" 60"
61 61
62# We need to keep bitbake tools in PATH
63PATH := "${@os.path.dirname(bb.utils.which(d.getVar('PATH'),'bitbake'))}:${TMPDIR}/hosttools"