diff options
author | Steven Knight <knight@baldmt.com> | 2005-10-10 04:22:54 (GMT) |
---|---|---|
committer | Steven Knight <knight@baldmt.com> | 2005-10-10 04:22:54 (GMT) |
commit | 49cf589d13237f9ccdc0ae384bf40d3776065bb7 (patch) | |
tree | 2f8e826219def1de31873c0a88a2e47052dd59b9 /src | |
parent | 69998af3b908a9cfe2645daddf577ac01bcec285 (diff) | |
download | SCons-49cf589d13237f9ccdc0ae384bf40d3776065bb7.zip SCons-49cf589d13237f9ccdc0ae384bf40d3776065bb7.tar.gz SCons-49cf589d13237f9ccdc0ae384bf40d3776065bb7.tar.bz2 |
Improve intelc.py so it doesn't throw an exception if a version other than ia32 (for example, em64t) is installed without the ia32 version. (Anonymous)
Diffstat (limited to 'src')
-rw-r--r-- | src/CHANGES.txt | 3 | ||||
-rw-r--r-- | src/engine/SCons/Tool/intelc.py | 37 |
2 files changed, 27 insertions, 13 deletions
diff --git a/src/CHANGES.txt b/src/CHANGES.txt index 2312d58..97a4bcd 100644 --- a/src/CHANGES.txt +++ b/src/CHANGES.txt @@ -17,6 +17,9 @@ RELEASE 0.97 - XXX - Fix a typo in the man page description of PathIsDirCreate. + - Fix the intelc.py Tool module to not throw an exception if the + only installed version is something other than ia32. + From Chad Austin: - Allow Help() to be called multiple times, appending to the help diff --git a/src/engine/SCons/Tool/intelc.py b/src/engine/SCons/Tool/intelc.py index 921bcee..9499205 100644 --- a/src/engine/SCons/Tool/intelc.py +++ b/src/engine/SCons/Tool/intelc.py @@ -86,11 +86,17 @@ def check_abi(abi): abi = abi.lower() # valid_abis maps input name to canonical name if is_win32: - valid_abis = {'ia32':'ia32', 'x86':'ia32', - 'ia64':'ia64'} + valid_abis = {'ia32' : 'ia32', + 'x86' : 'ia32', + 'ia64' : 'ia64', + 'em64t' : 'ia32e', + 'amd64' : 'ia32e'} if is_linux: - valid_abis = {'ia32':'ia32', 'x86':'ia32', - 'x86_64':'x86_64', 'em64t':'x86_64', 'amd64':'x86_64'} + valid_abis = {'ia32' : 'ia32', + 'x86' : 'ia32', + 'x86_64' : 'x86_64', + 'em64t' : 'x86_64', + 'amd64' : 'x86_64'} try: abi = valid_abis[abi] except KeyError: @@ -125,14 +131,13 @@ def get_intel_registry_value(valuename, version=None, abi=None): """ Return a value from the Intel compiler registry tree. (Win32 only) """ - # Open the key: K = 'Software\\Intel\\Compilers\\C++\\' + version + '\\'+abi.upper() try: k = SCons.Util.RegOpenKeyEx(SCons.Util.HKEY_LOCAL_MACHINE, K) except SCons.Util.RegError: raise MissingRegistryError, \ - "%s was not found in the registry, for Intel compiler version %s"%(K, version) + "%s was not found in the registry, for Intel compiler version %s, abi='%s'"%(K, version,abi) # Get the value: try: @@ -167,7 +172,7 @@ def get_all_compiler_versions(): # than uninstalling properly), so the registry values # are still there. ok = False - for try_abi in ('IA32', 'IA64'): + for try_abi in ('IA32', 'IA32e', 'IA64'): try: d = get_intel_registry_value('ProductDir', subkey, try_abi) except MissingRegistryError: @@ -201,12 +206,10 @@ def get_intel_compiler_top(version, abi): The compiler will be in <top>/bin/icl.exe (icc on linux), the include dir is <top>/include, etc. """ - if is_win32: if not SCons.Util.can_read_reg: raise NoRegistryModuleError, "No Windows registry module was found" top = get_intel_registry_value('ProductDir', version, abi) - if not os.path.exists(os.path.join(top, "Bin", "icl.exe")): raise MissingDirError, \ "Can't find Intel compiler in %s"%(top) @@ -245,7 +248,7 @@ def generate(env, version=None, abi=None, topdir=None, verbose=0): SCons.Tool.msvc.generate(env) elif is_linux: SCons.Tool.gcc.generate(env) - + # if version is unspecified, use latest vlist = get_all_compiler_versions() if not version: @@ -285,14 +288,22 @@ def generate(env, version=None, abi=None, topdir=None, verbose=0): if not topdir: # Normally this is an error, but it might not be if the compiler is # on $PATH and the user is importing their env. + class ICLTopDirWarning(SCons.Warnings.Warning): + pass if is_linux and not env.Detect('icc') or \ is_win32 and not env.Detect('icl'): - class ICLTopDirWarning(SCons.Warnings.Warning): - pass + SCons.Warnings.enableWarningClass(ICLTopDirWarning) SCons.Warnings.warn(ICLTopDirWarning, - "Can't find Intel compiler top dir for version='%s', abi='%s'"% + "Failed to find Intel compiler for version='%s', abi='%s'"% (str(version), str(abi))) + else: + # should be cleaned up to say what this other version is + # since in this case we have some other Intel compiler installed + SCons.Warnings.enableWarningClass(ICLTopDirWarning) + SCons.Warnings.warn(ICLTopDirWarning, + "Can't find Intel compiler top dir for version='%s', abi='%s'"% + (str(version), str(abi))) if topdir: if verbose: |