summaryrefslogtreecommitdiffstats
path: root/src/engine
diff options
context:
space:
mode:
authorGary Oberbrunner <garyo@oberbrunner.com>2014-05-18 23:45:24 (GMT)
committerGary Oberbrunner <garyo@oberbrunner.com>2014-05-18 23:45:24 (GMT)
commit111bccab646e608e43a0803ac4b770a774c76497 (patch)
treead82c121bd7d31d9256caec686cf1646eb4271e7 /src/engine
parentf6a50e5a7c6bd8677e334d5d417ad8ee95e5077c (diff)
parent67355d075084e82e1e36caa3dfbbdf81a7b4182e (diff)
downloadSCons-111bccab646e608e43a0803ac4b770a774c76497.zip
SCons-111bccab646e608e43a0803ac4b770a774c76497.tar.gz
SCons-111bccab646e608e43a0803ac4b770a774c76497.tar.bz2
Merged in haubi/scons, pull request #139:
Delegate linker Tool.exists() to CC/CXX Tool.exists(). See issue #1723.
Diffstat (limited to 'src/engine')
-rw-r--r--src/engine/SCons/Tool/aixlink.py15
-rw-r--r--src/engine/SCons/Tool/gnulink.py11
2 files changed, 16 insertions, 10 deletions
diff --git a/src/engine/SCons/Tool/aixlink.py b/src/engine/SCons/Tool/aixlink.py
index 3512522..4e9db21 100644
--- a/src/engine/SCons/Tool/aixlink.py
+++ b/src/engine/SCons/Tool/aixlink.py
@@ -37,7 +37,6 @@ import os.path
import SCons.Util
-import aixcc
import link
cplusplus = __import__('c++', globals(), locals(), [])
@@ -62,12 +61,14 @@ def generate(env):
env['SHLIBSUFFIX'] = '.a'
def exists(env):
- path, _cc, _shcc, version = aixcc.get_xlc(env)
- if path and _cc:
- xlc = os.path.join(path, _cc)
- if os.path.exists(xlc):
- return xlc
- return None
+ # TODO: sync with link.smart_link() to choose a linker
+ linkers = { 'CXX': ['aixc++'], 'CC': ['aixcc'] }
+ alltools = []
+ for langvar, linktools in linkers.items():
+ if langvar in env: # use CC over CXX when user specified CC but not CXX
+ return SCons.Tool.FindTool(linktools, env)
+ alltools.extend(linktools)
+ return SCons.Tool.FindTool(alltools, env)
# Local Variables:
# tab-width:4
diff --git a/src/engine/SCons/Tool/gnulink.py b/src/engine/SCons/Tool/gnulink.py
index bf71270..3dc8f51 100644
--- a/src/engine/SCons/Tool/gnulink.py
+++ b/src/engine/SCons/Tool/gnulink.py
@@ -37,8 +37,6 @@ import SCons.Util
import link
-linkers = ['g++', 'gcc']
-
def generate(env):
"""Add Builders and construction variables for gnulink to an Environment."""
link.generate(env)
@@ -53,7 +51,14 @@ def generate(env):
env['_RPATH'] = '${_concat(RPATHPREFIX, RPATH, RPATHSUFFIX, __env__)}'
def exists(env):
- return env.Detect(linkers)
+ # TODO: sync with link.smart_link() to choose a linker
+ linkers = { 'CXX': ['g++'], 'CC': ['gcc'] }
+ alltools = []
+ for langvar, linktools in linkers.items():
+ if langvar in env: # use CC over CXX when user specified CC but not CXX
+ return SCons.Tool.FindTool(linktools, env)
+ alltools.extend(linktools)
+ return SCons.Tool.FindTool(alltools, env) # find CXX or CC
# Local Variables:
# tab-width:4