Gentoo Wiki


This article is part of the HOWTO series.
Installation Kernel & Hardware Networks Portage Software System X Server Gaming Non-x86 Emulators Misc


After a successfull ccache and distcc packages merge, and after issuing the commands:

Code: At the shell prompt
$ env-update && source /etc/profile

you must have a PATH environment variable looking like this:

Code: At the shell prompt
$ echo $PATH

Check to see if you also have the following environment variables (just as samples):

Code: At the shell prompt

$ echo $CCACHE_DIR

Tip: If you don't have some of the above environment variables, check the manpages or other HOWTOs about ccache and distcc .

Gentoo Distcc Documentation


Then, you only need to add lines like the ones below to make your scons builds use object caching and distributed compilation:

Code: SConstruct segment
  if os.path.exists('/usr/lib/distcc/bin'):
    os.environ['PATH']         = '/usr/lib/distcc/bin:' + os.environ['PATH']
    env['ENV']['DISTCC_HOSTS'] = os.environ['DISTCC_HOSTS']
  if os.path.exists('/usr/lib/ccache/bin'):
    os.environ['PATH']         = '/usr/lib/ccache/bin:' + os.environ['PATH']
    env['ENV']['CCACHE_DIR']   = os.environ['CCACHE_DIR']
  env['ENV']['PATH'] = os.environ['PATH']
  env['ENV']['HOME'] = os.environ['HOME']

and call scons with the option -j n, with n being the number of distccd servers, including your localhost

That's it.

Retrieved from ""

Last modified: Fri, 05 Sep 2008 03:53:00 +0000 Hits: 10,108