mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-02 18:48:28 +02:00
scons: Lookup WINDDK and WINCE SDK directories in the registry.
This commit is contained in:
parent
101d1a658a
commit
4ec4ea14a5
2 changed files with 62 additions and 28 deletions
|
|
@ -76,6 +76,27 @@ def get_wce500_paths(env):
|
|||
exe_path = string.join(exe_paths, os.pathsep )
|
||||
return (include_path, lib_path, exe_path)
|
||||
|
||||
def get_wce600_root(env):
|
||||
try:
|
||||
return os.environ['_WINCEROOT']
|
||||
except KeyError:
|
||||
pass
|
||||
|
||||
if SCons.Util.can_read_reg:
|
||||
key = r'SOFTWARE\Microsoft\Platform Builder\6.00\Directories\OS Install Dir'
|
||||
try:
|
||||
path, t = SCons.Util.RegGetValue(SCons.Util.HKEY_LOCAL_MACHINE, key)
|
||||
except SCons.Util.RegError:
|
||||
pass
|
||||
else:
|
||||
return path
|
||||
|
||||
default_path = os.path.join(r'C:\WINCE600', version)
|
||||
if os.path.exists(default_path):
|
||||
return default_path
|
||||
|
||||
return None
|
||||
|
||||
def get_wce600_paths(env):
|
||||
"""Return a 3-tuple of (INCLUDE, LIB, PATH) as the values
|
||||
of those three environment variables that should be set
|
||||
|
|
@ -87,16 +108,19 @@ def get_wce600_paths(env):
|
|||
|
||||
# See also C:\WINCE600\public\common\oak\misc\wince.bat
|
||||
|
||||
os_version = os.environ.get('_winceosver', '600')
|
||||
wince_root = os.environ.get('_winceroot', r'C:\WINCE600')
|
||||
platform_root = os.environ.get('_platformroot', os.path.join(wince_root, 'platform'))
|
||||
sdk_root = os.environ.get('_sdkroot' ,os.path.join(wince_root, 'sdk'))
|
||||
wince_root = get_wce600_root(env)
|
||||
if wince_root is None:
|
||||
raise SCons.Errors.InternalError, "Windows CE 6.0 SDK not found"
|
||||
|
||||
os_version = os.environ.get('_WINCEOSVER', '600')
|
||||
platform_root = os.environ.get('_PLATFORMROOT', os.path.join(wince_root, 'platform'))
|
||||
sdk_root = os.environ.get('_SDKROOT' ,os.path.join(wince_root, 'sdk'))
|
||||
|
||||
platform_root = os.environ.get('_platformroot', os.path.join(wince_root, 'platform'))
|
||||
sdk_root = os.environ.get('_sdkroot' ,os.path.join(wince_root, 'sdk'))
|
||||
platform_root = os.environ.get('_PLATFORMROOT', os.path.join(wince_root, 'platform'))
|
||||
sdk_root = os.environ.get('_SDKROOT' ,os.path.join(wince_root, 'sdk'))
|
||||
|
||||
host_cpu = os.environ.get('_hostcputype', 'i386')
|
||||
target_cpu = os.environ.get('_tgtcpu', 'x86')
|
||||
host_cpu = os.environ.get('_HOSTCPUTYPE', 'i386')
|
||||
target_cpu = os.environ.get('_TGTCPU', 'x86')
|
||||
|
||||
if env['debug']:
|
||||
build = 'debug'
|
||||
|
|
@ -104,7 +128,7 @@ def get_wce600_paths(env):
|
|||
build = 'retail'
|
||||
|
||||
try:
|
||||
project_root = os.environ['_projectroot']
|
||||
project_root = os.environ['_PROJECTROOT']
|
||||
except KeyError:
|
||||
# No project root defined -- use the common stuff instead
|
||||
project_root = os.path.join(wince_root, 'public', 'common')
|
||||
|
|
@ -147,12 +171,6 @@ def generate(env):
|
|||
pass
|
||||
|
||||
def exists(env):
|
||||
if not msvc_sa.exits(env):
|
||||
return 0
|
||||
if not mslib_sa.exits(env):
|
||||
return 0
|
||||
if not mslink_sa.exits(env):
|
||||
return 0
|
||||
return 1
|
||||
return get_wce600_root(env) is not None
|
||||
|
||||
# vim:set ts=4 sw=4 et:
|
||||
|
|
|
|||
|
|
@ -44,7 +44,30 @@ import msvc_sa
|
|||
import mslib_sa
|
||||
import mslink_sa
|
||||
|
||||
def get_winddk_paths(env, version=None):
|
||||
def get_winddk_root(env):
|
||||
try:
|
||||
return os.environ['BASEDIR']
|
||||
except KeyError:
|
||||
pass
|
||||
|
||||
version = "3790.1830"
|
||||
|
||||
if SCons.Util.can_read_reg:
|
||||
key = r'SOFTWARE\Microsoft\WINDDK\%s\LFNDirectory' % version
|
||||
try:
|
||||
path, t = SCons.Util.RegGetValue(SCons.Util.HKEY_LOCAL_MACHINE, key)
|
||||
except SCons.Util.RegError:
|
||||
pass
|
||||
else:
|
||||
return path
|
||||
|
||||
default_path = os.path.join(r'C:\WINDDK', version)
|
||||
if os.path.exists(default_path):
|
||||
return default_path
|
||||
|
||||
return None
|
||||
|
||||
def get_winddk_paths(env):
|
||||
"""Return a 3-tuple of (INCLUDE, LIB, PATH) as the values
|
||||
of those three environment variables that should be set
|
||||
in order to execute the MSVC tools properly."""
|
||||
|
|
@ -54,10 +77,9 @@ def get_winddk_paths(env, version=None):
|
|||
lib_paths = []
|
||||
include_paths = []
|
||||
|
||||
if 'BASEDIR' in os.environ:
|
||||
WINDDKdir = os.environ['BASEDIR']
|
||||
else:
|
||||
WINDDKdir = "C:\\WINDDK\\3790.1830"
|
||||
WINDDKdir = get_winddk_root(env)
|
||||
if WINDDKdir is None:
|
||||
raise SCons.Errors.InternalError, "WINDDK not found"
|
||||
|
||||
exe_paths.append( os.path.join(WINDDKdir, 'bin') )
|
||||
exe_paths.append( os.path.join(WINDDKdir, 'bin', 'x86') )
|
||||
|
|
@ -103,12 +125,6 @@ def generate(env):
|
|||
pass
|
||||
|
||||
def exists(env):
|
||||
if not msvc_sa.exits(env):
|
||||
return 0
|
||||
if not mslib_sa.exits(env):
|
||||
return 0
|
||||
if not mslink_sa.exits(env):
|
||||
return 0
|
||||
return 1
|
||||
return get_winddk_root(env) is not None
|
||||
|
||||
# vim:set ts=4 sw=4 et:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue