Skip to content

Tools: Use Distcc when it's configured #7846

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 23, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions tools/toolchains/gcc.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"""
import re
from os.path import join, basename, splitext, dirname, exists
from os import getenv
from distutils.spawn import find_executable
from distutils.version import LooseVersion

Expand Down Expand Up @@ -116,6 +117,9 @@ def __init__(self, target, notify=None, macros=None, build_profile=None,
self.ar = join(tool_path, "arm-none-eabi-ar")
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):
stdout, _, retcode = run_cmd([self.cc[0], "--version"], redirect=True)
msg = None
Expand Down Expand Up @@ -207,6 +211,8 @@ def compile(self, cc, source, object, includes):

# Call cmdline hook
cmd = self.hook.get_cmdline_compiler(cmd)
if self.use_distcc:
cmd = ["distcc"] + cmd

return [cmd]

Expand Down