diff options
author | bdrewery <bdrewery@FreeBSD.org> | 2017-03-09 23:20:46 +0000 |
---|---|---|
committer | bdrewery <bdrewery@FreeBSD.org> | 2017-03-09 23:20:46 +0000 |
commit | 619349586acb9f6203b56c98bbe2a94d0f03bb5a (patch) | |
tree | c9cfeea72292ee74e5f3703a238c2f087f990c22 | |
parent | 920d6210c272b337d602ebcb3d0cc777f7803b52 (diff) | |
download | FreeBSD-ports-619349586acb9f6203b56c98bbe2a94d0f03bb5a.zip FreeBSD-ports-619349586acb9f6203b56c98bbe2a94d0f03bb5a.tar.gz |
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
-rw-r--r-- | Mk/bsd.ccache.mk | 10 | ||||
-rw-r--r-- | devel/ccache-memcached/Makefile | 1 | ||||
-rw-r--r-- | devel/ccache/Makefile | 8 |
3 files changed, 15 insertions, 4 deletions
diff --git a/Mk/bsd.ccache.mk b/Mk/bsd.ccache.mk index 046a2ab..ffb1fe5 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 diff --git a/devel/ccache-memcached/Makefile b/devel/ccache-memcached/Makefile index 5e56b1b..317a230 100644 --- a/devel/ccache-memcached/Makefile +++ b/devel/ccache-memcached/Makefile @@ -7,6 +7,5 @@ MASTERDIR= ${.CURDIR}/../ccache OPTIONS_SLAVE= MEMCACHED CONFLICTS_INSTALL= ccache-[0-9]* -NOCCACHE= yes .include "${MASTERDIR}/Makefile" diff --git a/devel/ccache/Makefile b/devel/ccache/Makefile index 2bb62d4a..0908c39 100644 --- a/devel/ccache/Makefile +++ b/devel/ccache/Makefile @@ -43,16 +43,20 @@ MEMCACHED_LIB_DEPENDS= libmemcached.so:databases/libmemcached MEMCACHED_LDFLAGS= -L${LOCALBASE}/lib MEMCACHED_CFLAGS= -I${LOCALBASE}/include -.if defined(WITH_CCACHE_BUILD) && empty(OPTIONS_SLAVE:MMEMCACHED) +.if defined(WITH_CCACHE_BUILD) && empty(OPTIONS_SLAVE:MMEMCACHED) && \ + !defined(NO_CCACHE_DEPEND) # Don't allow autoreconf. We want no dependencies on this to keep # WITH_CCACHE_BUILD working. USES:= ${USES:Nautoreconf} MEMCACHED_IGNORE= MEMCACHED cannot be combined with WITH_CCACHE_BUILD. Use devel/ccache-memcached # XXX: This needs more testing with Poudriere before enabling. Also bsd.options.mk support. -#MEMCACHED_DEPENDS_ARGS+= NO_CCACHE=1 +#MEMCACHED_DEPENDS_ARGS+= NO_CCACHE_DEPEND=1 .endif +# Support WITH_CCACHE_BUILD but don't depend on it. +NO_CCACHE_DEPEND= yes + OPTIONS_SUB= yes STATIC_LDFLAGS= -static |