summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2004-04-13 03:46:05 (GMT)
committerSteven Knight <knight@baldmt.com>2004-04-13 03:46:05 (GMT)
commite4adb76f832acf1d22f99801a54abb9ea1562182 (patch)
tree78e53644e9c5ebc5de83171602f2f31b894179b7 /src
parent622d5777ae1e7db95933e3218a0619a764f20bd6 (diff)
downloadSCons-e4adb76f832acf1d22f99801a54abb9ea1562182.zip
SCons-e4adb76f832acf1d22f99801a54abb9ea1562182.tar.gz
SCons-e4adb76f832acf1d22f99801a54abb9ea1562182.tar.bz2
More robust searching for the ICL license file. (Gary Oberbrunner)
Diffstat (limited to 'src')
-rw-r--r--src/CHANGES.txt3
-rw-r--r--src/engine/SCons/Tool/icl.py29
2 files changed, 31 insertions, 1 deletions
diff --git a/src/CHANGES.txt b/src/CHANGES.txt
index d7922ce..bf2c760 100644
--- a/src/CHANGES.txt
+++ b/src/CHANGES.txt
@@ -85,6 +85,9 @@ RELEASE 0.96 - XXX
are otherwise silently (and confusingly) turned into construction
variable overrides.
+ - Try to find the ICL license file path name in the external environment
+ and the registry before resorting to the hard-coded path name.
+
From Simon Perkins:
- Fix a bug introduced in building shared libraries under MinGW.
diff --git a/src/engine/SCons/Tool/icl.py b/src/engine/SCons/Tool/icl.py
index ec1e063..d59647c 100644
--- a/src/engine/SCons/Tool/icl.py
+++ b/src/engine/SCons/Tool/icl.py
@@ -38,6 +38,7 @@ import string
import SCons.Tool.msvc
import SCons.Util
+import SCons.Warnings
# Find Intel compiler:
# Could enumerate subkeys here to be more flexible.
@@ -99,7 +100,33 @@ def generate(env):
env['CXX'] = 'icl'
env['LINK'] = 'xilink'
- env['ENV']['INTEL_LICENSE_FILE'] = r'C:\Program Files\Common Files\Intel\Licenses'
+ # Look for license file dir.
+ envlicdir = os.environ.get("INTEL_LICENSE_FILE", '')
+ K = ('SOFTWARE\Intel\Licenses')
+ try:
+ k = SCons.Util.RegOpenKeyEx(SCons.Util.HKEY_LOCAL_MACHINE, K)
+ reglicdir = SCons.Util.RegQueryValueEx(k, "w_cpp")[0]
+ except (AttributeError, SCons.Util.RegError):
+ reglicdir = ""
+ defaultlicdir = r'C:\Program Files\Common Files\Intel\Licenses'
+
+ licdir = None
+ for ld in [envlicdir, reglicdir]:
+ if ld and os.path.exists(ld):
+ licdir = ld
+ break
+ if not licdir:
+ licdir = defaultlicdir
+ if not os.path.exists(licdir):
+ class ICLLicenseDirWarning(SCons.Warnings.Warning):
+ pass
+ SCons.Warnings.enableWarningClass(ICLLicenseDirWarning)
+ SCons.Warnings.warn(ICLLicenseDirWarning,
+ "Intel license dir was not found."
+ " Tried using the INTEL_LICENSE_FILE environment variable (%s), the registry (%s) and the default path (%s)."
+ " Using the default path as a last resort."
+ % (envlicdir, reglicdir, defaultlicdir))
+ env['ENV']['INTEL_LICENSE_FILE'] = licdir
def exists(env):
try: