aboutsummaryrefslogtreecommitdiffstats
path: root/Mk
diff options
context:
space:
mode:
authorbeat <beat@FreeBSD.org>2012-08-30 23:31:25 +0800
committerbeat <beat@FreeBSD.org>2012-08-30 23:31:25 +0800
commit4eee183e3705c37b8aae479c1765206b82d23254 (patch)
tree604018ada1d2e5cac1c6940dffa99659d40a3fe9 /Mk
parent8dc3dbb663255f306dfa197c76521fb76dc96c5d (diff)
downloadfreebsd-ports-gnome-4eee183e3705c37b8aae479c1765206b82d23254.tar.gz
freebsd-ports-gnome-4eee183e3705c37b8aae479c1765206b82d23254.tar.zst
freebsd-ports-gnome-4eee183e3705c37b8aae479c1765206b82d23254.zip
- Add ccache support for building ports. [1]
- Fix CONFIGURE_FAIL_MESSAGE to be pkgng-aware. [2] - Resolve symlinks in PREFIX on deinstall. [3] - Introduce CLEAN_FETCH_ENV variable to disable package dependency in fetch target for mass fetching. [4] PR: ports/169579 [1], ports/170552 [2], ports/170784 [3], ports/170796 [4] Submitted by: bdrewery@ [1], crees@ [2], gahr@ [3], ohauer@ [4] Tested on: pointyhat
Diffstat (limited to 'Mk')
-rw-r--r--Mk/bsd.port.mk29
1 files changed, 27 insertions, 2 deletions
diff --git a/Mk/bsd.port.mk b/Mk/bsd.port.mk
index 1ad6cb2f3ad2..78a944cf5276 100644
--- a/Mk/bsd.port.mk
+++ b/Mk/bsd.port.mk
@@ -833,6 +833,9 @@ FreeBSD_MAINTAINER= portmgr@FreeBSD.org
# Default: none
# FETCH_REGET - Times to retry fetching of files on checksum errors.
# Default: 1
+# CLEAN_FETCH_ENV
+# - Disable package dependency in fetch target for mass
+# fetching. User settable.
#
# For extract:
#
@@ -934,6 +937,13 @@ FreeBSD_MAINTAINER= portmgr@FreeBSD.org
# that are explicitly marked MAKE_JOBS_UNSAFE. User settable.
# MAKE_JOBS_NUMBER
# - Override the number of make jobs to be used. User settable.
+## cacche
+#
+# WITH_CCACHE_BUILD
+# - Enable CCACHE support (devel/ccache). User settable.
+# NO_CCACHE
+# - Disable CCACHE support for example for certain ports if
+# CCACHE is enabled. User settable.
#
# For install:
#
@@ -1626,9 +1636,11 @@ PLIST_SUB+= LIB32DIR=${LIB32DIR}
.if defined(WITH_PKGNG)
.if !defined(PKG_DEPENDS)
+.if !defined(CLEAN_FETCH_ENV)
PKG_DEPENDS+= ${LOCALBASE}/sbin/pkg:${PORTSDIR}/ports-mgmt/pkg
.endif
.endif
+.endif
.if defined(USE_ZIP)
EXTRACT_DEPENDS+= ${LOCALBASE}/bin/unzip:${PORTSDIR}/archivers/unzip
@@ -2217,6 +2229,19 @@ BUILD_FAIL_MESSAGE+= "You have chosen to use multiple make jobs (parallelization
.endif
.endif
+# ccache support
+# 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*}
+# Avoid depends loops between pkg and ccache
+. if !${.CURDIR:M*/devel/ccache} && !${.CURDIR:M*/ports-mgmt/pkg}
+BUILD_DEPENDS+= ${LOCALBASE}/bin/ccache:${PORTSDIR}/devel/ccache
+. endif
+
+# Prepend the ccache dir into the PATH and setup ccache env
+MAKE_ENV+= PATH=${LOCALBASE}/libexec/ccache:${PATH}
+.endif
+
PTHREAD_CFLAGS?=
PTHREAD_LIBS?= -pthread
@@ -2908,7 +2933,7 @@ CONFIGURE_TARGET:= ${CONFIGURE_TARGET:S/--build=//}
CONFIGURE_LOG?= config.log
# A default message to print if do-configure fails.
-CONFIGURE_FAIL_MESSAGE?= "Please report the problem to ${MAINTAINER} [maintainer] and attach the \"${CONFIGURE_WRKSRC}/${CONFIGURE_LOG}\" including the output of the failure of your make command. Also, it might be a good idea to provide an overview of all packages installed on your system (e.g. an \`ls ${PKG_DBDIR}\`)."
+CONFIGURE_FAIL_MESSAGE?= "Please report the problem to ${MAINTAINER} [maintainer] and attach the \"${CONFIGURE_WRKSRC}/${CONFIGURE_LOG}\" including the output of the failure of your make command. Also, it might be a good idea to provide an overview of all packages installed on your system (e.g. a ${PKG_INFO} -Ea)."
.if defined(GNU_CONFIGURE)
# Maximum command line length
@@ -4474,7 +4499,7 @@ deinstall:
check_name=`${ECHO_CMD} $${p} | ${SED} -e 's/-[^-]*$$//'`; \
if [ "$${check_name}" = "${PKGBASE}" ]; then \
prfx=`${PKG_INFO} -q -p $${p} 2> /dev/null | ${SED} -ne '1s|^@cwd ||p'`; \
- if [ "x${PREFIX}" = "x$${prfx}" ]; then \
+ if [ "x`${READLINK_CMD} -f ${PREFIX}`" = "x$${prfx}" ]; then \
${ECHO_MSG} "===> Deinstalling $${p}"; \
${PKG_DELETE} -f $${p}; \
else \