From 1989e2672394227e183691f93c012881ab371179 Mon Sep 17 00:00:00 2001 From: Steven Knight Date: Thu, 5 Dec 2002 10:41:31 +0000 Subject: Change the name of 'lib.py' to 'mslib.py'. --- config | 23 +++++++++++----- doc/SConscript | 6 +++-- doc/man/scons.1 | 1 + rpm/scons.spec | 4 +-- src/CHANGES.txt | 2 ++ src/RELEASE.txt | 8 ++++++ src/engine/MANIFEST.in | 2 +- src/engine/SCons/Tool/__init__.py | 6 ++--- src/engine/SCons/Tool/lib.py | 57 --------------------------------------- src/engine/SCons/Tool/mslib.py | 57 +++++++++++++++++++++++++++++++++++++++ src/engine/SCons/UtilTests.py | 4 +-- test/option-n.py | 5 ++-- 12 files changed, 100 insertions(+), 75 deletions(-) delete mode 100644 src/engine/SCons/Tool/lib.py create mode 100644 src/engine/SCons/Tool/mslib.py diff --git a/config b/config index 1b35600..331e9e5 100644 --- a/config +++ b/config @@ -6,13 +6,24 @@ */ /* - * The build_command field of the project config file is used to invoke the - * relevant build command. This command tells make where to find the rules. - * The ${s src/script/scons.py} expands to a path into the baseline during - * development if the script file is not in the change. Look in aesub(5) - * for more information about command substitutions. + * The build_command field of the project config file is used to invoke + * the relevant build command. This command tells SCons where to find + * the rules. + * + * The ${bl}/build/scons-src/src/engine points $SCONS_LIB_DIR points + * SCons at the last-built scons-src package, which should have + * everything. This means that, under Aegis, we're really using the + * currently-checked-in baseline to build the current version. This + * implies that using a new feature in our own SConscripts is a + * two-stage process: check in the underlying feature, then check in a + * change to use it in our SConscripts. + * + * The ${s src/script/scons.py} expands to a path into the baseline + * during development if the script file is not in the change. + * + * Look in aesub(5) for more information about command substitutions. */ -build_command = "SCONS_LIB_DIR=src/engine python ${Source src/script/scons.py} -Y${SUBSTitute : \\ -Y $Search_Path} date='${DAte %Y/%m/%d %H:%M:%S}' developer=${DEVeloper} version=${VERsion} change=${Change}"; +build_command = "SCONS_LIB_DIR=${BaseLine}/build/scons-src/src/engine python ${Source src/script/scons.py} -Y${SUBSTitute : \\ -Y $Search_Path} date='${DAte %Y/%m/%d %H:%M:%S}' developer=${DEVeloper} version=${VERsion} change=${Change}"; /* * SCons removes its targets before constructing them, which qualifies it diff --git a/doc/SConscript b/doc/SConscript index 29801ef..aa8d119 100644 --- a/doc/SConscript +++ b/doc/SConscript @@ -151,7 +151,7 @@ THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT. } # - # We have to tell Cons to QuickScan the top-level SGML files which + # We have to tell SCons to scan the top-level SGML files which # get included by the document SGML files in the subdirectories. # included_sgml = [ @@ -204,7 +204,8 @@ THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT. jpg = os.path.join(htmldir, '%s.jpg' % g) env.Command(jpg, fig, "%s -L jpeg -q 100 $SOURCES $TARGET" % fig2dev) - env.Depends(ps, jpg) + env.Depends(html, jpg) + Local(jpg) if docs[doc].get('ps') and jadetex: env.Command(ps, main, [ @@ -225,6 +226,7 @@ THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT. eps = os.path.join('PS', '%s.eps' % g) env.Command(eps, fig, "%s -L eps $SOURCES $TARGET" % fig2dev) env.Depends(ps, eps) + Local(eps) if docs[doc].get('pdf') and pdfjadetex: env.Command(pdf, main, [ diff --git a/doc/man/scons.1 b/doc/man/scons.1 index e1f0ed1..7136721 100644 --- a/doc/man/scons.1 +++ b/doc/man/scons.1 @@ -773,6 +773,7 @@ gnulink latex lex masm +mslib mslink msvc nasm diff --git a/rpm/scons.spec b/rpm/scons.spec index 76f6d3b..423e073 100644 --- a/rpm/scons.spec +++ b/rpm/scons.spec @@ -138,10 +138,10 @@ rm -rf $RPM_BUILD_ROOT /usr/lib/scons/SCons/Tool/latex.pyc /usr/lib/scons/SCons/Tool/lex.py /usr/lib/scons/SCons/Tool/lex.pyc -/usr/lib/scons/SCons/Tool/lib.py -/usr/lib/scons/SCons/Tool/lib.pyc /usr/lib/scons/SCons/Tool/masm.py /usr/lib/scons/SCons/Tool/masm.pyc +/usr/lib/scons/SCons/Tool/mslib.py +/usr/lib/scons/SCons/Tool/mslib.pyc /usr/lib/scons/SCons/Tool/mslink.py /usr/lib/scons/SCons/Tool/mslink.pyc /usr/lib/scons/SCons/Tool/msvc.py diff --git a/src/CHANGES.txt b/src/CHANGES.txt index a97caaa..9156d58 100644 --- a/src/CHANGES.txt +++ b/src/CHANGES.txt @@ -73,6 +73,8 @@ RELEASE 0.09 - - Prevent SCons from unlinking files in certain situations when the -n option is used. + - Change the name of Tool/lib.py to Tool/mslib.py. + From Steven Knight and Anthony Roach: - Man page: document the fact that Builder calls return Node objects. diff --git a/src/RELEASE.txt b/src/RELEASE.txt index d35168c..17b75d3 100644 --- a/src/RELEASE.txt +++ b/src/RELEASE.txt @@ -36,6 +36,14 @@ RELEASE 0.09 - XXX formally succeeded despite the absence of a scanned file will now fail unless the -k (keep going on error) flag is used. + - The specification of the name for the 'lib' tool (the Microsoft + library archiver) has now been changed to 'mslib'. If you + previously used the Tool() method to fetch the 'lib' tool + explicitly, you will need to change the name in the call to + 'mslib': + + env = Environment(tools = [ Tool('mslib') ]) + Please note the following important changes since release 0.07: - Builder objects no longer automatically split target and source diff --git a/src/engine/MANIFEST.in b/src/engine/MANIFEST.in index d500733..3481a24 100644 --- a/src/engine/MANIFEST.in +++ b/src/engine/MANIFEST.in @@ -44,8 +44,8 @@ SCons/Tool/ifl.py SCons/Tool/ilink.py SCons/Tool/latex.py SCons/Tool/lex.py -SCons/Tool/lib.py SCons/Tool/masm.py +SCons/Tool/mslib.py SCons/Tool/mslink.py SCons/Tool/msvc.py SCons/Tool/nasm.py diff --git a/src/engine/SCons/Tool/__init__.py b/src/engine/SCons/Tool/__init__.py index 661ea96..10b6608 100644 --- a/src/engine/SCons/Tool/__init__.py +++ b/src/engine/SCons/Tool/__init__.py @@ -146,21 +146,21 @@ def tool_list(platform, env): c_compilers = ['msvc', 'gcc', 'icc'] assemblers = ['masm', 'nasm', 'gas'] fortran_compilers = ['g77', 'ifl'] - ars = ['lib', 'ar'] + ars = ['mslib', 'ar'] elif str(platform) == 'os2': "prefer IBM tools on OS/2" linkers = ['ilink', 'gnulink', 'mslink'] c_compilers = ['icc', 'gcc', 'msvc'] assemblers = ['nasm', 'masm', 'gas'] fortran_compilers = ['ifl', 'g77'] - ars = ['ar', 'lib'] + ars = ['ar', 'mslib'] else: "prefer GNU tools on all other platforms" linkers = ['gnulink', 'mslink', 'ilink'] c_compilers = ['gcc', 'msvc', 'icc'] assemblers = ['gas', 'nasm', 'masm'] fortran_compilers = ['g77', 'ifl'] - ars = ['ar', 'lib'] + ars = ['ar', 'mslib'] linker = FindTool(linkers, env) or linkers[0] c_compiler = FindTool(c_compilers, env) or c_compilers[0] diff --git a/src/engine/SCons/Tool/lib.py b/src/engine/SCons/Tool/lib.py deleted file mode 100644 index ed93bb9..0000000 --- a/src/engine/SCons/Tool/lib.py +++ /dev/null @@ -1,57 +0,0 @@ -"""SCons.Tool.lib - -Tool-specific initialization for lib (MicroSoft library archiver). - -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 (c) 2001, 2002 Steven Knight -# -# 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 - -from SCons.Platform.win32 import TempFileMunge - -def win32ArGenerator(env, target, source, for_signature, **kw): - args = [ '$AR', '$ARFLAGS', '/OUT:%s' % target[0]] - args.extend(map(SCons.Util.to_String, source)) - return TempFileMunge(env, args, for_signature) - -ArAction = SCons.Action.CommandGenerator(win32ArGenerator) - -def generate(env, platform): - """Add Builders and construction variables for lib to an Environment.""" - env['BUILDERS']['Library'] = SCons.Defaults.StaticLibrary - env['BUILDERS']['StaticLibrary'] = SCons.Defaults.StaticLibrary - - env['AR'] = 'lib' - env['ARFLAGS'] = '/nologo' - env['ARCOM'] = ArAction - -def exists(env): - return env.Detect('lib') diff --git a/src/engine/SCons/Tool/mslib.py b/src/engine/SCons/Tool/mslib.py new file mode 100644 index 0000000..f89e669 --- /dev/null +++ b/src/engine/SCons/Tool/mslib.py @@ -0,0 +1,57 @@ +"""SCons.Tool.mslib + +Tool-specific initialization for lib (MicroSoft library archiver). + +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 (c) 2001, 2002 Steven Knight +# +# 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 + +from SCons.Platform.win32 import TempFileMunge + +def win32ArGenerator(env, target, source, for_signature, **kw): + args = [ '$AR', '$ARFLAGS', '/OUT:%s' % target[0]] + args.extend(map(SCons.Util.to_String, source)) + return TempFileMunge(env, args, for_signature) + +ArAction = SCons.Action.CommandGenerator(win32ArGenerator) + +def generate(env, platform): + """Add Builders and construction variables for lib to an Environment.""" + env['BUILDERS']['Library'] = SCons.Defaults.StaticLibrary + env['BUILDERS']['StaticLibrary'] = SCons.Defaults.StaticLibrary + + env['AR'] = 'lib' + env['ARFLAGS'] = '/nologo' + env['ARCOM'] = ArAction + +def exists(env): + return env.Detect('lib') diff --git a/src/engine/SCons/UtilTests.py b/src/engine/SCons/UtilTests.py index 4b93d0f..1f609ab 100644 --- a/src/engine/SCons/UtilTests.py +++ b/src/engine/SCons/UtilTests.py @@ -489,8 +489,8 @@ class UtilTestCase(unittest.TestCase): res = mapPaths([ file, 'baz', 'blat/boo', '#test' ], dir) assert res[0] == file, res[0] - assert res[1] == os.path.normpath('foo/baz'), res[1] - assert res[2] == os.path.normpath('foo/blat/boo'), res[2] + assert res[1] == os.path.join('foo', 'baz'), res[1] + assert res[2] == os.path.join('foo', 'blat/boo'), res[2] assert res[3] == '#test', res[3] env=DummyEnv() diff --git a/test/option-n.py b/test/option-n.py index 5871978..c0ca611 100644 --- a/test/option-n.py +++ b/test/option-n.py @@ -121,16 +121,17 @@ test.fail_test(not os.path.exists(test.workpath('f2.out'))) # to print what's going on when -n is used. Following the # directions on the XXX lines below whenever that gets fixed. # +install_f3_in = os.path.join('install', 'f3.in') # XXX Uncomment the next line and remove the one after it when we # fix the Install print during -n. -#expect = test.wrap_stdout('Install file: "f3.in" as "install/f3.in"\n') +#expect = test.wrap_stdout('Install file: "f3.in" as "%s"\n' % install_f3_in) expect = test.wrap_stdout('') test.run(arguments = '-n install', stdout = expect) test.fail_test(os.path.exists(test.workpath('install', 'f3.in'))) # XXX Remove the next line when we fix the Install print during -n. -expect = test.wrap_stdout('Install file: "f3.in" as "install/f3.in"\n') +expect = test.wrap_stdout('Install file: "f3.in" as "%s"\n' % install_f3_in) test.run(arguments = 'install', stdout = expect) test.fail_test(not os.path.exists(test.workpath('install', 'f3.in'))) -- cgit v0.12