From: stevenknight Date: Thu, 8 Jul 2004 04:01:21 +0000 (+0000) Subject: Two more win32 fixes: don't have SConfTests.py look for sin(), since it's available... X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=e0d2c316014b2d4ba28dab43f0b82df189fdb1e9;p=scons.git Two more win32 fixes: don't have SConfTests.py look for sin(), since it's available in the default library when using Visual Studio; add the new object scanner as the source_scanner for the RES Builder. git-svn-id: http://scons.tigris.org/svn/scons/trunk@998 fdb21ef1-2011-0410-befe-b5e4ea1792b1 --- diff --git a/src/engine/SCons/SConfTests.py b/src/engine/SCons/SConfTests.py index 39af3a18..9b3f2a62 100644 --- a/src/engine/SCons/SConfTests.py +++ b/src/engine/SCons/SConfTests.py @@ -342,8 +342,16 @@ int main() { assert r, "did not find %s" % existing_lib r = sconf.CheckLib( ["hopefullynolib"], "main", autoadd=0 ) assert not r, "unexpectedly found hopefullynolib" - r = sconf.CheckLib( [], "sin", autoadd=0 ) - assert not r, "unexpectedly found nonexistent library" + # This is a check that a null list doesn't find functions + # that are in libraries that must be explicitly named. + # This works on POSIX systems where you have to -lm to + # get the math functions, but it fails on Visual Studio + # where you apparently get all those functions for free. + # Comment out this check until someone who understands + # Visual Studio better can come up with a corresponding + # test (if that ever really becomes necessary). + #r = sconf.CheckLib( [], "sin", autoadd=0 ) + #assert not r, "unexpectedly found nonexistent library" r = sconf.CheckLib( [existing_lib,"hopefullynolib"], "main", autoadd=0 ) assert r, "did not find %s,%s " % (existing_lib,r) r = sconf.CheckLib( ["hopefullynolib",existing_lib], "main", autoadd=0 ) @@ -396,8 +404,16 @@ int main() { assert r, "did not find %s" % existing_lib r = sconf.CheckLibWithHeader( [existing_lib], ["stdio.h", "math.h"], "C", autoadd=0 ) assert r, "did not find %s, #include stdio.h first" % existing_lib - r = sconf.CheckLibWithHeader( [], "math.h", "C", call="sin(3);", autoadd=0 ) - assert not r, "unexpectedly found non-existent library" + # This is a check that a null list doesn't find functions + # that are in libraries that must be explicitly named. + # This works on POSIX systems where you have to -lm to + # get the math functions, but it fails on Visual Studio + # where you apparently get all those functions for free. + # Comment out this check until someone who understands + # Visual Studio better can come up with a corresponding + # test (if that ever really becomes necessary). + #r = sconf.CheckLibWithHeader( [], "math.h", "C", call="sin(3);", autoadd=0 ) + #assert not r, "unexpectedly found non-existent library" r = sconf.CheckLibWithHeader( ["hopefullynolib"], "math.h", "C", autoadd=0 ) assert not r, "unexpectedly found hopefullynolib" r = sconf.CheckLibWithHeader( ["hopefullynolib",existing_lib], ["stdio.h", "math.h"], "C", autoadd=0 ) diff --git a/src/engine/SCons/Tool/mingw.py b/src/engine/SCons/Tool/mingw.py index 22df3d4a..debb873d 100644 --- a/src/engine/SCons/Tool/mingw.py +++ b/src/engine/SCons/Tool/mingw.py @@ -94,7 +94,9 @@ def shlib_emitter(target, source, env): shlib_action = SCons.Action.CommandGenerator(shlib_generator) -res_builder = SCons.Builder.Builder(action='$RCCOM', suffix='.o') +res_builder = SCons.Builder.Builder(action='$RCCOM', suffix='.o', + source_scanner=SCons.Defaults.ObjSourceScan) +SCons.Defaults.ObjSourceScan.add_scanner('.rc', SCons.Defaults.CScan) def generate(env): mingw = find(env) @@ -137,7 +139,6 @@ def generate(env): env['RCINCPREFIX'] = '--include-dir ' env['RCINCSUFFIX'] = '' env['RCCOM'] = '$RC $RCINCFLAGS $RCFLAGS -i $SOURCE -o $TARGET' - SCons.Defaults.ObjSourceScan.add_scanner('.rc', SCons.Defaults.CScan) env['BUILDERS']['RES'] = res_builder # Some setting from the platform also have to be overridden: diff --git a/src/engine/SCons/Tool/msvc.py b/src/engine/SCons/Tool/msvc.py index 3280eb5d..a32c5037 100644 --- a/src/engine/SCons/Tool/msvc.py +++ b/src/engine/SCons/Tool/msvc.py @@ -398,7 +398,9 @@ def shared_object_emitter(target, source, env): SCons.Defaults.SharedObjectEmitter) pch_builder = SCons.Builder.Builder(action='$PCHCOM', suffix='.pch', emitter=pch_emitter) -res_builder = SCons.Builder.Builder(action='$RCCOM', suffix='.res') +res_builder = SCons.Builder.Builder(action='$RCCOM', suffix='.res', + source_scanner=SCons.Defaults.ObjSourceScan) +SCons.Defaults.ObjSourceScan.add_scanner('.rc', SCons.Defaults.CScan) def generate(env): """Add Builders and construction variables for MSVC++ to an Environment.""" @@ -438,7 +440,6 @@ def generate(env): env['RC'] = 'rc' env['RCFLAGS'] = SCons.Util.CLVar('') env['RCCOM'] = '$RC $_CPPDEFFLAGS $_CPPINCFLAGS $RCFLAGS /fo$TARGET $SOURCES' - SCons.Defaults.ObjSourceScan.add_scanner('.rc', SCons.Defaults.CScan) env['BUILDERS']['RES'] = res_builder try: