aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBryan Drewery <bdrewery@FreeBSD.org>2021-07-14 17:58:11 +0000
committerBryan Drewery <bdrewery@FreeBSD.org>2021-07-14 18:09:37 +0000
commit481cf80cb4226bcb94fe743428879848550f659e (patch)
treeeeaafff234d3c11668738fc06a3533771a54aebc
parent9984bd302c51f48dccba1346ec717b0d7745d5b8 (diff)
downloadports-481cf80cb4226bcb94fe743428879848550f659e.tar.gz
ports-481cf80cb4226bcb94fe743428879848550f659e.zip
Mk/bsd.ccache.mk: Fix Poudriere CCACHE_STATIC_PREFIX feature.
Poudriere's CCACHE_STATIC_PREFIX feature (not Mk/) avoids installing ccache for each port using the native jail ABI and instead copies in a host static binary. It uses NO_CCACHE_DEPEND to avoid installing ccache. For example, this is used for ccache-memcached where the dependency chain would make using ccache unfeasible. Poudriere sets CCACHE_WRAPPER_PATH, rather than the new CCACHE_PKG_PREFIX. Because CCACHE_BIN is now computed from CCACHE_PKG_PREFIX rather than CCACHE_WRAPPER_PATH, CCACHE_BIN was incorrect. Now compute CCACHE_PKG_PREFIX from CCACHE_WRAPPER_PATH if it is set, otherwise fallback to using LOCALBASE and computing CCACHE_BIN and CCACHE_WRAPPER_PATH from there. PR 257151 Fixes: 6b641f4eb4 ("Mk: Document and simply user-modifiable ...")
-rw-r--r--Mk/bsd.ccache.mk5
1 files changed, 5 insertions, 0 deletions
diff --git a/Mk/bsd.ccache.mk b/Mk/bsd.ccache.mk
index 0a240bcffe03..fa1b32ca8cfd 100644
--- a/Mk/bsd.ccache.mk
+++ b/Mk/bsd.ccache.mk
@@ -57,6 +57,11 @@ WARNING+= WITH_CCACHE_BUILD support disabled, please set CCACHE_DIR.
.if !defined(NO_CCACHE) && defined(WITH_CCACHE_BUILD) && !${CC:M*ccache*} && \
!defined(NO_BUILD)
+# Poudriere will only define CCACHE_WRAPPER_PATH for using a host-static ccache
+# binary.
+.if defined(CCACHE_WRAPPER_PATH)
+CCACHE_PKG_PREFIX= ${CCACHE_WRAPPER_PATH:C,/libexec/ccache$,,}
+.endif
CCACHE_PKG_PREFIX?= ${LOCALBASE}
CCACHE_WRAPPER_PATH?= ${CCACHE_PKG_PREFIX}/libexec/ccache
CCACHE_BIN?= ${CCACHE_PKG_PREFIX}/bin/ccache