Add support for the SGI library archiver. (Chad Austin)
authorstevenknight <stevenknight@fdb21ef1-2011-0410-befe-b5e4ea1792b1>
Mon, 10 Feb 2003 21:43:09 +0000 (21:43 +0000)
committerstevenknight <stevenknight@fdb21ef1-2011-0410-befe-b5e4ea1792b1>
Mon, 10 Feb 2003 21:43:09 +0000 (21:43 +0000)
git-svn-id: http://scons.tigris.org/svn/scons/trunk@584 fdb21ef1-2011-0410-befe-b5e4ea1792b1

bin/files
src/engine/MANIFEST.in
src/engine/SCons/Tool/__init__.py
src/engine/SCons/Tool/ar.py
src/engine/SCons/Tool/sgiar.py [new file with mode: 0644]
src/engine/SCons/Tool/sgif77.py
test/SharedLibrary.py
test/import.py

index d824a3f14b2baa454a718628175d89cc2f9dc267..75db80182b050596d5f92cab4a2e01bfd53628c1 100644 (file)
--- a/bin/files
+++ b/bin/files
@@ -47,6 +47,7 @@
 ./SCons/Tool/nasm.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
index cde966f644a39c03f7dae0cfd1bcc6753a0252b7..1746de93666723fdcc12e23fd8306fa567b1288d 100644 (file)
@@ -56,6 +56,7 @@ SCons/Tool/nasm.py
 SCons/Tool/pdflatex.py
 SCons/Tool/pdftex.py
 SCons/Tool/PharLapCommon.py
+SCons/Tool/sgiar.py
 SCons/Tool/sgias.py
 SCons/Tool/sgicc.py
 SCons/Tool/sgif77.py
index 7002606d901c01bab55c8204d4120c46efb20a3d..d2df5bba2fe02fe20d284be1de97446d1802ccd6 100644 (file)
@@ -166,7 +166,7 @@ def tool_list(platform, env):
         c_compilers = ['sgicc', 'gcc']
         assemblers = ['sgias', 'gas']
         fortran_compilers = ['sgif77', 'g77']
-        ars = ['ar']
+        ars = ['sgiar']
     else:
         "prefer GNU tools on all other platforms"
         linkers = ['gnulink', 'mslink', 'ilink']
index 1729bfc5635979b5076845e823daa450bb2667b7..4671309ddb4481eefb2943bb898e1924107e2483 100644 (file)
@@ -34,7 +34,6 @@ selection method.
 __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
 
 import SCons.Defaults
-import SCons.Util
 
 def generate(env, platform):
     """Add Builders and construction variables for ar to an Environment."""
diff --git a/src/engine/SCons/Tool/sgiar.py b/src/engine/SCons/Tool/sgiar.py
new file mode 100644 (file)
index 0000000..7869298
--- /dev/null
@@ -0,0 +1,60 @@
+"""SCons.Tool.sgiar
+
+Tool-specific initialization for SGI ar (library archive).  If CC
+exists, static libraries should be built with it, so the prelinker has
+a chance to resolve C++ template instantiations.
+
+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, platform):
+    """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']     = '-ar'
+        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 -shared'
+    env['SHLINKCOM']   = '$SHLINK $SHLINKFLAGS -o $TARGET $SOURCES $_LIBDIRFLAGS $_LIBFLAGS'
+
+def exists(env):
+    return env.Detect('CC') or env.Detect('ar')
index 435dc4dda0f28a1eb7d386e313d2ccef8d052f51..5cb3b268ffed16cfbd84049c449103e34d7f8e6c 100644 (file)
@@ -41,7 +41,7 @@ import SCons.Util
 
 compilers = ['f77']
 
-F77Suffixes = ['.f', '.for', '.FOR']
+F77Suffixes = ['.f', '.for', '.F', '.FOR']
 F77PPSuffixes = ['.fpp', '.FPP']
 
 def generate(env, platform):
index 4ed33f625eed4e97b2556589710f4565e368b74a..9fa1141cd5d00cafea446ceec3f37b2530eb4257 100644 (file)
@@ -147,6 +147,7 @@ f3b(void)
 test.write('f3c.c', r"""
 #include <stdio.h>
 
+void
 f3c(void)
 {
        printf("f3c.c\n");
index 76c003be69148c7da4c2100b1bf262694836122c..1390289600354ef5d139904611a737fe531f7be9 100644 (file)
@@ -68,6 +68,7 @@ tools = [
     'nasm',
     'pdflatex',
     'pdftex',
+    'sgiar',
     'sgias',
     'sgicc',
     'sgif77',