3 Tool-specific initialization for Microsoft Windows DDK.
8 # Copyright (c) 2001-2007 The SCons Foundation
9 # Copyright (c) 2008 Tungsten Graphics, Inc.
11 # Permission is hereby granted, free of charge, to any person obtaining
12 # a copy of this software and associated documentation files (the
13 # "Software"), to deal in the Software without restriction, including
14 # without limitation the rights to use, copy, modify, merge, publish,
15 # distribute, sublicense, and/or sell copies of the Software, and to
16 # permit persons to whom the Software is furnished to do so, subject to
17 # the following conditions:
19 # The above copyright notice and this permission notice shall be included
20 # in all copies or substantial portions of the Software.
22 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
23 # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
24 # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
25 # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
26 # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
27 # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
28 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
38 import SCons.Platform.win32
47 def get_winddk_paths(env, version=None):
48 """Return a 3-tuple of (INCLUDE, LIB, PATH) as the values
49 of those three environment variables that should be set
50 in order to execute the MSVC tools properly."""
57 if 'BASEDIR' in os.environ:
58 WINDDKdir = os.environ['BASEDIR']
60 WINDDKdir = "C:\\WINDDK\\3790.1830"
62 exe_paths.append( os.path.join(WINDDKdir, 'bin') )
63 exe_paths.append( os.path.join(WINDDKdir, 'bin', 'x86') )
64 include_paths.append( os.path.join(WINDDKdir, 'inc', 'wxp') )
65 lib_paths.append( os.path.join(WINDDKdir, 'lib') )
70 env['SDK_INC_PATH'] = os.path.join(WINDDKdir, 'inc', target_os)
71 env['CRT_INC_PATH'] = os.path.join(WINDDKdir, 'inc', 'crt')
72 env['DDK_INC_PATH'] = os.path.join(WINDDKdir, 'inc', 'ddk', target_os)
73 env['WDM_INC_PATH'] = os.path.join(WINDDKdir, 'inc', 'ddk', 'wdm', target_os)
75 env['SDK_LIB_PATH'] = os.path.join(WINDDKdir, 'lib', target_os, target_cpu)
76 env['CRT_LIB_PATH'] = os.path.join(WINDDKdir, 'lib', 'crt', target_cpu)
77 env['DDK_LIB_PATH'] = os.path.join(WINDDKdir, 'lib', target_os, target_cpu)
78 env['WDM_LIB_PATH'] = os.path.join(WINDDKdir, 'lib', target_os, target_cpu)
80 include_path = string.join( include_paths, os.pathsep )
81 lib_path = string.join(lib_paths, os.pathsep )
82 exe_path = string.join(exe_paths, os.pathsep )
83 return (include_path, lib_path, exe_path)
88 mslib_sa.generate(env)
89 mslink_sa.generate(env)
91 if not env.has_key('ENV'):
95 include_path, lib_path, exe_path = get_winddk_paths(env)
97 # since other tools can set these, we just make sure that the
98 # relevant stuff from WINDDK is in there somewhere.
99 env.PrependENVPath('INCLUDE', include_path)
100 env.PrependENVPath('LIB', lib_path)
101 env.PrependENVPath('PATH', exe_path)
102 except (SCons.Util.RegError, SCons.Errors.InternalError):
106 if not msvc_sa.exits(env):
108 if not mslib_sa.exits(env):
110 if not mslink_sa.exits(env):
114 # vim:set ts=4 sw=4 et: