summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bin/files1
-rw-r--r--src/engine/MANIFEST.in1
-rw-r--r--src/engine/SCons/Tool/__init__.py2
-rw-r--r--src/engine/SCons/Tool/ar.py1
-rw-r--r--src/engine/SCons/Tool/sgiar.py60
-rw-r--r--src/engine/SCons/Tool/sgif77.py2
-rw-r--r--test/SharedLibrary.py1
-rw-r--r--test/import.py1
8 files changed, 66 insertions, 3 deletions
diff --git a/bin/files b/bin/files
index d824a3f..75db801 100644
--- 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
diff --git a/src/engine/MANIFEST.in b/src/engine/MANIFEST.in
index cde966f..1746de9 100644
--- a/src/engine/MANIFEST.in
+++ b/src/engine/MANIFEST.in
@@ -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
diff --git a/src/engine/SCons/Tool/__init__.py b/src/engine/SCons/Tool/__init__.py
index 7002606..d2df5bb 100644
--- a/src/engine/SCons/Tool/__init__.py
+++ b/src/engine/SCons/Tool/__init__.py
@@ -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']
diff --git a/src/engine/SCons/Tool/ar.py b/src/engine/SCons/Tool/ar.py
index 1729bfc..4671309 100644
--- a/src/engine/SCons/Tool/ar.py
+++ b/src/engine/SCons/Tool/ar.py
@@ -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
index 0000000..7869298
--- /dev/null
+++ b/src/engine/SCons/Tool/sgiar.py
@@ -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')
diff --git a/src/engine/SCons/Tool/sgif77.py b/src/engine/SCons/Tool/sgif77.py
index 435dc4d..5cb3b26 100644
--- a/src/engine/SCons/Tool/sgif77.py
+++ b/src/engine/SCons/Tool/sgif77.py
@@ -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):
diff --git a/test/SharedLibrary.py b/test/SharedLibrary.py
index 4ed33f6..9fa1141 100644
--- a/test/SharedLibrary.py
+++ b/test/SharedLibrary.py
@@ -147,6 +147,7 @@ f3b(void)
test.write('f3c.c', r"""
#include <stdio.h>
+void
f3c(void)
{
printf("f3c.c\n");
diff --git a/test/import.py b/test/import.py
index 76c003b..1390289 100644
--- a/test/import.py
+++ b/test/import.py
@@ -68,6 +68,7 @@ tools = [
'nasm',
'pdflatex',
'pdftex',
+ 'sgiar',
'sgias',
'sgicc',
'sgif77',