Fix VS8 integration for use with Express. (Christian Maaser) Portability fix in...
authorstevenknight <stevenknight@fdb21ef1-2011-0410-befe-b5e4ea1792b1>
Tue, 21 Feb 2006 05:55:52 +0000 (05:55 +0000)
committerstevenknight <stevenknight@fdb21ef1-2011-0410-befe-b5e4ea1792b1>
Tue, 21 Feb 2006 05:55:52 +0000 (05:55 +0000)
git-svn-id: http://scons.tigris.org/svn/scons/trunk@1428 fdb21ef1-2011-0410-befe-b5e4ea1792b1

src/engine/SCons/Tool/msvc.py
src/engine/SCons/Tool/msvs.py

index 8ea4b39dee002c8e7735889491bda299c14e9fbe..80c5896cf96a58c05c900624ba7a739f27949304 100644 (file)
@@ -229,9 +229,6 @@ def _parse_msvc8_overrides(version,platform,suite):
                                 # ToDo: Support for other destinations than Win32
                                 path_dirs = path_dirs.replace('Win32|', '')
                                 dirs['PATH'] = path_dirs
-
-        dirs['VCINSTALLDIR'] = os.getenv('VCInstallDir')
-        dirs['VSINSTALLDIR'] = os.getenv('VSInstallDir')
     else:
         # There are no default directories in the registry for VS8 Express :(
         raise SCons.Errors.InternalError, "Unable to find MSVC paths in the registry."
@@ -268,7 +265,12 @@ def _get_msvc7_path(path, version, platform):
         if paths.has_key(key):
             return paths[key]
         else:
-            return '---Unknown Location %s---' % match.group()
+            # Now look in the global environment variables
+            envresult = os.getenv(key)
+            if not envresult is None:
+                return envresult + '\\'
+            else:
+                return '---Unknown Location %s---' % match.group()
 
     rv = []
     for entry in p.split(os.pathsep):
@@ -343,9 +345,9 @@ def get_msvc_path(env, path, version):
         platform = 'x86'
 
     if version_num >= 8.0:
-        return _get_msvc8_path(path, version, platform, suite)
+        return _get_msvc8_path(path, str(version_num), platform, suite)
     elif version_num >= 7.0:
-        return _get_msvc7_path(path, version, platform)
+        return _get_msvc7_path(path, str(version_num), platform)
 
     path = string.upper(path + ' Dirs')
     K = ('Software\\Microsoft\\Devstudio\\%s\\' +
index f00aca970862690c9aad9c7b168615161ffcc5b1..e17dcfd894ae473952b3f21dd0900fe3281e2ca2 100644 (file)
@@ -739,7 +739,7 @@ class _GenerateV7DSP(_DSPGenerator):
             if len(sources) > 1:
                 s = map(os.path.normpath, sources)
                 cp = os.path.commonprefix(s)
-                if cp and s[0][len(cp)] == os.path.sep:
+                if cp and s[0][len(cp)] == os.sep:
                     sources = map(lambda s, l=len(cp): s[l:], sources)
                     commonprefix = cp