diff options
author | Joshua Watt <jpewhacker@gmail.com> | 2018-11-30 21:01:42 -0600 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2018-12-05 22:30:19 +0000 |
commit | 794a60191bf16d057b46f2e5767c57510e366222 (patch) | |
tree | 54f9ea54a2a57187f23e86885cefe1b211ed2140 /meta/classes | |
parent | 5806b4cbd88afc6d3f30f197b978a798ba226ccc (diff) | |
download | poky-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')
-rw-r--r-- | meta/classes/waf.bbclass | 8 |
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 |
2 | DISABLE_STATIC = "" | 2 | DISABLE_STATIC = "" |
3 | 3 | ||
4 | B = "${WORKDIR}/build" | ||
5 | |||
4 | EXTRA_OECONF_append = " ${PACKAGECONFIG_CONFARGS}" | 6 | EXTRA_OECONF_append = " ${PACKAGECONFIG_CONFARGS}" |
5 | 7 | ||
6 | python waf_preconfigure() { | 8 | python waf_preconfigure() { |
@@ -22,16 +24,16 @@ python waf_preconfigure() { | |||
22 | do_configure[prefuncs] += "waf_preconfigure" | 24 | do_configure[prefuncs] += "waf_preconfigure" |
23 | 25 | ||
24 | waf_do_configure() { | 26 | waf_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 | ||
28 | do_compile[progress] = "outof:^\[\s*(\d+)/\s*(\d+)\]\s+" | 30 | do_compile[progress] = "outof:^\[\s*(\d+)/\s*(\d+)\]\s+" |
29 | waf_do_compile() { | 31 | waf_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 | ||
33 | waf_do_install() { | 35 | waf_do_install() { |
34 | ${S}/waf install --destdir=${D} | 36 | (cd ${S} && ./waf install --destdir=${D}) |
35 | } | 37 | } |
36 | 38 | ||
37 | EXPORT_FUNCTIONS do_configure do_compile do_install | 39 | EXPORT_FUNCTIONS do_configure do_compile do_install |