3

What's the correct way of using scons with distcc? The obvious way of using CC="distcc g++" or CXX doesn't work.

Did anyone ever succeed in combining the two?

Thanks!

Jonathon Reinhart
  • 132,704
  • 33
  • 254
  • 328
Protostome
  • 5,569
  • 5
  • 30
  • 45
  • I know nothing about `scons` but did you have a look into [its documentation](http://www.scons.org/doc/production/HTML/scons-user/c2092.html) ? – Basile Starynkevitch Nov 06 '11 at 08:42
  • Yep, I did. I've ran into several workarounds that suggested modifying the scons source code. Problem is, I don't have the right permissions to modify it, and I'm looking for the standard way of running them both, if one exists. – Protostome Nov 06 '11 at 08:45
  • You can make a link to `distcc` from `gcc` and put that link early in your `PATH` as suggested by `distcc` man page. – Basile Starynkevitch Nov 06 '11 at 08:48

1 Answers1

7

Have you configured CC or CXX via an environment variable? SCons doesn't pollute its default environment with variables from the calling environment. However, you may initialize the SCons environment from the OS environment (or preferably a subset of it):

import os
env = Environment(ENV = os.environ)
env.Program('yourprogram.cpp')

Alternatively, this could also work (haven't used SCons in a long time):

env = Environment(CXX='distcc g++')
env.Program('yourprogram.cpp')

Have a look at the man page for an overview of all the variables used in SCons.

Pankrat
  • 5,206
  • 4
  • 31
  • 37