Implement tool chains for AIX, SunOS, and HP-UX. (Steve Leblanc)
authorstevenknight <stevenknight@fdb21ef1-2011-0410-befe-b5e4ea1792b1>
Thu, 24 Apr 2003 03:45:32 +0000 (03:45 +0000)
committerstevenknight <stevenknight@fdb21ef1-2011-0410-befe-b5e4ea1792b1>
Thu, 24 Apr 2003 03:45:32 +0000 (03:45 +0000)
git-svn-id: http://scons.tigris.org/svn/scons/trunk@657 fdb21ef1-2011-0410-befe-b5e4ea1792b1

31 files changed:
bin/files
doc/man/scons.1
src/engine/MANIFEST.in
src/engine/SCons/Platform/PlatformTests.py
src/engine/SCons/Platform/__init__.py
src/engine/SCons/Platform/aix.py [new file with mode: 0644]
src/engine/SCons/Platform/hpux.py [new file with mode: 0644]
src/engine/SCons/Platform/sunos.py [new file with mode: 0644]
src/engine/SCons/Tool/386asm.py
src/engine/SCons/Tool/__init__.py
src/engine/SCons/Tool/aixcc.py [new file with mode: 0644]
src/engine/SCons/Tool/aixf77.py [new file with mode: 0644]
src/engine/SCons/Tool/aixlink.py [new file with mode: 0644]
src/engine/SCons/Tool/as.py [moved from src/engine/SCons/Tool/sgias.py with 89% similarity]
src/engine/SCons/Tool/cc.py [new file with mode: 0644]
src/engine/SCons/Tool/f77.py [moved from src/engine/SCons/Tool/sgif77.py with 88% similarity]
src/engine/SCons/Tool/g77.py
src/engine/SCons/Tool/gas.py
src/engine/SCons/Tool/gcc.py
src/engine/SCons/Tool/gnulink.py
src/engine/SCons/Tool/hpcc.py [new file with mode: 0644]
src/engine/SCons/Tool/hplink.py [new file with mode: 0644]
src/engine/SCons/Tool/icc.py
src/engine/SCons/Tool/ifl.py
src/engine/SCons/Tool/link.py [new file with mode: 0644]
src/engine/SCons/Tool/sgicc.py
src/engine/SCons/Tool/sgilink.py
src/engine/SCons/Tool/sunar.py [new file with mode: 0644]
src/engine/SCons/Tool/suncc.py [new file with mode: 0644]
src/engine/SCons/Tool/sunlink.py [new file with mode: 0644]
test/import.py

index 75db80182b050596d5f92cab4a2e01bfd53628c1..ccb608952226f55ac2aedfdd1fd605d89adaf9d2 100644 (file)
--- a/bin/files
+++ b/bin/files
@@ -9,13 +9,17 @@
 ./SCons/Node/__init__.py
 ./SCons/Options.py
 ./SCons/Platform/__init__.py
+./SCons/Platform/aix.py
 ./SCons/Platform/cygwin.py
+./SCons/Platform/hpux.py
 ./SCons/Platform/irix.py
 ./SCons/Platform/os2.py
 ./SCons/Platform/posix.py
+./SCons/Platform/sunos.py
 ./SCons/Platform/win32.py
 ./SCons/Scanner/C.py
 ./SCons/Scanner/Fortran.py
+./SCons/Scanner/IDL.py
 ./SCons/Scanner/Prog.py
 ./SCons/Scanner/__init__.py
 ./SCons/Script/SConscript.py
 ./SCons/Sig/__init__.py
 ./SCons/Taskmaster.py
 ./SCons/Tool/__init__.py
+./SCons/Tool/aixcc.py
+./SCons/Tool/aixf77.py
+./SCons/Tool/aixlink.py
 ./SCons/Tool/ar.py
+./SCons/Tool/as.py
+./SCons/Tool/cc.py
 ./SCons/Tool/default.py
 ./SCons/Tool/dvipdf.py
 ./SCons/Tool/dvips.py
+./SCons/Tool/f77.py
 ./SCons/Tool/g++.py
 ./SCons/Tool/g77.py
 ./SCons/Tool/gas.py
 ./SCons/Tool/gcc.py
 ./SCons/Tool/gnulink.py
+./SCons/Tool/hpcc.py
+./SCons/Tool/hplink.py
 ./SCons/Tool/icc.py
 ./SCons/Tool/ifl.py
 ./SCons/Tool/ilink.py
 ./SCons/Tool/latex.py
 ./SCons/Tool/lex.py
+./SCons/Tool/link.py
 ./SCons/Tool/masm.py
+./SCons/Tool/midl.py
 ./SCons/Tool/mingw.py
 ./SCons/Tool/mslib.py
 ./SCons/Tool/mslink.py
 ./SCons/Tool/pdflatex.py
 ./SCons/Tool/pdftex.py
 ./SCons/Tool/sgiar.py
-./SCons/Tool/sgias.py
 ./SCons/Tool/sgicc.py
-./SCons/Tool/sgif77.py
 ./SCons/Tool/sgilink.py
+./SCons/Tool/sunar.py
+./SCons/Tool/suncc.py
+./SCons/Tool/sunlink.py
 ./SCons/Tool/tar.py
 ./SCons/Tool/tex.py
 ./SCons/Tool/yacc.py
index ffed57a6f2281670356100064485a9bb609d29de..5c9db8ccffab8386dfb889cde9a5f1e9261d4ced 100644 (file)
@@ -311,11 +311,12 @@ searches in order for the
 OS/2 compiler,
 the GCC tool chain,
 and the Microsoft Visual C++ tools,
-On SGI IRIX systems,
+On SGI IRIX, IBM AIX, Hewlett Packard HP-UX, and Sun Solaris systems,
 .B scons
-searches for the MIPSPro compiler tools
+searches for the native compiler tools
+(MIPSpro, Visual Age, aCC, and Forte tools respectively)
 and the GCC tool chain.
-And on all other platforms,
+On all other platforms,
 including POSIX (Linux and UNIX) platforms,
 .B scons
 searches in order
index cb26d182b1b72e95f47509dd50c2fedcf780f8df..ca713ff879cfc0763ef92462e220fb765eb57e3f 100644 (file)
@@ -15,15 +15,18 @@ SCons/Optik/option.py
 SCons/Optik/option_parser.py
 SCons/Options.py
 SCons/Platform/__init__.py
+SCons/Platform/aix.py
 SCons/Platform/cygwin.py
+SCons/Platform/hpux.py
 SCons/Platform/irix.py
 SCons/Platform/os2.py
 SCons/Platform/posix.py
+SCons/Platform/sunos.py
 SCons/Platform/win32.py
 SCons/Scanner/__init__.py
 SCons/Scanner/C.py
-SCons/Scanner/IDL.py
 SCons/Scanner/Fortran.py
+SCons/Scanner/IDL.py
 SCons/Scanner/Prog.py
 SCons/SConf.py
 SCons/Script/SConscript.py
@@ -34,18 +37,26 @@ SCons/Sig/TimeStamp.py
 SCons/Taskmaster.py
 SCons/Tool/__init__.py
 SCons/Tool/386asm.py
+SCons/Tool/aixcc.py
+SCons/Tool/aixf77.py
+SCons/Tool/aixlink.py
 SCons/Tool/ar.py
+SCons/Tool/as.py
 SCons/Tool/BitKeeper.py
+SCons/Tool/cc.py
 SCons/Tool/CVS.py
 SCons/Tool/default.py
 SCons/Tool/dvipdf.py
 SCons/Tool/dvips.py
+SCons/Tool/f77.py
 SCons/Tool/g++.py
 SCons/Tool/g77.py
 SCons/Tool/gas.py
 SCons/Tool/gcc.py
 SCons/Tool/gnulink.py
 SCons/Tool/gs.py
+SCons/Tool/hpcc.py
+SCons/Tool/hplink.py
 SCons/Tool/javac.py
 SCons/Tool/jar.py
 SCons/Tool/icc.py
@@ -53,6 +64,7 @@ SCons/Tool/ifl.py
 SCons/Tool/ilink.py
 SCons/Tool/latex.py
 SCons/Tool/lex.py
+SCons/Tool/link.py
 SCons/Tool/linkloc.py
 SCons/Tool/masm.py
 SCons/Tool/midl.py
@@ -68,10 +80,11 @@ SCons/Tool/PharLapCommon.py
 SCons/Tool/RCS.py
 SCons/Tool/SCCS.py
 SCons/Tool/sgiar.py
-SCons/Tool/sgias.py
 SCons/Tool/sgicc.py
-SCons/Tool/sgif77.py
 SCons/Tool/sgilink.py
+SCons/Tool/sunar.py
+SCons/Tool/suncc.py
+SCons/Tool/sunlink.py
 SCons/Tool/Subversion.py
 SCons/Tool/tar.py
 SCons/Tool/tex.py
index 63152f0f77a4be7860774a343a9c913aa143fa70..bbfdd92df8dd2666501b4202aa3e2ec202d59e12 100644 (file)
@@ -68,6 +68,30 @@ class PlatformTestCase(unittest.TestCase):
         assert env['LIBSUFFIX'] == '.a', env
         assert env['SHELL'] == 'sh', env
 
+        p = SCons.Platform.Platform('aix')
+        assert str(p) == 'aix', p
+        env = Environment()
+        p(env)
+        assert env['PROGSUFFIX'] == '', env
+        assert env['LIBSUFFIX'] == '.a', env
+        assert env['SHELL'] == 'sh', env
+
+        p = SCons.Platform.Platform('sunos')
+        assert str(p) == 'sunos', p
+        env = Environment()
+        p(env)
+        assert env['PROGSUFFIX'] == '', env
+        assert env['LIBSUFFIX'] == '.a', env
+        assert env['SHELL'] == 'sh', env
+
+        p = SCons.Platform.Platform('hpux')
+        assert str(p) == 'hpux', 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 565c2a040be7a7e8167ebca8dbd20c93e13f7937..84fe2088f17326de15e80469b3cb2d0cc07bd67f 100644 (file)
@@ -66,6 +66,12 @@ def platform_default():
             return 'cygwin'
         elif string.find(sys.platform, 'irix') != -1:
             return 'irix'
+        elif string.find(sys.platform, 'sunos') != -1:
+            return 'sunos'
+        elif string.find(sys.platform, 'hp-ux') != -1:
+            return 'hpux'
+        elif string.find(sys.platform, 'aix') != -1:
+            return 'aix'
         else:
             return 'posix'
     elif os.name == 'os2':
diff --git a/src/engine/SCons/Platform/aix.py b/src/engine/SCons/Platform/aix.py
new file mode 100644 (file)
index 0000000..542f548
--- /dev/null
@@ -0,0 +1,38 @@
+"""engine.SCons.Platform.aix
+
+Platform-specific initialization for IBM AIX 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)
diff --git a/src/engine/SCons/Platform/hpux.py b/src/engine/SCons/Platform/hpux.py
new file mode 100644 (file)
index 0000000..9b3a6bb
--- /dev/null
@@ -0,0 +1,38 @@
+"""engine.SCons.Platform.hpux
+
+Platform-specific initialization for HP-UX 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)
diff --git a/src/engine/SCons/Platform/sunos.py b/src/engine/SCons/Platform/sunos.py
new file mode 100644 (file)
index 0000000..6b37dd6
--- /dev/null
@@ -0,0 +1,38 @@
+"""engine.SCons.Platform.sunos
+
+Platform-specific initialization for Sun 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 5a2340b6f86e8d64ccb989546ccad7361a2b7657..5681534eed15478d54cb58e57215322935865cd2 100644 (file)
@@ -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']   = ''
index c1e4d01f0ca16d87cda128323e422de57d0ca82f..8f2f63ca59736c57ba9d52f5e7c4f433974fe657 100644 (file)
@@ -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 (file)
index 0000000..ef5b280
--- /dev/null
@@ -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 (file)
index 0000000..7c8554e
--- /dev/null
@@ -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 (file)
index 0000000..1209862
--- /dev/null
@@ -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)
similarity index 89%
rename from src/engine/SCons/Tool/sgias.py
rename to src/engine/SCons/Tool/as.py
index f258ab2a90fa07179b87f47936854ba317e39722..ba33182b15335bc79a34986edb74ce38033ebf31 100644 (file)
@@ -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 (file)
index 0000000..a414590
--- /dev/null
@@ -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')
similarity index 88%
rename from src/engine/SCons/Tool/sgif77.py
rename to src/engine/SCons/Tool/f77.py
index 040e1d81588f992e9dc1a726b76175acf90b35b0..3d4852adb90efb0845c1346ef8ef86a3f86f218e 100644 (file)
@@ -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:
index 33fe76b85b0750b52c7505ac168ca92d462daefb..549dffb96b5ef3841d385ff81bae8098ca81d57e 100644 (file)
@@ -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)
index 097624c82e5eaa40cdb114249a55aeedacd07505..3b354240fe0fbe047a41f7902ff816f5a9a35486 100644 (file)
@@ -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)
index 5caf1fba9ef2f618843997ab4abac6f8b1f7cdf5..bf81ba806b172f90e5717ca54bc3e984e3e04543 100644 (file)
@@ -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)
index 7e17370f680e907b83b6e506d164342b757d86c8..1928b58bc7cb1a397fd7a5767543733cecb64830 100644 (file)
@@ -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 (file)
index 0000000..f4ff80c
--- /dev/null
@@ -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 (file)
index 0000000..e3b3f92
--- /dev/null
@@ -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)
index 490db6df089c6deaf2e9e0631c633f453889dad9..42a179e94aa34c4ac5fe34f009321155ffc6d6bb 100644 (file)
@@ -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'
 
index 6e9f248f9fc47ca636380acace6371d0885cc19b..f8a8be883591825be578ae5bcdaf9a1e1d887f5a 100644 (file)
@@ -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 (file)
index 0000000..3d51fd3
--- /dev/null
@@ -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)
index 92ce92b6e237c0639de7f87a62e3a55248b4e73d..cc285e704ea455849078b54b9c8aeba4dbafc66b 100644 (file)
@@ -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')
index f1b6a0607275cba2b4cce7cdc7f9afc3963c3d04..aba06cfe481fb63dcadb8e542f57afba3bd6849a 100644 (file)
@@ -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 (file)
index 0000000..41ba90b
--- /dev/null
@@ -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 (file)
index 0000000..e851cd1
--- /dev/null
@@ -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 (file)
index 0000000..bc66dce
--- /dev/null
@@ -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)
index 1390289600354ef5d139904611a737fe531f7be9..d66658bd9951717ed9ba4ec36bc2ad42d35b00a3 100644 (file)
@@ -46,6 +46,8 @@ x = SCons.Platform.%s.generate
 tools = [
     # Can't import '386asm' directly due to initial '3' syntax error...
     'ar',
+    'as',
+    'cc',
     'default',
     'dvipdf',
     'dvips',
@@ -59,6 +61,7 @@ tools = [
     'ilink',
     'latex',
     'lex',
+    'link',
     # Can't import 'linkloc' everywhere due to Windows registry dependency...
     'masm',
     'mingw',
@@ -69,9 +72,7 @@ tools = [
     'pdflatex',
     'pdftex',
     'sgiar',
-    'sgias',
     'sgicc',
-    'sgif77',
     'sgilink',
     'tar',
     'tex',