summaryrefslogtreecommitdiffstats
path: root/meta/classes/waf.bbclass
diff options
context:
space:
mode:
authorJoshua Watt <jpewhacker@gmail.com>2018-11-30 21:01:42 -0600
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-12-05 22:30:19 +0000
commit794a60191bf16d057b46f2e5767c57510e366222 (patch)
tree54f9ea54a2a57187f23e86885cefe1b211ed2140 /meta/classes/waf.bbclass
parent5806b4cbd88afc6d3f30f197b978a798ba226ccc (diff)
downloadpoky-794a60191bf16d057b46f2e5767c57510e366222.tar.gz
classes/waf: Fix builds when B != S
Waf requires that the current working directory be ${S} (the location of the wscript) when building. Most of the time, this was true only because B defaults to S. However, anything that changed that behavior (notably, using externalsrc) would break the recipe. Remedy this by explicitly changing cwd to ${S} when running waf commands. As a happy side effect, B can be set up for "out of tree" builds to keep the source directory clean. (From OE-Core rev: 62dffb71ce22222c635bd90eaa47dd01f70f9c0f) Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/waf.bbclass')
-rw-r--r--meta/classes/waf.bbclass8
1 files changed, 5 insertions, 3 deletions
diff --git a/meta/classes/waf.bbclass b/meta/classes/waf.bbclass
index 19e93761b3..8e6d754c29 100644
--- a/meta/classes/waf.bbclass
+++ b/meta/classes/waf.bbclass
@@ -1,6 +1,8 @@
1# avoids build breaks when using no-static-libs.inc 1# avoids build breaks when using no-static-libs.inc
2DISABLE_STATIC = "" 2DISABLE_STATIC = ""
3 3
4B = "${WORKDIR}/build"
5
4EXTRA_OECONF_append = " ${PACKAGECONFIG_CONFARGS}" 6EXTRA_OECONF_append = " ${PACKAGECONFIG_CONFARGS}"
5 7
6python waf_preconfigure() { 8python waf_preconfigure() {
@@ -22,16 +24,16 @@ python waf_preconfigure() {
22do_configure[prefuncs] += "waf_preconfigure" 24do_configure[prefuncs] += "waf_preconfigure"
23 25
24waf_do_configure() { 26waf_do_configure() {
25 ${S}/waf configure --prefix=${prefix} ${WAF_EXTRA_CONF} ${EXTRA_OECONF} 27 (cd ${S} && ./waf configure -o ${B} --prefix=${prefix} ${WAF_EXTRA_CONF} ${EXTRA_OECONF})
26} 28}
27 29
28do_compile[progress] = "outof:^\[\s*(\d+)/\s*(\d+)\]\s+" 30do_compile[progress] = "outof:^\[\s*(\d+)/\s*(\d+)\]\s+"
29waf_do_compile() { 31waf_do_compile() {
30 ${S}/waf build ${@oe.utils.parallel_make_argument(d, '-j%d', limit=64)} 32 (cd ${S} && ./waf build ${@oe.utils.parallel_make_argument(d, '-j%d', limit=64)})
31} 33}
32 34
33waf_do_install() { 35waf_do_install() {
34 ${S}/waf install --destdir=${D} 36 (cd ${S} && ./waf install --destdir=${D})
35} 37}
36 38
37EXPORT_FUNCTIONS do_configure do_compile do_install 39EXPORT_FUNCTIONS do_configure do_compile do_install