diff options
author | Steven Knight <knight@baldmt.com> | 2003-04-24 03:45:32 (GMT) |
---|---|---|
committer | Steven Knight <knight@baldmt.com> | 2003-04-24 03:45:32 (GMT) |
commit | db7e2b9bef087394fd3ce603e75231dec7f2eca4 (patch) | |
tree | 59fe8e23d14566ca5776d7ad108e95208ed17344 /src/engine/SCons/Tool | |
parent | 9587e1d2dad1c532d86f664f5cbd6266ebd77808 (diff) | |
download | SCons-db7e2b9bef087394fd3ce603e75231dec7f2eca4.zip SCons-db7e2b9bef087394fd3ce603e75231dec7f2eca4.tar.gz SCons-db7e2b9bef087394fd3ce603e75231dec7f2eca4.tar.bz2 |
Implement tool chains for AIX, SunOS, and HP-UX. (Steve Leblanc)
Diffstat (limited to 'src/engine/SCons/Tool')
22 files changed, 602 insertions, 213 deletions
diff --git a/src/engine/SCons/Tool/386asm.py b/src/engine/SCons/Tool/386asm.py index 5a2340b..5681534 100644 --- a/src/engine/SCons/Tool/386asm.py +++ b/src/engine/SCons/Tool/386asm.py @@ -34,32 +34,12 @@ selection method. __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" -import os.path -import string -import re - -import SCons.Action -import SCons.Defaults -import SCons.Tool - +import as from SCons.Tool.PharLapCommon import addPharLapPaths -ASSuffixes = ['.s', '.asm', '.ASM'] -ASPPSuffixes = ['.spp', '.SPP'] -if os.path.normcase('.s') == os.path.normcase('.S'): - ASSuffixes.extend(['.S']) -else: - ASPPSuffixes.extend(['.S']) - def generate(env): """Add Builders and construction variables for ar to an Environment.""" - static_obj, shared_obj = SCons.Tool.createObjBuilders(env) - - for suffix in ASSuffixes: - static_obj.add_action(suffix, SCons.Defaults.ASAction) - - for suffix in ASPPSuffixes: - static_obj.add_action(suffix, SCons.Defaults.ASPPAction) + as.generate(env) env['AS'] = '386asm' env['ASFLAGS'] = '' diff --git a/src/engine/SCons/Tool/__init__.py b/src/engine/SCons/Tool/__init__.py index c1e4d01..8f2f63c 100644 --- a/src/engine/SCons/Tool/__init__.py +++ b/src/engine/SCons/Tool/__init__.py @@ -164,9 +164,30 @@ def tool_list(platform, env): "prefer MIPSPro on IRIX" linkers = ['sgilink', 'gnulink'] c_compilers = ['sgicc', 'gcc'] - assemblers = ['sgias', 'gas'] - fortran_compilers = ['sgif77', 'g77'] + assemblers = ['as', 'gas'] + fortran_compilers = ['f77', 'g77'] ars = ['sgiar'] + elif str(platform) == 'sunos': + "prefer Forte tools on SunOS" + linkers = ['sunlink', 'gnulink'] + c_compilers = ['suncc', 'gcc'] + assemblers = ['as', 'gas'] + fortran_compilers = ['f77', 'g77'] + ars = ['sunar'] + elif str(platform) == 'hpux': + "prefer aCC tools on HP-UX" + linkers = ['hplink', 'gnulink'] + c_compilers = ['hpcc', 'gcc'] + assemblers = ['as', 'gas'] + fortran_compilers = ['f77', 'g77'] + ars = ['ar'] + elif str(platform) == 'aix': + "prefer AIX Visual Age tools on AIX" + linkers = ['aixlink', 'gnulink'] + c_compilers = ['aixcc', 'gcc'] + assemblers = ['as', 'gas'] + fortran_compilers = ['aixf77', 'g77'] + ars = ['ar'] else: "prefer GNU tools on all other platforms" linkers = ['gnulink', 'mslink', 'ilink'] diff --git a/src/engine/SCons/Tool/aixcc.py b/src/engine/SCons/Tool/aixcc.py new file mode 100644 index 0000000..ef5b280 --- /dev/null +++ b/src/engine/SCons/Tool/aixcc.py @@ -0,0 +1,50 @@ +"""SCons.Tool.aixcc + +Tool-specific initialization for IBM Visual Age C++ and 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 cc + +def generate(env): + """ + Add Builders and construction variables for Visual Age C and C++ compilers + to an Environment. + """ + cc.generate(env) + + env['CC'] = 'xlc' + env['SHCC'] = 'xlc_r' + env['CXX'] = 'xlC' + env['SHCXX'] = 'xlC_r' + +def exists(env): + return env.Detect('xlC') diff --git a/src/engine/SCons/Tool/aixf77.py b/src/engine/SCons/Tool/aixf77.py new file mode 100644 index 0000000..7c8554e --- /dev/null +++ b/src/engine/SCons/Tool/aixf77.py @@ -0,0 +1,51 @@ +"""engine.SCons.Tool.aixf77 + +Tool-specific initialization for IBM Visual Age f77 Fortran 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 f77 + +pcompilers = ['xlf77'] +rcompilers = ['xlf77_r'] + +def generate(env): + """ + Add Builders and construction variables for the Visual Age FORTRAN + compiler to an Environment. + """ + f77.generate(env) + + env['F77'] = env.Detect(pcompilers) or 'f77' + env['SHF77'] = env.Detect(rcompilers) or 'f77' + +def exists(env): + return env.Detect(pcompilers) diff --git a/src/engine/SCons/Tool/aixlink.py b/src/engine/SCons/Tool/aixlink.py new file mode 100644 index 0000000..1209862 --- /dev/null +++ b/src/engine/SCons/Tool/aixlink.py @@ -0,0 +1,53 @@ +"""SCons.Tool.aixlink + +Tool-specific initialization for the IBM Visual Age linker. + +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 link + +plinkers = ['xlC', 'xlc'] +rlinkers = ['xlC_r', 'xlc_r'] + +def generate(env): + """ + Add Builders and construction variables for Visual Age linker to + an Environment. + """ + link.generate(env) + + env['SHLINK'] = env.Detect(rlinkers) or 'cc' + env['SHLINKFLAGS'] = '$LINKFLAGS -qmkshrobj' + env['SHLINKCOM'] = '$SHLINK $SHLINKFLAGS -o $TARGET $SOURCES $_LIBDIRFLAGS $_LIBFLAGS' + env['LINK'] = env.Detect(plinkers) or 'cc' + +def exists(env): + return env.Detect(linkers) diff --git a/src/engine/SCons/Tool/sgias.py b/src/engine/SCons/Tool/as.py index f258ab2..ba33182 100644 --- a/src/engine/SCons/Tool/sgias.py +++ b/src/engine/SCons/Tool/as.py @@ -1,6 +1,6 @@ -"""SCons.Tool.sgias +"""SCons.Tool.as -Tool-specific initialization for as, the SGI assembler. +Tool-specific initialization for as, the generic Posix assembler. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() @@ -42,7 +42,11 @@ import SCons.Util assemblers = ['as'] ASSuffixes = ['.s', '.asm', '.ASM'] -ASPPSuffixes = ['.S', '.spp', '.SPP'] +ASPPSuffixes = ['.spp', '.SPP'] +if os.path.normcase('.s') == os.path.normcase('.S'): + ASSuffixes.extend(['.S']) +else: + ASPPSuffixes.extend(['.S']) def generate(env): """Add Builders and construction variables for as to an Environment.""" diff --git a/src/engine/SCons/Tool/cc.py b/src/engine/SCons/Tool/cc.py new file mode 100644 index 0000000..a414590 --- /dev/null +++ b/src/engine/SCons/Tool/cc.py @@ -0,0 +1,84 @@ +"""SCons.Tool.cc + +Tool-specific initialization for generic Posix C++ and 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 + +CSuffixes = ['.c'] +CXXSuffixes = ['.cpp', '.cc', '.cxx', '.c++', '.C++'] +if os.path.normcase('.c') == os.path.normcase('.C'): + CSuffixes.append('.C') +else: + CXXSuffixes.append('.C') + +def generate(env): + """ + Add Builders and construction variables for Visual Age C and C++ compilers + to an Environment. + """ + static_obj, shared_obj = SCons.Tool.createObjBuilders(env) + + for suffix in CSuffixes: + static_obj.add_action(suffix, SCons.Defaults.CAction) + shared_obj.add_action(suffix, SCons.Defaults.ShCAction) + for suffix in CXXSuffixes: + static_obj.add_action(suffix, SCons.Defaults.CXXAction) + shared_obj.add_action(suffix, SCons.Defaults.ShCXXAction) + + env['CC'] = 'cc' + env['CCFLAGS'] = '' + env['CCCOM'] = '$CC $CCFLAGS $CPPFLAGS $_CPPINCFLAGS -c -o $TARGET $SOURCES' + env['SHCC'] = '$CC' + env['SHCCFLAGS'] = '$CCFLAGS' + env['SHCCCOM'] = '$SHCC $SHCCFLAGS $CPPFLAGS $_CPPINCFLAGS -c -o $TARGET $SOURCES' + + env['CXX'] = 'c++' + env['CXXFLAGS'] = '$CCFLAGS' + env['CXXCOM'] = '$CXX $CXXFLAGS $CPPFLAGS $_CPPINCFLAGS -c -o $TARGET $SOURCES' + env['SHCXX'] = '$CXX' + env['SHCXXFLAGS'] = '$CXXFLAGS' + env['SHCXXCOM'] = '$SHCXX $SHCXXFLAGS $CPPFLAGS $_CPPINCFLAGS -c -o $TARGET $SOURCES' + + env['INCPREFIX'] = '-I' + env['INCSUFFIX'] = '' + env['SHOBJSUFFIX'] = '.os' + env['STATIC_AND_SHARED_OBJECTS_ARE_THE_SAME'] = 0 + + env['CFILESUFFIX'] = '.c' + +def exists(env): + return env.Detect('CC') diff --git a/src/engine/SCons/Tool/sgif77.py b/src/engine/SCons/Tool/f77.py index 040e1d8..3d4852a 100644 --- a/src/engine/SCons/Tool/sgif77.py +++ b/src/engine/SCons/Tool/f77.py @@ -1,6 +1,6 @@ -"""engine.SCons.Tool.sgif77 +"""engine.SCons.Tool.f77 -Tool-specific initialization for SGI f77 Fortran compiler. +Tool-specific initialization for the generic Posix f77 Fortran compiler. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() @@ -42,10 +42,14 @@ import SCons.Util compilers = ['f77'] F77Suffixes = ['.f', '.for', '.FOR'] -F77PPSuffixes = ['.F', '.fpp', '.FPP'] +F77PPSuffixes = ['.fpp', '.FPP'] +if os.path.normcase('.f') == os.path.normcase('.F'): + F77Suffixes.append('.F') +else: + F77PPSuffixes.append('.F') def generate(env): - """Add Builders and construction variables for g77 to an Environment.""" + """Add Builders and construction variables for f77 to an Environment.""" static_obj, shared_obj = SCons.Tool.createObjBuilders(env) for suffix in F77Suffixes: diff --git a/src/engine/SCons/Tool/g77.py b/src/engine/SCons/Tool/g77.py index 33fe76b..549dffb 100644 --- a/src/engine/SCons/Tool/g77.py +++ b/src/engine/SCons/Tool/g77.py @@ -33,41 +33,15 @@ selection method. __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" -import os.path - -import SCons.Defaults -import SCons.Tool -import SCons.Util +import f77 compilers = ['g77', 'f77'] -F77Suffixes = ['.f', '.for', '.FOR'] -F77PPSuffixes = ['.fpp', '.FPP'] -if os.path.normcase('.f') == os.path.normcase('.F'): - F77Suffixes.append('.F') -else: - F77PPSuffixes.append('.F') - def generate(env): """Add Builders and construction variables for g77 to an Environment.""" - static_obj, shared_obj = SCons.Tool.createObjBuilders(env) - - for suffix in F77Suffixes: - static_obj.add_action(suffix, SCons.Defaults.F77Action) - shared_obj.add_action(suffix, SCons.Defaults.ShF77Action) - - for suffix in F77PPSuffixes: - static_obj.add_action(suffix, SCons.Defaults.F77PPAction) - shared_obj.add_action(suffix, SCons.Defaults.ShF77PPAction) + f77.generate(env) - env['F77'] = env.Detect(compilers) or 'g77' - env['F77FLAGS'] = '' - env['F77COM'] = '$F77 $F77FLAGS $_F77INCFLAGS -c -o $TARGET $SOURCES' - env['F77PPCOM'] = '$F77 $F77FLAGS $CPPFLAGS $_F77INCFLAGS -c -o $TARGET $SOURCES' - env['SHF77'] = '$F77' - env['SHF77FLAGS'] = '$F77FLAGS -fPIC' - env['SHF77COM'] = '$SHF77 $SHF77FLAGS $_F77INCFLAGS -c -o $TARGET $SOURCES' - env['SHF77PPCOM'] = '$SHF77 $SHF77FLAGS $CPPFLAGS $_F77INCFLAGS -c -o $TARGET $SOURCES' + env['F77'] = env.Detect(compilers) or 'g77' def exists(env): return env.Detect(compilers) diff --git a/src/engine/SCons/Tool/gas.py b/src/engine/SCons/Tool/gas.py index 097624c..3b35424 100644 --- a/src/engine/SCons/Tool/gas.py +++ b/src/engine/SCons/Tool/gas.py @@ -33,35 +33,15 @@ selection method. __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" -import os.path - -import SCons.Defaults -import SCons.Tool -import SCons.Util +import as assemblers = ['as', 'gas'] -ASSuffixes = ['.s', '.asm', '.ASM'] -ASPPSuffixes = ['.spp', '.SPP'] -if os.path.normcase('.s') == os.path.normcase('.S'): - ASSuffixes.extend(['.S']) -else: - ASPPSuffixes.extend(['.S']) - def generate(env): """Add Builders and construction variables for as to an Environment.""" - static_obj, shared_obj = SCons.Tool.createObjBuilders(env) - - for suffix in ASSuffixes: - static_obj.add_action(suffix, SCons.Defaults.ASAction) - - for suffix in ASPPSuffixes: - static_obj.add_action(suffix, SCons.Defaults.ASPPAction) + as.generate(env) env['AS'] = env.Detect(assemblers) or 'as' - env['ASFLAGS'] = '' - env['ASCOM'] = '$AS $ASFLAGS -o $TARGET $SOURCES' - env['ASPPCOM'] = '$CC $ASFLAGS $CPPFLAGS $_CPPINCFLAGS -c -o $TARGET $SOURCES' def exists(env): return env.Detect(assemblers) diff --git a/src/engine/SCons/Tool/gcc.py b/src/engine/SCons/Tool/gcc.py index 5caf1fb..bf81ba8 100644 --- a/src/engine/SCons/Tool/gcc.py +++ b/src/engine/SCons/Tool/gcc.py @@ -33,41 +33,19 @@ selection method. __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" -import os.path - -import SCons.Tool -import SCons.Defaults -import SCons.Util +import cc compilers = ['cc', 'gcc'] -CSuffixes = ['.c'] -if os.path.normcase('.c') == os.path.normcase('.C'): - CSuffixes.append('.C') - def generate(env): """Add Builders and construction variables for gcc to an Environment.""" - static_obj, shared_obj = SCons.Tool.createObjBuilders(env) + cc.generate(env) - for suffix in CSuffixes: - static_obj.add_action(suffix, SCons.Defaults.CAction) - shared_obj.add_action(suffix, SCons.Defaults.ShCAction) - - env['CC'] = env.Detect(compilers) or 'cc' - env['CCFLAGS'] = '' - env['CCCOM'] = '$CC $CCFLAGS $CPPFLAGS $_CPPINCFLAGS -c -o $TARGET $SOURCES' - env['SHCC'] = '$CC' + env['CC'] = env.Detect(compilers) or 'cc' if env['PLATFORM'] == 'cygwin': env['SHCCFLAGS'] = '$CCFLAGS' else: env['SHCCFLAGS'] = '$CCFLAGS -fPIC' - env['SHCCCOM'] = '$SHCC $SHCCFLAGS $CPPFLAGS $_CPPINCFLAGS -c -o $TARGET $SOURCES' - env['SHOBJSUFFIX'] = '.os' - env['INCPREFIX'] = '-I' - env['INCSUFFIX'] = '' - env['STATIC_AND_SHARED_OBJECTS_ARE_THE_SAME'] = 0 - - env['CFILESUFFIX'] = '.c' def exists(env): return env.Detect(compilers) diff --git a/src/engine/SCons/Tool/gnulink.py b/src/engine/SCons/Tool/gnulink.py index 7e17370..1928b58 100644 --- a/src/engine/SCons/Tool/gnulink.py +++ b/src/engine/SCons/Tool/gnulink.py @@ -33,28 +33,13 @@ selection method. __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" -import SCons.Defaults -import SCons.Util +import link linkers = ['c++', 'cc', 'g++', 'gcc'] def generate(env): """Add Builders and construction variables for gnulink to an Environment.""" - env['BUILDERS']['SharedLibrary'] = SCons.Defaults.SharedLibrary - env['BUILDERS']['Program'] = SCons.Defaults.Program - - env['SHLINK'] = '$LINK' - env['SHLINKFLAGS'] = '$LINKFLAGS -shared' - env['SHLINKCOM'] = '$SHLINK $SHLINKFLAGS -o $TARGET $SOURCES $_LIBDIRFLAGS $_LIBFLAGS' - env['SHLIBEMITTER']= None - env['LINK'] = env.Detect(linkers) or 'c++' - env['LINKFLAGS'] = '' - env['LINKCOM'] = '$LINK $LINKFLAGS -o $TARGET $SOURCES $_LIBDIRFLAGS $_LIBFLAGS' - env['LIBDIRPREFIX']='-L' - env['LIBDIRSUFFIX']='' - env['_LIBFLAGS']='${_stripixes(LIBLINKPREFIX, LIBS, LIBLINKSUFFIX, LIBPREFIX, LIBSUFFIX, __env__)}' - env['LIBLINKPREFIX']='-l' - env['LIBLINKSUFFIX']='' + link.generate(env) def exists(env): return env.Detect(linkers) diff --git a/src/engine/SCons/Tool/hpcc.py b/src/engine/SCons/Tool/hpcc.py new file mode 100644 index 0000000..f4ff80c --- /dev/null +++ b/src/engine/SCons/Tool/hpcc.py @@ -0,0 +1,44 @@ +"""SCons.Tool.hpcc + +Tool-specific initialization for HP aCC and cc. + +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 cc + +def generate(env): + """Add Builders and construction variables for aCC & cc to an Environment.""" + cc.generate(env) + + env['CXX'] = 'aCC' + +def exists(env): + return env.Detect('aCC') diff --git a/src/engine/SCons/Tool/hplink.py b/src/engine/SCons/Tool/hplink.py new file mode 100644 index 0000000..e3b3f92 --- /dev/null +++ b/src/engine/SCons/Tool/hplink.py @@ -0,0 +1,46 @@ +"""SCons.Tool.hplink + +Tool-specific initialization for the HP linker. + +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 link + +linkers = ['aCC', 'cc'] + +def generate(env): + "Add Builders and construction variables for HP linker to an Environment." + link.generate(env) + + env['SHLINKFLAGS'] = '$LINKFLAGS -b' + +def exists(env): + return env.Detect(linkers) diff --git a/src/engine/SCons/Tool/icc.py b/src/engine/SCons/Tool/icc.py index 490db6d..42a179e 100644 --- a/src/engine/SCons/Tool/icc.py +++ b/src/engine/SCons/Tool/icc.py @@ -33,34 +33,16 @@ selection method. __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" -import SCons.Action -import SCons.Tool -import SCons.Errors - -CSuffixes = ['.c', '.C'] -CXXSuffixes = ['.cc', '.cpp', '.cxx', '.c++', '.C++'] +import cc def generate(env): - """Add Builders and construction variables for MSVC++ to an Environment.""" - static_obj, shared_obj = SCons.Tool.createObjBuilders(env) - - for suffix in CSuffixes: - static_obj.add_action(suffix, SCons.Defaults.CAction) - shared_obj.add_action(suffix, SCons.Defaults.ShCAction) - - for suffix in CXXSuffixes: - static_obj.add_action(suffix, SCons.Defaults.CXXAction) - shared_obj.add_action(suffix, SCons.Defaults.ShCXXAction) + """Add Builders and construction variables for the OS/2 to an Environment.""" + cc.generate(env) env['CC'] = 'icc' - env['CCFLAGS'] = '' env['CCCOM'] = '$CC $CCFLAGS $CPPFLAGS $_CPPINCFLAGS /c $SOURCES /Fo$TARGET' - env['CXX'] = '$CC' - env['CXXFLAGS'] = '$CCFLAGS' env['CXXCOM'] = '$CXX $CXXFLAGS $CPPFLAGS $_CPPINCFLAGS /c $SOURCES /Fo$TARGET' env['INCPREFIX'] = '/I' - env['INCSUFFIX'] = '' - env['CFILESUFFIX'] = '.c' env['CXXFILESUFFIX'] = '.cc' diff --git a/src/engine/SCons/Tool/ifl.py b/src/engine/SCons/Tool/ifl.py index 6e9f248..f8a8be8 100644 --- a/src/engine/SCons/Tool/ifl.py +++ b/src/engine/SCons/Tool/ifl.py @@ -1,4 +1,4 @@ -"""engine.SCons.Tool.icc +"""engine.SCons.Tool.ifl Tool-specific initialization for the Intel Fortran compiler. @@ -33,30 +33,11 @@ selection method. __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" -import os.path - -import SCons.Action -import SCons.Tool -import SCons.Errors - -F77Suffixes = ['.f', '.for', '.FOR'] -F77PPSuffixes = ['.fpp', '.FPP'] -if os.path.normcase('.f') == os.path.normcase('.F'): - F77Suffixes.append('.F') -else: - F77PPSuffixes.append('.F') +import f77 def generate(env): """Add Builders and construction variables for ifl to an Environment.""" - static_obj, shared_obj = SCons.Tool.createObjBuilders(env) - - for suffix in F77Suffixes: - static_obj.add_action(suffix, SCons.Defaults.F77Action) - shared_obj.add_action(suffix, SCons.Defaults.ShF77Action) - - for suffix in F77PPSuffixes: - static_obj.add_action(suffix, SCons.Defaults.F77PPAction) - shared_obj.add_action(suffix, SCons.Defaults.ShF77PPAction) + f77.generate(env) env['F77'] = 'ifl' env['F77FLAGS'] = '' diff --git a/src/engine/SCons/Tool/link.py b/src/engine/SCons/Tool/link.py new file mode 100644 index 0000000..3d51fd3 --- /dev/null +++ b/src/engine/SCons/Tool/link.py @@ -0,0 +1,60 @@ +"""SCons.Tool.link + +Tool-specific initialization for the generic Posix linker. + +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.Defaults +import SCons.Util + +linkers = ['c++', 'cc'] + +def generate(env): + """Add Builders and construction variables for gnulink to an Environment.""" + env['BUILDERS']['SharedLibrary'] = SCons.Defaults.SharedLibrary + env['BUILDERS']['Program'] = SCons.Defaults.Program + + env['SHLINK'] = '$LINK' + env['SHLINKFLAGS'] = '$LINKFLAGS -shared' + env['SHLINKCOM'] = '$SHLINK $SHLINKFLAGS -o $TARGET $SOURCES $_LIBDIRFLAGS $_LIBFLAGS' + env['SHLIBEMITTER']= None + env['LINK'] = env.Detect(linkers) or 'c++' + env['LINKFLAGS'] = '' + env['LINKCOM'] = '$LINK $LINKFLAGS -o $TARGET $SOURCES $_LIBDIRFLAGS $_LIBFLAGS' + env['LIBDIRPREFIX']='-L' + env['LIBDIRSUFFIX']='' + env['_LIBFLAGS']='${_stripixes(LIBLINKPREFIX, LIBS, LIBLINKSUFFIX, LIBPREFIX, LIBSUFFIX, __env__)}' + env['LIBLINKPREFIX']='-l' + env['LIBLINKSUFFIX']='' + +def exists(env): + return env.Detect(linkers) diff --git a/src/engine/SCons/Tool/sgicc.py b/src/engine/SCons/Tool/sgicc.py index 92ce92b..cc285e7 100644 --- a/src/engine/SCons/Tool/sgicc.py +++ b/src/engine/SCons/Tool/sgicc.py @@ -33,45 +33,16 @@ selection method. __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" -import os.path - -import SCons.Tool -import SCons.Defaults -import SCons.Util - -CSuffixes = ['.c'] -CXXSuffixes = ['.C', '.cpp', '.cc', '.cxx', '.c++', '.C++'] +import cc def generate(env): """Add Builders and construction variables for gcc to an Environment.""" - static_obj, shared_obj = SCons.Tool.createObjBuilders(env) - - for suffix in CSuffixes: - static_obj.add_action(suffix, SCons.Defaults.CAction) - shared_obj.add_action(suffix, SCons.Defaults.ShCAction) - for suffix in CXXSuffixes: - static_obj.add_action(suffix, SCons.Defaults.CXXAction) - shared_obj.add_action(suffix, SCons.Defaults.ShCXXAction) + cc.generate(env) - env['CC'] = 'cc' - env['CCFLAGS'] = '' - env['CCCOM'] = '$CC $CCFLAGS $CPPFLAGS $_CPPINCFLAGS -c -o $TARGET $SOURCES' - env['SHCC'] = '$CC' - env['SHCCFLAGS'] = '$CCFLAGS' - env['SHCCCOM'] = '$SHCC $SHCCFLAGS $CPPFLAGS $_CPPINCFLAGS -c -o $TARGET $SOURCES' - env['CXX'] = 'CC' env['CXXFLAGS'] = ['$CCFLAGS', '-LANG:std'] - env['CXXCOM'] = '$CXX $CXXFLAGS $CPPFLAGS $_CPPINCFLAGS -c -o $TARGET $SOURCES' - env['SHCXX'] = '$CXX' - env['SHCXXFLAGS'] = '$CXXFLAGS' - env['SHCXXCOM'] = '$SHCXX $SHCXXFLAGS $CPPFLAGS $_CPPINCFLAGS -c -o $TARGET $SOURCES' - - env['INCPREFIX'] = '-I' - env['INCSUFFIX'] = '' + env['SHOBJSUFFIX'] = '.o' env['STATIC_AND_SHARED_OBJECTS_ARE_THE_SAME'] = 1 - env['CFILESUFFIX'] = '.c' - def exists(env): return env.Detect('CC') diff --git a/src/engine/SCons/Tool/sgilink.py b/src/engine/SCons/Tool/sgilink.py index f1b6a06..aba06cf 100644 --- a/src/engine/SCons/Tool/sgilink.py +++ b/src/engine/SCons/Tool/sgilink.py @@ -33,28 +33,16 @@ selection method. __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" -import SCons.Defaults -import SCons.Util +import link linkers = ['CC', 'cc'] def generate(env): """Add Builders and construction variables for MIPSPro to an Environment.""" - env['BUILDERS']['SharedLibrary'] = SCons.Defaults.SharedLibrary - env['BUILDERS']['Program'] = SCons.Defaults.Program + link.generate(env) - env['SHLINK'] = '$LINK' - env['SHLINKFLAGS'] = '$LINKFLAGS -shared' - env['SHLINKCOM'] = '$SHLINK $SHLINKFLAGS -o $TARGET $SOURCES $_LIBDIRFLAGS $_LIBFLAGS' - env['SHLIBEMITTER']= None env['LINK'] = env.Detect(linkers) or 'cc' env['LINKFLAGS'] = '-LANG:std' - env['LINKCOM'] = '$LINK $LINKFLAGS -o $TARGET $SOURCES $_LIBDIRFLAGS $_LIBFLAGS' - env['LIBDIRPREFIX']='-L' - env['LIBDIRSUFFIX']='' - env['_LIBFLAGS']='${_stripixes(LIBLINKPREFIX, LIBS, LIBLINKSUFFIX, LIBPREFIX, LIBSUFFIX, __env__)}' - env['LIBLINKPREFIX']='-l' - env['LIBLINKSUFFIX']='' def exists(env): return env.Detect(linkers) diff --git a/src/engine/SCons/Tool/sunar.py b/src/engine/SCons/Tool/sunar.py new file mode 100644 index 0000000..41ba90b --- /dev/null +++ b/src/engine/SCons/Tool/sunar.py @@ -0,0 +1,59 @@ +"""engine.SCons.Tool.sunar + +Tool-specific initialization for Solaris (Forte) ar (library archive). If CC +exists, static libraries should be built with it, so that template +instantians can be resolved. + +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.Defaults + +def generate(env): + """Add Builders and construction variables for ar to an Environment.""" + bld = SCons.Defaults.StaticLibrary + env['BUILDERS']['Library'] = bld + env['BUILDERS']['StaticLibrary'] = bld + + if env.Detect('CC'): + env['AR'] = 'CC' + env['ARFLAGS'] = '-xar' + env['ARCOM'] = '$AR $ARFLAGS -o $TARGET $SOURCES' + else: + env['AR'] = 'ar' + env['ARFLAGS'] = 'r' + env['ARCOM'] = '$AR $ARFLAGS $TARGET $SOURCES' + + env['SHLINK'] = '$LINK' + env['SHLINKFLAGS'] = '$LINKFLAGS -G' + env['SHLINKCOM'] = '$SHLINK $SHLINKFLAGS -o $TARGET $SOURCES $_LIBDIRFLAGS $_LIBFLAGS' + +def exists(env): + return env.Detect('CC') or env.Detect('ar') diff --git a/src/engine/SCons/Tool/suncc.py b/src/engine/SCons/Tool/suncc.py new file mode 100644 index 0000000..e851cd1 --- /dev/null +++ b/src/engine/SCons/Tool/suncc.py @@ -0,0 +1,47 @@ +"""SCons.Tool.suncc + +Tool-specific initialization for Sun Solaris (Forte) CC and cc. + +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 cc + +def generate(env): + """ + Add Builders and construction variables for Forte C and C++ compilers + to an Environment. + """ + cc.generate(env) + + env['CXX'] = 'CC' + +def exists(env): + return env.Detect('CC') diff --git a/src/engine/SCons/Tool/sunlink.py b/src/engine/SCons/Tool/sunlink.py new file mode 100644 index 0000000..bc66dce --- /dev/null +++ b/src/engine/SCons/Tool/sunlink.py @@ -0,0 +1,47 @@ +"""SCons.Tool.sunlink + +Tool-specific initialization for the Sun Solaris (Forte) linker. + +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 link + +linkers = ['CC', 'cc'] + +def generate(env): + """Add Builders and construction variables for Forte to an Environment.""" + link.generate(env) + + env['SHLINKFLAGS'] = '$LINKFLAGS -G' + env['LINK'] = env.Detect(linkers) or 'cc' + +def exists(env): + return env.Detect(linkers) |