diff options
author | Steven Knight <knight@baldmt.com> | 2003-11-18 07:10:57 (GMT) |
---|---|---|
committer | Steven Knight <knight@baldmt.com> | 2003-11-18 07:10:57 (GMT) |
commit | f178684f565030f529e50b58d060a98fd8795e14 (patch) | |
tree | 2852b82f577251e2af04c8bb3a335b0ca467e3b5 /src | |
parent | c1482a3213790dba0c7faed021e309cf0a010c00 (diff) | |
download | SCons-f178684f565030f529e50b58d060a98fd8795e14.zip SCons-f178684f565030f529e50b58d060a98fd8795e14.tar.gz SCons-f178684f565030f529e50b58d060a98fd8795e14.tar.bz2 |
Ensure that the ENV values are all strings. (Anthony Roach)
Diffstat (limited to 'src')
-rw-r--r-- | src/CHANGES.txt | 16 | ||||
-rw-r--r-- | src/engine/SCons/Action.py | 17 | ||||
-rw-r--r-- | src/engine/SCons/Tool/msvc.py | 45 | ||||
-rw-r--r-- | src/engine/SCons/Tool/msvs.py | 10 |
4 files changed, 70 insertions, 18 deletions
diff --git a/src/CHANGES.txt b/src/CHANGES.txt index a36b2ab..a6965c6 100644 --- a/src/CHANGES.txt +++ b/src/CHANGES.txt @@ -20,6 +20,20 @@ RELEASE 0.95 - XXX - Accomodate the fact that Cygwin's os.path.normcase() lies about the underlying system being case-sensitive. + From Charles Crain: + + - If no version of MSVC is detected but the tool is specified, + use the MSVC 6.0 paths by default. + + - Ignore any "6.1" version of MSVC found in the registry; this is a + phony version number (created by later service packs?) and would + throw off the logic if the user had any non-default paths configure. + + - Correctly detect if the user has independently configured the MSVC + "include," "lib" or "path" in the registry and use the appropriate + values. Previously, SCons would only use the values if all three + were set in the registry. + From Steven Knight: - Fix EnsureSConsVersion() so it checks against the SCons version, @@ -46,6 +60,8 @@ RELEASE 0.95 - XXX - Add -H help text listing the legal --debug values. + - Don't choke if a construction variable is a non-string value. + RELEASE 0.94 - Fri, 07 Nov 2003 05:29:48 -0600 diff --git a/src/engine/SCons/Action.py b/src/engine/SCons/Action.py index 93580cc..1791532 100644 --- a/src/engine/SCons/Action.py +++ b/src/engine/SCons/Action.py @@ -237,6 +237,23 @@ class CommandAction(ActionBase): import SCons.Environment default_ENV = SCons.Environment.Environment()['ENV'] ENV = default_ENV + + # ensure that the ENV values are all strings: + for key, value in ENV.items(): + if SCons.Util.is_List(value): + # If the value is a list, then we assume + # it is a path list, because that's a pretty + # common list like value to stick in an environment + # variable: + ENV[key] = string.join(map(str, value), os.pathsep) + elif not SCons.Util.is_String(value): + # If it isn't a string or a list, then + # we just coerce it to a string, which + # is proper way to handle Dir and File instances + # and will produce something reasonable for + # just about everything else: + ENV[key] = str(value) + # Escape the command line for the command # interpreter we are using map(lambda x, e=escape: x.escape(e), cmd_line) diff --git a/src/engine/SCons/Tool/msvc.py b/src/engine/SCons/Tool/msvc.py index 2a067b9..f7ec5e4 100644 --- a/src/engine/SCons/Tool/msvc.py +++ b/src/engine/SCons/Tool/msvc.py @@ -261,29 +261,38 @@ def get_msvc_paths(version=None): lib_path = '' include_path = '' - if not version and not SCons.Util.can_read_reg: - version = '6.0' - - try: - if not version: - version = SCons.Tool.msvs.get_visualstudio_versions()[0] #use highest version + if not version: + versions = SCons.Tool.msvs.get_visualstudio_versions() + if versions: + version = versions[0] #use highest version by default + else: + version = '6.0' + # Some of the configured directories only + # appear if the user changes them from the default. + # Therefore, we'll see if we can get the path to the MSDev + # base installation from the registry and deduce the default + # directories. + if float(version) >= 7.0: + defpaths = _get_msvc7_default_paths(version) + else: + defpaths = _get_msvc6_default_paths(version) + + try: include_path = get_msvc_path("include", version) + except (SCons.Util.RegError, SCons.Errors.InternalError): + include_path = defpaths[0] + + try: lib_path = get_msvc_path("lib", version) - exe_path = get_msvc_path("path", version) + except (SCons.Util.RegError, SCons.Errors.InternalError): + lib_path = defpaths[1] + try: + exe_path = get_msvc_path("path", version) except (SCons.Util.RegError, SCons.Errors.InternalError): - # Could not get all the configured directories from the - # registry. However, some of the configured directories only - # appear if the user changes them from the default. - # Therefore, we'll see if we can get the path to the MSDev - # base installation from the registry and deduce the default - # directories. - if float(version) >= 7.0: - return _get_msvc7_default_paths(version) - else: - return _get_msvc6_default_paths(version) - + exe_path = defpaths[2] + return (include_path, lib_path, exe_path) def get_msvc_default_paths(version = None): diff --git a/src/engine/SCons/Tool/msvs.py b/src/engine/SCons/Tool/msvs.py index 949793a..ee860e3 100644 --- a/src/engine/SCons/Tool/msvs.py +++ b/src/engine/SCons/Tool/msvs.py @@ -787,6 +787,16 @@ def get_visualstudio_versions(): if not L: return [] + # This is a hack to get around the fact that certain Visual Studio + # patches place a "6.1" version in the registry, which does not have + # any of the keys we need to find include paths, install directories, + # etc. Therefore we ignore it if it is there, since it throws all + # other logic off. + try: + L.remove("6.1") + except ValueError: + pass + L.sort() L.reverse() |