]> Git Repo - buildroot-mgba.git/blame - package/ccache/ccache.mk
ccache: bump to version 3.3
[buildroot-mgba.git] / package / ccache / ccache.mk
CommitLineData
8dfd59d1 1################################################################################
17b66aff
TP
2#
3# ccache
4#
8dfd59d1 5################################################################################
17b66aff 6
ca6811fe 7CCACHE_VERSION = 3.3
67524ba4 8CCACHE_SITE = https://samba.org/ftp/ccache
f268f713 9CCACHE_SOURCE = ccache-$(CCACHE_VERSION).tar.xz
c5f8797b
LC
10CCACHE_LICENSE = GPLv3+, others
11CCACHE_LICENSE_FILES = LICENSE.txt GPL-3.0.txt
17b66aff 12
7ea11daf
TP
13# Force ccache to use its internal zlib. The problem is that without
14# this, ccache would link against the zlib of the build system, but we
15# might build and install a different version of zlib in $(O)/host
16# afterwards, which ccache will pick up. This might break if there is
17# a version mismatch. A solution would be to add host-zlib has a
18# dependency of ccache, but it would require tuning the zlib .mk file
19# to use HOSTCC_NOCCACHE as the compiler. Instead, we take the easy
20# path: tell ccache to use its internal copy of zlib, so that ccache
21# has zero dependency besides the C library.
83c8fae3 22HOST_CCACHE_CONF_OPTS += --with-bundled-zlib
7ea11daf 23
43329076 24# Patch host-ccache as follows:
e7ab4b49 25# - Use BR_CACHE_DIR instead of CCACHE_DIR, because CCACHE_DIR
43329076 26# is already used by autotargets for the ccache package.
e7ab4b49 27# BR_CACHE_DIR is exported by Makefile based on config option
43329076 28# BR2_CCACHE_DIR.
d93a0b40
DM
29# - Change hard-coded last-ditch default to match path in .config, to avoid
30# the need to specify BR_CACHE_DIR when invoking ccache directly.
43329076 31define HOST_CCACHE_PATCH_CONFIGURATION
e7ab4b49 32 sed -i 's,getenv("CCACHE_DIR"),getenv("BR_CACHE_DIR"),' $(@D)/ccache.c
83c8fae3 33 sed -i 's,"%s/.ccache","$(BR_CACHE_DIR)",' $(@D)/conf.c
17b66aff
TP
34endef
35
83c8fae3 36HOST_CCACHE_POST_PATCH_HOOKS += HOST_CCACHE_PATCH_CONFIGURATION
17b66aff 37
ffe3540e
DM
38define HOST_CCACHE_MAKE_CACHE_DIR
39 mkdir -p $(BR_CACHE_DIR)
40endef
41
dd79f2df
DM
42HOST_CCACHE_POST_INSTALL_HOOKS += HOST_CCACHE_MAKE_CACHE_DIR
43
44# Provide capability to do initial ccache setup (e.g. increase default size)
45BR_CCACHE_INITIAL_SETUP = $(call qstrip,$(BR2_CCACHE_INITIAL_SETUP))
46ifneq ($(BR_CCACHE_INITIAL_SETUP),)
47define HOST_CCACHE_DO_INITIAL_SETUP
48 @$(call MESSAGE,"Applying initial settings")
49 $(CCACHE) $(BR_CCACHE_INITIAL_SETUP)
50 $(CCACHE) -s
51endef
52
53HOST_CCACHE_POST_INSTALL_HOOKS += HOST_CCACHE_DO_INITIAL_SETUP
54endif
ffe3540e 55
69e64c42 56$(eval $(host-autotools-package))
17b66aff
TP
57
58ifeq ($(BR2_CCACHE),y)
59ccache-stats: host-ccache
60 $(Q)$(CCACHE) -s
d1bca7c4
TJL
61
62ccache-options: host-ccache
63ifeq ($(CCACHE_OPTIONS),)
f3b44101
JG
64 $(Q)echo "Usage: make ccache-options CCACHE_OPTIONS=\"opts\""
65 $(Q)echo "where 'opts' corresponds to one or more valid ccache options" \
66 "(see ccache help text below)"
67 $(Q)echo
d1bca7c4 68endif
f3b44101 69 $(Q)$(CCACHE) $(CCACHE_OPTIONS)
17b66aff 70endif
This page took 0.980671 seconds and 4 git commands to generate.