Patchwork [v2,2/4] ccache: Set CCACHE on a per recipe basis

login
register
mail settings
Submitter wenzong.fan@windriver.com
Date June 24, 2011, 9:53 a.m.
Message ID <874e7a3e34884c2de217a71726e40d0082e5626b.1308902512.git.wenzong.fan@windriver.com>
Download mbox | patch
Permalink /patch/6475/
State New, archived
Headers show

Comments

wenzong.fan@windriver.com - June 24, 2011, 9:53 a.m.
From: Wenzong Fan <wenzong.fan@windriver.com>

Set 'CCACHE_DIR' in 'bitbake.conf' and create the dirs for every
package before task 'do_configure' started.

Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com>
---
 meta/classes/base.bbclass |    1 +
 meta/conf/bitbake.conf    |    1 +
 2 files changed, 2 insertions(+), 0 deletions(-)

Patch

diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass
index 119b052..40fbb47 100644
--- a/meta/classes/base.bbclass
+++ b/meta/classes/base.bbclass
@@ -195,6 +195,7 @@  python base_eventhandler() {
 
 addtask configure after do_unpack do_patch
 do_configure[dirs] = "${S} ${B}"
+do_configure[dirs] =+ "${CCACHE_DIR} "
 do_configure[deptask] = "do_populate_sysroot"
 base_do_configure() {
 	:
diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
index 6d8a674..d963d2e 100644
--- a/meta/conf/bitbake.conf
+++ b/meta/conf/bitbake.conf
@@ -391,6 +391,7 @@  export PATH
 CCACHE = "${@bb.which(bb.data.getVar('PATH', d, 1), 'ccache') and 'ccache '}"
 TOOLCHAIN_OPTIONS = " --sysroot=${STAGING_DIR_TARGET}"
 
+export CCACHE_DIR = "${TMPDIR}/ccache/${HOST_SYS}/${PN}"
 export CC = "${CCACHE}${HOST_PREFIX}gcc ${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS}"
 export CXX = "${CCACHE}${HOST_PREFIX}g++ ${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS}"
 export F77 = "${CCACHE}${HOST_PREFIX}g77 ${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS}"