def gather_icl_versions(conf, versions): version_pattern = re.compile('^...?.?\....?.?') try: all_versions = _winreg.OpenKey(_winreg.HKEY_LOCAL_MACHINE, 'SOFTWARE\\Wow6432node\\Intel\\Compilers\\C++') except WindowsError: try: all_versions = _winreg.OpenKey(_winreg.HKEY_LOCAL_MACHINE, 'SOFTWARE\\Intel\\Compilers\\C++') except WindowsError: return index = 0 while 1: try: version = _winreg.EnumKey(all_versions, index) except WindowsError: break index = index + 1 if not version_pattern.match(version): continue targets = [] for target,arch in all_icl_platforms: try: icl_version = _winreg.OpenKey(all_versions, version+'\\'+target) path,type = _winreg.QueryValueEx(icl_version,'ProductDir') if os.path.isfile(os.path.join(path, 'bin', 'iclvars.bat')): try: targets.append((target, (arch, conf.get_msvc_version('intel', version, target, os.path.join(path, 'bin', 'iclvars.bat'))))) except Configure.ConfigurationError: pass except WindowsError: continue major = version[0:2] versions.append(('intel ' + major, targets))
def gather_wsdk_versions(conf, versions): version_pattern = re.compile('^v..?.?\...?.?') try: all_versions = _winreg.OpenKey(_winreg.HKEY_LOCAL_MACHINE, 'SOFTWARE\\Wow6432node\\Microsoft\\Microsoft SDKs\\Windows') except WindowsError: try: all_versions = _winreg.OpenKey(_winreg.HKEY_LOCAL_MACHINE, 'SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows') except WindowsError: return index = 0 while 1: try: version = _winreg.EnumKey(all_versions, index) except WindowsError: break index = index + 1 if not version_pattern.match(version): continue try: msvc_version = _winreg.OpenKey(all_versions, version) path,type = _winreg.QueryValueEx(msvc_version,'InstallationFolder') except WindowsError: continue if os.path.isfile(os.path.join(path, 'bin', 'SetEnv.cmd')): targets = [] for target,arch in all_msvc_platforms: try: targets.append((target, (arch, conf.get_msvc_version('wsdk', version, '/'+target, os.path.join(path, 'bin', 'SetEnv.cmd'))))) except Configure.ConfigurationError: pass versions.append(('wsdk ' + version[1:], targets))
def gather_msvc_versions(conf, versions): try: ce_sdk = _winreg.OpenKey( _winreg.HKEY_LOCAL_MACHINE, 'SOFTWARE\\Wow6432node\\Microsoft\\Windows CE Tools\\SDKs') except WindowsError: try: ce_sdk = _winreg.OpenKey( _winreg.HKEY_LOCAL_MACHINE, 'SOFTWARE\\Microsoft\\Windows CE Tools\\SDKs') except WindowsError: ce_sdk = '' if ce_sdk: supported_wince_platforms = [] ce_index = 0 while 1: try: sdk_device = _winreg.EnumKey(ce_sdk, ce_index) except WindowsError: break ce_index = ce_index + 1 sdk = _winreg.OpenKey(ce_sdk, sdk_device) path, type = _winreg.QueryValueEx(sdk, 'SDKRootDir') path = str(path) path, device = os.path.split(path) if not device: path, device = os.path.split(path) for arch, compiler in all_wince_platforms: platforms = [] if os.path.isdir(os.path.join(path, device, 'Lib', arch)): platforms.append((arch, compiler, os.path.join(path, device, 'Include', arch), os.path.join(path, device, 'Lib', arch))) if platforms: supported_wince_platforms.append((device, platforms)) version_pattern = re.compile('^..?\...?') for vcver, vcvar in [('VCExpress', 'exp'), ('VisualStudio', '')]: try: all_versions = _winreg.OpenKey( _winreg.HKEY_LOCAL_MACHINE, 'SOFTWARE\\Wow6432node\\Microsoft\\' + vcver) except WindowsError: try: all_versions = _winreg.OpenKey(_winreg.HKEY_LOCAL_MACHINE, 'SOFTWARE\\Microsoft\\' + vcver) except WindowsError: continue index = 0 while 1: try: version = _winreg.EnumKey(all_versions, index) except WindowsError: break index = index + 1 if not version_pattern.match(version): continue try: msvc_version = _winreg.OpenKey(all_versions, version + "\\Setup\\VS") path, type = _winreg.QueryValueEx(msvc_version, 'ProductDir') path = str(path) targets = [] if ce_sdk: for device, platforms in supported_wince_platforms: cetargets = [] for platform, compiler, include, lib in platforms: winCEpath = os.path.join(path, 'VC', 'ce') if os.path.isdir(winCEpath): common_bindirs, _1, _2 = conf.get_msvc_version( 'msvc', version, 'x86', os.path.join(path, 'Common7', 'Tools', 'vsvars32.bat')) if os.path.isdir( os.path.join(winCEpath, 'lib', platform)): bindirs = [ os.path.join(winCEpath, 'bin', compiler), os.path.join(winCEpath, 'bin', 'x86_' + compiler) ] + common_bindirs incdirs = [ include, os.path.join(winCEpath, 'include'), os.path.join(winCEpath, 'atlmfc', 'include') ] libdirs = [ lib, os.path.join(winCEpath, 'lib', platform), os.path.join(winCEpath, 'atlmfc', 'lib', platform) ] cetargets.append( (platform, (platform, (bindirs, incdirs, libdirs)))) versions.append((device + ' ' + version, cetargets)) if os.path.isfile(os.path.join(path, 'VC', 'vcvarsall.bat')): for target, realtarget in all_msvc_platforms[::-1]: try: targets.append( (target, (realtarget, conf.get_msvc_version( 'msvc', version, target, os.path.join(path, 'VC', 'vcvarsall.bat'))))) except: pass elif os.path.isfile( os.path.join(path, 'Common7', 'Tools', 'vsvars32.bat')): try: targets.append( ('x86', ('x86', conf.get_msvc_version( 'msvc', version, 'x86', os.path.join(path, 'Common7', 'Tools', 'vsvars32.bat'))))) except Configure.ConfigurationError: pass versions.append(('msvc ' + version, targets)) except WindowsError: continue
def gather_msvc_versions(conf, versions): # checks SmartPhones SDKs try: ce_sdk = _winreg.OpenKey(_winreg.HKEY_LOCAL_MACHINE, 'SOFTWARE\\Wow6432node\\Microsoft\\Windows CE Tools\\SDKs') except WindowsError: try: ce_sdk = _winreg.OpenKey(_winreg.HKEY_LOCAL_MACHINE, 'SOFTWARE\\Microsoft\\Windows CE Tools\\SDKs') except WindowsError: ce_sdk = '' if ce_sdk: supported_wince_platforms = [] ce_index = 0 while 1: try: sdk_device = _winreg.EnumKey(ce_sdk, ce_index) except WindowsError: break ce_index = ce_index + 1 sdk = _winreg.OpenKey(ce_sdk, sdk_device) path,type = _winreg.QueryValueEx(sdk, 'SDKRootDir') path=str(path) path,device = os.path.split(path) if not device: path,device = os.path.split(path) for arch,compiler in all_wince_platforms: platforms = [] if os.path.isdir(os.path.join(path, device, 'Lib', arch)): platforms.append((arch, compiler, os.path.join(path, device, 'Include', arch), os.path.join(path, device, 'Lib', arch))) if platforms: supported_wince_platforms.append((device, platforms)) # checks MSVC version_pattern = re.compile('^..?\...?') for vcver,vcvar in [('VCExpress','exp'), ('VisualStudio','')]: try: all_versions = _winreg.OpenKey(_winreg.HKEY_LOCAL_MACHINE, 'SOFTWARE\\Wow6432node\\Microsoft\\'+vcver) except WindowsError: try: all_versions = _winreg.OpenKey(_winreg.HKEY_LOCAL_MACHINE, 'SOFTWARE\\Microsoft\\'+vcver) except WindowsError: continue index = 0 while 1: try: version = _winreg.EnumKey(all_versions, index) except WindowsError: break index = index + 1 if not version_pattern.match(version): continue try: msvc_version = _winreg.OpenKey(all_versions, version + "\\Setup\\VS") path,type = _winreg.QueryValueEx(msvc_version, 'ProductDir') path=str(path) targets = [] if ce_sdk: for device,platforms in supported_wince_platforms: cetargets = [] for platform,compiler,include,lib in platforms: winCEpath = os.path.join(path, 'VC', 'ce') if os.path.isdir(winCEpath): common_bindirs,_1,_2 = conf.get_msvc_version('msvc', version, 'x86', os.path.join(path, 'Common7', 'Tools', 'vsvars32.bat')) if os.path.isdir(os.path.join(winCEpath, 'lib', platform)): bindirs = [os.path.join(winCEpath, 'bin', compiler), os.path.join(winCEpath, 'bin', 'x86_'+compiler)] + common_bindirs incdirs = [include, os.path.join(winCEpath, 'include'), os.path.join(winCEpath, 'atlmfc', 'include')] libdirs = [lib, os.path.join(winCEpath, 'lib', platform), os.path.join(winCEpath, 'atlmfc', 'lib', platform)] cetargets.append((platform, (platform, (bindirs,incdirs,libdirs)))) versions.append((device+' '+version, cetargets)) if os.path.isfile(os.path.join(path, 'VC', 'vcvarsall.bat')): for target,realtarget in all_msvc_platforms[::-1]: try: targets.append((target, (realtarget, conf.get_msvc_version('msvc', version, target, os.path.join(path, 'VC', 'vcvarsall.bat'))))) except: pass elif os.path.isfile(os.path.join(path, 'Common7', 'Tools', 'vsvars32.bat')): try: targets.append(('x86', ('x86', conf.get_msvc_version('msvc', version, 'x86', os.path.join(path, 'Common7', 'Tools', 'vsvars32.bat'))))) except Configure.ConfigurationError: pass versions.append(('msvc '+version, targets)) except WindowsError: continue
def gather_msvc_versions(conf, versions): # checks SmartPhones SDKs try: ce_sdk = _winreg.OpenKey(_winreg.HKEY_LOCAL_MACHINE, "SOFTWARE\\Wow6432node\\Microsoft\\Windows CE Tools\\SDKs") except WindowsError: try: ce_sdk = _winreg.OpenKey(_winreg.HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\Windows CE Tools\\SDKs") except WindowsError: ce_sdk = "" if ce_sdk: supported_wince_platforms = [] ce_index = 0 while 1: try: sdk_device = _winreg.EnumKey(ce_sdk, ce_index) except WindowsError: break ce_index = ce_index + 1 sdk = _winreg.OpenKey(ce_sdk, sdk_device) path, type = _winreg.QueryValueEx(sdk, "SDKRootDir") path = str(path) path, device = os.path.split(path) if not device: path, device = os.path.split(path) for arch, compiler in all_wince_platforms: platforms = [] if os.path.isdir(os.path.join(path, device, "Lib", arch)): platforms.append( ( arch, compiler, os.path.join(path, device, "Include", arch), os.path.join(path, device, "Lib", arch), ) ) if platforms: supported_wince_platforms.append((device, platforms)) # checks MSVC version_pattern = re.compile("^..?\...?") for vcver, vcvar in [("VCExpress", "exp"), ("VisualStudio", "")]: try: all_versions = _winreg.OpenKey(_winreg.HKEY_LOCAL_MACHINE, "SOFTWARE\\Wow6432node\\Microsoft\\" + vcver) except WindowsError: try: all_versions = _winreg.OpenKey(_winreg.HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\" + vcver) except WindowsError: continue index = 0 while 1: try: version = _winreg.EnumKey(all_versions, index) except WindowsError: break index = index + 1 if not version_pattern.match(version): continue try: msvc_version = _winreg.OpenKey(all_versions, version + "\\Setup\\VS") path, type = _winreg.QueryValueEx(msvc_version, "ProductDir") path = str(path) targets = [] if ce_sdk: for device, platforms in supported_wince_platforms: cetargets = [] for platform, compiler, include, lib in platforms: winCEpath = os.path.join(path, "VC", "ce") if os.path.isdir(winCEpath): common_bindirs, _1, _2 = conf.get_msvc_version( "msvc", version, "x86", os.path.join(path, "Common7", "Tools", "vsvars32.bat") ) if os.path.isdir(os.path.join(winCEpath, "lib", platform)): bindirs = [ os.path.join(winCEpath, "bin", compiler), os.path.join(winCEpath, "bin", "x86_" + compiler), ] + common_bindirs incdirs = [ include, os.path.join(winCEpath, "include"), os.path.join(winCEpath, "atlmfc", "include"), ] libdirs = [ lib, os.path.join(winCEpath, "lib", platform), os.path.join(winCEpath, "atlmfc", "lib", platform), ] cetargets.append((platform, (platform, (bindirs, incdirs, libdirs)))) versions.append((device + " " + version, cetargets)) if os.path.isfile(os.path.join(path, "VC", "vcvarsall.bat")): for target, realtarget in all_msvc_platforms[::-1]: try: targets.append( ( target, ( realtarget, conf.get_msvc_version( "msvc", version, target, os.path.join(path, "VC", "vcvarsall.bat") ), ), ) ) except: pass elif os.path.isfile(os.path.join(path, "Common7", "Tools", "vsvars32.bat")): try: targets.append( ( "x86", ( "x86", conf.get_msvc_version( "msvc", version, "x86", os.path.join(path, "Common7", "Tools", "vsvars32.bat") ), ), ) ) except Configure.ConfigurationError: pass versions.append(("msvc " + version, targets)) except WindowsError: continue