svn commit: r435809 - in head: Mk devel/ccache devel/ccache-memcached
Bryan Drewery
bdrewery at FreeBSD.org
Thu Mar 9 23:20:48 UTC 2017
Author: bdrewery
Date: Thu Mar 9 23:20:46 2017
New Revision: 435809
URL: https://svnweb.freebsd.org/changeset/ports/435809
Log:
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
Modified:
head/Mk/bsd.ccache.mk
head/devel/ccache-memcached/Makefile
head/devel/ccache/Makefile
Modified: head/Mk/bsd.ccache.mk
==============================================================================
--- head/Mk/bsd.ccache.mk Thu Mar 9 22:44:33 2017 (r435808)
+++ head/Mk/bsd.ccache.mk Thu Mar 9 23:20:46 2017 (r435809)
@@ -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 at FreeBSD.org
@@ -22,13 +26,16 @@ WARNING+= WITH_CCACHE_BUILD support disa
# 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
Modified: head/devel/ccache-memcached/Makefile
==============================================================================
--- head/devel/ccache-memcached/Makefile Thu Mar 9 22:44:33 2017 (r435808)
+++ head/devel/ccache-memcached/Makefile Thu Mar 9 23:20:46 2017 (r435809)
@@ -7,6 +7,5 @@ MASTERDIR= ${.CURDIR}/../ccache
OPTIONS_SLAVE= MEMCACHED
CONFLICTS_INSTALL= ccache-[0-9]*
-NOCCACHE= yes
.include "${MASTERDIR}/Makefile"
Modified: head/devel/ccache/Makefile
==============================================================================
--- head/devel/ccache/Makefile Thu Mar 9 22:44:33 2017 (r435808)
+++ head/devel/ccache/Makefile Thu Mar 9 23:20:46 2017 (r435809)
@@ -43,16 +43,20 @@ MEMCACHED_LIB_DEPENDS= libmemcached.so:
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
More information about the svn-ports-all
mailing list