Using distcc With scons Without Modifying Build Files

By default scons does not observe global environment variables however, scons can be made to use distcc even without having to modify scons build files. The trick is to add the distcc hosts to the hosts file within the home directory:

mkdir -p ~/.distcc/ 
echo "HOST_A:35001 HOST_B:35002" >~/.distcc/hosts

and then specify the C, respectively C++ compiler:

python3 buildscripts/scons.py build CC="distcc" CXX="distcc g++" ${JOBS_ARG}