aboutsummaryrefslogtreecommitdiffstats
path: root/Mk
diff options
context:
space:
mode:
authorbdrewery <bdrewery@FreeBSD.org>2017-03-10 07:20:46 +0800
committerbdrewery <bdrewery@FreeBSD.org>2017-03-10 07:20:46 +0800
commit619349586acb9f6203b56c98bbe2a94d0f03bb5a (patch)
treec9cfeea72292ee74e5f3703a238c2f087f990c22 /Mk
parent920d6210c272b337d602ebcb3d0cc777f7803b52 (diff)
downloadfreebsd-ports-gnome-619349586acb9f6203b56c98bbe2a94d0f03bb5a.tar.gz
freebsd-ports-gnome-619349586acb9f6203b56c98bbe2a94d0f03bb5a.tar.zst
freebsd-ports-gnome-619349586acb9f6203b56c98bbe2a94d0f03bb5a.zip
WITH_CCACHE_BUILD: Add a NO_CCACHE_DEPEND to allow using ccache without the dependency.
This allows WITH_CCACHE_BUILD to be set and still allow modifying MAKE_ENV/CC, etc, to achieve using the ccache wrappers located at LOCALBASE/libexec/ccache. This kind of mechanism is needed to support ccache-memcached which has many build dependencies. Building a version of that first then allows building further ports with it without introducing cyclic dependencies. Poudriere will grow support for using a static version of ccache for this purpose. With hat: portmgr
Diffstat (limited to 'Mk')
-rw-r--r--Mk/bsd.ccache.mk10
1 files changed, 9 insertions, 1 deletions
diff --git a/Mk/bsd.ccache.mk b/Mk/bsd.ccache.mk
index 046a2ab418bb..ffb1fe5d985e 100644
--- a/Mk/bsd.ccache.mk
+++ b/Mk/bsd.ccache.mk
@@ -1,6 +1,10 @@
# $FreeBSD$
#-*- tab-width: 4; -*-
# ex:ts=4
+#
+# WITH_CCACHE_BUILD=yes enables depending on ccache and using it in the build.
+# NO_CCACHE_DEPEND will additionally not add the dependency on ccache.
+# NO_CCACHE will disable this entirely.
COMMANDS_Include_MAINTAINER= portmgr@FreeBSD.org
@@ -22,13 +26,16 @@ WARNING+= WITH_CCACHE_BUILD support disabled, please set CCACHE_DIR.
# don't use if ccache already set in CC
.if !defined(NO_CCACHE) && defined(WITH_CCACHE_BUILD) && !${CC:M*ccache*} && \
!defined(NO_BUILD) && !defined(NOCCACHE)
+
# Avoid depends loops between ccache and pkg
-. if ${PKGORIGIN} != devel/ccache && ${PKGORIGIN} != ${PKG_ORIGIN}
+. if !defined(NO_CCACHE_DEPEND) && \
+ ${PKGORIGIN} != ${PKG_ORIGIN}
BUILD_DEPENDS+= ${LOCALBASE}/bin/ccache:devel/ccache
. endif
_CCACHE_PATH= ${LOCALBASE}/libexec/ccache
+.if exists(${_CCACHE_PATH})
# Prepend the ccache dir into the PATH and setup ccache env
PATH:= ${_CCACHE_PATH}:${PATH}
#.MAKEFLAGS: PATH=${PATH}
@@ -44,5 +51,6 @@ MAKE_ENV+= CCACHE_DIR="${CCACHE_DIR}"
CONFIGURE_ENV+= CCACHE_DIR="${CCACHE_DIR}"
. endif
.endif
+.endif
.endif