Add Borland compiler support. (Vincent Risi)
authorstevenknight <stevenknight@fdb21ef1-2011-0410-befe-b5e4ea1792b1>
Sat, 22 Nov 2003 13:28:28 +0000 (13:28 +0000)
committerstevenknight <stevenknight@fdb21ef1-2011-0410-befe-b5e4ea1792b1>
Sat, 22 Nov 2003 13:28:28 +0000 (13:28 +0000)
git-svn-id: http://scons.tigris.org/svn/scons/trunk@849 fdb21ef1-2011-0410-befe-b5e4ea1792b1

bin/files
doc/man/scons.1
src/CHANGES.txt
src/engine/MANIFEST.in
src/engine/SCons/Tool/__init__.py
src/engine/SCons/Tool/bcc32.py [new file with mode: 0644]
src/engine/SCons/Tool/ilink32.py [new file with mode: 0644]
src/engine/SCons/Tool/tlib.py [new file with mode: 0644]
test/import.py

index cc8bf10a9dde5e7cabcbb051625e8cace22f7db0..3365f4c049c556041e19d6069322afffb50080c5 100644 (file)
--- a/bin/files
+++ b/bin/files
@@ -43,6 +43,7 @@
 ./SCons/Tool/aixlink.py
 ./SCons/Tool/ar.py
 ./SCons/Tool/as.py
+./SCons/Tool/bcc32.py
 ./SCons/Tool/c++.py
 ./SCons/Tool/cc.py
 ./SCons/Tool/default.py
@@ -61,6 +62,7 @@
 ./SCons/Tool/icl.py
 ./SCons/Tool/ifl.py
 ./SCons/Tool/ilink.py
+./SCons/Tool/ilink32.py
 ./SCons/Tool/jar.py
 ./SCons/Tool/javac.py
 ./SCons/Tool/JavaCommon.py
@@ -92,6 +94,7 @@
 ./SCons/Tool/swig.py
 ./SCons/Tool/tar.py
 ./SCons/Tool/tex.py
+./SCons/Tool/tlib.py
 ./SCons/Tool/yacc.py
 ./SCons/Util.py
 ./SCons/Warnings.py
index 67b1b9e166d562a6c3956809f28a8bc1484d1898..262f6708d254b136d3772cac7eb55020a076f139 100644 (file)
@@ -900,6 +900,7 @@ aixf77
 aixlink
 ar
 as
+bcc32
 c++
 cc
 dvipdf
@@ -918,6 +919,7 @@ icc
 icl
 ifl
 ilink
+ilink32
 jar
 javac
 javah
@@ -949,6 +951,7 @@ sunlink
 swig
 tar
 tex
+tlib
 yacc
 zip
 .EE
index a6965c626b4abbdcfb8ad5c8ad5803fb1169a956..0d6b43dc000b5df8ff67222d6a6abd85d665edb9 100644 (file)
@@ -51,6 +51,10 @@ RELEASE 0.95 - XXX
   - Allow the LIBS construction variable to be a single string or File
     node, not a list, when only one library is needed.
 
+  From Vincent Risi:
+
+  - Add support for the bcc32, ilink32 and tlib Borland tools.
+
   From Anthony Roach:
 
   - Supply an error message if the user tries to configure a BuildDir
index c5fe7a373fe0ec15c5b5de0839b7ab8f8f745a2d..e939790d41298873b42a088abef1c94e62569d02 100644 (file)
@@ -51,6 +51,7 @@ SCons/Tool/aixf77.py
 SCons/Tool/aixlink.py
 SCons/Tool/ar.py
 SCons/Tool/as.py
+SCons/Tool/bcc32.py
 SCons/Tool/BitKeeper.py
 SCons/Tool/c++.py
 SCons/Tool/cc.py
@@ -76,6 +77,7 @@ SCons/Tool/icc.py
 SCons/Tool/icl.py
 SCons/Tool/ifl.py
 SCons/Tool/ilink.py
+SCons/Tool/ilink32.py
 SCons/Tool/latex.py
 SCons/Tool/lex.py
 SCons/Tool/link.py
@@ -109,6 +111,7 @@ SCons/Tool/Subversion.py
 SCons/Tool/swig.py
 SCons/Tool/tar.py
 SCons/Tool/tex.py
+SCons/Tool/tlib.py
 SCons/Tool/yacc.py
 SCons/Tool/zip.py
 SCons/Util.py
index b71b08bf744d8729af87138c8a16f9b0ecf5ec08..a58ac6d0c00c7395b4797b4710d42d1b771bd5c5 100644 (file)
@@ -230,12 +230,12 @@ def tool_list(platform, env):
     # change these search orders, update the man page as well.
     if str(platform) == 'win32':
         "prefer Microsoft tools on Windows"
-        linkers = ['mslink', 'gnulink', 'ilink', 'linkloc' ]
-        c_compilers = ['msvc', 'mingw', 'gcc', 'icl', 'icc', 'cc' ]
-        cxx_compilers = ['msvc', 'icc', 'g++', 'c++']
+        linkers = ['mslink', 'gnulink', 'ilink', 'linkloc', 'ilink32' ]
+        c_compilers = ['msvc', 'mingw', 'gcc', 'icl', 'icc', 'cc', 'bcc32' ]
+        cxx_compilers = ['msvc', 'icc', 'g++', 'c++', 'bcc32' ]
         assemblers = ['masm', 'nasm', 'gas', '386asm' ]
         fortran_compilers = ['g77', 'ifl']
