pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/mk/compiler Correct shadowing system compiler with a p...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/1705a09254b5
branches:  trunk
changeset: 363806:1705a09254b5
user:      kamil <kamil%pkgsrc.org@localhost>
date:      Sat Jun 17 01:44:54 2017 +0000

description:
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:

 mk/compiler/ccache.mk |  13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)

diffs (41 lines):

diff -r f66260748030 -r 1705a09254b5 mk/compiler/ccache.mk
--- a/mk/compiler/ccache.mk     Fri Jun 16 21:03:58 2017 +0000
+++ b/mk/compiler/ccache.mk     Sat Jun 17 01:44:54 2017 +0000
@@ -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 @@
 #
 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