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.
