Fix use of TargetSignatures('content') with SConf. (Christoph Wiedemann)
authorstevenknight <stevenknight@fdb21ef1-2011-0410-befe-b5e4ea1792b1>
Mon, 10 Jan 2005 20:37:46 +0000 (20:37 +0000)
committerstevenknight <stevenknight@fdb21ef1-2011-0410-befe-b5e4ea1792b1>
Mon, 10 Jan 2005 20:37:46 +0000 (20:37 +0000)
git-svn-id: http://scons.tigris.org/svn/scons/trunk@1213 fdb21ef1-2011-0410-befe-b5e4ea1792b1

src/CHANGES.txt
src/engine/SCons/SConf.py
test/Configure.py

index fb98cce021361b17773d43cc925620fa69616f55..04444f25413e5131c10414ddbba0280263544421 100644 (file)
@@ -438,6 +438,8 @@ RELEASE 0.97 - XXX
     try:-except: blocks that catch all errors, which potentially catch
     and mask keyboard interrupts.
 
+  - Fix us of TargetSignatures('content') with the SConf subsystem.
+
   From Russell Yanofsky:
 
   - Add support for the Metrowerks Codewarrior compiler and linker
index 6b96384773acf12b69d26a664b14324f0cb89268..5572a01476a9a7c58fc4da86d9cc0a3d2628b4e8 100644 (file)
@@ -250,9 +250,12 @@ class SConfBuildTask(SCons.Taskmaster.Task):
                 if cache_mode == CACHE:
                     t.state = SCons.Node.up_to_date
                 else:
-                    bsig = t.calc_signature(sconf_global.calc)
-                    is_up_to_date = (is_up_to_date and
-                                     bsig == bi.bsig)
+                    new_bsig = t.calc_signature(sconf_global.calc)
+                    if t.env.use_build_signature():
+                        old_bsig = bi.bsig
+                    else:
+                        old_bsig = bi.csig
+                    is_up_to_date = (is_up_to_date and new_bsig == old_bsig)
                 cached_error = cached_error or bi.result
             else:
                 # the node hasn't been built in a SConf context or doesn't
index 715219edb6104e52d6b9f8fff54d1432ecaddaf0..515ae70b148dfaf14acb7eaf65ea7d589014157e 100644 (file)
@@ -206,6 +206,8 @@ try:
     reset(RE)
 
     test.write([work_dir,  'SConstruct'], """
+if int(ARGUMENTS.get('target_signatures_content', 0)):
+    TargetSignatures('content')
 env = Environment()
 import os
 env.AppendENVPath('PATH', os.environ['PATH'])
@@ -248,11 +250,41 @@ if not (r1 and r2 and r3 and r4 and r5 and r6):
                        [[((".cpp", CR), (_obj, CR))]],
                       test, "config.log", ".sconf_temp", "SConstruct")
 
+    # same should be true for TargetSignatures('content')
+
+    test.run(chdir=work_dir, arguments='target_signatures_content=1 --config=force')
+    checkLogAndStdout(["Checking for main() in C library %s... " % lib,
+                       "Checking for main() in C library None... ",
+                       "Checking for main() in C library %s... " % lib,
+                       "Checking for main() in C library None... ",
+                       "Checking for C header file math.h... ",
+                       "Checking for C++ header file vector... "],
+                      ["yes"]*6,
+                      [[((".c", NCR), (_obj, NCR), (_exe, NCR))]]*4 +
+                        [[((".c", NCR), (_obj, NCR))]] +
+                        [[((".cpp", NCR), (_obj, NCR))]],
+                      test, "config.log", ".sconf_temp", "SConstruct")    
+
+    test.run(chdir=work_dir, arguments='target_signatures_content=1')
+    checkLogAndStdout(["Checking for main() in C library %s... " % lib,
+                       "Checking for main() in C library None... ",
+                       "Checking for main() in C library %s... " % lib,
+                       "Checking for main() in C library None... ",
+                       "Checking for C header file math.h... ",
+                       "Checking for C++ header file vector... "],
+                      ["yes"]*6,
+                      [[((".c", CR), (_obj, CR), (_exe, CR))]]*4 +
+                       [[((".c", CR), (_obj, CR))]] +
+                       [[((".cpp", CR), (_obj, CR))]],
+                      test, "config.log", ".sconf_temp", "SConstruct")    
+
     # 1.2 if checks are not ok, the cache mechanism should work as well
     #     (via explicit cache)
     reset(EXACT)              # match exactly, "()" is a regexp thing
 
     test.write([work_dir,  'SConstruct'], """
+if int(ARGUMENTS.get('target_signatures_content', 0)):
+    TargetSignatures('content')
 env = Environment()
 import os
 env.AppendENVPath('PATH', os.environ['PATH'])
@@ -281,6 +313,24 @@ if not (not r1 and not r2):
                        [((".c", CR), (_obj, CR), (_exe, CF))]],
                       test, "config.log", ".sconf_temp", "SConstruct")
 
+    # 1.3 same should be true for TargetSignatures('content')
+    test.run(chdir=work_dir, arguments='--config=force target_signatures_content=1')
+    checkLogAndStdout(["Checking for C header file no_std_c_header.h... ",
+                       "Checking for main() in C library no_c_library_SAFFDG... "],
+                      ["no"]*2,
+                      [[((".c", NCR), (_obj, NCF))],
+                       [((".c", NCR), (_obj, NCR), (_exe, NCF))]],
+                      test, "config.log", ".sconf_temp", "SConstruct")
+
+    test.run(chdir=work_dir, arguments='target_signatures_content=1')
+    checkLogAndStdout(["Checking for C header file no_std_c_header.h... ",
+                       "Checking for main() in C library no_c_library_SAFFDG... "],
+                      ["no"]*2,
+                      [[((".c", CR), (_obj, CF))],
+                       [((".c", CR), (_obj, CR), (_exe, CF))]],
+                      test, "config.log", ".sconf_temp", "SConstruct")
+
+    
 
     # 2.1 test that normal builds work together with Sconf
     reset(RE_DOTALL)