Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Danomi Manchego <danomimanchego123@gmail.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH 3/3] ccache: provide capability to do initial ccache setup
Date: Wed, 30 Oct 2013 22:54:24 -0400	[thread overview]
Message-ID: <1383188064-2380-4-git-send-email-danomimanchego123@gmail.com> (raw)
In-Reply-To: <1383188064-2380-1-git-send-email-danomimanchego123@gmail.com>

For example, if your project is known to require more space
than the default max cache size, then you might want to
automatically increase the cache size to a suitable amount
using the -M option.

Signed-off-by: Danomi Manchego <danomimanchego123@gmail.com>
---
 Config.in                |   15 ++++++++++++++-
 package/ccache/ccache.mk |   11 +++++++++++
 2 files changed, 25 insertions(+), 1 deletion(-)

diff --git a/Config.in b/Config.in
index af720ec..c2971df 100644
--- a/Config.in
+++ b/Config.in
@@ -222,7 +222,7 @@ config BR2_CCACHE
 	help
 	  This option will enable the use of ccache, a compiler
 	  cache. It will cache the result of previous builds to speed
-	  up future builds. The cache is stored in
+	  up future builds. By default, the cache is stored in
 	  $HOME/.buildroot-ccache.
 
 	  Note that Buildroot does not try to invalidate the cache
@@ -239,6 +239,19 @@ config BR2_CCACHE_DIR
 	help
 	  Where ccache should store cached files.
 
+config BR2_CCACHE_INITIAL_SETUP
+	string "Compiler cache initial setup"
+	depends on BR2_CCACHE
+	help
+	  Additional ccache setup options, such as max-files or max-size.
+
+	  For example, if your project is known to require more space
+	  than the default max cache size, then you might want to
+	  automatically increase the cache size to a suitable amount
+	  using the -M option.
+
+	  Applied at time of ccache compilation.
+
 config BR2_DEPRECATED
 	bool "Show packages that are deprecated or obsolete"
 	help
diff --git a/package/ccache/ccache.mk b/package/ccache/ccache.mk
index 1ebe974..cea0701 100644
--- a/package/ccache/ccache.mk
+++ b/package/ccache/ccache.mk
@@ -21,6 +21,17 @@ CCACHE_LICENSE_FILES = LICENSE.txt GPL-3.0.txt
 # has zero dependency besides the C library.
 HOST_CCACHE_CONF_OPT += ccache_cv_zlib_1_2_3=no
 
+# Provide capability to do initial ccache setup (e.g. increase default size)
+HOST_CCACHE_INITIAL_SETUP = $(call qstrip,$(BR2_CCACHE_INITIAL_SETUP))
+ifneq ($(HOST_CCACHE_INITIAL_SETUP),)
+  define HOST_CCACHE_DO_INITIAIL_SETUP
+	@$(call MESSAGE,"Do initial host ccache setup")
+	$(CCACHE) $(HOST_CCACHE_INITIAL_SETUP)
+	$(CCACHE) -s
+  endef
+  HOST_CCACHE_POST_INSTALL_HOOKS += HOST_CCACHE_DO_INITIAIL_SETUP
+endif
+
 # Patch host-ccache as follows:
 #  - Use BUILDROOT_CACHE_DIR instead of CCACHE_DIR, because CCACHE_DIR
 #    is already used by autotargets for the ccache package.
-- 
1.7.9.5

      parent reply	other threads:[~2013-10-31  2:54 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-31  2:54 [Buildroot] [PATCH 0/3] ccache compilercheck and automated option setup Danomi Manchego
2013-10-31  2:54 ` [Buildroot] [PATCH 1/3] ccache: change compilercheck to use compiler and toolchain info Danomi Manchego
2013-11-20 22:12   ` Arnout Vandecappelle
2013-11-28 22:20     ` Peter Korsgaard
2013-10-31  2:54 ` [Buildroot] [PATCH 2/3] ccache: change default cache directory path to match config setting Danomi Manchego
2013-10-31  2:54 ` Danomi Manchego [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1383188064-2380-4-git-send-email-danomimanchego123@gmail.com \
    --to=danomimanchego123@gmail.com \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox