[OE-core] [PATCH 1/1] autogen-native 5.12: fix ccache issue

Robert Yang liezhi.yang at windriver.com
Thu Jun 21 10:04:04 UTC 2012


The autogen-native built error on FC17:

ccache: failed to create /dev/null/.ccache

This is because the gcc of FC17 is a symlink to ccache, so the ccache
will always be used regardless to the user's setting, ccache uses
$HOME/.ccache as the CCACHE_DIR if it has not been set, and autogen set
HOME=/dev/null.

Assign CCACHE_DIR the default value to preven it uses $HOME/.ccache
would fix the error.

[YOCTO #2554]

Signed-off-by: Robert Yang <liezhi.yang at windriver.com>
---
 .../autogen/autogen-native_5.12.bb                 |   20 ++++++++++++++++++++
 1 files changed, 20 insertions(+), 0 deletions(-)

diff --git a/meta/recipes-devtools/autogen/autogen-native_5.12.bb b/meta/recipes-devtools/autogen/autogen-native_5.12.bb
index eb3721d..e80d555 100644
--- a/meta/recipes-devtools/autogen/autogen-native_5.12.bb
+++ b/meta/recipes-devtools/autogen/autogen-native_5.12.bb
@@ -28,6 +28,26 @@ inherit autotools native
 export GUILE_LOAD_PATH = "${STAGING_DATADIR_NATIVE}/guile/2.0"
 export GUILE_LOAD_COMPILED_PATH = "${STAGING_LIBDIR_NATIVE}/guile/2.0/ccache"
 
+#
+# The do_compile_prepend is used for fixing a build error on FC17, the
+# gcc of FC17 is a symlink to ccache, if we don't set the CCACHE_DIR,
+# there would be an error:
+#
+# ccache: failed to create /dev/null/.ccache
+#
+# This is because ccache uses $HOME/.ccache as the CCACHE_DIR if it has
+# not been set, and autogen set HOME=/dev/null.
+#
+# Assign CCACHE_DIR the default value so that it would not use
+# $HOME/.ccache would fix the error.
+#
+do_compile_prepend() {
+	if [ "${CCACHE_DIR}" = "" ]; then
+		export CCACHE_DISABLE=true
+		export CCACHE_DIR=$HOME
+	fi
+}
+
 do_install_append () {
 	create_wrapper ${D}/${bindir}/autogen \
 		GUILE_LOAD_PATH=${STAGING_DATADIR_NATIVE}/guile/2.0 \
-- 
1.7.1





More information about the Openembedded-core mailing list