-
Notifications
You must be signed in to change notification settings - Fork 727
/
ccache-howto-freebsd.txt.in
67 lines (47 loc) · 2.14 KB
/
ccache-howto-freebsd.txt.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
To use ccache for ports, just add WITH_CCACHE_BUILD=yes to
/etc/make.conf. The rest of this guide is for building
/usr/src and other checkouts.
To use ccache for base (11.0+) just add WITH_CCACHE_BUILD=yes
to /etc/src.conf. Refer to src.conf(5) for more information.
-------------------------------------------------------------------------------
For older releases, before 11.0, add the following to /etc/make.conf.
You can replace cc and c++ with the compilers of your choice.
(remember that only GCC and Clang can build world and kernel)
.if (!empty(.CURDIR:M/usr/src*) || !empty(.CURDIR:M/usr/obj*))
.if !defined(NOCCACHE) && exists(%%PREFIX%%/%%CCLINKDIR%%/world/cc)
CC:=${CC:C,^cc,%%PREFIX%%/%%CCLINKDIR%%/world/cc,1}
CXX:=${CXX:C,^c\+\+,%%PREFIX%%/%%CCLINKDIR%%/world/c++,1}
.endif
.endif
For Korn/Bourne shells Add the following to /etc/profile:
export PATH=%%PREFIX%%/%%CCLINKDIR%%:$PATH
export CCACHE_PATH=/usr/bin:%%LOCALBASE%%/bin
For csh/tcsh Add the following to /etc/csh.cshrc:
setenv PATH %%PREFIX%%/%%CCLINKDIR%%:$PATH
setenv CCACHE_PATH /usr/bin:%%LOCALBASE%%/bin
For icc users:
Add %%ICCPREFIX%% to CCACHE_PATH
-------------------------------------------------------------------------------
To use distcc:
For Korn/Bourne shells Add the following to /etc/profile:
export CCACHE_PREFIX=distcc
export DISTCC_HOSTS="localhost host1 host2"
For csh/tcsh Add the following to /etc/csh.cshrc:
setenv CCACHE_PREFIX distcc
setenv DISTCC_HOSTS "localhost host1 host2"
--
If you have a problem building world
define NOCCACHE and try again.
If you have a problem building a port
reset PATH=$CCACHE_PATH and try again.
--
Make sure you run 'ccache-update-links' after you install/uninstall
additional compilers in order to create/remove compiler links.
--
Ccache's default cache size is 1GB and this is larger than the default size of
the root partition (/) on FreeBSD. To over come this you may specify a new
cache location on a different partition with the following examples.
For Korn/Bourne shells Add the following to /etc/profile:
export CCACHE_DIR=/usr/.ccache
For csh/tcsh Add the following to /etc/csh.cshrc
setenv CCACHE_DIR "/usr/.ccache"