-        ars = ['mslib', 'ar']
+        ars = ['mslib', 'ar', 'tlib']
     elif str(platform) == 'os2':
         "prefer IBM tools on OS/2"
         linkers = ['ilink', 'gnulink', 'mslink']
diff --git a/src/engine/SCons/Tool/bcc32.py b/src/engine/SCons/Tool/bcc32.py
new file mode 100644 (file)
index 0000000..6f63525
--- /dev/null
@@ -0,0 +1,76 @@
+"""SCons.Tool.bcc32
+
+XXX
+
+"""
+
+#
+# __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
+import os.path
+import string
+
+import SCons.Defaults
+import SCons.Tool
+import SCons.Util
+
+def findIt(program, env):
+    # First search in the SCons path and then the OS path:
+    borwin = env.WhereIs(program) or SCons.Util.WhereIs(program)
+    if borwin:
+        dir = os.path.dirname(borwin)
+        path = env['ENV'].get('PATH', [])
+        if not path:
+            path = []
+        if SCons.Util.is_String(path):
+            path = string.split(path, os.pathsep)
+        env['ENV']['PATH'] = string.join([dir]+path, os.pathsep)
+    return borwin
+
+def generate(env):
+    findIt('bcc32', env)
+    """Add Builders and construction variables for bcc to an
+    Environment."""
+    static_obj, shared_obj = SCons.Tool.createObjBuilders(env)
+    for suffix in ['.c', '.cpp']:
+        static_obj.add_action(suffix, SCons.Defaults.CAction)
+        shared_obj.add_action(suffix, SCons.Defaults.ShCAction)
+    env['CC']        = 'bcc32'
+    env['CCFLAGS']   = ''
+    env['CCCOM']     = '$CC -q $CCFLAGS $CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS -c -o $TARGET $SOURCES'
+    env['SHCC']      = '$CC'
+    env['SHCCFLAGS'] = '$CCFLAGS'
+    env['SHCCCOM']   = '$SHCC -WD $SHCCFLAGS $CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS -c -o $TARGET $SOURCES'
+    env['CPPDEFPREFIX']  = '-D'
+    env['CPPDEFSUFFIX']  = ''
+    env['INCPREFIX']  = '-I'
+    env['INCSUFFIX']  = ''
+    env['SHOBJSUFFIX'] = '.dll'
+    env['STATIC_AND_SHARED_OBJECTS_ARE_THE_SAME'] = 0
+    env['CFILESUFFIX'] = '.cpp'
+
+def exists(env):
+    return findIt('bcc32', env)
diff --git a/src/engine/SCons/Tool/ilink32.py b/src/engine/SCons/Tool/ilink32.py
new file mode 100644 (file)
index 0000000..35d1a66
--- /dev/null
@@ -0,0 +1,51 @@
+"""SCons.Tool.ilink32
+
+XXX
+
+"""
+
+#
+# __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.Tool
+import SCons.Tool.bcc32
+
+def generate(env):
+    """Add Builders and construction variables for ilink to an
+    Environment."""
+    SCons.Tool.createProgBuilder(env)
+
+    env['LINK']        = '$CC'
+    env['LINKFLAGS']   = ''
+    env['LINKCOM']     = '$LINK -q $LINKFLAGS $SOURCES $LIBS'
+    env['LIBDIRPREFIX']=''
+    env['LIBDIRSUFFIX']=''
+    env['LIBLINKPREFIX']=''
+    env['LIBLINKSUFFIX']='$LIBSUFFIX'
+
+def exists(env):
+    # Uses bcc32 to do linking as it generally knows where the standard
+    # LIBS are and set up the linking correctly
+    return SCons.Tool.bcc32.findIt('bcc32', env)
diff --git a/src/engine/SCons/Tool/tlib.py b/src/engine/SCons/Tool/tlib.py
new file mode 100644 (file)
index 0000000..6ce1bf4
--- /dev/null
@@ -0,0 +1,44 @@
+"""SCons.Tool.tlib
+
+XXX
+
+"""
+
+#
+# __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.Tool
+import SCons.Tool.bcc32
+
+def generate(env):
+    SCons.Tool.bcc32.findIt('tlib', env)
+    """Add Builders and construction variables for ar to an Environment."""
+    SCons.Tool.createStaticLibBuilder(env)
+    env['AR']          = 'tlib'
+    env['ARFLAGS']     = ''
+    env['ARCOM']       = '$AR $TARGET $ARFLAGS /a $SOURCES'
+
+def exists(env):
+    return SCons.Tool.bcc32.findIt('tlib', env)
index d30328b1b73de019765caf0a7d1d01b523eb1dd5..ff7200c4f445200509dc24867888f26169119025 100644 (file)
@@ -51,6 +51,7 @@ tools = [
     'aixlink',
     'ar',
     'as',
+    'bcc32',
     'BitKeeper',
     'c++',
     'cc',
@@ -72,6 +73,7 @@ tools = [
     'icl',
     'ifl',
     'ilink',
+    'ilink32',
     'jar',
     'javac',
     'javah',
@@ -107,6 +109,7 @@ tools = [
     'swig',
     'tar',
     'tex',
+    'tlib',
     'yacc',
     'zip',
 ]