1
0
mirror of https://git.FreeBSD.org/ports.git synced 2025-01-04 06:15:24 +00:00

- Fix WITH_CCACHE_BUILD support (fix build) with ports that use

HOME=/dev/null to avoid staging violations. This will force
  CCACHE_DIR=/root/.ccache when running as root, and otherwise
  will force CCACHE_DIR to be manually set.

With hat:	portmgr
PR:		ports/186410 [textproc/xmlto build]
Reported by:	mandree, Rainer Duffner <rainer@ultra-secure.de>
MFH:		2014Q2
This commit is contained in:
Bryan Drewery 2014-05-03 15:11:01 +00:00
parent 6e20b4730a
commit 03fd5eb749
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=352918

View File

@ -2125,6 +2125,19 @@ BUILD_FAIL_MESSAGE+= Try to set MAKE_JOBS_UNSAFE=yes and rebuild before reportin
.endif
# ccache support
# Try to set a default CCACHE_DIR to workaround HOME=/dev/null and
# HOME=${WRKDIR}/* staging fixes
.if defined(WITH_CCACHE_BUILD) && !defined(CCACHE_DIR) && \
(!defined(HOME) || ${HOME} == /dev/null || ${HOME:S/^${WRKDIR}//} != ${HOME})
. if defined(USER) && ${USER} == root
CCACHE_DIR= /root/.ccache
. else
NO_CCACHE= yes
WARNING+= WITH_CCACHE_BUILD support disabled, please set CCACHE_DIR.
. endif
.endif
# Support NO_CCACHE for common setups, require WITH_CCACHE_BUILD, and
# don't use if ccache already set in CC
.if !defined(NO_CCACHE) && defined(WITH_CCACHE_BUILD) && !${CC:M*ccache*} && \
@ -2138,12 +2151,15 @@ _CCACHE_PATH= ${LOCALBASE}/libexec/ccache
# Prepend the ccache dir into the PATH and setup ccache env
PATH:= ${_CCACHE_PATH}:${PATH}
#.MAKEFLAGS: PATH=${PATH}
.if !${MAKE_ENV:MPATH=*} && !${CONFIGURE_ENV:MPATH=*}
MAKE_ENV+= PATH=${PATH}
CONFIGURE_ENV+= PATH=${PATH}
.endif
# Ensure this is always in subchild environments
. if defined(CCACHE_DIR)
#.MAKEFLAGS: CCACHE_DIR=${CCACHE_DIR}
MAKE_ENV+= CCACHE_DIR="${CCACHE_DIR}"
CONFIGURE_ENV+= CCACHE_DIR="${CCACHE_DIR}"
. endif