aboutsummaryrefslogtreecommitdiffstats
path: root/Mk/bsd.port.mk
diff options
context:
space:
mode:
authorbdrewery <bdrewery@FreeBSD.org>2013-05-30 09:14:42 +0800
committerbdrewery <bdrewery@FreeBSD.org>2013-05-30 09:14:42 +0800
commit788ff68ddbecd2f5c2f19924231ce7ed70a3eee5 (patch)
tree0cf64713df587da063b8f6603a8a314418fd7d22 /Mk/bsd.port.mk
parent5f31f90dd66322c80732fe422715a3c49c3c4233 (diff)
downloadfreebsd-ports-graphics-788ff68ddbecd2f5c2f19924231ce7ed70a3eee5.tar.gz
freebsd-ports-graphics-788ff68ddbecd2f5c2f19924231ce7ed70a3eee5.tar.zst
freebsd-ports-graphics-788ff68ddbecd2f5c2f19924231ce7ed70a3eee5.zip
Fix build with WITH_CCACHE_BUILD with ports that override PATH via
MAKE_ENV or CONFIGURE_ENV. I.e., don't set PATH in MAKE_ENV twice as env(1) only takes one, in which case some ports fail to build. One example is any USES=ada port (such as textproc/xmlada). Instead, add the ccache path into PATH via := and let it fall into there via the sourcing port's MAKE_ENV=PATH=...:${PATH} line. A more comprehensive solution to this could be to add a MACRO/feature to modify the PATH for all ports without using MAKE_ENV via something like ADDPATH=... With hat: portmgr Tested by: several exp-runs
Diffstat (limited to 'Mk/bsd.port.mk')
-rw-r--r--Mk/bsd.port.mk10
1 files changed, 8 insertions, 2 deletions
diff --git a/Mk/bsd.port.mk b/Mk/bsd.port.mk
index ff47322e72c..038b7a63207 100644
--- a/Mk/bsd.port.mk
+++ b/Mk/bsd.port.mk
@@ -2193,9 +2193,15 @@ MAKE_JOBS_NUMBER= 1
BUILD_DEPENDS+= ${LOCALBASE}/bin/ccache:${PORTSDIR}/devel/ccache
. endif
+_CCACHE_PATH= ${LOCALBASE}/libexec/ccache
+
# Prepend the ccache dir into the PATH and setup ccache env
-MAKE_ENV+= PATH=${LOCALBASE}/libexec/ccache:${PATH}
-CONFIGURE_ENV+= PATH=${LOCALBASE}/libexec/ccache:${PATH}
+PATH:= ${_CCACHE_PATH}:${PATH}
+.if !${MAKE_ENV:M*PATH=*} && !${CONFIGURE_ENV:M*PATH=*}
+MAKE_ENV+= PATH=${PATH}
+CONFIGURE_ENV+= PATH=${PATH}
+.endif
+
. if defined(CCACHE_DIR)
MAKE_ENV+= CCACHE_DIR="${CCACHE_DIR}"
CONFIGURE_ENV+= CCACHE_DIR="${CCACHE_DIR}"