summaryrefslogtreecommitdiff
path: root/mk
diff options
context:
space:
mode:
authorkamil <kamil@pkgsrc.org>2017-06-17 01:44:54 +0000
committerkamil <kamil@pkgsrc.org>2017-06-17 01:44:54 +0000
commitbcf98dccea822b1518021d46b9c7392e2be665ea (patch)
tree28d5fcd0c42bdc2f4f3224121af18d22cc91b7b0 /mk
parent4681cb296600c9937af22166aede44fb6fc798a2 (diff)
downloadpkgsrc-bcf98dccea822b1518021d46b9c7392e2be665ea.tar.gz
Correct shadowing system compiler with a pkgsrc one in ccache
ccache needs to call real compiler and it detects it with looking in $PATH. In case of usage of /usr/local/bin/clang as the desired pkgsrc $CC option, it will be shadowed by /usr/pkg/bin/clang if someone will build it in as a package. Workaround the problem with setting CCACHE_PATH through PKGSRC_MAKE_ENV. Little bit overzelaously set it to ${CCPATH:H}:${CXXPATH:H}:${CPPATH:H}, just in case that they might be in different paths. To ensure that they are not shadowed in narrow cases, there is an option to rename clang to xclang or similar and use it this way in $PKG_CC. While there, introduce new user settable option: CCACHE_LOGFILE. If set, ccache logs to file specified in ${CCACHE_LOGFILE:Q}. +# CCACHE_LOGFILE +# If set to a file path, ccache will write information on what it is +# doing to the specified file. This is useful for tracking down +# problems. This fixes another set of problems building large projects like Clang, LLVM with ccache. Sponsored by <The NetBSD Foundation>
Diffstat (limited to 'mk')
-rw-r--r--mk/compiler/ccache.mk13
1 files changed, 11 insertions, 2 deletions
diff --git a/mk/compiler/ccache.mk b/mk/compiler/ccache.mk
index e75753957e8..96e7a4ca74f 100644
--- a/mk/compiler/ccache.mk
+++ b/mk/compiler/ccache.mk
@@ -1,4 +1,4 @@
-# $NetBSD: ccache.mk,v 1.35 2015/03/20 17:53:14 tnn Exp $
+# $NetBSD: ccache.mk,v 1.36 2017/06/17 01:44:54 kamil Exp $
#
# Copyright (c) 2004 The NetBSD Foundation, Inc.
# All rights reserved.
@@ -48,6 +48,11 @@
# default, they are stored inside WRKDIR, so they are lost after
# a "make clean".
#
+# CCACHE_LOGFILE
+# If set to a file path, ccache will write information on what it is
+# doing to the specified file. This is useful for tracking down
+# problems.
+#
# === Package-settable variables ===
#
# IGNORE_CCACHE
@@ -60,7 +65,7 @@
COMPILER_CCACHE_MK= defined
_VARGROUPS+= ccache
-_USER_VARS.ccache= CCACHE_BASE CCACHE_DIR
+_USER_VARS.ccache= CCACHE_BASE CCACHE_DIR CCACHE_LOGFILE
_PKG_VARS.ccache= IGNORE_CCACHE
.include "../bsd.fast.prefs.mk"
@@ -140,6 +145,10 @@ TOOL_DEPENDS+= ccache-[0-9]*:../../devel/ccache
#
PKGSRC_MAKE_ENV+= CCACHE_COMPILERCHECK=echo\ ${CC_VERSION_STRING:Q}
PKGSRC_MAKE_ENV+= CCACHE_DIR=${CCACHE_DIR:Q}
+PKGSRC_MAKE_ENV+= CCACHE_PATH=${CCPATH:H}:${CXXPATH:H}:${CPPATH:H}
+.ifdef CCACHE_LOGFILE
+PKGSRC_MAKE_ENV+= CCACHE_LOGFILE=${CCACHE_LOGFILE:Q}
+.endif
# Create symlinks for the compiler into ${WRKDIR}.
. for _var_ in ${_CCACHE_VARS}