On Wed, Nov 27, 2013 at 09:24:33AM +0000, Stuart Henderson wrote:
> On 2013/11/27 13:05, Vadim Zhukov wrote:
> > CCache won't work for non-base C/C++ compilers, so don't even try
> > to do it. Okays, objections?
> > 

The ports framework only uses ccache with base gcc. I don't know why you
need add NO_CCACHE to ports-gcc/clang. Look bsd.port.mk line 2453:

.if ${USE_CCACHE:L} == "yes" && ${NO_CCACHE:L} == "no"
        @${ECHO_MSG} "===>  Enabling ccache for
${FULLPKGNAME}${_MASTER}"
        @ln -s ${LOCALBASE}/bin/ccache ${WRKDIR}/bin/gcc
        @ln -s ${LOCALBASE}/bin/ccache ${WRKDIR}/bin/g++
        @ln -s ${LOCALBASE}/bin/ccache ${WRKDIR}/bin/cc
        @ln -s ${LOCALBASE}/bin/ccache ${WRKDIR}/bin/c++
.endif

ccache is pretty intelligent, ignores unknown languages or compiler
options.

> 
> Ok for now, though in those cases you might want to investigate setting
> CC/CXX to "ccache egcc", etc. I didn't use that method for the general
> case as I was worried about quoting issues e.g. MAKE_FLAGS= CC=${CC}
> but this might be manageable if it's just for ports using non-base
> compilers.
> 

Why not add support for ports-gcc/clang?. The symlinks only works with
base-gcc but ccache can work with any compiler using
"CCACHE_CC=mycompiler". I think a script in ${WRKDIR}/bin with
"CCACHE_CC=mycompiler ccache $@" inside or something similar should be
enough.

"MAKE_FLAGS= CC=${CC}" uses "cc" from PATH=${WRKDIR}/bin. Don't worry.


-- 
Juan Francisco Cantero Hurtado http://juanfra.info

Reply via email to