Add IRIX and MIPSPro support. (Chad Austin)
authorstevenknight <stevenknight@fdb21ef1-2011-0410-befe-b5e4ea1792b1>
Wed, 29 Jan 2003 11:44:58 +0000 (11:44 +0000)
committerstevenknight <stevenknight@fdb21ef1-2011-0410-befe-b5e4ea1792b1>
Wed, 29 Jan 2003 11:44:58 +0000 (11:44 +0000)
git-svn-id: http://scons.tigris.org/svn/scons/trunk@568 fdb21ef1-2011-0410-befe-b5e4ea1792b1

12 files changed:
bin/files
src/CHANGES.txt
src/engine/MANIFEST.in
src/engine/SCons/Platform/PlatformTests.py
src/engine/SCons/Platform/__init__.py
src/engine/SCons/Platform/irix.py [new file with mode: 0644]
src/engine/SCons/Tool/__init__.py
src/engine/SCons/Tool/gas.py
src/engine/SCons/Tool/sgias.py [new file with mode: 0644]
src/engine/SCons/Tool/sgicc.py [new file with mode: 0644]
src/engine/SCons/Tool/sgif77.py [new file with mode: 0644]
src/engine/SCons/Tool/sgilink.py [new file with mode: 0644]

index d4ec77aba867fdbe90407e9a9e64aa5ebc2a03a4..d824a3f14b2baa454a718628175d89cc2f9dc267 100644 (file)
--- a/bin/files
+++ b/bin/files
@@ -10,6 +10,7 @@
 ./SCons/Options.py
 ./SCons/Platform/__init__.py
 ./SCons/Platform/cygwin.py
+./SCons/Platform/irix.py
 ./SCons/Platform/os2.py
 ./SCons/Platform/posix.py
 ./SCons/Platform/win32.py
 ./SCons/Tool/nasm.py
 ./SCons/Tool/pdflatex.py
 ./SCons/Tool/pdftex.py
+./SCons/Tool/sgias.py
+./SCons/Tool/sgicc.py
+./SCons/Tool/sgif77.py
+./SCons/Tool/sgilink.py
 ./SCons/Tool/tar.py
 ./SCons/Tool/tex.py
 ./SCons/Tool/yacc.py
index ce88f015588b9a01f89928a34d92910113799d35..4e8fcee4d4c2f3546e593aa0c02f606f60f01778 100644 (file)
 
 RELEASE 0.11 - XXX
 
+  From Chad Austin:
+
+  - Add support for IRIX and the SGI MIPSPro tool chain.
+
   From Charles Crain:
 
   - Added new AddPreAction() and AddPostAction() functions that support
index a51277bbcbebfcd6b06bcc548b1fddda595b98c1..cde966f644a39c03f7dae0cfd1bcc6753a0252b7 100644 (file)
@@ -16,6 +16,7 @@ SCons/Optik/option_parser.py
 SCons/Options.py
 SCons/Platform/__init__.py
 SCons/Platform/cygwin.py
+SCons/Platform/irix.py
 SCons/Platform/os2.py
 SCons/Platform/posix.py
 SCons/Platform/win32.py
@@ -55,6 +56,10 @@ SCons/Tool/nasm.py
 SCons/Tool/pdflatex.py
 SCons/Tool/pdftex.py
 SCons/Tool/PharLapCommon.py
+SCons/Tool/sgias.py
+SCons/Tool/sgicc.py
+SCons/Tool/sgif77.py
+SCons/Tool/sgilink.py
 SCons/Tool/tar.py
 SCons/Tool/tex.py
 SCons/Tool/yacc.py
index e0001032ca0953f5fa968fa0f44b0962fa83611b..63152f0f77a4be7860774a343a9c913aa143fa70 100644 (file)
@@ -60,6 +60,14 @@ class PlatformTestCase(unittest.TestCase):
         assert env['LIBSUFFIX'] == '.a', env
         assert env['SHELL'] == 'sh', env
 
+        p = SCons.Platform.Platform('irix')
+        assert str(p) == 'irix', p
+        env = Environment()
+        p(env)
+        assert env['PROGSUFFIX'] == '', env
+        assert env['LIBSUFFIX'] == '.a', env
+        assert env['SHELL'] == 'sh', env
+
         p = SCons.Platform.Platform('win32')
         assert str(p) == 'win32', p
         env = Environment()
index e75a024769623dd70a462b6856c02ab2a16ce2ed..90bb27cf49401e19f11ccd1566e27c0436838e58 100644 (file)
@@ -46,6 +46,7 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
 
 import imp
 import os
+import string
 import sys
 
 import SCons.Errors
@@ -63,7 +64,10 @@ def platform_default():
     if osname == 'posix':
         if sys.platform == 'cygwin':
             return 'cygwin'
-        return 'posix'
+        elif string.find(sys.platform, 'irix') != -1:
+            return 'irix'
+        else:
+            return 'posix'
     elif os.name == 'os2':
         return 'os2'
     else:
diff --git a/src/engine/SCons/Platform/irix.py b/src/engine/SCons/Platform/irix.py
new file mode 100644 (file)
index 0000000..861ecac
--- /dev/null
@@ -0,0 +1,38 @@
+"""SCons.Platform.irix
+
+Platform-specific initialization for SGI IRIX systems.
+
+There normally shouldn't be any need to import this module directly.  It
+will usually be imported through the generic SCons.Platform.Platform()
+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 posix
+
+def generate(env):
+    posix.generate(env)
index 50ab4564786363e3ad31422bc935c994951328ac..ca591f611f7f736b836fbe53a2eeac0232027aeb 100644 (file)
@@ -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)
index c402716613b85a105f595a683ad8886e6bcad356..08f0e5bc5326e218332811b7083c65dac2198cad 100644 (file)
@@ -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 (file)
index 0000000..fea4a6f
--- /dev/null
@@ -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 (file)
index 0000000..d323303
--- /dev/null
@@ -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 (file)
index 0000000..435dc4d
--- /dev/null
@@ -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 (file)
index 0000000..6d04ec2
--- /dev/null
@@ -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)