summaryrefslogtreecommitdiffstats
path: root/src/engine/SCons/Tool
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2003-01-29 11:44:58 (GMT)
committerSteven Knight <knight@baldmt.com>2003-01-29 11:44:58 (GMT)
commit286d4a73c144735959428265a26a27ec8f46dae5 (patch)
treecbdcc69a01a7ccd56179a1ba05a1287fc071c9b9 /src/engine/SCons/Tool
parent078be7b37ba947064d07ac85969f1bd5f3c8ae27 (diff)
downloadSCons-286d4a73c144735959428265a26a27ec8f46dae5.zip
SCons-286d4a73c144735959428265a26a27ec8f46dae5.tar.gz
SCons-286d4a73c144735959428265a26a27ec8f46dae5.tar.bz2
Add IRIX and MIPSPro support. (Chad Austin)
Diffstat (limited to 'src/engine/SCons/Tool')
-rw-r--r--src/engine/SCons/Tool/__init__.py10
-rw-r--r--src/engine/SCons/Tool/gas.py2
-rw-r--r--src/engine/SCons/Tool/sgias.py63
-rw-r--r--src/engine/SCons/Tool/sgicc.py77
-rw-r--r--src/engine/SCons/Tool/sgif77.py69
-rw-r--r--src/engine/SCons/Tool/sgilink.py60
6 files changed, 279 insertions, 2 deletions
diff --git a/src/engine/SCons/Tool/__init__.py b/src/engine/SCons/Tool/__init__.py
index 50ab456..ca591f6 100644
--- a/src/engine/SCons/Tool/__init__.py
+++ b/src/engine/SCons/Tool/__init__.py
@@ -157,6 +157,13 @@ def tool_list(platform, env):
assemblers = ['nasm', 'masm', 'gas']
fortran_compilers = ['ifl', 'g77']
ars = ['ar', 'mslib']
+ elif str(platform) == 'irix':
+ "prefer MIPSPro on IRIX"
+ linkers = ['sgilink', 'gnulink']
+ c_compilers = ['sgicc', 'gcc']
+ assemblers = ['sgias', 'gas']
+ fortran_compilers = ['sgif77', 'g77']
+ ars = ['ar']
else:
"prefer GNU tools on all other platforms"
linkers = ['gnulink', 'mslink', 'ilink']
@@ -184,7 +191,8 @@ def tool_list(platform, env):
ar = FindTool(ars, env) or ars[0]
# Don't use g++ if the C compiler has built-in C++ support:
- if c_compiler and (c_compiler == 'msvc' or c_compiler == 'icc'):
+ if c_compiler and (c_compiler == 'msvc' or c_compiler == 'icc' or
+ c_compiler == 'sgicc'):
cxx_compiler = None
else:
cxx_compiler = FindTool(['g++'], env)
diff --git a/src/engine/SCons/Tool/gas.py b/src/engine/SCons/Tool/gas.py
index c402716..08f0e5b 100644
--- a/src/engine/SCons/Tool/gas.py
+++ b/src/engine/SCons/Tool/gas.py
@@ -1,4 +1,4 @@
-"""SCons.Tool.as
+"""SCons.Tool.gas
Tool-specific initialization for as, the Gnu assembler.
diff --git a/src/engine/SCons/Tool/sgias.py b/src/engine/SCons/Tool/sgias.py
new file mode 100644
index 0000000..fea4a6f
--- /dev/null
+++ b/src/engine/SCons/Tool/sgias.py
@@ -0,0 +1,63 @@
+"""SCons.Tool.sgias
+
+Tool-specific initialization for as, the SGI assembler.
+
+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.Defaults
+import SCons.Tool
+import SCons.Util
+
+assemblers = ['as']
+
+ASSuffixes = ['.s', '.asm', '.ASM']
+ASPPSuffixes = ['.spp', '.SPP']
+
+def generate(env, platform):
+ """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)
+
+ 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/sgicc.py b/src/engine/SCons/Tool/sgicc.py
new file mode 100644
index 0000000..d323303
--- /dev/null
+++ b/src/engine/SCons/Tool/sgicc.py
@@ -0,0 +1,77 @@
+"""SCons.Tool.sgicc
+
+Tool-specific initialization for MIPSPro 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 os.path
+
+import SCons.Tool
+import SCons.Defaults
+import SCons.Util
+
+CSuffixes = ['.c']
+CXXSuffixes = ['.C', '.cpp', '.cc', '.cxx']
+
+def generate(env, platform):
+ """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)
+
+ 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['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/sgif77.py b/src/engine/SCons/Tool/sgif77.py
new file mode 100644
index 0000000..435dc4d
--- /dev/null
+++ b/src/engine/SCons/Tool/sgif77.py
@@ -0,0 +1,69 @@
+"""engine.SCons.Tool.sgif77
+
+Tool-specific initialization for SGI 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 os.path
+
+import SCons.Defaults
+import SCons.Tool
+import SCons.Util
+
+compilers = ['f77']
+
+F77Suffixes = ['.f', '.for', '.FOR']
+F77PPSuffixes = ['.fpp', '.FPP']
+
+def generate(env, platform):
+ """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)
+
+ env['F77'] = env.Detect(compilers) or 'f77'
+ 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'
+
+def exists(env):
+ return env.Detect(compilers)
diff --git a/src/engine/SCons/Tool/sgilink.py b/src/engine/SCons/Tool/sgilink.py
new file mode 100644
index 0000000..6d04ec2
--- /dev/null
+++ b/src/engine/SCons/Tool/sgilink.py
@@ -0,0 +1,60 @@
+"""SCons.Tool.sgilink
+
+Tool-specific initialization for the SGI MIPSPro 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 = ['CC', 'cc']
+
+def generate(env, platform):
+ """Add Builders and construction variables for MIPSPro 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 '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, locals(), globals(), LIBPREFIX, LIBSUFFIX)}'
+ env['LIBLINKPREFIX']='-l'
+ env['LIBLINKSUFFIX']=''
+
+def exists(env):
+ return env.Detect(linkers)