]> code.ossystems Code Review - openembedded-core.git/commitdiff
classes/waf: Fix builds when B != S
authorJoshua Watt <jpewhacker@gmail.com>
Sat, 1 Dec 2018 03:01:42 +0000 (21:01 -0600)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 5 Dec 2018 22:30:15 +0000 (22:30 +0000)
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.

Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes/waf.bbclass

index 19e93761b3909ed7914299d475e572df75ae50b6..8e6d754c299bbcb0cd3d4ec038f9d1612eb7c069 100644 (file)
@@ -1,6 +1,8 @@
 # avoids build breaks when using no-static-libs.inc
 DISABLE_STATIC = ""
 
+B = "${WORKDIR}/build"
+
 EXTRA_OECONF_append = " ${PACKAGECONFIG_CONFARGS}"
 
 python waf_preconfigure() {
@@ -22,16 +24,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