Makefile, toolchain-wrapper.c: disable ccache by default outside of Buildroot
Until now, when BR2_CCACHE=y, ccache support was built into the toolchain wrapper, and used regardless of whether the toolchain is using during the Buildroot build itself, or later as part of the SDK. However, having ccache support forcefully enabled in the SDK can really be surprising, and is certainly unexpected for a cross-compilation toolchain. This can be particularly surprising as the ccache cache directory may be hardcoded in the ccache binary to point to a folder that does not make sense on the SDK user's machine. So what this commit does is create a BR2_USE_CCACHE variable, which when set to 1 tells the toolchain wrapper to use ccache. Not defining the variable, or specifying any other value that 1 causes the toolchain wrapper to not use ccache. The main Buildroot Makefile is modified to export BR2_USE_CCACHE = 1 when ccache support is enabled, so that ccache is used during the Buildroot build. However, when someone will use the SDK outside of Buildroot, the toolchain wrapper will not use ccache. The BR2_USE_CCACHE variable is only conditionally enabled in the main Makefile (via ?=) so that it can be overridden in the environment if one wants to quickly test disabling ccache in a ccache-enabled Buildroot configuration. This is the scenario that was considered in commit 792f1278 ("toolchain-wrapper: support change of BR2_CCACHE"), which added the BR_NO_CCACHE variable. The BR_NO_CCACHE variable is no longer needed, and replaced by this BR2_USE_CCACHE variable. Signed-off-by:Paul Cercueil <paul@crapouillou.net> [Thomas: almost entirely rework the implementation and commit log] Signed-off-by:
Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Loading
Please register or sign in to comment