Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1453)

Side by Side Diff: third_party/scons/scons-local/SCons/Tool/gcc.py

Issue 17024: Update to SCons 1.2.0. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 """SCons.Tool.gcc 1 """SCons.Tool.gcc
2 2
3 Tool-specific initialization for gcc. 3 Tool-specific initialization for gcc.
4 4
5 There normally shouldn't be any need to import this module directly. 5 There normally shouldn't be any need to import this module directly.
6 It will usually be imported through the generic SCons.Tool.Tool() 6 It will usually be imported through the generic SCons.Tool.Tool()
7 selection method. 7 selection method.
8 8
9 """ 9 """
10 10
(...skipping 13 matching lines...) Expand all
24 # 24 #
25 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY 25 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
26 # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE 26 # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
27 # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 27 # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
28 # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 28 # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
29 # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 29 # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
30 # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 30 # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
31 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 31 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
32 # 32 #
33 33
34 __revision__ = "src/engine/SCons/Tool/gcc.py 3603 2008/10/10 05:46:45 scons" 34 __revision__ = "src/engine/SCons/Tool/gcc.py 3842 2008/12/20 22:59:52 scons"
35 35
36 import cc 36 import cc
37 import os 37 import os
38 import re 38 import re
39 import subprocess 39 import subprocess
40 40
41 import SCons.Util 41 import SCons.Util
42 42
43 compilers = ['gcc', 'cc'] 43 compilers = ['gcc', 'cc']
44 44
45 def generate(env): 45 def generate(env):
46 """Add Builders and construction variables for gcc to an Environment.""" 46 """Add Builders and construction variables for gcc to an Environment."""
47 cc.generate(env) 47 cc.generate(env)
48 48
49 env['CC'] = env.Detect(compilers) or 'gcc' 49 env['CC'] = env.Detect(compilers) or 'gcc'
50 if env['PLATFORM'] in ['cygwin', 'win32']: 50 if env['PLATFORM'] in ['cygwin', 'win32']:
51 env['SHCCFLAGS'] = SCons.Util.CLVar('$CCFLAGS') 51 env['SHCCFLAGS'] = SCons.Util.CLVar('$CCFLAGS')
52 else: 52 else:
53 env['SHCCFLAGS'] = SCons.Util.CLVar('$CCFLAGS -fPIC') 53 env['SHCCFLAGS'] = SCons.Util.CLVar('$CCFLAGS -fPIC')
54 # determine compiler version 54 # determine compiler version
55 if env['CC']: 55 if env['CC']:
56 #pipe = SCons.Action._subproc(env, [env['CC'], '-dumpversion'], 56 #pipe = SCons.Action._subproc(env, [env['CC'], '-dumpversion'],
57 pipe = SCons.Action._subproc(env, [env['CC'], '--version'], 57 pipe = SCons.Action._subproc(env, [env['CC'], '--version'],
58 stderr = subprocess.PIPE, 58 stdin = 'devnull',
59 stderr = 'devnull',
59 stdout = subprocess.PIPE) 60 stdout = subprocess.PIPE)
60 if pipe.wait() != 0: return 61 if pipe.wait() != 0: return
61 # -dumpversion was added in GCC 3.0. As long as we're supporting 62 # -dumpversion was added in GCC 3.0. As long as we're supporting
62 # GCC versions older than that, we should use --version and a 63 # GCC versions older than that, we should use --version and a
63 # regular expression. 64 # regular expression.
64 #line = pipe.stdout.read().strip() 65 #line = pipe.stdout.read().strip()
65 #if line: 66 #if line:
66 # env['CCVERSION'] = line 67 # env['CCVERSION'] = line
67 line = pipe.stdout.readline() 68 line = pipe.stdout.readline()
68 match = re.search(r'[0-9]+(\.[0-9]+)+', line) 69 match = re.search(r'[0-9]+(\.[0-9]+)+', line)
69 if match: 70 if match:
70 env['CCVERSION'] = match.group(0) 71 env['CCVERSION'] = match.group(0)
71 72
72 def exists(env): 73 def exists(env):
73 return env.Detect(compilers) 74 return env.Detect(compilers)
OLDNEW
« no previous file with comments | « third_party/scons/scons-local/SCons/Tool/gas.py ('k') | third_party/scons/scons-local/SCons/Tool/gfortran.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698