summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorWilliam Deegan <bill@baddogconsulting.com>2018-11-26 05:03:46 (GMT)
committerWilliam Deegan <bill@baddogconsulting.com>2018-11-26 05:03:46 (GMT)
commite6cd6f05b61bd8d460785ea1fa64ae3fcc0dd50f (patch)
tree472e30936dced4e1de627f1751f165a739c93e07 /src
parentf34f454759beeaaf32c182b6a72ed0f148e0ed17 (diff)
downloadSCons-e6cd6f05b61bd8d460785ea1fa64ae3fcc0dd50f.zip
SCons-e6cd6f05b61bd8d460785ea1fa64ae3fcc0dd50f.tar.gz
SCons-e6cd6f05b61bd8d460785ea1fa64ae3fcc0dd50f.tar.bz2
PEP8
Diffstat (limited to 'src')
-rw-r--r--src/engine/SCons/Tool/gcc.py15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/engine/SCons/Tool/gcc.py b/src/engine/SCons/Tool/gcc.py
index 998e35b..fabcc96 100644
--- a/src/engine/SCons/Tool/gcc.py
+++ b/src/engine/SCons/Tool/gcc.py
@@ -42,6 +42,7 @@ import SCons.Util
compilers = ['gcc', 'cc']
+
def generate(env):
"""Add Builders and construction variables for gcc to an Environment."""
@@ -59,26 +60,28 @@ def generate(env):
if version:
env['CCVERSION'] = version
+
def exists(env):
# is executable, and is a GNU compiler (or accepts '--version' at least)
return detect_version(env, env.Detect(env.get('CC', compilers)))
+
def detect_version(env, cc):
"""Return the version of the GNU compiler, or None if it is not a GNU compiler."""
cc = env.subst(cc)
if not cc:
return None
version = None
- #pipe = SCons.Action._subproc(env, SCons.Util.CLVar(cc) + ['-dumpversion'],
+ # pipe = SCons.Action._subproc(env, SCons.Util.CLVar(cc) + ['-dumpversion'],
pipe = SCons.Action._subproc(env, SCons.Util.CLVar(cc) + ['--version'],
- stdin = 'devnull',
- stderr = 'devnull',
- stdout = subprocess.PIPE)
+ stdin='devnull',
+ stderr='devnull',
+ stdout=subprocess.PIPE)
# -dumpversion was added in GCC 3.0. As long as we're supporting
# GCC versions older than that, we should use --version and a
# regular expression.
- #line = pipe.stdout.read().strip()
- #if line:
+ # line = pipe.stdout.read().strip()
+ # if line:
# version = line
line = SCons.Util.to_str(pipe.stdout.readline())
match = re.search(r'[0-9]+(\.[0-9]+)+', line)