diff options
author | William Deegan <bill@baddogconsulting.com> | 2018-11-26 05:03:46 (GMT) |
---|---|---|
committer | William Deegan <bill@baddogconsulting.com> | 2018-11-26 05:03:46 (GMT) |
commit | e6cd6f05b61bd8d460785ea1fa64ae3fcc0dd50f (patch) | |
tree | 472e30936dced4e1de627f1751f165a739c93e07 /src | |
parent | f34f454759beeaaf32c182b6a72ed0f148e0ed17 (diff) | |
download | SCons-e6cd6f05b61bd8d460785ea1fa64ae3fcc0dd50f.zip SCons-e6cd6f05b61bd8d460785ea1fa64ae3fcc0dd50f.tar.gz SCons-e6cd6f05b61bd8d460785ea1fa64ae3fcc0dd50f.tar.bz2 |
PEP8
Diffstat (limited to 'src')
-rw-r--r-- | src/engine/SCons/Tool/gcc.py | 15 |
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) |