diff options
author | Steven Knight <knight@baldmt.com> | 2006-01-02 22:23:13 (GMT) |
---|---|---|
committer | Steven Knight <knight@baldmt.com> | 2006-01-02 22:23:13 (GMT) |
commit | 615623538cfc5761c74ea996eea0adfd69009a48 (patch) | |
tree | 775b1b395cd5fb93bf4809b787e21ba7545fc028 /src/engine | |
parent | 2dbfb934a3e6e025f6619afef1cac72da4ed5b53 (diff) | |
download | SCons-615623538cfc5761c74ea996eea0adfd69009a48.zip SCons-615623538cfc5761c74ea996eea0adfd69009a48.tar.gz SCons-615623538cfc5761c74ea996eea0adfd69009a48.tar.bz2 |
Add code to set $CCVERSION when using gcc. (Anonymous)
Diffstat (limited to 'src/engine')
-rw-r--r-- | src/engine/SCons/Tool/gcc.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/engine/SCons/Tool/gcc.py b/src/engine/SCons/Tool/gcc.py index 761082e..1be665a 100644 --- a/src/engine/SCons/Tool/gcc.py +++ b/src/engine/SCons/Tool/gcc.py @@ -36,6 +36,8 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" import SCons.Util import cc +import os +import re compilers = ['gcc', 'cc'] @@ -48,6 +50,12 @@ def generate(env): env['SHCCFLAGS'] = SCons.Util.CLVar('$CCFLAGS') else: env['SHCCFLAGS'] = SCons.Util.CLVar('$CCFLAGS -fPIC') + # determine compiler version + if env['CC']: + line = os.popen(env['CC'] + ' --version').readline() + match = re.search(r'[0-9]+(\.[0-9]+)+', line) + if match: + env['CCVERSION'] = match.group(0) def exists(env): return env.Detect(compilers) |