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.
import SCons.Tool.msvc
import SCons.Util
+import SCons.Warnings
# Find Intel compiler:
# Could enumerate subkeys here to be more flexible.
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:
'zip',
]
+error_output = {
+ 'icl' : """
+scons: warning: Intel license dir was not found. Tried using the INTEL_LICENSE_FILE environment variable (), the registry () and the default path (C:\Program Files\Common Files\Intel\Licenses). Using the default path as a last resort.
+File "SConstruct", line 1, in ?
+"""
+}
+
# An SConstruct for importing Tool names that have illegal characters
# for Python variable names.
indirect_import = """\
test.write('SConstruct', indirect_import % (tool, tool, tool))
else:
test.write('SConstruct', direct_import % (tool, tool, tool))
- test.run()
+ test.run(stderr=None)
+ stderr = test.stderr()
+ if stderr != '' and stderr != error_output.get(tool, ''):
+ print "Failed importing '%s', stderr:" % tool
+ print stderr
+ test.fail_test(1)
test.pass_test()