From owner-svn-src-head@freebsd.org Tue Aug 1 16:15:09 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C0372DB1FB7; Tue, 1 Aug 2017 16:15:09 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8D7C68194E; Tue, 1 Aug 2017 16:15:09 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v71GF8Fo013176; Tue, 1 Aug 2017 16:15:08 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v71GF8Yg013175; Tue, 1 Aug 2017 16:15:08 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201708011615.v71GF8Yg013175@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Tue, 1 Aug 2017 16:15:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321880 - head/share/mk X-SVN-Group: head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: head/share/mk X-SVN-Commit-Revision: 321880 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Aug 2017 16:15:09 -0000 Author: bdrewery Date: Tue Aug 1 16:15:08 2017 New Revision: 321880 URL: https://svnweb.freebsd.org/changeset/base/321880 Log: CCACHE_BUILD: Allow setting CCACHE_BUILD_TYPE=wrapper. This uses the /usr/local/libexec/ccache/ wrappers rather than modifying CC to be '/usr/local/bin/ccache cc'. Some forms of compilation do not support the 'command' type. Sponsored by: Dell EMC Isilon Modified: head/share/mk/bsd.compiler.mk Modified: head/share/mk/bsd.compiler.mk ============================================================================== --- head/share/mk/bsd.compiler.mk Tue Aug 1 16:05:23 2017 (r321879) +++ head/share/mk/bsd.compiler.mk Tue Aug 1 16:15:08 2017 (r321880) @@ -31,6 +31,9 @@ ____: .include +# command = /usr/local/bin/ccache cc ... +# wrapper = /usr/local/libexec/ccache/cc ... +CCACHE_BUILD_TYPE?= command # Handle ccache after CC is determined, but not if CC/CXX are already # overridden with a manual setup. .if ${MK_CCACHE_BUILD:Uno} == "yes" && \ @@ -65,19 +68,23 @@ CCACHE_COMPILERCHECK?= content CCACHE_COMPILERCHECK?= mtime .endif .export CCACHE_COMPILERCHECK -# Remove ccache from the PATH to prevent double calls and wasted CPP/LD time. -PATH:= ${PATH:C,:?${CCACHE_WRAPPER_PATH}(/world)?(:$)?,,g} # Ensure no bogus CCACHE_PATH leaks in which might avoid the in-tree compiler. .if !empty(CCACHE_PATH) CCACHE_PATH= .export CCACHE_PATH .endif +.if ${CCACHE_BUILD_TYPE} == "command" +# Remove ccache from the PATH to prevent double calls and wasted CPP/LD time. +PATH:= ${PATH:C,:?${CCACHE_WRAPPER_PATH}(/world)?(:$)?,,g} # Override various toolchain vars. .for var in CC CXX HOST_CC HOST_CXX .if defined(${var}) && ${${var}:M${CCACHE_BIN}} == "" ${var}:= ${CCACHE_BIN} ${${var}} .endif .endfor +.elif empty(PATH:M*${CCACHE_WRAPPER_PATH}*) +PATH:= ${CCACHE_WRAPPER_PATH}:${PATH} +.endif # ${CCACHE_BUILD_TYPE} == "command" # GCC does not need the CCACHE_CPP2 hack enabled by default in devel/ccache. # The port enables it due to ccache passing preprocessed C to clang # which fails with -Wparentheses-equality, -Wtautological-compare, and