From: stevenknight Date: Mon, 10 Feb 2003 21:43:09 +0000 (+0000) Subject: Add support for the SGI library archiver. (Chad Austin) X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=3f265f19f358d8a056616e9b71f4a3b5f6fbaa77;p=scons.git Add support for the SGI library archiver. (Chad Austin) git-svn-id: http://scons.tigris.org/svn/scons/trunk@584 fdb21ef1-2011-0410-befe-b5e4ea1792b1 --- diff --git a/bin/files b/bin/files index d824a3f1..75db8018 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 cde966f6..1746de93 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 7002606d..d2df5bba 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 1729bfc5..4671309d 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 00000000..7869298d --- /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 435dc4dd..5cb3b268 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 4ed33f62..9fa1141c 100644 --- a/test/SharedLibrary.py +++ b/test/SharedLibrary.py @@ -147,6 +147,7 @@ f3b(void) test.write('f3c.c', r""" #include +void f3c(void) { printf("f3c.c\n"); diff --git a/test/import.py b/test/import.py index 76c003be..13902896 100644 --- a/test/import.py +++ b/test/import.py @@ -68,6 +68,7 @@ tools = [ 'nasm', 'pdflatex', 'pdftex', + 'sgiar', 'sgias', 'sgicc', 'sgif77',