summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorWilliam Deegan <bill@baddogconsulting.com>2017-01-15 02:06:39 (GMT)
committerWilliam Deegan <bill@baddogconsulting.com>2017-01-15 02:06:39 (GMT)
commitb428a201ac880a80a5ba66b01f1bfe88435b509c (patch)
tree8cd3a8c7100bf1efda1d48e2522d33719d92c605 /src
parent9035ce35b05670e644b63821a926232f405688ee (diff)
parent7e55f7120bf5b54d12a8f1ab01ad36da3b930bc5 (diff)
downloadSCons-b428a201ac880a80a5ba66b01f1bfe88435b509c.zip
SCons-b428a201ac880a80a5ba66b01f1bfe88435b509c.tar.gz
SCons-b428a201ac880a80a5ba66b01f1bfe88435b509c.tar.bz2
merge heads
Diffstat (limited to 'src')
-rw-r--r--src/engine/SCons/Platform/win32.py30
-rw-r--r--src/engine/SCons/Tool/aixc++.py36
-rw-r--r--src/engine/SCons/Tool/aixcxx.py75
-rw-r--r--src/engine/SCons/Tool/ar.py4
-rw-r--r--src/engine/SCons/Tool/c++.py60
-rw-r--r--src/engine/SCons/Tool/cxx.py100
-rw-r--r--src/engine/SCons/Tool/g++.py38
-rw-r--r--src/engine/SCons/Tool/gxx.py79
-rw-r--r--src/engine/SCons/Tool/hpc++.py43
-rw-r--r--src/engine/SCons/Tool/hpcxx.py84
-rw-r--r--src/engine/SCons/Tool/mingw.py3
-rw-r--r--src/engine/SCons/Tool/sgic++.py19
-rw-r--r--src/engine/SCons/Tool/sgicxx.py58
-rw-r--r--src/engine/SCons/Tool/sunc++.py101
-rw-r--r--src/engine/SCons/Tool/suncxx.py142
15 files changed, 577 insertions, 295 deletions
diff --git a/src/engine/SCons/Platform/win32.py b/src/engine/SCons/Platform/win32.py
index cdbb824..b9defbb 100644
--- a/src/engine/SCons/Platform/win32.py
+++ b/src/engine/SCons/Platform/win32.py
@@ -60,16 +60,8 @@ except AttributeError:
else:
parallel_msg = None
- _builtin_file = file
_builtin_open = open
- class _scons_file(_builtin_file):
- def __init__(self, *args, **kw):
- _builtin_file.__init__(self, *args, **kw)
- win32api.SetHandleInformation(msvcrt.get_osfhandle(self.fileno()),
- win32con.HANDLE_FLAG_INHERIT, 0)
-
-
def _scons_open(*args, **kw):
fp = _builtin_open(*args, **kw)
win32api.SetHandleInformation(msvcrt.get_osfhandle(fp.fileno()),
@@ -77,9 +69,29 @@ else:
0)
return fp
- file = _scons_file
open = _scons_open
+ if sys.version_info.major == 2:
+ _builtin_file = file
+ class _scons_file(_builtin_file):
+ def __init__(self, *args, **kw):
+ _builtin_file.__init__(self, *args, **kw)
+ win32api.SetHandleInformation(msvcrt.get_osfhandle(self.fileno()),
+ win32con.HANDLE_FLAG_INHERIT, 0)
+ file = _scons_file
+ else:
+ import io
+ for io_class in ['BufferedReader', 'BufferedWriter', 'BufferedRWPair',
+ 'BufferedRandom', 'TextIOWrapper']:
+ _builtin_file = getattr(io, io_class)
+ class _scons_file(_builtin_file):
+ def __init__(self, *args, **kw):
+ _builtin_file.__init__(self, *args, **kw)
+ win32api.SetHandleInformation(msvcrt.get_osfhandle(self.fileno()),
+ win32con.HANDLE_FLAG_INHERIT, 0)
+ setattr(io, io_class, _scons_file)
+
+
try:
import threading
spawn_lock = threading.Lock()
diff --git a/src/engine/SCons/Tool/aixc++.py b/src/engine/SCons/Tool/aixc++.py
index f03f763..c3efaea 100644
--- a/src/engine/SCons/Tool/aixc++.py
+++ b/src/engine/SCons/Tool/aixc++.py
@@ -33,40 +33,8 @@ selection method.
__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
-import os.path
-
-import SCons.Platform.aix
-
-cplusplus = __import__('c++', globals(), locals(), [])
-
-packages = ['vacpp.cmp.core', 'vacpp.cmp.batch', 'vacpp.cmp.C', 'ibmcxx.cmp']
-
-def get_xlc(env):
- xlc = env.get('CXX', 'xlC')
- return SCons.Platform.aix.get_xlc(env, xlc, packages)
-
-def generate(env):
- """Add Builders and construction variables for xlC / Visual Age
- suite to an Environment."""
- path, _cxx, version = get_xlc(env)
- if path and _cxx:
- _cxx = os.path.join(path, _cxx)
-
- if 'CXX' not in env:
- env['CXX'] = _cxx
-
- cplusplus.generate(env)
-
- if version:
- env['CXXVERSION'] = version
-
-def exists(env):
- path, _cxx, version = get_xlc(env)
- if path and _cxx:
- xlc = os.path.join(path, _cxx)
- if os.path.exists(xlc):
- return xlc
- return None
+#forward proxy to the preffered cxx version
+from SCons.Tool.aixcxx import *
# Local Variables:
# tab-width:4
diff --git a/src/engine/SCons/Tool/aixcxx.py b/src/engine/SCons/Tool/aixcxx.py
new file mode 100644
index 0000000..f03f763
--- /dev/null
+++ b/src/engine/SCons/Tool/aixcxx.py
@@ -0,0 +1,75 @@
+"""SCons.Tool.aixc++
+
+Tool-specific initialization for IBM xlC / Visual Age C++ compiler.
+
+There normally shouldn't be any need to import this module directly.
+It will usually be imported through the generic SCons.Tool.Tool()
+selection method.
+
+"""
+
+#
+# __COPYRIGHT__
+#
+# Permission is hereby granted, free of charge, to any person obtaining
+# a copy of this software and associated documentation files (the
+# "Software"), to deal in the Software without restriction, including
+# without limitation the rights to use, copy, modify, merge, publish,
+# distribute, sublicense, and/or sell copies of the Software, and to
+# permit persons to whom the Software is furnished to do so, subject to
+# the following conditions:
+#
+# The above copyright notice and this permission notice shall be included
+# in all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
+# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
+# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+# 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__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
+
+import os.path
+
+import SCons.Platform.aix
+
+cplusplus = __import__('c++', globals(), locals(), [])
+
+packages = ['vacpp.cmp.core', 'vacpp.cmp.batch', 'vacpp.cmp.C', 'ibmcxx.cmp']
+
+def get_xlc(env):
+ xlc = env.get('CXX', 'xlC')
+ return SCons.Platform.aix.get_xlc(env, xlc, packages)
+
+def generate(env):
+ """Add Builders and construction variables for xlC / Visual Age
+ suite to an Environment."""
+ path, _cxx, version = get_xlc(env)
+ if path and _cxx:
+ _cxx = os.path.join(path, _cxx)
+
+ if 'CXX' not in env:
+ env['CXX'] = _cxx
+
+ cplusplus.generate(env)
+
+ if version:
+ env['CXXVERSION'] = version
+
+def exists(env):
+ path, _cxx, version = get_xlc(env)
+ if path and _cxx:
+ xlc = os.path.join(path, _cxx)
+ if os.path.exists(xlc):
+ return xlc
+ return None
+
+# Local Variables:
+# tab-width:4
+# indent-tabs-mode:nil
+# End:
+# vim: set expandtab tabstop=4 shiftwidth=4:
diff --git a/src/engine/SCons/Tool/ar.py b/src/engine/SCons/Tool/ar.py
index e9b5922..14910b7 100644
--- a/src/engine/SCons/Tool/ar.py
+++ b/src/engine/SCons/Tool/ar.py
@@ -48,7 +48,11 @@ def generate(env):
env['LIBPREFIX'] = 'lib'
env['LIBSUFFIX'] = '.a'
+<<<<<<< working copy
if env.get('RANLIB',False) or env.Detect('ranlib'):
+=======
+ if env.get('RANLIB',env.Detect('ranlib')) :
+>>>>>>> merge rev
env['RANLIB'] = env.get('RANLIB','ranlib')
env['RANLIBFLAGS'] = SCons.Util.CLVar('')
env['RANLIBCOM'] = '$RANLIB $RANLIBFLAGS $TARGET'
diff --git a/src/engine/SCons/Tool/c++.py b/src/engine/SCons/Tool/c++.py
index 430851c..6b772fa 100644
--- a/src/engine/SCons/Tool/c++.py
+++ b/src/engine/SCons/Tool/c++.py
@@ -32,66 +32,10 @@ selection method.
__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
-import os.path
-import SCons.Tool
-import SCons.Defaults
-import SCons.Util
+#forward proxy to the preffered cxx version
+from SCons.Tool.cxx import *
-compilers = ['CC', 'c++']
-
-CXXSuffixes = ['.cpp', '.cc', '.cxx', '.c++', '.C++', '.mm']
-if SCons.Util.case_sensitive_suffixes('.c', '.C'):
- CXXSuffixes.append('.C')
-
-def iscplusplus(source):
- if not source:
- # Source might be None for unusual cases like SConf.
- return 0
- for s in source:
- if s.sources:
- ext = os.path.splitext(str(s.sources[0]))[1]
- if ext in CXXSuffixes:
- return 1
- return 0
-
-def generate(env):
- """
- Add Builders and construction variables for Visual Age C++ compilers
- to an Environment.
- """
- import SCons.Tool
- import SCons.Tool.cc
- static_obj, shared_obj = SCons.Tool.createObjBuilders(env)
-
- for suffix in CXXSuffixes:
- static_obj.add_action(suffix, SCons.Defaults.CXXAction)
- shared_obj.add_action(suffix, SCons.Defaults.ShCXXAction)
- static_obj.add_emitter(suffix, SCons.Defaults.StaticObjectEmitter)
- shared_obj.add_emitter(suffix, SCons.Defaults.SharedObjectEmitter)
-
- SCons.Tool.cc.add_common_cc_variables(env)
-
- if 'CXX' not in env:
- env['CXX'] = env.Detect(compilers) or compilers[0]
- env['CXXFLAGS'] = SCons.Util.CLVar('')
- env['CXXCOM'] = '$CXX -o $TARGET -c $CXXFLAGS $CCFLAGS $_CCCOMCOM $SOURCES'
- env['SHCXX'] = '$CXX'
- env['SHCXXFLAGS'] = SCons.Util.CLVar('$CXXFLAGS')
- env['SHCXXCOM'] = '$SHCXX -o $TARGET -c $SHCXXFLAGS $SHCCFLAGS $_CCCOMCOM $SOURCES'
-
- env['CPPDEFPREFIX'] = '-D'
- env['CPPDEFSUFFIX'] = ''
- env['INCPREFIX'] = '-I'
- env['INCSUFFIX'] = ''
- env['SHOBJSUFFIX'] = '.os'
- env['OBJSUFFIX'] = '.o'
- env['STATIC_AND_SHARED_OBJECTS_ARE_THE_SAME'] = 0
-
- env['CXXFILESUFFIX'] = '.cc'
-
-def exists(env):
- return env.Detect(env.get('CXX', compilers))
# Local Variables:
# tab-width:4
diff --git a/src/engine/SCons/Tool/cxx.py b/src/engine/SCons/Tool/cxx.py
new file mode 100644
index 0000000..430851c
--- /dev/null
+++ b/src/engine/SCons/Tool/cxx.py
@@ -0,0 +1,100 @@
+"""SCons.Tool.c++
+
+Tool-specific initialization for generic Posix C++ compilers.
+
+There normally shouldn't be any need to import this module directly.
+It will usually be imported through the generic SCons.Tool.Tool()
+selection method.
+"""
+
+#
+# __COPYRIGHT__
+#
+# Permission is hereby granted, free of charge, to any person obtaining
+# a copy of this software and associated documentation files (the
+# "Software"), to deal in the Software without restriction, including
+# without limitation the rights to use, copy, modify, merge, publish,
+# distribute, sublicense, and/or sell copies of the Software, and to
+# permit persons to whom the Software is furnished to do so, subject to
+# the following conditions:
+#
+# The above copyright notice and this permission notice shall be included
+# in all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
+# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
+# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+# 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__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
+
+import os.path
+
+import SCons.Tool
+import SCons.Defaults
+import SCons.Util
+
+compilers = ['CC', 'c++']
+
+CXXSuffixes = ['.cpp', '.cc', '.cxx', '.c++', '.C++', '.mm']
+if SCons.Util.case_sensitive_suffixes('.c', '.C'):
+ CXXSuffixes.append('.C')
+
+def iscplusplus(source):
+ if not source:
+ # Source might be None for unusual cases like SConf.
+ return 0
+ for s in source:
+ if s.sources:
+ ext = os.path.splitext(str(s.sources[0]))[1]
+ if ext in CXXSuffixes:
+ return 1
+ return 0
+
+def generate(env):
+ """
+ Add Builders and construction variables for Visual Age C++ compilers
+ to an Environment.
+ """
+ import SCons.Tool
+ import SCons.Tool.cc
+ static_obj, shared_obj = SCons.Tool.createObjBuilders(env)
+
+ for suffix in CXXSuffixes:
+ static_obj.add_action(suffix, SCons.Defaults.CXXAction)
+ shared_obj.add_action(suffix, SCons.Defaults.ShCXXAction)
+ static_obj.add_emitter(suffix, SCons.Defaults.StaticObjectEmitter)
+ shared_obj.add_emitter(suffix, SCons.Defaults.SharedObjectEmitter)
+
+ SCons.Tool.cc.add_common_cc_variables(env)
+
+ if 'CXX' not in env:
+ env['CXX'] = env.Detect(compilers) or compilers[0]
+ env['CXXFLAGS'] = SCons.Util.CLVar('')
+ env['CXXCOM'] = '$CXX -o $TARGET -c $CXXFLAGS $CCFLAGS $_CCCOMCOM $SOURCES'
+ env['SHCXX'] = '$CXX'
+ env['SHCXXFLAGS'] = SCons.Util.CLVar('$CXXFLAGS')
+ env['SHCXXCOM'] = '$SHCXX -o $TARGET -c $SHCXXFLAGS $SHCCFLAGS $_CCCOMCOM $SOURCES'
+
+ env['CPPDEFPREFIX'] = '-D'
+ env['CPPDEFSUFFIX'] = ''
+ env['INCPREFIX'] = '-I'
+ env['INCSUFFIX'] = ''
+ env['SHOBJSUFFIX'] = '.os'
+ env['OBJSUFFIX'] = '.o'
+ env['STATIC_AND_SHARED_OBJECTS_ARE_THE_SAME'] = 0
+
+ env['CXXFILESUFFIX'] = '.cc'
+
+def exists(env):
+ return env.Detect(env.get('CXX', compilers))
+
+# Local Variables:
+# tab-width:4
+# indent-tabs-mode:nil
+# End:
+# vim: set expandtab tabstop=4 shiftwidth=4:
diff --git a/src/engine/SCons/Tool/g++.py b/src/engine/SCons/Tool/g++.py
index c5eb579..88d88ca 100644
--- a/src/engine/SCons/Tool/g++.py
+++ b/src/engine/SCons/Tool/g++.py
@@ -33,44 +33,10 @@ selection method.
__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
-import os.path
-import re
-import subprocess
-import SCons.Tool
-import SCons.Util
+#forward proxy to the preffered cxx version
+from SCons.Tool.gxx import *
-from . import gcc
-cplusplus = __import__(__package__+'.c++', globals(), locals(), ['*'])
-
-compilers = ['g++']
-
-def generate(env):
- """Add Builders and construction variables for g++ to an Environment."""
- static_obj, shared_obj = SCons.Tool.createObjBuilders(env)
-
- if 'CXX' not in env:
- env['CXX'] = env.Detect(compilers) or compilers[0]
-
- cplusplus.generate(env)
-
- # platform specific settings
- if env['PLATFORM'] == 'aix':
- env['SHCXXFLAGS'] = SCons.Util.CLVar('$CXXFLAGS -mminimal-toc')
- env['STATIC_AND_SHARED_OBJECTS_ARE_THE_SAME'] = 1
- env['SHOBJSUFFIX'] = '$OBJSUFFIX'
- elif env['PLATFORM'] == 'hpux':
- env['SHOBJSUFFIX'] = '.pic.o'
- elif env['PLATFORM'] == 'sunos':
- env['SHOBJSUFFIX'] = '.pic.o'
- # determine compiler version
- version = gcc.detect_version(env, env['CXX'])
- if version:
- env['CXXVERSION'] = version
-
-def exists(env):
- # is executable, and is a GNU compiler (or accepts '--version' at least)
- return gcc.detect_version(env, env.Detect(env.get('CXX', compilers)))
# Local Variables:
# tab-width:4
diff --git a/src/engine/SCons/Tool/gxx.py b/src/engine/SCons/Tool/gxx.py
new file mode 100644
index 0000000..c5eb579
--- /dev/null
+++ b/src/engine/SCons/Tool/gxx.py
@@ -0,0 +1,79 @@
+"""SCons.Tool.g++
+
+Tool-specific initialization for g++.
+
+There normally shouldn't be any need to import this module directly.
+It will usually be imported through the generic SCons.Tool.Tool()
+selection method.
+
+"""
+
+#
+# __COPYRIGHT__
+#
+# Permission is hereby granted, free of charge, to any person obtaining
+# a copy of this software and associated documentation files (the
+# "Software"), to deal in the Software without restriction, including
+# without limitation the rights to use, copy, modify, merge, publish,
+# distribute, sublicense, and/or sell copies of the Software, and to
+# permit persons to whom the Software is furnished to do so, subject to
+# the following conditions:
+#
+# The above copyright notice and this permission notice shall be included
+# in all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
+# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
+# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+# 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__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
+
+import os.path
+import re
+import subprocess
+
+import SCons.Tool
+import SCons.Util
+
+from . import gcc
+cplusplus = __import__(__package__+'.c++', globals(), locals(), ['*'])
+
+compilers = ['g++']
+
+def generate(env):
+ """Add Builders and construction variables for g++ to an Environment."""
+ static_obj, shared_obj = SCons.Tool.createObjBuilders(env)
+
+ if 'CXX' not in env:
+ env['CXX'] = env.Detect(compilers) or compilers[0]
+
+ cplusplus.generate(env)
+
+ # platform specific settings
+ if env['PLATFORM'] == 'aix':
+ env['SHCXXFLAGS'] = SCons.Util.CLVar('$CXXFLAGS -mminimal-toc')
+ env['STATIC_AND_SHARED_OBJECTS_ARE_THE_SAME'] = 1
+ env['SHOBJSUFFIX'] = '$OBJSUFFIX'
+ elif env['PLATFORM'] == 'hpux':
+ env['SHOBJSUFFIX'] = '.pic.o'
+ elif env['PLATFORM'] == 'sunos':
+ env['SHOBJSUFFIX'] = '.pic.o'
+ # determine compiler version
+ version = gcc.detect_version(env, env['CXX'])
+ if version:
+ env['CXXVERSION'] = version
+
+def exists(env):
+ # is executable, and is a GNU compiler (or accepts '--version' at least)
+ return gcc.detect_version(env, env.Detect(env.get('CXX', compilers)))
+
+# Local Variables:
+# tab-width:4
+# indent-tabs-mode:nil
+# End:
+# vim: set expandtab tabstop=4 shiftwidth=4:
diff --git a/src/engine/SCons/Tool/hpc++.py b/src/engine/SCons/Tool/hpc++.py
index 2b8ed3f..9631277 100644
--- a/src/engine/SCons/Tool/hpc++.py
+++ b/src/engine/SCons/Tool/hpc++.py
@@ -33,49 +33,10 @@ selection method.
__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
-import os.path
-import SCons.Util
+#forward proxy to the preffered cxx version
+from SCons.Tool.hpcxx import *
-cplusplus = __import__('c++', globals(), locals(), [])
-
-acc = None
-
-# search for the acc compiler and linker front end
-
-try:
- dirs = os.listdir('/opt')
-except (IOError, OSError):
- # Not being able to read the directory because it doesn't exist
- # (IOError) or isn't readable (OSError) is okay.
- dirs = []
-
-for dir in dirs:
- cc = '/opt/' + dir + '/bin/aCC'
- if os.path.exists(cc):
- acc = cc
- break
-
-
-def generate(env):
- """Add Builders and construction variables for g++ to an Environment."""
- cplusplus.generate(env)
-
- if acc:
- env['CXX'] = acc or 'aCC'
- env['SHCXXFLAGS'] = SCons.Util.CLVar('$CXXFLAGS +Z')
- # determine version of aCC
- line = os.popen(acc + ' -V 2>&1').readline().rstrip()
- if line.find('aCC: HP ANSI C++') == 0:
- env['CXXVERSION'] = line.split()[-1]
-
- if env['PLATFORM'] == 'cygwin':
- env['SHCXXFLAGS'] = SCons.Util.CLVar('$CXXFLAGS')
- else:
- env['SHCXXFLAGS'] = SCons.Util.CLVar('$CXXFLAGS +Z')
-
-def exists(env):
- return acc
# Local Variables:
# tab-width:4
diff --git a/src/engine/SCons/Tool/hpcxx.py b/src/engine/SCons/Tool/hpcxx.py
new file mode 100644
index 0000000..2b8ed3f
--- /dev/null
+++ b/src/engine/SCons/Tool/hpcxx.py
@@ -0,0 +1,84 @@
+"""SCons.Tool.hpc++
+
+Tool-specific initialization for c++ on HP/UX.
+
+There normally shouldn't be any need to import this module directly.
+It will usually be imported through the generic SCons.Tool.Tool()
+selection method.
+
+"""
+
+#
+# __COPYRIGHT__
+#
+# Permission is hereby granted, free of charge, to any person obtaining
+# a copy of this software and associated documentation files (the
+# "Software"), to deal in the Software without restriction, including
+# without limitation the rights to use, copy, modify, merge, publish,
+# distribute, sublicense, and/or sell copies of the Software, and to
+# permit persons to whom the Software is furnished to do so, subject to
+# the following conditions:
+#
+# The above copyright notice and this permission notice shall be included
+# in all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
+# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
+# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+# 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__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
+
+import os.path
+
+import SCons.Util
+
+cplusplus = __import__('c++', globals(), locals(), [])
+
+acc = None
+
+# search for the acc compiler and linker front end
+
+try:
+ dirs = os.listdir('/opt')
+except (IOError, OSError):
+ # Not being able to read the directory because it doesn't exist
+ # (IOError) or isn't readable (OSError) is okay.
+ dirs = []
+
+for dir in dirs:
+ cc = '/opt/' + dir + '/bin/aCC'
+ if os.path.exists(cc):
+ acc = cc
+ break
+
+
+def generate(env):
+ """Add Builders and construction variables for g++ to an Environment."""
+ cplusplus.generate(env)
+
+ if acc:
+ env['CXX'] = acc or 'aCC'
+ env['SHCXXFLAGS'] = SCons.Util.CLVar('$CXXFLAGS +Z')
+ # determine version of aCC
+ line = os.popen(acc + ' -V 2>&1').readline().rstrip()
+ if line.find('aCC: HP ANSI C++') == 0:
+ env['CXXVERSION'] = line.split()[-1]
+
+ if env['PLATFORM'] == 'cygwin':
+ env['SHCXXFLAGS'] = SCons.Util.CLVar('$CXXFLAGS')
+ else:
+ env['SHCXXFLAGS'] = SCons.Util.CLVar('$CXXFLAGS +Z')
+
+def exists(env):
+ return acc
+
+# Local Variables:
+# tab-width:4
+# indent-tabs-mode:nil
+# End:
+# vim: set expandtab tabstop=4 shiftwidth=4:
diff --git a/src/engine/SCons/Tool/mingw.py b/src/engine/SCons/Tool/mingw.py
index 948ebe5..778db3c 100644
--- a/src/engine/SCons/Tool/mingw.py
+++ b/src/engine/SCons/Tool/mingw.py
@@ -86,7 +86,8 @@ def shlib_emitter(target, source, env):
no_import_lib = env.get('no_import_lib', 0)
if not dll:
- raise SCons.Errors.UserError("A shared library should have exactly one target with the suffix: %s" % env.subst("$SHLIBSUFFIX"))
+ raise SCons.Errors.UserError("A shared library should have exactly one target with the suffix: %s Target(s) are:%s" % \
+ (env.subst("$SHLIBSUFFIX"), ",".join([str(t) for t in target])))
if not no_import_lib and \
not env.FindIxes(target, 'LIBPREFIX', 'LIBSUFFIX'):
diff --git a/src/engine/SCons/Tool/sgic++.py b/src/engine/SCons/Tool/sgic++.py
index 35547ac..63c66e2 100644
--- a/src/engine/SCons/Tool/sgic++.py
+++ b/src/engine/SCons/Tool/sgic++.py
@@ -33,23 +33,8 @@ selection method.
__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
-import SCons.Util
-
-cplusplus = __import__('c++', globals(), locals(), [])
-
-def generate(env):
- """Add Builders and construction variables for SGI MIPS C++ to an Environment."""
-
- cplusplus.generate(env)
-
- env['CXX'] = 'CC'
- env['CXXFLAGS'] = SCons.Util.CLVar('-LANG:std')
- env['SHCXX'] = '$CXX'
- env['SHOBJSUFFIX'] = '.o'
- env['STATIC_AND_SHARED_OBJECTS_ARE_THE_SAME'] = 1
-
-def exists(env):
- return env.Detect('CC')
+#forward proxy to the preffered cxx version
+from SCons.Tool.sgicxx import *
# Local Variables:
# tab-width:4
diff --git a/src/engine/SCons/Tool/sgicxx.py b/src/engine/SCons/Tool/sgicxx.py
new file mode 100644
index 0000000..35547ac
--- /dev/null
+++ b/src/engine/SCons/Tool/sgicxx.py
@@ -0,0 +1,58 @@
+"""SCons.Tool.sgic++
+
+Tool-specific initialization for MIPSpro C++ on SGI.
+
+There normally shouldn't be any need to import this module directly.
+It will usually be imported through the generic SCons.Tool.Tool()
+selection method.
+
+"""
+
+#
+# __COPYRIGHT__
+#
+# Permission is hereby granted, free of charge, to any person obtaining
+# a copy of this software and associated documentation files (the
+# "Software"), to deal in the Software without restriction, including
+# without limitation the rights to use, copy, modify, merge, publish,
+# distribute, sublicense, and/or sell copies of the Software, and to
+# permit persons to whom the Software is furnished to do so, subject to
+# the following conditions:
+#
+# The above copyright notice and this permission notice shall be included
+# in all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
+# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
+# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+# 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__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
+
+import SCons.Util
+
+cplusplus = __import__('c++', globals(), locals(), [])
+
+def generate(env):
+ """Add Builders and construction variables for SGI MIPS C++ to an Environment."""
+
+ cplusplus.generate(env)
+
+ env['CXX'] = 'CC'
+ env['CXXFLAGS'] = SCons.Util.CLVar('-LANG:std')
+ env['SHCXX'] = '$CXX'
+ env['SHOBJSUFFIX'] = '.o'
+ env['STATIC_AND_SHARED_OBJECTS_ARE_THE_SAME'] = 1
+
+def exists(env):
+ return env.Detect('CC')
+
+# Local Variables:
+# tab-width:4
+# indent-tabs-mode:nil
+# End:
+# vim: set expandtab tabstop=4 shiftwidth=4:
diff --git a/src/engine/SCons/Tool/sunc++.py b/src/engine/SCons/Tool/sunc++.py
index 49f90ea..3304f80 100644
--- a/src/engine/SCons/Tool/sunc++.py
+++ b/src/engine/SCons/Tool/sunc++.py
@@ -33,107 +33,10 @@ selection method.
__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
-import SCons
-import os
-import re
-import subprocess
+#forward proxy to the preffered cxx version
+from SCons.Tool.suncxx import *
-cplusplus = __import__('c++', globals(), locals(), [])
-
-package_info = {}
-
-def get_package_info(package_name, pkginfo, pkgchk):
- try:
- return package_info[package_name]
- except KeyError:
- version = None
- pathname = None
- try:
- sadm_contents = open('/var/sadm/install/contents', 'r').read()
- except EnvironmentError:
- pass
- else:
- sadm_re = re.compile('^(\S*/bin/CC)(=\S*)? %s$' % package_name, re.M)
- sadm_match = sadm_re.search(sadm_contents)
- if sadm_match:
- pathname = os.path.dirname(sadm_match.group(1))
-
- try:
- p = subprocess.Popen([pkginfo, '-l', package_name],
- stdout=subprocess.PIPE,
- stderr=open('/dev/null', 'w'))
- except EnvironmentError:
- pass
- else:
- pkginfo_contents = p.communicate()[0]
- version_re = re.compile('^ *VERSION:\s*(.*)$', re.M)
- version_match = version_re.search(pkginfo_contents)
- if version_match:
- version = version_match.group(1)
-
- if pathname is None:
- try:
- p = subprocess.Popen([pkgchk, '-l', package_name],
- stdout=subprocess.PIPE,
- stderr=open('/dev/null', 'w'))
- except EnvironmentError:
- pass
- else:
- pkgchk_contents = p.communicate()[0]
- pathname_re = re.compile(r'^Pathname:\s*(.*/bin/CC)$', re.M)
- pathname_match = pathname_re.search(pkgchk_contents)
- if pathname_match:
- pathname = os.path.dirname(pathname_match.group(1))
-
- package_info[package_name] = (pathname, version)
- return package_info[package_name]
-
-# use the package installer tool lslpp to figure out where cppc and what
-# version of it is installed
-def get_cppc(env):
- cxx = env.subst('$CXX')
- if cxx:
- cppcPath = os.path.dirname(cxx)
- else:
- cppcPath = None
-
- cppcVersion = None
-
- pkginfo = env.subst('$PKGINFO')
- pkgchk = env.subst('$PKGCHK')
-
- for package in ['SPROcpl']:
- path, version = get_package_info(package, pkginfo, pkgchk)
- if path and version:
- cppcPath, cppcVersion = path, version
- break
-
- return (cppcPath, 'CC', 'CC', cppcVersion)
-
-def generate(env):
- """Add Builders and construction variables for SunPRO C++."""
- path, cxx, shcxx, version = get_cppc(env)
- if path:
- cxx = os.path.join(path, cxx)
- shcxx = os.path.join(path, shcxx)
-
- cplusplus.generate(env)
-
- env['CXX'] = cxx
- env['SHCXX'] = shcxx
- env['CXXVERSION'] = version
- env['SHCXXFLAGS'] = SCons.Util.CLVar('$CXXFLAGS -KPIC')
- env['SHOBJPREFIX'] = 'so_'
- env['SHOBJSUFFIX'] = '.o'
-
-def exists(env):
- path, cxx, shcxx, version = get_cppc(env)
- if path and cxx:
- cppc = os.path.join(path, cxx)
- if os.path.exists(cppc):
- return cppc
- return None
# Local Variables:
# tab-width:4
diff --git a/src/engine/SCons/Tool/suncxx.py b/src/engine/SCons/Tool/suncxx.py
new file mode 100644
index 0000000..49f90ea
--- /dev/null
+++ b/src/engine/SCons/Tool/suncxx.py
@@ -0,0 +1,142 @@
+"""SCons.Tool.sunc++
+
+Tool-specific initialization for C++ on SunOS / Solaris.
+
+There normally shouldn't be any need to import this module directly.
+It will usually be imported through the generic SCons.Tool.Tool()
+selection method.
+
+"""
+
+#
+# __COPYRIGHT__
+#
+# Permission is hereby granted, free of charge, to any person obtaining
+# a copy of this software and associated documentation files (the
+# "Software"), to deal in the Software without restriction, including
+# without limitation the rights to use, copy, modify, merge, publish,
+# distribute, sublicense, and/or sell copies of the Software, and to
+# permit persons to whom the Software is furnished to do so, subject to
+# the following conditions:
+#
+# The above copyright notice and this permission notice shall be included
+# in all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
+# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
+# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+# 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__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
+
+import SCons
+
+import os
+import re
+import subprocess
+
+cplusplus = __import__('c++', globals(), locals(), [])
+
+package_info = {}
+
+def get_package_info(package_name, pkginfo, pkgchk):
+ try:
+ return package_info[package_name]
+ except KeyError:
+ version = None
+ pathname = None
+ try:
+ sadm_contents = open('/var/sadm/install/contents', 'r').read()
+ except EnvironmentError:
+ pass
+ else:
+ sadm_re = re.compile('^(\S*/bin/CC)(=\S*)? %s$' % package_name, re.M)
+ sadm_match = sadm_re.search(sadm_contents)
+ if sadm_match:
+ pathname = os.path.dirname(sadm_match.group(1))
+
+ try:
+ p = subprocess.Popen([pkginfo, '-l', package_name],
+ stdout=subprocess.PIPE,
+ stderr=open('/dev/null', 'w'))
+ except EnvironmentError:
+ pass
+ else:
+ pkginfo_contents = p.communicate()[0]
+ version_re = re.compile('^ *VERSION:\s*(.*)$', re.M)
+ version_match = version_re.search(pkginfo_contents)
+ if version_match:
+ version = version_match.group(1)
+
+ if pathname is None:
+ try:
+ p = subprocess.Popen([pkgchk, '-l', package_name],
+ stdout=subprocess.PIPE,
+ stderr=open('/dev/null', 'w'))
+ except EnvironmentError:
+ pass
+ else:
+ pkgchk_contents = p.communicate()[0]
+ pathname_re = re.compile(r'^Pathname:\s*(.*/bin/CC)$', re.M)
+ pathname_match = pathname_re.search(pkgchk_contents)
+ if pathname_match:
+ pathname = os.path.dirname(pathname_match.group(1))
+
+ package_info[package_name] = (pathname, version)
+ return package_info[package_name]
+
+# use the package installer tool lslpp to figure out where cppc and what
+# version of it is installed
+def get_cppc(env):
+ cxx = env.subst('$CXX')
+ if cxx:
+ cppcPath = os.path.dirname(cxx)
+ else:
+ cppcPath = None
+
+ cppcVersion = None
+
+ pkginfo = env.subst('$PKGINFO')
+ pkgchk = env.subst('$PKGCHK')
+
+ for package in ['SPROcpl']:
+ path, version = get_package_info(package, pkginfo, pkgchk)
+ if path and version:
+ cppcPath, cppcVersion = path, version
+ break
+
+ return (cppcPath, 'CC', 'CC', cppcVersion)
+
+def generate(env):
+ """Add Builders and construction variables for SunPRO C++."""
+ path, cxx, shcxx, version = get_cppc(env)
+ if path:
+ cxx = os.path.join(path, cxx)
+ shcxx = os.path.join(path, shcxx)
+
+ cplusplus.generate(env)
+
+ env['CXX'] = cxx
+ env['SHCXX'] = shcxx
+ env['CXXVERSION'] = version
+ env['SHCXXFLAGS'] = SCons.Util.CLVar('$CXXFLAGS -KPIC')
+ env['SHOBJPREFIX'] = 'so_'
+ env['SHOBJSUFFIX'] = '.o'
+
+def exists(env):
+ path, cxx, shcxx, version = get_cppc(env)
+ if path and cxx:
+ cppc = os.path.join(path, cxx)
+ if os.path.exists(cppc):
+ return cppc
+ return None
+
+# Local Variables:
+# tab-width:4
+# indent-tabs-mode:nil
+# End:
+# vim: set expandtab tabstop=4 shiftwidth=4: