summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2003-04-24 03:45:32 (GMT)
committerSteven Knight <knight@baldmt.com>2003-04-24 03:45:32 (GMT)
commitdb7e2b9bef087394fd3ce603e75231dec7f2eca4 (patch)
tree59fe8e23d14566ca5776d7ad108e95208ed17344
parent9587e1d2dad1c532d86f664f5cbd6266ebd77808 (diff)
downloadSCons-db7e2b9bef087394fd3ce603e75231dec7f2eca4.zip
SCons-db7e2b9bef087394fd3ce603e75231dec7f2eca4.tar.gz
SCons-db7e2b9bef087394fd3ce603e75231dec7f2eca4.tar.bz2
Implement tool chains for AIX, SunOS, and HP-UX. (Steve Leblanc)
-rw-r--r--bin/files19
-rw-r--r--doc/man/scons.17
-rw-r--r--src/engine/MANIFEST.in19
-rw-r--r--src/engine/SCons/Platform/PlatformTests.py24
-rw-r--r--src/engine/SCons/Platform/__init__.py6
-rw-r--r--src/engine/SCons/Platform/aix.py38
-rw-r--r--src/engine/SCons/Platform/hpux.py38
-rw-r--r--src/engine/SCons/Platform/sunos.py38
-rw-r--r--src/engine/SCons/Tool/386asm.py24
-rw-r--r--src/engine/SCons/Tool/__init__.py25
-rw-r--r--src/engine/SCons/Tool/aixcc.py50
-rw-r--r--src/engine/SCons/Tool/aixf77.py51
-rw-r--r--src/engine/SCons/Tool/aixlink.py53
-rw-r--r--src/engine/SCons/Tool/as.py (renamed from src/engine/SCons/Tool/sgias.py)10
-rw-r--r--src/engine/SCons/Tool/cc.py84
-rw-r--r--src/engine/SCons/Tool/f77.py (renamed from src/engine/SCons/Tool/sgif77.py)12
-rw-r--r--src/engine/SCons/Tool/g77.py32
-rw-r--r--src/engine/SCons/Tool/gas.py24
-rw-r--r--src/engine/SCons/Tool/gcc.py28
-rw-r--r--src/engine/SCons/Tool/gnulink.py19
-rw-r--r--src/engine/SCons/Tool/hpcc.py44
-rw-r--r--src/engine/SCons/Tool/hplink.py46
-rw-r--r--src/engine/SCons/Tool/icc.py24
-rw-r--r--src/engine/SCons/Tool/ifl.py25
-rw-r--r--src/engine/SCons/Tool/link.py60
-rw-r--r--src/engine/SCons/Tool/sgicc.py35
-rw-r--r--src/engine/SCons/Tool/sgilink.py16
-rw-r--r--src/engine/SCons/Tool/sunar.py59
-rw-r--r--src/engine/SCons/Tool/suncc.py47
-rw-r--r--src/engine/SCons/Tool/sunlink.py47
-rw-r--r--test/import.py5
31 files changed, 786 insertions, 223 deletions
diff --git a/bin/files b/bin/files
index 75db801..ccb6089 100644
--- 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
@@ -25,21 +29,31 @@
./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
@@ -48,10 +62,11 @@
./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
diff --git a/doc/man/scons.1 b/doc/man/scons.1
index ffed57a..5c9db8c 100644
--- a/doc/man/scons.1
+++ b/doc/man/scons.1
@@ -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
diff --git a/src/engine/MANIFEST.in b/src/engine/MANIFEST.in
index cb26d18..ca713ff 100644
--- a/src/engine/MANIFEST.in
+++ b/src/engine/MANIFEST.in
@@ -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
diff --git a/src/engine/SCons/Platform/PlatformTests.py b/src/engine/SCons/Platform/PlatformTests.py
index 63152f0..bbfdd92 100644
--- a/src/engine/SCons/Platform/PlatformTests.py
+++ b/src/engine/SCons/Platform/PlatformTests.py
@@ -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()
diff --git a/src/engine/SCons/Platform/__init__.py b/src/engine/SCons/Platform/__init__.py
index 565c2a0..84fe208 100644
--- a/src/engine/SCons/Platform/__init__.py
+++ b/src/engine/SCons/Platform/__init__.py
@@ -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
index 0000000..542f548
--- /dev/null
+++ b/src/engine/SCons/Platform/aix.py
@@ -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
index 0000000..9b3a6bb
--- /dev/null
+++ b/src/engine/SCons/Platform/hpux.py
@@ -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
index 0000000..6b37dd6
--- /dev/null
+++ b/src/engine/SCons/Platform/sunos.py
@@ -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)
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)
diff --git a/test/import.py b/test/import.py
index 1390289..d66658b 100644
--- a/test/import.py
+++ b/test/import.py
@@ -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',