-
Notifications
You must be signed in to change notification settings - Fork 1
/
scons-issue1723.diff
101 lines (84 loc) · 3.08 KB
/
scons-issue1723.diff
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
diff -r def048b86854 src/engine/SCons/Tool/c++.py
--- a/src/engine/SCons/Tool/c++.py Mon Apr 28 18:39:49 2014 +0200
+++ b/src/engine/SCons/Tool/c++.py Wed May 07 17:18:54 2014 +0200
@@ -72,7 +72,7 @@
SCons.Tool.cc.add_common_cc_variables(env)
- env['CXX'] = 'c++'
+ env['CXX'] = exists(env) or compilers[0]
env['CXXFLAGS'] = SCons.Util.CLVar('')
env['CXXCOM'] = '$CXX -o $TARGET -c $CXXFLAGS $CCFLAGS $_CCCOMCOM $SOURCES'
env['SHCXX'] = '$CXX'
@@ -90,7 +90,7 @@
env['CXXFILESUFFIX'] = '.cc'
def exists(env):
- return env.Detect(compilers)
+ return env.Detect(env.get('CXX', compilers))
# Local Variables:
# tab-width:4
diff -r def048b86854 src/engine/SCons/Tool/cc.py
--- a/src/engine/SCons/Tool/cc.py Mon Apr 28 18:39:49 2014 +0200
+++ b/src/engine/SCons/Tool/cc.py Wed May 07 17:18:54 2014 +0200
@@ -62,6 +62,8 @@
if 'SHCCFLAGS' not in env:
env['SHCCFLAGS'] = SCons.Util.CLVar('$CCFLAGS')
+compilers = ['cc']
+
def generate(env):
"""
Add Builders and construction variables for C compilers to an Environment.
@@ -76,7 +78,7 @@
add_common_cc_variables(env)
- env['CC'] = 'cc'
+ env['CC'] = exists(env) or compilers[0]
env['CFLAGS'] = SCons.Util.CLVar('')
env['CCCOM'] = '$CC -o $TARGET -c $CFLAGS $CCFLAGS $_CCCOMCOM $SOURCES'
env['SHCC'] = '$CC'
@@ -93,7 +95,7 @@
env['CFILESUFFIX'] = '.c'
def exists(env):
- return env.Detect('cc')
+ return env.Detect(env.get('CC', compilers))
# Local Variables:
# tab-width:4
diff -r def048b86854 src/engine/SCons/Tool/g++.py
--- a/src/engine/SCons/Tool/g++.py Mon Apr 28 18:39:49 2014 +0200
+++ b/src/engine/SCons/Tool/g++.py Wed May 07 17:18:54 2014 +0200
@@ -48,10 +48,10 @@
"""Add Builders and construction variables for g++ to an Environment."""
static_obj, shared_obj = SCons.Tool.createObjBuilders(env)
+ env['CXX'] = exists(env) or compilers[0]
+
cplusplus.generate(env)
- env['CXX'] = env.Detect(compilers)
-
# platform specific settings
if env['PLATFORM'] == 'aix':
env['SHCXXFLAGS'] = SCons.Util.CLVar('$CXXFLAGS -mminimal-toc')
@@ -81,7 +81,7 @@
env['CXXVERSION'] = match.group(0)
def exists(env):
- return env.Detect(compilers)
+ return env.Detect(env.get('CXX', compilers))
# Local Variables:
# tab-width:4
diff -r def048b86854 src/engine/SCons/Tool/gcc.py
--- a/src/engine/SCons/Tool/gcc.py Mon Apr 28 18:39:49 2014 +0200
+++ b/src/engine/SCons/Tool/gcc.py Wed May 07 17:18:54 2014 +0200
@@ -44,9 +44,11 @@
def generate(env):
"""Add Builders and construction variables for gcc to an Environment."""
+
+ env['CC'] = exists(env) or compilers[0]
+
cc.generate(env)
- env['CC'] = env.Detect(compilers) or 'gcc'
if env['PLATFORM'] in ['cygwin', 'win32']:
env['SHCCFLAGS'] = SCons.Util.CLVar('$CCFLAGS')
else:
@@ -71,7 +73,7 @@
env['CCVERSION'] = match.group(0)
def exists(env):
- return env.Detect(compilers)
+ return env.Detect(env.get('CC', compilers))
# Local Variables:
# tab-width:4