summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoss Burton <ross@burtonini.com>2021-11-05 16:57:58 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2021-11-07 15:49:48 +0000
commit88d77d82ee506576988936e06b8d624879a80f2e (patch)
tree478bb05479483883ac8a020deb516442e2a10599
parent8cc28b231b821bb9669eb3980281d27399f378be (diff)
downloadopenembedded-core-contrib-88d77d82ee506576988936e06b8d624879a80f2e.tar.gz
scons: support out-of-tree builds
SCons has a slightly unusual implementation of out-of-tree builds where there is no standard way of doing it. However, if a recipe sets B to the idiomatic ${WORKDIR}/build and passes the right arguments so that this is used then scons will fail as it is trying to find the SConstruct file in ${B} not ${S}. Always pass --directory=${S} to scons so that the SConstruct file can be found, and don't call --clean if out-of-tree builds are being used as we would have just deleted the entire build tree already. Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/classes/scons.bbclass8
1 files changed, 4 insertions, 4 deletions
diff --git a/meta/classes/scons.bbclass b/meta/classes/scons.bbclass
index 4f3ae502ef..80f8382107 100644
--- a/meta/classes/scons.bbclass
+++ b/meta/classes/scons.bbclass
@@ -5,9 +5,9 @@ DEPENDS += "python3-scons-native"
EXTRA_OESCONS ?= ""
do_configure() {
- if [ -n "${CONFIGURESTAMPFILE}" ]; then
+ if [ -n "${CONFIGURESTAMPFILE}" -a "${S}" = "${B}" ]; then
if [ -e "${CONFIGURESTAMPFILE}" -a "`cat ${CONFIGURESTAMPFILE}`" != "${BB_TASKHASH}" -a "${CLEANBROKEN}" != "1" ]; then
- ${STAGING_BINDIR_NATIVE}/scons --clean PREFIX=${prefix} prefix=${prefix} ${EXTRA_OESCONS}
+ ${STAGING_BINDIR_NATIVE}/scons --directory=${S} --clean PREFIX=${prefix} prefix=${prefix} ${EXTRA_OESCONS}
fi
mkdir -p `dirname ${CONFIGURESTAMPFILE}`
@@ -16,12 +16,12 @@ do_configure() {
}
scons_do_compile() {
- ${STAGING_BINDIR_NATIVE}/scons ${PARALLEL_MAKE} PREFIX=${prefix} prefix=${prefix} ${EXTRA_OESCONS} || \
+ ${STAGING_BINDIR_NATIVE}/scons --directory=${S} ${PARALLEL_MAKE} PREFIX=${prefix} prefix=${prefix} ${EXTRA_OESCONS} || \
die "scons build execution failed."
}
scons_do_install() {
- ${STAGING_BINDIR_NATIVE}/scons install_root=${D}${prefix} PREFIX=${prefix} prefix=${prefix} ${EXTRA_OESCONS} install || \
+ ${STAGING_BINDIR_NATIVE}/scons --directory=${S} install_root=${D}${prefix} PREFIX=${prefix} prefix=${prefix} ${EXTRA_OESCONS} install || \
die "scons install execution failed."
}