summaryrefslogtreecommitdiffstats
path: root/external/poky/meta/classes/waf.bbclass
diff options
context:
space:
mode:
Diffstat (limited to 'external/poky/meta/classes/waf.bbclass')
-rw-r--r--external/poky/meta/classes/waf.bbclass34
1 files changed, 31 insertions, 3 deletions
diff --git a/external/poky/meta/classes/waf.bbclass b/external/poky/meta/classes/waf.bbclass
index 19e93761..90024400 100644
--- a/external/poky/meta/classes/waf.bbclass
+++ b/external/poky/meta/classes/waf.bbclass
@@ -1,8 +1,36 @@
# avoids build breaks when using no-static-libs.inc
DISABLE_STATIC = ""
+B = "${WORKDIR}/build"
+
EXTRA_OECONF_append = " ${PACKAGECONFIG_CONFARGS}"
+def waflock_hash(d):
+ # Calculates the hash used for the waf lock file. This should include
+ # all of the user controllable inputs passed to waf configure. Note
+ # that the full paths for ${B} and ${S} are used; this is OK and desired
+ # because a change to either of these should create a unique lock file
+ # to prevent collisions.
+ import hashlib
+ h = hashlib.sha512()
+ def update(name):
+ val = d.getVar(name)
+ if val is not None:
+ h.update(val.encode('utf-8'))
+ update('S')
+ update('B')
+ update('prefix')
+ update('EXTRA_OECONF')
+ return h.hexdigest()
+
+# Use WAFLOCK to specify a separate lock file. The build is already
+# sufficiently isolated by setting the output directory, this ensures that
+# bitbake won't step on toes of any other configured context in the source
+# directory (e.g. if the source is coming from externalsrc and was previously
+# configured elsewhere).
+export WAFLOCK = ".lock-waf_oe_${@waflock_hash(d)}_build"
+BB_HASHBASE_WHITELIST += "WAFLOCK"
+
python waf_preconfigure() {
import subprocess
from distutils.version import StrictVersion
@@ -22,16 +50,16 @@ python waf_preconfigure() {
do_configure[prefuncs] += "waf_preconfigure"
waf_do_configure() {
- ${S}/waf configure --prefix=${prefix} ${WAF_EXTRA_CONF} ${EXTRA_OECONF}
+ (cd ${S} && ./waf configure -o ${B} --prefix=${prefix} ${WAF_EXTRA_CONF} ${EXTRA_OECONF})
}
do_compile[progress] = "outof:^\[\s*(\d+)/\s*(\d+)\]\s+"
waf_do_compile() {
- ${S}/waf build ${@oe.utils.parallel_make_argument(d, '-j%d', limit=64)}
+ (cd ${S} && ./waf build ${@oe.utils.parallel_make_argument(d, '-j%d', limit=64)})
}
waf_do_install() {
- ${S}/waf install --destdir=${D}
+ (cd ${S} && ./waf install --destdir=${D})
}
EXPORT_FUNCTIONS do_configure do_compile do_install