Merge pull request #7846 from theotherjimmy/gcc-distcc

Tools: Use Distcc when it's configured
pull/7873/head
Cruz Monrreal 2018-08-23 10:06:33 -05:00 committed by GitHub
commit 6c4d64c520
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 0 deletions

View File

@ -16,6 +16,7 @@ limitations under the License.
""" """
import re import re
from os.path import join, basename, splitext, dirname, exists from os.path import join, basename, splitext, dirname, exists
from os import getenv
from distutils.spawn import find_executable from distutils.spawn import find_executable
from distutils.version import LooseVersion from distutils.version import LooseVersion
@ -116,6 +117,9 @@ class GCC(mbedToolchain):
self.ar = join(tool_path, "arm-none-eabi-ar") self.ar = join(tool_path, "arm-none-eabi-ar")
self.elf2bin = join(tool_path, "arm-none-eabi-objcopy") self.elf2bin = join(tool_path, "arm-none-eabi-objcopy")
self.use_distcc = (bool(getenv("DISTCC_POTENTIAL_HOSTS", False))
and not getenv("MBED_DISABLE_DISTCC", False))
def version_check(self): def version_check(self):
stdout, _, retcode = run_cmd([self.cc[0], "--version"], redirect=True) stdout, _, retcode = run_cmd([self.cc[0], "--version"], redirect=True)
msg = None msg = None
@ -207,6 +211,8 @@ class GCC(mbedToolchain):
# Call cmdline hook # Call cmdline hook
cmd = self.hook.get_cmdline_compiler(cmd) cmd = self.hook.get_cmdline_compiler(cmd)
if self.use_distcc:
cmd = ["distcc"] + cmd
return [cmd] return [cmd]