]> code.ossystems Code Review - openembedded-core.git/commitdiff
externalsrc: use shared CONFIGURESTAMPFILE if B=S
authorMarkus Lehtonen <markus.lehtonen@linux.intel.com>
Fri, 29 Jan 2016 15:04:31 +0000 (17:04 +0200)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Sun, 31 Jan 2016 13:29:37 +0000 (13:29 +0000)
External source tree is used as the builddir even for different
architectures in case ${B}=${S}. This may cause problems if MACHINE is
changed as do_configure is not being re-run (which would run make
clean). This patches changes externalsrc to use a common (per-recipe)
CONFIGURESTAMPFILE under 'work-shared' if ${B}=${S}. In addition,
do_configure will depend on changes of this stamp file. As a result,
do_configure is re-run and the build dir is cleaned correctly if a
rebuild for different MACHINE is done.

[YOCTO #8950]

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes/externalsrc.bbclass

index f7ed66d8c697405c3248d128b3a36420e5d2d2a5..be0fe55d5f1e376875aa1227414698d51af3060d 100644 (file)
@@ -85,6 +85,17 @@ python () {
 
         # Ensure compilation happens every time
         d.setVarFlag('do_compile', 'nostamp', '1')
+
+        # If B=S the same builddir is used even for different architectures.
+        # Thus, use a shared CONFIGURESTAMPFILE so that change of do_configure
+        # task hash is correctly detected if e.g. MACHINE changes. In addition,
+        # do_configure needs to depend on the stamp file so that the task is
+        # re-run when the stamp was changed since the last run on this
+        # architecture.
+        if d.getVar('S', True) == d.getVar('B', True):
+            configstamp = '${TMPDIR}/work-shared/${PN}/${EXTENDPE}${PV}-${PR}/configure.sstate'
+            d.setVar('CONFIGURESTAMPFILE', configstamp)
+            d.setVarFlag('do_configure', 'file-checksums', configstamp + ':True')
 }
 
 python externalsrc_compile_prefunc() {