pkgsrc-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: pkgsrc/mk/compiler



Module Name:    pkgsrc
Committed By:   kamil
Date:           Sat Jun 17 01:44:54 UTC 2017

Modified Files:
        pkgsrc/mk/compiler: ccache.mk

Log Message:
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>


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 pkgsrc/mk/compiler/ccache.mk

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/mk/compiler/ccache.mk
diff -u pkgsrc/mk/compiler/ccache.mk:1.35 pkgsrc/mk/compiler/ccache.mk:1.36
--- pkgsrc/mk/compiler/ccache.mk:1.35   Fri Mar 20 17:53:14 2015
+++ pkgsrc/mk/compiler/ccache.mk        Sat Jun 17 01:44:54 2017
@@ -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
 #
 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}



Home | Main Index | Thread Index | Old Index