Fix scans for derived include files in Repositories. (Charles Crain)
authorstevenknight <stevenknight@fdb21ef1-2011-0410-befe-b5e4ea1792b1>
Tue, 12 Nov 2002 10:42:12 +0000 (10:42 +0000)
committerstevenknight <stevenknight@fdb21ef1-2011-0410-befe-b5e4ea1792b1>
Tue, 12 Nov 2002 10:42:12 +0000 (10:42 +0000)
git-svn-id: http://scons.tigris.org/svn/scons/trunk@494 fdb21ef1-2011-0410-befe-b5e4ea1792b1

etc/SConscript
src/CHANGES.txt
src/engine/SCons/Scanner/C.py
src/engine/SCons/Scanner/CTests.py
src/engine/SCons/Scanner/Fortran.py
src/engine/SCons/Scanner/FortranTests.py

index 96a464d1d982fa925643129fcdee75988cb40904..adac43e6cf6574e4157e012b37cb3eda782d104d 100644 (file)
@@ -48,4 +48,6 @@ for file in files:
     p = os.path.join('build', 'etc', file)
     if os.path.islink(p):
         os.unlink(p)
-    env.Command(os.path.join('#' + p), file, copy)
+    sp = '#' + p
+    env.Command(sp, file, copy)
+    Local(sp)
index 83c0d08f5cb4505209a99066a03615b696e04bda..a313b09ca35a8387ef26b75122a02753fddaa80a 100644 (file)
@@ -17,7 +17,7 @@ RELEASE 0.09 -
 
  From Charles Crain and Steven Knight:
 
-  - Add Repository() functionality.
+  - Add Repository() functionality, including the -Y option.
 
  From Steven Knight:
 
index 0e6e5d38353342fb0cd119141e61833358f4d1f5..6eb03f4b56ff2e93f31de58a18a10542b934e7c8 100644 (file)
@@ -80,7 +80,7 @@ def scan(node, env, target, fs = SCons.Node.FS.default_fs):
 
     if not hasattr(target, 'cpppath'):
         try:
-            target.cpppath = tuple(fs.Rsearchall(SCons.Util.mapPaths(env['CPPPATH'], target.cwd), clazz=SCons.Node.FS.Dir))
+            target.cpppath = tuple(fs.Rsearchall(SCons.Util.mapPaths(env['CPPPATH'], target.cwd), clazz=SCons.Node.FS.Dir, must_exist=0))
         except KeyError:
             target.cpppath = ()
 
index b91200f2451795f18712b4ce97e7d9e3c0006e71..be911d9e970f64bb33c56b1e32fb44914616fe0d 100644 (file)
@@ -127,6 +127,7 @@ test.write(['repository', 'include', 'iii.h'], "\n")
 
 test.write(['work', 'src', 'fff.c'], """
 #include <iii.h>
+#include <jjj.h>
 
 int main()
 {
@@ -319,10 +320,15 @@ class CScannerTestCase11(unittest.TestCase):
         os.chdir(test.workpath('work'))
         fs = SCons.Node.FS.FS(test.workpath('work'))
         fs.Repository(test.workpath('repository'))
+
+        # Create a derived file in a directory that does not exist yet.
+        # This was a bug at one time.
+        f1=fs.File('include2/jjj.h')
+        f1.builder=1
         s = SCons.Scanner.C.CScan(fs=fs)
-        env = DummyEnvironment(['include'])
+        env = DummyEnvironment(['include', 'include2'])
         deps = s.scan(fs.File('src/fff.c'), env, DummyTarget())
-        deps_match(self, deps, [test.workpath('repository/include/iii.h')])
+        deps_match(self, deps, [ test.workpath('repository/include/iii.h'), 'include2/jjj.h' ])
         os.chdir(test.workpath(''))
 
 class CScannerTestCase12(unittest.TestCase):
index 5c4f69dd59698f3f4c81d34781caadb66f466d84..afe46d09858060699239cd12883fc2a69f1bb793 100644 (file)
@@ -78,7 +78,7 @@ def scan(node, env, target, fs = SCons.Node.FS.default_fs):
 
     if not hasattr(target, 'f77path'):
         try:
-            target.f77path = tuple(fs.Rsearchall(SCons.Util.mapPaths(env['F77PATH'], target.cwd), clazz=SCons.Node.FS.Dir))
+            target.f77path = tuple(fs.Rsearchall(SCons.Util.mapPaths(env['F77PATH'], target.cwd), clazz=SCons.Node.FS.Dir, must_exist=0))
         except KeyError:
             target.f77path = ()
 
index 9806d60f68a83965805d08016428a46b3fbad085..3e3f7da66abad0e146ad6a595e1567dadfe1c78c 100644 (file)
@@ -102,6 +102,7 @@ test.write(['repository', 'include', 'iii.f'], "\n")
 test.write(['work', 'src', 'fff.f'], """
       PROGRAM FOO
       INCLUDE 'iii.f'
+      INCLUDE 'jjj.f'
       STOP
       END
 """)
@@ -323,10 +324,15 @@ class FortranScannerTestCase13(unittest.TestCase):
         os.chdir(test.workpath('work'))
         fs = SCons.Node.FS.FS(test.workpath('work'))
         fs.Repository(test.workpath('repository'))
+
+        # Create a derived file in a directory that does not exist yet.
+        # This was a bug at one time.
+        f1=fs.File('include2/jjj.f')
+        f1.builder=1
         s = SCons.Scanner.Fortran.FortranScan(fs=fs)
-        env = DummyEnvironment(['include'])
+        env = DummyEnvironment(['include','include2'])
         deps = s.scan(fs.File('src/fff.f'), env, DummyTarget())
-        deps_match(self, deps, [test.workpath('repository/include/iii.f')])
+        deps_match(self, deps, [test.workpath('repository/include/iii.f'), 'include2/jjj.f'])
         os.chdir(test.workpath(''))
 
 class FortranScannerTestCase14(unittest.TestCase):