summaryrefslogtreecommitdiff
path: root/meta
diff options
context:
space:
mode:
authorPeter Kjellerstedt <peter.kjellerstedt@axis.com>2016-09-17 03:18:08 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-09-20 15:10:35 +0100
commit449a0b21255d895e8620383ce76a9d7ea41b5cc6 (patch)
treee4fa4b4dd450eea152916cda2a0162f6209489b8 /meta
parente30c6c93bb70d17244c90c2be12229148f8f6314 (diff)
downloadopenembedded-core-449a0b21255d895e8620383ce76a9d7ea41b5cc6.tar.gz
openembedded-core-449a0b21255d895e8620383ce76a9d7ea41b5cc6.tar.bz2
openembedded-core-449a0b21255d895e8620383ce76a9d7ea41b5cc6.zip
externalsrc.bbclass: Make reparsing work for BBCLASSEXTENDed recipes
To make sure changes to any source files are detected when externalsrc is used, it sets BB_DONT_CACHE to force the recipe to be reparsed every time. Previously, this was done conditionally based on whether EXTERNALSRC was set. This worked fine for building the base recipe. But if one tried to build, e.g., a native version of it (provided via BBCLASSEXTEND), the recipe would not be reparsed as expected. To solve the above problem, BB_DONT_CACHE is now set for the base recipe if EXTERNALSRC is set for it or any of it derivatives. Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/classes/externalsrc.bbclass20
1 files changed, 17 insertions, 3 deletions
diff --git a/meta/classes/externalsrc.bbclass b/meta/classes/externalsrc.bbclass
index b7140a321d..5c65d2b742 100644
--- a/meta/classes/externalsrc.bbclass
+++ b/meta/classes/externalsrc.bbclass
@@ -29,6 +29,23 @@ EXTERNALSRC_SYMLINKS ?= "oe-workdir:${WORKDIR} oe-logs:${T}"
python () {
externalsrc = d.getVar('EXTERNALSRC', True)
+
+ # If this is the base recipe and EXTERNALSRC is set for it or any of its
+ # derivatives, then enable BB_DONT_CACHE to force the recipe to always be
+ # re-parsed so that the file-checksums function for do_compile is run every
+ # time.
+ bpn = d.getVar('BPN', True)
+ if bpn == d.getVar('PN', True):
+ classextend = (d.getVar('BBCLASSEXTEND', True) or '').split()
+ if (externalsrc or
+ ('native' in classextend and
+ d.getVar('EXTERNALSRC_pn-%s-native' % bpn, True)) or
+ ('nativesdk' in classextend and
+ d.getVar('EXTERNALSRC_pn-nativesdk-%s' % bpn, True)) or
+ ('cross' in classextend and
+ d.getVar('EXTERNALSRC_pn-%s-cross' % bpn, True))):
+ d.setVar('BB_DONT_CACHE', '1')
+
if externalsrc:
d.setVar('S', externalsrc)
externalsrcbuild = d.getVar('EXTERNALSRC_BUILD', True)
@@ -85,9 +102,6 @@ python () {
d.prependVarFlag('do_compile', 'prefuncs', "externalsrc_compile_prefunc ")
d.prependVarFlag('do_configure', 'prefuncs', "externalsrc_configure_prefunc ")
- # Force the recipe to be always re-parsed so that the file_checksums
- # function is run every time
- d.setVar('BB_DONT_CACHE', '1')
d.setVarFlag('do_compile', 'file-checksums', '${@srctree_hash_files(d)}')
# We don't want the workdir to go away