diff options
author | Ross Burton <ross@burtonini.com> | 2021-11-05 16:57:58 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2021-11-07 15:49:51 +0000 |
commit | daa069382c3266a6ebeb81d9e17b6f0344dc0d80 (patch) | |
tree | 6b7c50998d981eaa0a3bd3e58fc13f8e6a3efa02 | |
parent | ddcaf3596227a32628b436f4130f4c0b1541a4be (diff) | |
download | poky-daa069382c3266a6ebeb81d9e17b6f0344dc0d80.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.
(From OE-Core rev: 88d77d82ee506576988936e06b8d624879a80f2e)
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | meta/classes/scons.bbclass | 8 |
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" | |||
5 | EXTRA_OESCONS ?= "" | 5 | EXTRA_OESCONS ?= "" |
6 | 6 | ||
7 | do_configure() { | 7 | do_configure() { |
8 | if [ -n "${CONFIGURESTAMPFILE}" ]; then | 8 | if [ -n "${CONFIGURESTAMPFILE}" -a "${S}" = "${B}" ]; then |
9 | if [ -e "${CONFIGURESTAMPFILE}" -a "`cat ${CONFIGURESTAMPFILE}`" != "${BB_TASKHASH}" -a "${CLEANBROKEN}" != "1" ]; then | 9 | if [ -e "${CONFIGURESTAMPFILE}" -a "`cat ${CONFIGURESTAMPFILE}`" != "${BB_TASKHASH}" -a "${CLEANBROKEN}" != "1" ]; then |
10 | ${STAGING_BINDIR_NATIVE}/scons --clean PREFIX=${prefix} prefix=${prefix} ${EXTRA_OESCONS} | 10 | ${STAGING_BINDIR_NATIVE}/scons --directory=${S} --clean PREFIX=${prefix} prefix=${prefix} ${EXTRA_OESCONS} |
11 | fi | 11 | fi |
12 | 12 | ||
13 | mkdir -p `dirname ${CONFIGURESTAMPFILE}` | 13 | mkdir -p `dirname ${CONFIGURESTAMPFILE}` |
@@ -16,12 +16,12 @@ do_configure() { | |||
16 | } | 16 | } |
17 | 17 | ||
18 | scons_do_compile() { | 18 | scons_do_compile() { |
19 | ${STAGING_BINDIR_NATIVE}/scons ${PARALLEL_MAKE} PREFIX=${prefix} prefix=${prefix} ${EXTRA_OESCONS} || \ | 19 | ${STAGING_BINDIR_NATIVE}/scons --directory=${S} ${PARALLEL_MAKE} PREFIX=${prefix} prefix=${prefix} ${EXTRA_OESCONS} || \ |
20 | die "scons build execution failed." | 20 | die "scons build execution failed." |
21 | } | 21 | } |
22 | 22 | ||
23 | scons_do_install() { | 23 | scons_do_install() { |
24 | ${STAGING_BINDIR_NATIVE}/scons install_root=${D}${prefix} PREFIX=${prefix} prefix=${prefix} ${EXTRA_OESCONS} install || \ | 24 | ${STAGING_BINDIR_NATIVE}/scons --directory=${S} install_root=${D}${prefix} PREFIX=${prefix} prefix=${prefix} ${EXTRA_OESCONS} install || \ |
25 | die "scons install execution failed." | 25 | die "scons install execution failed." |
26 | } | 26 | } |
27 | 27 | ||