FreeBSD ccache port is wonderfiul!

Michael C. Shultz ringworm01 at gmail.com
Fri Nov 25 12:06:01 GMT 2005


On Friday 25 November 2005 01:28, Bjarne Wichmann Petersen wrote:
> On Monday 21 November 2005 15:25, Michael C. Shultz wrote:
> > ps: I cc'ed freebsd-ports at freebsd.org in case others like myself haven't
> > heard of this program yet, it may be found in /usr/ports/devel/ccache.
>
> I'm looking at it now, and have a small question. Reading the howto-freebsd
> I'll have to insert the following into etc/make.conf:
>
> .if !defined(NOCCACHE)
>  .if ${.CURDIR:M/usr/src*}
>  CC=/usr/local/libexec/ccache/cc
>  CXX=/usr/local/libexec/ccache/c++
>  .else
>  CC=cc
>  CXX=c++
>  .endif
>  .else
>  CC=/usr/bin/cc
>  CXX=/usr/bin/c++
>  .endif
>
> I don't know much shell-scripting, so I'm not entirely sure what
> ${.CURDIR:M/usr/src*} does. But to me it looks like ccache will be called
> upon only when the current directory is beneath /usr/src; ie.
> world/kernel-builds. Should I make another if-statement for /usr/ports? Or
> do I have it all wrong?
>
> Bjarne

For ports I just use this:

.if !defined(NOCCACHE)
CC=/usr/local/libexec/ccache/cc
CXX=/usr/local/libexec/ccache/c++
.endif

For cdrtools ports it has to be disabled

.if ${.CURDIR:M*/sysutils/cdrtools}
NOCCACHE=1
.endif

.if ${.CURDIR:M*/sysutils/cdrtools-cjk}
NOCCACHE=1
.endif

ccache gets too complicated to use for me when building world/kernel,
look up the thread in current from ealier this month and decide for yourself.

I only build world and kernel once a month so something like make buildworld 
-DNOCCACHE  is probably how I'll do it.

-Mike









More information about the freebsd-ports mailing list