summaryrefslogtreecommitdiff
path: root/src/engine/SCons/Tool/__init__.py
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff-webhosting.net>2017-09-28 12:18:58 +0200
committerJörg Frings-Fürst <debian@jff-webhosting.net>2017-09-28 12:18:58 +0200
commitbaee03c569c91b745a1e025660b19a718db16e7d (patch)
tree1aaa25835bd24c5c95649cd8ab34d97bafded599 /src/engine/SCons/Tool/__init__.py
parent4c7fed99e5554ba71d62987c0ec5f1302011b122 (diff)
New upstream version 3.0.0upstream/3.0.0
Diffstat (limited to 'src/engine/SCons/Tool/__init__.py')
-rw-r--r--src/engine/SCons/Tool/__init__.py286
1 files changed, 193 insertions, 93 deletions
diff --git a/src/engine/SCons/Tool/__init__.py b/src/engine/SCons/Tool/__init__.py
index 274b563..9265b81 100644
--- a/src/engine/SCons/Tool/__init__.py
+++ b/src/engine/SCons/Tool/__init__.py
@@ -14,7 +14,7 @@ tool definition.
"""
#
-# Copyright (c) 2001 - 2016 The SCons Foundation
+# Copyright (c) 2001 - 2017 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -35,14 +35,16 @@ tool definition.
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-__revision__ = "src/engine/SCons/Tool/__init__.py rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/__init__.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
import imp
+import importlib
import sys
import re
import os
import shutil
+
import SCons.Builder
import SCons.Errors
import SCons.Node.FS
@@ -52,6 +54,7 @@ import SCons.Scanner.D
import SCons.Scanner.LaTeX
import SCons.Scanner.Prog
import SCons.Scanner.SWIG
+import collections
DefaultToolpath=[]
@@ -94,9 +97,20 @@ for suffix in LaTeXSuffixes:
SourceFileScanner.add_scanner(suffix, LaTeXScanner)
SourceFileScanner.add_scanner(suffix, PDFLaTeXScanner)
+
+# Tool aliases are needed for those tools whos module names also
+# occur in the python standard library. This causes module shadowing and
+# can break using python library functions under python3
+TOOL_ALIASES = {
+ 'gettext':'gettext_tool',
+ 'clang++': 'clangxx',
+}
+
class Tool(object):
def __init__(self, name, toolpath=[], **kw):
- self.name = name
+
+ # Rename if there's a TOOL_ALIAS for this tool
+ self.name = TOOL_ALIASES.get(name,name)
self.toolpath = toolpath + DefaultToolpath
# remember these so we can merge them into the call
self.init_kw = kw
@@ -107,35 +121,124 @@ class Tool(object):
if hasattr(module, 'options'):
self.options = module.options
+ def _load_dotted_module_py2(self, short_name, full_name, searchpaths=None):
+ splitname = short_name.split('.')
+ index = 0
+ srchpths = searchpaths
+ for item in splitname:
+ file, path, desc = imp.find_module(item, srchpths)
+ mod = imp.load_module(full_name, file, path, desc)
+ srchpths = [path]
+ return mod, file
+
def _tool_module(self):
- # TODO: Interchange zipimport with normal initialization for better error reporting
oldpythonpath = sys.path
sys.path = self.toolpath + sys.path
+ # sys.stderr.write("Tool:%s\nPATH:%s\n"%(self.name,sys.path))
- try:
+ if sys.version_info[0] < 3 or (sys.version_info[0] == 3 and sys.version_info[1] in (0,1,2,3,4)):
+ # Py 2 code
try:
- file, path, desc = imp.find_module(self.name, self.toolpath)
try:
- return imp.load_module(self.name, file, path, desc)
- finally:
- if file:
- file.close()
- except ImportError, e:
- if str(e)!="No module named %s"%self.name:
- raise SCons.Errors.EnvironmentError(e)
- try:
- import zipimport
- except ImportError:
- pass
+ file = None
+ try:
+ mod, file = self._load_dotted_module_py2(self.name, self.name, self.toolpath)
+ return mod
+ finally:
+ if file:
+ file.close()
+ except ImportError as e:
+ splitname = self.name.split('.')
+ if str(e)!="No module named %s"%splitname[0]:
+ raise SCons.Errors.EnvironmentError(e)
+ try:
+ import zipimport
+ except ImportError:
+ pass
+ else:
+ for aPath in self.toolpath:
+ try:
+ importer = zipimport.zipimporter(aPath)
+ return importer.load_module(self.name)
+ except ImportError as e:
+ pass
+ finally:
+ sys.path = oldpythonpath
+ elif sys.version_info[1] > 4:
+ # From: http://stackoverflow.com/questions/67631/how-to-import-a-module-given-the-full-path/67692#67692
+ # import importlib.util
+ # spec = importlib.util.spec_from_file_location("module.name", "/path/to/file.py")
+ # foo = importlib.util.module_from_spec(spec)
+ # spec.loader.exec_module(foo)
+ # foo.MyClass()
+ # Py 3 code
+
+ # import pdb; pdb.set_trace()
+ import importlib.util
+
+ # sys.stderr.write("toolpath:%s\n" % self.toolpath)
+ # sys.stderr.write("SCONS.TOOL path:%s\n" % sys.modules['SCons.Tool'].__path__)
+ debug = False
+ spec = None
+ found_name = self.name
+ add_to_scons_tools_namespace = False
+ for path in self.toolpath:
+ sepname = self.name.replace('.', os.path.sep)
+ file_path = os.path.join(path, "%s.py"%sepname)
+ file_package = os.path.join(path, sepname)
+
+ if debug: sys.stderr.write("Trying:%s %s\n"%(file_path, file_package))
+
+ if os.path.isfile(file_path):
+ spec = importlib.util.spec_from_file_location(self.name, file_path)
+ if debug: print("file_Path:%s FOUND"%file_path)
+ break
+ elif os.path.isdir(file_package):
+ file_package = os.path.join(file_package, '__init__.py')
+ spec = importlib.util.spec_from_file_location(self.name, file_package)
+ if debug: print("PACKAGE:%s Found"%file_package)
+ break
+
else:
- for aPath in self.toolpath:
- try:
- importer = zipimport.zipimporter(aPath)
- return importer.load_module(self.name)
- except ImportError, e:
- pass
- finally:
- sys.path = oldpythonpath
+ continue
+
+ if spec is None:
+ if debug: sys.stderr.write("NO SPEC :%s\n"%self.name)
+ spec = importlib.util.find_spec("."+self.name, package='SCons.Tool')
+ if spec:
+ found_name = 'SCons.Tool.'+self.name
+ add_to_scons_tools_namespace = True
+ if debug: sys.stderr.write("Spec Found? .%s :%s\n"%(self.name, spec))
+
+ if spec is None:
+ error_string = "No module named %s"%self.name
+ raise SCons.Errors.EnvironmentError(error_string)
+
+ module = importlib.util.module_from_spec(spec)
+ if module is None:
+ if debug: print("MODULE IS NONE:%s"%self.name)
+ error_string = "No module named %s"%self.name
+ raise SCons.Errors.EnvironmentError(error_string)
+
+ # Don't reload a tool we already loaded.
+ sys_modules_value = sys.modules.get(found_name,False)
+ if sys_modules_value and sys_modules_value.__file__ == spec.origin:
+ return sys.modules[found_name]
+ else:
+ # Not sure what to do in the case that there already
+ # exists sys.modules[self.name] but the source file is
+ # different.. ?
+ module = spec.loader.load_module(spec.name)
+
+ sys.modules[found_name] = module
+ if add_to_scons_tools_namespace:
+ # If we found it in SCons.Tool, then add it to the module
+ setattr(SCons.Tool, self.name, module)
+
+ return module
+
+
+ sys.path = oldpythonpath
full_name = 'SCons.Tool.' + self.name
try:
@@ -144,13 +247,12 @@ class Tool(object):
try:
smpath = sys.modules['SCons.Tool'].__path__
try:
- file, path, desc = imp.find_module(self.name, smpath)
- module = imp.load_module(full_name, file, path, desc)
+ module, file = self._load_dotted_module_py2(self.name, full_name, smpath)
setattr(SCons.Tool, self.name, module)
if file:
file.close()
return module
- except ImportError, e:
+ except ImportError as e:
if str(e)!="No module named %s"%self.name:
raise SCons.Errors.EnvironmentError(e)
try:
@@ -159,10 +261,10 @@ class Tool(object):
module = importer.load_module(full_name)
setattr(SCons.Tool, self.name, module)
return module
- except ImportError, e:
+ except ImportError as e:
m = "No tool named '%s': %s" % (self.name, e)
raise SCons.Errors.EnvironmentError(m)
- except ImportError, e:
+ except ImportError as e:
m = "No tool named '%s': %s" % (self.name, e)
raise SCons.Errors.EnvironmentError(m)
@@ -217,6 +319,7 @@ def createProgBuilder(env):
return program
+
def createStaticLibBuilder(env):
"""This is a utility function that creates the StaticLibrary
Builder in an Environment if it is not there already.
@@ -228,7 +331,7 @@ def createStaticLibBuilder(env):
static_lib = env['BUILDERS']['StaticLibrary']
except KeyError:
action_list = [ SCons.Action.Action("$ARCOM", "$ARCOMSTR") ]
- if env.Detect('ranlib'):
+ if env.get('RANLIB',False) or env.Detect('ranlib'):
ranlib_action = SCons.Action.Action("$RANLIBCOM", "$RANLIBCOMSTR")
action_list.append(ranlib_action)
@@ -254,22 +357,22 @@ def _call_linker_cb(env, callback, args, result = None):
Verbose = False
if Verbose:
- print '_call_linker_cb: args=%r' % args
- print '_call_linker_cb: callback=%r' % callback
-
+ print('_call_linker_cb: args=%r' % args)
+ print('_call_linker_cb: callback=%r' % callback)
+
try:
cbfun = env['LINKCALLBACKS'][callback]
except (KeyError, TypeError):
if Verbose:
- print '_call_linker_cb: env["LINKCALLBACKS"][%r] not found or can not be used' % callback
+ print('_call_linker_cb: env["LINKCALLBACKS"][%r] not found or can not be used' % callback)
pass
else:
if Verbose:
- print '_call_linker_cb: env["LINKCALLBACKS"][%r] found' % callback
- print '_call_linker_cb: env["LINKCALLBACKS"][%r]=%r' % (callback, cbfun)
- if(callable(cbfun)):
+ print('_call_linker_cb: env["LINKCALLBACKS"][%r] found' % callback)
+ print('_call_linker_cb: env["LINKCALLBACKS"][%r]=%r' % (callback, cbfun))
+ if(isinstance(cbfun, collections.Callable)):
if Verbose:
- print '_call_linker_cb: env["LINKCALLBACKS"][%r] is callable' % callback
+ print('_call_linker_cb: env["LINKCALLBACKS"][%r] is callable' % callback)
result = cbfun(env, *args)
return result
@@ -388,7 +491,7 @@ class _LibInfoGeneratorBase(object):
def generate_versioned_lib_info(self, env, args, result = None, **kw):
callback = self.get_versioned_lib_info_generator(**kw)
- return _call_linker_cb(env, callback, args, result)
+ return _call_linker_cb(env, callback, args, result)
class _LibPrefixGenerator(_LibInfoGeneratorBase):
"""Library prefix generator, used as target_prefix in SharedLibrary and
@@ -407,17 +510,17 @@ class _LibPrefixGenerator(_LibInfoGeneratorBase):
prefix = self.get_lib_prefix(env,**kw2)
if Verbose:
- print "_LibPrefixGenerator: input prefix=%r" % prefix
+ print("_LibPrefixGenerator: input prefix=%r" % prefix)
version = self.get_lib_version(env, **kw2)
if Verbose:
- print "_LibPrefixGenerator: version=%r" % version
+ print("_LibPrefixGenerator: version=%r" % version)
if version:
prefix = self.generate_versioned_lib_info(env, [prefix, version], prefix, **kw2)
if Verbose:
- print "_LibPrefixGenerator: return prefix=%r" % prefix
+ print("_LibPrefixGenerator: return prefix=%r" % prefix)
return prefix
ShLibPrefixGenerator = _LibPrefixGenerator('ShLib')
@@ -441,17 +544,17 @@ class _LibSuffixGenerator(_LibInfoGeneratorBase):
suffix = self.get_lib_suffix(env, **kw2)
if Verbose:
- print "_LibSuffixGenerator: input suffix=%r" % suffix
+ print("_LibSuffixGenerator: input suffix=%r" % suffix)
version = self.get_lib_version(env, **kw2)
if Verbose:
- print "_LibSuffixGenerator: version=%r" % version
+ print("_LibSuffixGenerator: version=%r" % version)
if version:
suffix = self.generate_versioned_lib_info(env, [suffix, version], suffix, **kw2)
if Verbose:
- print "_LibSuffixGenerator: return suffix=%r" % suffix
+ print("_LibSuffixGenerator: return suffix=%r" % suffix)
return suffix
ShLibSuffixGenerator = _LibSuffixGenerator('ShLib')
@@ -474,15 +577,15 @@ class _LibSymlinkGenerator(_LibInfoGeneratorBase):
kw2 = kw
if Verbose:
- print "_LibSymLinkGenerator: libnode=%r" % libnode.get_path()
+ print("_LibSymLinkGenerator: libnode=%r" % libnode.get_path())
symlinks = None
version = self.get_lib_version(env, **kw2)
disable = self.get_lib_noversionsymlinks(env, **kw2)
if Verbose:
- print '_LibSymlinkGenerator: version=%r' % version
- print '_LibSymlinkGenerator: disable=%r' % disable
+ print('_LibSymlinkGenerator: version=%r' % version)
+ print('_LibSymlinkGenerator: disable=%r' % disable)
if version and not disable:
prefix = self.get_lib_prefix(env,**kw2)
@@ -490,7 +593,7 @@ class _LibSymlinkGenerator(_LibInfoGeneratorBase):
symlinks = self.generate_versioned_lib_info(env, [libnode, version, prefix, suffix], **kw2)
if Verbose:
- print '_LibSymlinkGenerator: return symlinks=%r' % StringizeLibSymlinks(symlinks)
+ print('_LibSymlinkGenerator: return symlinks=%r' % StringizeLibSymlinks(symlinks))
return symlinks
ShLibSymlinkGenerator = _LibSymlinkGenerator('ShLib')
@@ -499,7 +602,7 @@ ImpLibSymlinkGenerator = _LibSymlinkGenerator('ImpLib')
class _LibNameGenerator(_LibInfoGeneratorBase):
"""Generates "unmangled" library name from a library file node.
-
+
Generally, it's thought to revert modifications done by prefix/suffix
generators (_LibPrefixGenerator/_LibSuffixGenerator) used by a library
builder. For example, on gnulink the suffix generator used by SharedLibrary
@@ -509,7 +612,7 @@ class _LibNameGenerator(_LibInfoGeneratorBase):
"$SHLIBSUFFIX" in the node's basename. So that, if $SHLIBSUFFIX is ".so",
$SHLIBVERSION is "0.1.2" and the node path is "/foo/bar/libfoo.so.0.1.2",
the _LibNameGenerator shall return "libfoo.so". Other link tools may
- implement it's own way of library name unmangling.
+ implement it's own way of library name unmangling.
"""
def __init__(self, libtype):
super(_LibNameGenerator, self).__init__(libtype, 'Name')
@@ -525,11 +628,11 @@ class _LibNameGenerator(_LibInfoGeneratorBase):
kw2 = kw
if Verbose:
- print "_LibNameGenerator: libnode=%r" % libnode.get_path()
+ print("_LibNameGenerator: libnode=%r" % libnode.get_path())
version = self.get_lib_version(env, **kw2)
if Verbose:
- print '_LibNameGenerator: version=%r' % version
+ print('_LibNameGenerator: version=%r' % version)
name = None
if version:
@@ -541,7 +644,7 @@ class _LibNameGenerator(_LibInfoGeneratorBase):
name = os.path.basename(libnode.get_path())
if Verbose:
- print '_LibNameGenerator: return name=%r' % name
+ print('_LibNameGenerator: return name=%r' % name)
return name
@@ -550,7 +653,7 @@ LdModNameGenerator = _LibNameGenerator('LdMod')
ImpLibNameGenerator = _LibNameGenerator('ImpLib')
class _LibSonameGenerator(_LibInfoGeneratorBase):
- """Library soname generator. Returns library soname (e.g. libfoo.so.0) for
+ """Library soname generator. Returns library soname (e.g. libfoo.so.0) for
a given node (e.g. /foo/bar/libfoo.so.0.1.2)"""
def __init__(self, libtype):
super(_LibSonameGenerator, self).__init__(libtype, 'Soname')
@@ -566,13 +669,13 @@ class _LibSonameGenerator(_LibInfoGeneratorBase):
kw2 = kw
if Verbose:
- print "_LibSonameGenerator: libnode=%r" % libnode.get_path()
+ print("_LibSonameGenerator: libnode=%r" % libnode.get_path())
soname = _call_env_subst(env, '$SONAME', **kw2)
if not soname:
version = self.get_lib_version(env,**kw2)
if Verbose:
- print "_LibSonameGenerator: version=%r" % version
+ print("_LibSonameGenerator: version=%r" % version)
if version:
prefix = self.get_lib_prefix(env,**kw2)
suffix = self.get_lib_suffix(env,**kw2)
@@ -582,10 +685,10 @@ class _LibSonameGenerator(_LibInfoGeneratorBase):
# fallback to library name (as returned by appropriate _LibNameGenerator)
soname = _LibNameGenerator(self.get_libtype())(env, libnode)
if Verbose:
- print "_LibSonameGenerator: FALLBACK: soname=%r" % soname
+ print("_LibSonameGenerator: FALLBACK: soname=%r" % soname)
if Verbose:
- print "_LibSonameGenerator: return soname=%r" % soname
+ print("_LibSonameGenerator: return soname=%r" % soname)
return soname
@@ -613,39 +716,39 @@ def EmitLibSymlinks(env, symlinks, libnode, **kw):
clean_targets = kw.get('clean_targets', [])
if not SCons.Util.is_List(clean_targets):
clean_targets = [ clean_targets ]
-
+
for link, linktgt in symlinks:
env.SideEffect(link, linktgt)
if(Verbose):
- print "EmitLibSymlinks: SideEffect(%r,%r)" % (link.get_path(), linktgt.get_path())
- clean_list = filter(lambda x : x != linktgt, nodes)
+ print("EmitLibSymlinks: SideEffect(%r,%r)" % (link.get_path(), linktgt.get_path()))
+ clean_list = [x for x in nodes if x != linktgt]
env.Clean(list(set([linktgt] + clean_targets)), clean_list)
if(Verbose):
- print "EmitLibSymlinks: Clean(%r,%r)" % (linktgt.get_path(), map(lambda x : x.get_path(), clean_list))
+ print("EmitLibSymlinks: Clean(%r,%r)" % (linktgt.get_path(), [x.get_path() for x in clean_list]))
def CreateLibSymlinks(env, symlinks):
"""Physically creates symlinks. The symlinks argument must be a list in
form [ (link, linktarget), ... ], where link and linktarget are SCons
nodes.
"""
-
+
Verbose = False
for link, linktgt in symlinks:
linktgt = link.get_dir().rel_path(linktgt)
link = link.get_path()
if(Verbose):
- print "CreateLibSymlinks: preparing to add symlink %r -> %r" % (link, linktgt)
+ print("CreateLibSymlinks: preparing to add symlink %r -> %r" % (link, linktgt))
# Delete the (previously created) symlink if exists. Let only symlinks
# to be deleted to prevent accidental deletion of source files...
if env.fs.islink(link):
env.fs.unlink(link)
if(Verbose):
- print "CreateLibSymlinks: removed old symlink %r" % link
+ print("CreateLibSymlinks: removed old symlink %r" % link)
# If a file or directory exists with the same name as link, an OSError
# will be thrown, which should be enough, I think.
env.fs.symlink(linktgt, link)
if(Verbose):
- print "CreateLibSymlinks: add symlink %r -> %r" % (link, linktgt)
+ print("CreateLibSymlinks: add symlink %r -> %r" % (link, linktgt))
return 0
def LibSymlinksActionFunction(target, source, env):
@@ -670,10 +773,11 @@ def LibSymlinksStrFun(target, source, env, *args):
else:
cmd += ": %s" % linkstr
return cmd
-
+
LibSymlinksAction = SCons.Action.Action(LibSymlinksActionFunction, LibSymlinksStrFun)
+
def createSharedLibBuilder(env):
"""This is a utility function that creates the SharedLibrary
Builder in an Environment if it is not there already.
@@ -810,7 +914,7 @@ def CreateJarBuilder(env):
jar_com = SCons.Action.Action('$JARCOM', '$JARCOMSTR')
java_jar = SCons.Builder.Builder(action = jar_com,
suffix = '$JARSUFFIX',
- src_suffix = '$JAVACLASSSUFIX',
+ src_suffix = '$JAVACLASSSUFFIX',
src_builder = 'JavaClassFile',
source_factory = fs.Entry)
env['BUILDERS']['Jar'] = java_jar
@@ -890,9 +994,9 @@ class ToolInitializerMethod(object):
def get_builder(self, env):
"""
- Returns the appropriate real Builder for this method name
- after having the associated ToolInitializer object apply
- the appropriate Tool module.
+ Returns the appropriate real Builder for this method name
+ after having the associated ToolInitializer object apply
+ the appropriate Tool module.
"""
builder = getattr(env, self.__name__)
@@ -949,13 +1053,13 @@ class ToolInitializer(object):
so we no longer copy and re-bind them when the construction
environment gets cloned.
"""
- for method in self.methods.values():
+ for method in list(self.methods.values()):
env.RemoveMethod(method)
def apply_tools(self, env):
"""
- Searches the list of associated Tool modules for one that
- exists, and applies that to the construction environment.
+ Searches the list of associated Tool modules for one that
+ exists, and applies that to the construction environment.
"""
for t in self.tools:
tool = SCons.Tool.Tool(t)
@@ -1005,7 +1109,7 @@ def tool_list(platform, env):
"prefer Microsoft tools on Windows"
linkers = ['mslink', 'gnulink', 'ilink', 'linkloc', 'ilink32' ]
c_compilers = ['msvc', 'mingw', 'gcc', 'intelc', 'icl', 'icc', 'cc', 'bcc32' ]
- cxx_compilers = ['msvc', 'intelc', 'icc', 'g++', 'c++', 'bcc32' ]
+ cxx_compilers = ['msvc', 'intelc', 'icc', 'g++', 'cxx', 'bcc32' ]
assemblers = ['masm', 'nasm', 'gas', '386asm' ]
fortran_compilers = ['gfortran', 'g77', 'ifl', 'cvf', 'f95', 'f90', 'fortran']
ars = ['mslib', 'ar', 'tlib']
@@ -1014,7 +1118,7 @@ def tool_list(platform, env):
"prefer IBM tools on OS/2"
linkers = ['ilink', 'gnulink', ]#'mslink']
c_compilers = ['icc', 'gcc',]# 'msvc', 'cc']
- cxx_compilers = ['icc', 'g++',]# 'msvc', 'c++']
+ cxx_compilers = ['icc', 'g++',]# 'msvc', 'cxx']
assemblers = ['nasm',]# 'masm', 'gas']
fortran_compilers = ['ifl', 'g77']
ars = ['ar',]# 'mslib']
@@ -1022,7 +1126,7 @@ def tool_list(platform, env):
"prefer MIPSPro on IRIX"
linkers = ['sgilink', 'gnulink']
c_compilers = ['sgicc', 'gcc', 'cc']
- cxx_compilers = ['sgic++', 'g++', 'c++']
+ cxx_compilers = ['sgicxx', 'g++', 'cxx']
assemblers = ['as', 'gas']
fortran_compilers = ['f95', 'f90', 'f77', 'g77', 'fortran']
ars = ['sgiar']
@@ -1030,7 +1134,7 @@ def tool_list(platform, env):
"prefer Forte tools on SunOS"
linkers = ['sunlink', 'gnulink']
c_compilers = ['suncc', 'gcc', 'cc']
- cxx_compilers = ['sunc++', 'g++', 'c++']
+ cxx_compilers = ['suncxx', 'g++', 'cxx']
assemblers = ['as', 'gas']
fortran_compilers = ['sunf95', 'sunf90', 'sunf77', 'f95', 'f90', 'f77',
'gfortran', 'g77', 'fortran']
@@ -1039,7 +1143,7 @@ def tool_list(platform, env):
"prefer aCC tools on HP-UX"
linkers = ['hplink', 'gnulink']
c_compilers = ['hpcc', 'gcc', 'cc']
- cxx_compilers = ['hpc++', 'g++', 'c++']
+ cxx_compilers = ['hpcxx', 'g++', 'cxx']
assemblers = ['as', 'gas']
fortran_compilers = ['f95', 'f90', 'f77', 'g77', 'fortran']
ars = ['ar']
@@ -1047,7 +1151,7 @@ def tool_list(platform, env):
"prefer AIX Visual Age tools on AIX"
linkers = ['aixlink', 'gnulink']
c_compilers = ['aixcc', 'gcc', 'cc']
- cxx_compilers = ['aixc++', 'g++', 'c++']
+ cxx_compilers = ['aixcxx', 'g++', 'cxx']
assemblers = ['as', 'gas']
fortran_compilers = ['f95', 'f90', 'aixf77', 'g77', 'fortran']
ars = ['ar']
@@ -1055,7 +1159,7 @@ def tool_list(platform, env):
"prefer GNU tools on Mac OS X, except for some linkers and IBM tools"
linkers = ['applelink', 'gnulink']
c_compilers = ['gcc', 'cc']
- cxx_compilers = ['g++', 'c++']
+ cxx_compilers = ['g++', 'cxx']
assemblers = ['as']
fortran_compilers = ['gfortran', 'f95', 'f90', 'g77']
ars = ['ar']
@@ -1063,18 +1167,18 @@ def tool_list(platform, env):
"prefer GNU tools on Cygwin, except for a platform-specific linker"
linkers = ['cyglink', 'mslink', 'ilink']
c_compilers = ['gcc', 'msvc', 'intelc', 'icc', 'cc']
- cxx_compilers = ['g++', 'msvc', 'intelc', 'icc', 'c++']
+ cxx_compilers = ['g++', 'msvc', 'intelc', 'icc', 'cxx']
assemblers = ['gas', 'nasm', 'masm']
fortran_compilers = ['gfortran', 'g77', 'ifort', 'ifl', 'f95', 'f90', 'f77']
ars = ['ar', 'mslib']
else:
"prefer GNU tools on all other platforms"
- linkers = ['gnulink', 'mslink', 'ilink']
- c_compilers = ['gcc', 'msvc', 'intelc', 'icc', 'cc']
- cxx_compilers = ['g++', 'msvc', 'intelc', 'icc', 'c++']
+ linkers = ['gnulink', 'ilink']
+ c_compilers = ['gcc', 'intelc', 'icc', 'cc']
+ cxx_compilers = ['g++', 'intelc', 'icc', 'cxx']
assemblers = ['gas', 'nasm', 'masm']
fortran_compilers = ['gfortran', 'g77', 'ifort', 'ifl', 'f95', 'f90', 'f77']
- ars = ['ar', 'mslib']
+ ars = ['ar',]
if not str(platform) == 'win32':
other_plat_tools += ['m4', 'rpm']
@@ -1102,7 +1206,7 @@ def tool_list(platform, env):
fortran_compiler = FindTool(fortran_compilers, env) or fortran_compilers[0]
ar = FindTool(ars, env) or ars[0]
- d_compilers = ['dmd', 'gdc', 'ldc']
+ d_compilers = ['dmd', 'ldc', 'gdc']
d_compiler = FindTool(d_compilers, env) or d_compilers[0]
other_tools = FindAllTools(other_plat_tools + [
@@ -1121,9 +1225,6 @@ def tool_list(platform, env):
'tex', 'latex', 'pdflatex', 'pdftex',
# Archivers
'tar', 'zip',
- # SourceCode factories
- 'BitKeeper', 'CVS', 'Perforce',
- 'RCS', 'SCCS', # 'Subversion',
], env)
tools = ([linker, c_compiler, cxx_compiler,
@@ -1137,4 +1238,3 @@ def tool_list(platform, env):
# indent-tabs-mode:nil
# End:
# vim: set expandtab tabstop=4 shiftwidth=4:
-