summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2004-07-08 04:01:21 (GMT)
committerSteven Knight <knight@baldmt.com>2004-07-08 04:01:21 (GMT)
commitb7323556133cd1b757f11411adb53342dcbb1f28 (patch)
tree5d95f43b72f85f96674b3a47668d186f95ab9988 /src
parent325ecc35c1eaa8e9bdb8b1c0c9d3679840fbc325 (diff)
downloadSCons-b7323556133cd1b757f11411adb53342dcbb1f28.zip
SCons-b7323556133cd1b757f11411adb53342dcbb1f28.tar.gz
SCons-b7323556133cd1b757f11411adb53342dcbb1f28.tar.bz2
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.
Diffstat (limited to 'src')
-rw-r--r--src/engine/SCons/SConfTests.py24
-rw-r--r--src/engine/SCons/Tool/mingw.py5
-rw-r--r--src/engine/SCons/Tool/msvc.py5
3 files changed, 26 insertions, 8 deletions
diff --git a/src/engine/SCons/SConfTests.py b/src/engine/SCons/SConfTests.py
index 39af3a1..9b3f2a6 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 22df3d4..debb873 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 3280eb5..a32c503 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: