I'm new to FreeBSD (9.1) and I'm just setting up the system. One problem that I could not solve yet is to get ccache working. I installed it from ports and followed the guidelines in the documentation (modify /etc/make.conf). Compile new packages from ports works without errors but the cache is never filled, so it seems that ccache is simply not used.Here is the content of my /etc/make.conf file:WITH_PKGNG= yes# added by use.perl 2013-01-20 01:08:34PERL_VERSION=5.14.2# the rest here is copied from /usr/local/share/doc/ccache/ccache-howto-freebsd.txt.if (!empty(.CURDIR:M/usr/src*) || !empty(.CURDIR:M/usr/obj*)).if !defined(NOCCACHE)CC:=${CC:C,^cc,/usr/local/libexec/ccache/world/cc,1}CXX:=${CXX:C,^c\+\+,/usr/local/libexec/ccache/world/c++,1}.endif.endifI also tried to follow the other guidelines in ccache-howto-freebsd.txt and added the following lines to /etc/csh.cshrc, which is the default shell used by root:setenv PATH /usr/local/libexec/ccache:$PATHsetenv CCACHE_PATH /usr/bin:/usr/local/binStill no difference. ccache -s shows that the cache is still not filled during compilation. Do you have any ideas?
Cannot get ccache to work with ports in FreeBSD
freebsd;bsd ports
(arved's comment was right. It solved my problem, but I still don't understand exactly why the if statement was recommended, anyway. Thus, I post the answer as community wiki. Feel free to improve it if you know why.)First, find out which compiler is used: $ cd /usr/ports/devel/gdb && make -V CC cccc is the default C compiler but it should be ccache.To solve the problem, edit /etc/make.conf and remove the if-statement ....if (!empty(.CURDIR:M/usr/src*) || !empty(.CURDIR:M/usr/obj*))`... and, of course, its closing .endif statement. Then the problem is solved: $ cd /usr/ports/devel/gdb && make -V CC /usr/local/libexec/ccache/world/cc