Page MenuHomeFreeBSD

D49417.id157341.diff
No OneTemporary

D49417.id157341.diff

diff --git a/share/mk/bsd.compiler.mk b/share/mk/bsd.compiler.mk
--- a/share/mk/bsd.compiler.mk
+++ b/share/mk/bsd.compiler.mk
@@ -66,9 +66,10 @@
# PATH since it is more clear that ccache is used and avoids wasting time
# for mkdep/linking/asm builds.
LOCALBASE?= /usr/local
+CCACHE_NAME?= ccache
CCACHE_PKG_PREFIX?= ${LOCALBASE}
CCACHE_WRAPPER_PATH?= ${CCACHE_PKG_PREFIX}/libexec/ccache
-CCACHE_BIN?= ${CCACHE_PKG_PREFIX}/bin/ccache
+CCACHE_BIN?= ${CCACHE_PKG_PREFIX}/bin/${CCACHE_NAME}
.if exists(${CCACHE_BIN})
# Export to ensure sub-makes can filter it out for mkdep/linking and
# to chain down into kernel build which won't include this file.
@@ -122,7 +123,12 @@
.endif
# Canonicalize CCACHE_DIR for meta mode usage.
.if !defined(CCACHE_DIR)
+.if !empty(CCACHE_BIN:M*sccache)
+# Get the temp directory and remove beginning and trailing \"
+CCACHE_DIR!= ${CCACHE_BIN} -s | awk '$$2 == "location" && $$3 == "Local" {print substr($$5, 2, length($$5) - 2)}'
+.else
CCACHE_DIR!= ${CCACHE_BIN} -p | awk '$$2 == "cache_dir" {print $$4}'
+.endif
.export CCACHE_DIR
.endif
.if !empty(CCACHE_DIR) && empty(.MAKE.META.IGNORE_PATHS:M${CCACHE_DIR})
@@ -134,7 +140,11 @@
# comparisons.
.MAKE.META.IGNORE_PATHS+= ${CCACHE_BIN}
ccache-print-options: .PHONY
+.if !empty(CCACHE_BIN:M*sccache)
+ @${CCACHE_BIN} -s
+.else
@${CCACHE_BIN} -p
+.endif # !empty(CCACHE_BIN:M*sccache)
.endif # exists(${CCACHE_BIN})
.endif # ${MK_CCACHE_BUILD} == "yes"
diff --git a/tools/build/options/WITH_CCACHE_BUILD b/tools/build/options/WITH_CCACHE_BUILD
--- a/tools/build/options/WITH_CCACHE_BUILD
+++ b/tools/build/options/WITH_CCACHE_BUILD
@@ -3,11 +3,18 @@
for the build.
No configuration is required except to install the
.Sy devel/ccache
+or
+.Sy devel/sccache
package.
When using with
.Xr distcc 1 ,
set
.Sy CCACHE_PREFIX=/usr/local/bin/distcc .
+When using with sccache
+set
+.Sy CCACHE_NAME=sccache
+in
+.Xr src.conf 5 .
The default cache directory of
.Pa $HOME/.ccache
will be used, which can be overridden by setting

File Metadata

Mime Type
text/plain
Expires
Sun, Jan 25, 4:11 AM (5 h, 54 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
27924641
Default Alt Text
D49417.id157341.diff (1 KB)

Event Timeline