summaryrefslogtreecommitdiff
path: root/toolchain/toolchain-wrapper.mk
diff options
context:
space:
mode:
authorArnout Vandecappelle <arnout@mind.be>2015-10-04 16:25:32 +0100
committerPeter Korsgaard <peter@korsgaard.com>2015-10-04 18:22:21 +0200
commit1e97b2787331c5f4452d8c9a76961a89ec355d9d (patch)
tree3650a31a1a9b2fa3b9955823839057fa7b91ac89 /toolchain/toolchain-wrapper.mk
parentf4682cf933a3e0e1017aa8827a8c57fdd79e30f3 (diff)
ccache: support changing the output directory
When building in a different output directory than the original build, there will currently be a lot of ccache misses because in many cases there is some -I/... absolute path in the compilation. Ccache has an option CCACHE_BASEDIR to substitute absolute paths with relative paths, so they wil be the same in the hash (and in the output). Since there are some disadvantages to this path rewriting, it is made optional as BR2_CCACHE_USE_BASEDIR. It defaults to y because the usefulness of ccache is severely reduced without this option. In addition to CCACHE_BASEDIR, we also substitute away the occurences of $(HOST_DIR) in the calculation of the compiler hash. This is done regardless of the setting of BR2_CCACHE_USE_BASEDIR because it's quite harmless. Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
Diffstat (limited to 'toolchain/toolchain-wrapper.mk')
-rw-r--r--toolchain/toolchain-wrapper.mk4
1 files changed, 4 insertions, 0 deletions
diff --git a/toolchain/toolchain-wrapper.mk b/toolchain/toolchain-wrapper.mk
index 749afd7a5..c78363a2e 100644
--- a/toolchain/toolchain-wrapper.mk
+++ b/toolchain/toolchain-wrapper.mk
@@ -20,6 +20,10 @@ ifeq ($(BR2_CCACHE),y)
TOOLCHAIN_WRAPPER_ARGS += -DBR_CCACHE
endif
+ifeq ($(BR2_CCACHE_USE_BASEDIR),y)
+TOOLCHAIN_WRAPPER_ARGS += -DBR_CCACHE_BASEDIR='"$(BASE_DIR)"'
+endif
+
# For simplicity, build directly into the install location
define TOOLCHAIN_BUILD_WRAPPER
$(Q)mkdir -p $(HOST_DIR)/usr/bin