1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-10-18 19:49:40 +00:00

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
This commit is contained in:
Bryan Drewery 2017-03-09 23:20:46 +00:00
parent 4c8183f1e7
commit a720097133
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=435809
3 changed files with 15 additions and 4 deletions

View File

@ -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

View File

@ -7,6 +7,5 @@ MASTERDIR= ${.CURDIR}/../ccache
OPTIONS_SLAVE= MEMCACHED
CONFLICTS_INSTALL= ccache-[0-9]*
NOCCACHE= yes
.include "${MASTERDIR}/Makefile"

View File

@ -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