From 871e8747323c362ddbe01dc03323f775430c944a Mon Sep 17 00:00:00 2001 From: William Deegan Date: Mon, 20 Mar 2017 16:57:34 -0700 Subject: py3. Fix vendor specific compilers importing c++ module, instead of cxx. c++ is no longer legal module name in py3 --- src/engine/SCons/Tool/__init__.py | 18 +++++++++--------- src/engine/SCons/Tool/aixcxx.py | 4 +++- src/engine/SCons/Tool/aixlink.py | 5 ++++- src/engine/SCons/Tool/hpcxx.py | 5 ++++- src/engine/SCons/Tool/sgicxx.py | 5 ++++- src/engine/SCons/Tool/suncxx.py | 4 +++- test/textfile.py | 2 +- 7 files changed, 28 insertions(+), 15 deletions(-) diff --git a/src/engine/SCons/Tool/__init__.py b/src/engine/SCons/Tool/__init__.py index e44ae34..c57a93b 100644 --- a/src/engine/SCons/Tool/__init__.py +++ b/src/engine/SCons/Tool/__init__.py @@ -1040,7 +1040,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'] @@ -1049,7 +1049,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'] @@ -1057,7 +1057,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'] @@ -1065,7 +1065,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'] @@ -1074,7 +1074,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'] @@ -1082,7 +1082,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'] @@ -1090,7 +1090,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'] @@ -1098,7 +1098,7 @@ 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'] @@ -1106,7 +1106,7 @@ def tool_list(platform, env): "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++'] + cxx_compilers = ['g++', 'msvc', 'intelc', 'icc', 'cxx'] assemblers = ['gas', 'nasm', 'masm'] fortran_compilers = ['gfortran', 'g77', 'ifort', 'ifl', 'f95', 'f90', 'f77'] ars = ['ar', 'mslib'] diff --git a/src/engine/SCons/Tool/aixcxx.py b/src/engine/SCons/Tool/aixcxx.py index f03f763..58d9ecc 100644 --- a/src/engine/SCons/Tool/aixcxx.py +++ b/src/engine/SCons/Tool/aixcxx.py @@ -37,7 +37,9 @@ import os.path import SCons.Platform.aix -cplusplus = __import__('c++', globals(), locals(), []) +import SCons.Tool.cxx +cplusplus = SCons.Tool.cxx +#cplusplus = __import__('cxx', globals(), locals(), []) packages = ['vacpp.cmp.core', 'vacpp.cmp.batch', 'vacpp.cmp.C', 'ibmcxx.cmp'] diff --git a/src/engine/SCons/Tool/aixlink.py b/src/engine/SCons/Tool/aixlink.py index bfddf0a..fed4342 100644 --- a/src/engine/SCons/Tool/aixlink.py +++ b/src/engine/SCons/Tool/aixlink.py @@ -40,7 +40,10 @@ import SCons.Util from . import aixcc from . import link -cplusplus = __import__('c++', globals(), locals(), []) +import SCons.Tool.cxx +cplusplus = SCons.Tool.cxx +#cplusplus = __import__('cxx', globals(), locals(), []) + def smart_linkflags(source, target, env, for_signature): if cplusplus.iscplusplus(source): diff --git a/src/engine/SCons/Tool/hpcxx.py b/src/engine/SCons/Tool/hpcxx.py index 2b8ed3f..1ba9198 100644 --- a/src/engine/SCons/Tool/hpcxx.py +++ b/src/engine/SCons/Tool/hpcxx.py @@ -37,7 +37,10 @@ import os.path import SCons.Util -cplusplus = __import__('c++', globals(), locals(), []) +import SCons.Tool.cxx +cplusplus = SCons.Tool.cxx +#cplusplus = __import__('cxx', globals(), locals(), []) + acc = None diff --git a/src/engine/SCons/Tool/sgicxx.py b/src/engine/SCons/Tool/sgicxx.py index 35547ac..48b04ea 100644 --- a/src/engine/SCons/Tool/sgicxx.py +++ b/src/engine/SCons/Tool/sgicxx.py @@ -35,7 +35,10 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" import SCons.Util -cplusplus = __import__('c++', globals(), locals(), []) +import SCons.Tool.cxx +cplusplus = SCons.Tool.cxx +#cplusplus = __import__('cxx', globals(), locals(), []) + def generate(env): """Add Builders and construction variables for SGI MIPS C++ to an Environment.""" diff --git a/src/engine/SCons/Tool/suncxx.py b/src/engine/SCons/Tool/suncxx.py index 49f90ea..29226ea 100644 --- a/src/engine/SCons/Tool/suncxx.py +++ b/src/engine/SCons/Tool/suncxx.py @@ -39,7 +39,9 @@ import os import re import subprocess -cplusplus = __import__('c++', globals(), locals(), []) +import SCons.Tool.cxx +cplusplus = SCons.Tool.cxx +#cplusplus = __import__('c++', globals(), locals(), []) package_info = {} diff --git a/test/textfile.py b/test/textfile.py index 3d336c6..f82f50a 100644 --- a/test/textfile.py +++ b/test/textfile.py @@ -152,6 +152,6 @@ matchem('sub4', [line1, line2a, line3b]) matchem('sub5', [line1, line2b, line3b]) matchem('sub6', [line1, line2b, line3b]) -test.up_to_date(arguments = '. --debug=explain') +test.up_to_date(arguments = '.') test.pass_test() -- cgit v0.12