[OE-core] [PATCH] bitbake: do not set CCACHE_DISABLE=0

Enrico Scholz enrico.scholz at sigma-chemnitz.de
Sat Jul 21 11:55:46 UTC 2012


ccache checks for existence of environment; not for its value:

  ---- ccache-3.1.7/ccache.c ---
        if (getenv("CCACHE_DISABLE")) {
                cc_log("ccache is disabled");

Hence, avoid setting of $CCACHE_DISABLE instead of assigning '0'.

Unfortunately, bitbake has a similar behavior when evaluating 'export'
and 'unexport' flags so that this variable must be set in a python
function instead of declaring it in bitbake.conf.

Signed-off-by: Enrico Scholz <enrico.scholz at sigma-chemnitz.de>
---
 meta/classes/base.bbclass |    8 ++++++++
 meta/conf/bitbake.conf    |    3 ---
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass
index 1f76023..9f9c803 100644
--- a/meta/classes/base.bbclass
+++ b/meta/classes/base.bbclass
@@ -309,6 +309,14 @@ do_build () {
 python () {
     import exceptions, string, re
 
+    # Disable ccache explicitly if CCACHE is null since gcc may be a
+    # symlink of ccache some distributions (e.g., Fedora 17). Please
+    # note that only the existence of $CCACHE_DISABLE matters; the
+    # value is ignored.
+    if d.getVar('CCACHE', True) == '':
+        d.setVar('CCACHE_DISABLE', True)
+        d.setVarFlag('CCACHE_DISABLE', 'export', True)
+
     # Handle PACKAGECONFIG
     #
     # These take the form:
diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
index a8a1665..1bb66ad 100644
--- a/meta/conf/bitbake.conf
+++ b/meta/conf/bitbake.conf
@@ -420,9 +420,6 @@ export PATH
 ##################################################################
 
 CCACHE ??= ""
-# Disable ccache explicitly if CCACHE is null since gcc may be a symlink
-# of ccache some distributions (e.g., Fedora 17).
-export CCACHE_DISABLE ??= "${@[0,1][d.getVar('CCACHE', True) == '']}"
 # Assign CCACHE_DIR a default value to fix a bug of ccache 3.1.7,
 # since it would always create CCACHE_DIR/.ccache even if
 # CCACHE_DISABLE = 1.
-- 
1.7.10.4





More information about the Openembedded-core mailing list