summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJosé Fonseca <jose.r.fonseca@gmail.com>2011-04-23 11:30:38 +0100
committerJosé Fonseca <jose.r.fonseca@gmail.com>2011-04-23 11:30:38 +0100
commitea87fd848301b0414318f150a627d390afef07ab (patch)
tree5d3d121e6d30b7d50104b03c600152d74b28b3e9
parentc26fd5e9938d5088a31735330bd538209921eb1b (diff)
scons: Remove winsdk toolchain.
Unnecessary/undocumented.
-rw-r--r--scons/mslib_sa.py49
-rw-r--r--scons/mslink_sa.py211
-rw-r--r--scons/msvc_sa.py173
-rw-r--r--scons/winsdk.py139
-rw-r--r--src/SConstruct2
5 files changed, 1 insertions, 573 deletions
diff --git a/scons/mslib_sa.py b/scons/mslib_sa.py
deleted file mode 100644
index da51c57..0000000
--- a/scons/mslib_sa.py
+++ /dev/null
@@ -1,49 +0,0 @@
-"""mslib_sa
-
-Tool-specific initialization for lib (MicroSoft library archiver).
-
-Based on SCons.Tool.mslib, without the MSVC detection.
-
-"""
-
-#
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 The SCons Foundation
-#
-# Permission is hereby granted, free of charge, to any person obtaining
-# a copy of this software and associated documentation files (the
-# "Software"), to deal in the Software without restriction, including
-# without limitation the rights to use, copy, modify, merge, publish,
-# distribute, sublicense, and/or sell copies of the Software, and to
-# permit persons to whom the Software is furnished to do so, subject to
-# the following conditions:
-#
-# The above copyright notice and this permission notice shall be included
-# in all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
-# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
-# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-#
-
-import SCons.Defaults
-import SCons.Tool
-import SCons.Util
-
-def generate(env):
- """Add Builders and construction variables for lib to an Environment."""
- SCons.Tool.createStaticLibBuilder(env)
-
- env['AR'] = 'lib'
- env['ARFLAGS'] = SCons.Util.CLVar('/nologo')
- env['ARCOM'] = "${TEMPFILE('$AR $ARFLAGS /OUT:$TARGET $SOURCES')}"
- env['LIBPREFIX'] = ''
- env['LIBSUFFIX'] = '.lib'
-
-def exists(env):
- return env.Detect('lib')
-
-# vim:set ts=4 sw=4 et:
diff --git a/scons/mslink_sa.py b/scons/mslink_sa.py
deleted file mode 100644
index 53331de..0000000
--- a/scons/mslink_sa.py
+++ /dev/null
@@ -1,211 +0,0 @@
-"""mslink_sa
-
-Tool-specific initialization for the Microsoft linker.
-
-Based on SCons.Tool.mslink, without the MSVS detection.
-
-"""
-
-#
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 The SCons Foundation
-#
-# Permission is hereby granted, free of charge, to any person obtaining
-# a copy of this software and associated documentation files (the
-# "Software"), to deal in the Software without restriction, including
-# without limitation the rights to use, copy, modify, merge, publish,
-# distribute, sublicense, and/or sell copies of the Software, and to
-# permit persons to whom the Software is furnished to do so, subject to
-# the following conditions:
-#
-# The above copyright notice and this permission notice shall be included
-# in all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
-# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
-# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-#
-
-import os.path
-
-import SCons.Action
-import SCons.Defaults
-import SCons.Errors
-import SCons.Platform.win32
-import SCons.Tool
-import SCons.Tool.msvc
-import SCons.Util
-
-def pdbGenerator(env, target, source, for_signature):
- try:
- return ['/PDB:%s' % target[0].attributes.pdb, '/DEBUG']
- except (AttributeError, IndexError):
- return None
-
-def windowsShlinkTargets(target, source, env, for_signature):
- listCmd = []
- dll = env.FindIxes(target, 'SHLIBPREFIX', 'SHLIBSUFFIX')
- if dll: listCmd.append("/out:%s"%dll.get_string(for_signature))
-
- implib = env.FindIxes(target, 'LIBPREFIX', 'LIBSUFFIX')
- if implib: listCmd.append("/implib:%s"%implib.get_string(for_signature))
-
- return listCmd
-
-def windowsShlinkSources(target, source, env, for_signature):
- listCmd = []
-
- deffile = env.FindIxes(source, "WINDOWSDEFPREFIX", "WINDOWSDEFSUFFIX")
- for src in source:
- if src == deffile:
- # Treat this source as a .def file.
- listCmd.append("/def:%s" % src.get_string(for_signature))
- else:
- # Just treat it as a generic source file.
- listCmd.append(src)
- return listCmd
-
-def windowsLibEmitter(target, source, env):
- SCons.Tool.msvc.validate_vars(env)
-
- extratargets = []
- extrasources = []
-
- dll = env.FindIxes(target, "SHLIBPREFIX", "SHLIBSUFFIX")
- no_import_lib = env.get('no_import_lib', 0)
-
- if not dll:
- raise SCons.Errors.UserError, "A shared library should have exactly one target with the suffix: %s" % env.subst("$SHLIBSUFFIX")
-
- insert_def = env.subst("$WINDOWS_INSERT_DEF")
- if not insert_def in ['', '0', 0] and \
- not env.FindIxes(source, "WINDOWSDEFPREFIX", "WINDOWSDEFSUFFIX"):
-
- # append a def file to the list of sources
- extrasources.append(
- env.ReplaceIxes(dll,
- "SHLIBPREFIX", "SHLIBSUFFIX",
- "WINDOWSDEFPREFIX", "WINDOWSDEFSUFFIX"))
-
- if env.has_key('PDB') and env['PDB']:
- pdb = env.arg2nodes('$PDB', target=target, source=source)[0]
- extratargets.append(pdb)
- target[0].attributes.pdb = pdb
-
- if not no_import_lib and \
- not env.FindIxes(target, "LIBPREFIX", "LIBSUFFIX"):
- # Append an import library to the list of targets.
- extratargets.append(
- env.ReplaceIxes(dll,
- "SHLIBPREFIX", "SHLIBSUFFIX",
- "LIBPREFIX", "LIBSUFFIX"))
- # and .exp file is created if there are exports from a DLL
- extratargets.append(
- env.ReplaceIxes(dll,
- "SHLIBPREFIX", "SHLIBSUFFIX",
- "WINDOWSEXPPREFIX", "WINDOWSEXPSUFFIX"))
-
- return (target+extratargets, source+extrasources)
-
-def prog_emitter(target, source, env):
- SCons.Tool.msvc.validate_vars(env)
-
- extratargets = []
-
- exe = env.FindIxes(target, "PROGPREFIX", "PROGSUFFIX")
- if not exe:
- raise SCons.Errors.UserError, "An executable should have exactly one target with the suffix: %s" % env.subst("$PROGSUFFIX")
-
- if env.has_key('PDB') and env['PDB']:
- pdb = env.arg2nodes('$PDB', target=target, source=source)[0]
- extratargets.append(pdb)
- target[0].attributes.pdb = pdb
-
- return (target+extratargets,source)
-
-def RegServerFunc(target, source, env):
- if env.has_key('register') and env['register']:
- ret = regServerAction([target[0]], [source[0]], env)
- if ret:
- raise SCons.Errors.UserError, "Unable to register %s" % target[0]
- else:
- print "Registered %s sucessfully" % target[0]
- return ret
- return 0
-
-regServerAction = SCons.Action.Action("$REGSVRCOM", "$REGSVRCOMSTR")
-regServerCheck = SCons.Action.Action(RegServerFunc, None)
-shlibLinkAction = SCons.Action.Action('${TEMPFILE("$SHLINK $SHLINKFLAGS $_SHLINK_TARGETS $( $_LIBDIRFLAGS $) $_LIBFLAGS $_PDB $_SHLINK_SOURCES")}')
-compositeLinkAction = shlibLinkAction + regServerCheck
-
-def generate(env):
- """Add Builders and construction variables for ar to an Environment."""
- SCons.Tool.createSharedLibBuilder(env)
- SCons.Tool.createProgBuilder(env)
-
- env['SHLINK'] = '$LINK'
- env['SHLINKFLAGS'] = SCons.Util.CLVar('$LINKFLAGS /dll')
- env['_SHLINK_TARGETS'] = windowsShlinkTargets
- env['_SHLINK_SOURCES'] = windowsShlinkSources
- env['SHLINKCOM'] = compositeLinkAction
- env.Append(SHLIBEMITTER = [windowsLibEmitter])
- env['LINK'] = 'link'
- env['LINKFLAGS'] = SCons.Util.CLVar('/nologo')
- env['_PDB'] = pdbGenerator
- env['LINKCOM'] = '${TEMPFILE("$LINK $LINKFLAGS /OUT:$TARGET.windows $( $_LIBDIRFLAGS $) $_LIBFLAGS $_PDB $SOURCES.windows")}'
- env.Append(PROGEMITTER = [prog_emitter])
- env['LIBDIRPREFIX']='/LIBPATH:'
- env['LIBDIRSUFFIX']=''
- env['LIBLINKPREFIX']=''
- env['LIBLINKSUFFIX']='$LIBSUFFIX'
-
- env['WIN32DEFPREFIX'] = ''
- env['WIN32DEFSUFFIX'] = '.def'
- env['WIN32_INSERT_DEF'] = 0
- env['WINDOWSDEFPREFIX'] = '${WIN32DEFPREFIX}'
- env['WINDOWSDEFSUFFIX'] = '${WIN32DEFSUFFIX}'
- env['WINDOWS_INSERT_DEF'] = '${WIN32_INSERT_DEF}'
-
- env['WIN32EXPPREFIX'] = ''
- env['WIN32EXPSUFFIX'] = '.exp'
- env['WINDOWSEXPPREFIX'] = '${WIN32EXPPREFIX}'
- env['WINDOWSEXPSUFFIX'] = '${WIN32EXPSUFFIX}'
-
- env['WINDOWSSHLIBMANIFESTPREFIX'] = ''
- env['WINDOWSSHLIBMANIFESTSUFFIX'] = '${SHLIBSUFFIX}.manifest'
- env['WINDOWSPROGMANIFESTPREFIX'] = ''
- env['WINDOWSPROGMANIFESTSUFFIX'] = '${PROGSUFFIX}.manifest'
-
- env['REGSVRACTION'] = regServerCheck
- env['REGSVR'] = os.path.join(SCons.Platform.win32.get_system_root(),'System32','regsvr32')
- env['REGSVRFLAGS'] = '/s '
- env['REGSVRCOM'] = '$REGSVR $REGSVRFLAGS ${TARGET.windows}'
-
- # For most platforms, a loadable module is the same as a shared
- # library. Platforms which are different can override these, but
- # setting them the same means that LoadableModule works everywhere.
- SCons.Tool.createLoadableModuleBuilder(env)
- env['LDMODULE'] = '$SHLINK'
- env['LDMODULEPREFIX'] = '$SHLIBPREFIX'
- env['LDMODULESUFFIX'] = '$SHLIBSUFFIX'
- env['LDMODULEFLAGS'] = '$SHLINKFLAGS'
- # We can't use '$SHLINKCOM' here because that will stringify the
- # action list on expansion, and will then try to execute expanded
- # strings, with the upshot that it would try to execute RegServerFunc
- # as a command.
- env['LDMODULECOM'] = compositeLinkAction
-
-def exists(env):
- platform = env.get('PLATFORM', '')
- if platform in ('win32', 'cygwin'):
- # Only explicitly search for a 'link' executable on Windows
- # systems. Some other systems (e.g. Ubuntu Linux) have an
- # executable named 'link' and we don't want that to make SCons
- # think Visual Studio is installed.
- return env.Detect('link')
- return None
-
-# vim:set ts=4 sw=4 et:
diff --git a/scons/msvc_sa.py b/scons/msvc_sa.py
deleted file mode 100644
index 136d305..0000000
--- a/scons/msvc_sa.py
+++ /dev/null
@@ -1,173 +0,0 @@
-"""msvc_sa
-
-Tool-specific initialization for Microsoft Visual C/C++.
-
-Based on SCons.Tool.msvc, without the MSVS detection.
-
-"""
-
-#
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 The SCons Foundation
-#
-# Permission is hereby granted, free of charge, to any person obtaining
-# a copy of this software and associated documentation files (the
-# "Software"), to deal in the Software without restriction, including
-# without limitation the rights to use, copy, modify, merge, publish,
-# distribute, sublicense, and/or sell copies of the Software, and to
-# permit persons to whom the Software is furnished to do so, subject to
-# the following conditions:
-#
-# The above copyright notice and this permission notice shall be included
-# in all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
-# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
-# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-#
-
-import os.path
-import re
-import string
-
-import SCons.Action
-import SCons.Builder
-import SCons.Errors
-import SCons.Platform.win32
-import SCons.Tool
-import SCons.Util
-import SCons.Warnings
-
-CSuffixes = ['.c', '.C']
-CXXSuffixes = ['.cc', '.cpp', '.cxx', '.c++', '.C++']
-
-def validate_vars(env):
- """Validate the PCH and PCHSTOP construction variables."""
- if env.has_key('PCH') and env['PCH']:
- if not env.has_key('PCHSTOP'):
- raise SCons.Errors.UserError, "The PCHSTOP construction must be defined if PCH is defined."
- if not SCons.Util.is_String(env['PCHSTOP']):
- raise SCons.Errors.UserError, "The PCHSTOP construction variable must be a string: %r"%env['PCHSTOP']
-
-def pch_emitter(target, source, env):
- """Adds the object file target."""
-
- validate_vars(env)
-
- pch = None
- obj = None
-
- for t in target:
- if SCons.Util.splitext(str(t))[1] == '.pch':
- pch = t
- if SCons.Util.splitext(str(t))[1] == '.obj':
- obj = t
-
- if not obj:
- obj = SCons.Util.splitext(str(pch))[0]+'.obj'
-
- target = [pch, obj] # pch must be first, and obj second for the PCHCOM to work
-
- return (target, source)
-
-def object_emitter(target, source, env, parent_emitter):
- """Sets up the PCH dependencies for an object file."""
-
- validate_vars(env)
-
- parent_emitter(target, source, env)
-
- if env.has_key('PCH') and env['PCH']:
- env.Depends(target, env['PCH'])
-
- return (target, source)
-
-def static_object_emitter(target, source, env):
- return object_emitter(target, source, env,
- SCons.Defaults.StaticObjectEmitter)
-
-def shared_object_emitter(target, source, env):
- return object_emitter(target, source, env,
- SCons.Defaults.SharedObjectEmitter)
-
-pch_action = SCons.Action.Action('$PCHCOM', '$PCHCOMSTR')
-pch_builder = SCons.Builder.Builder(action=pch_action, suffix='.pch',
- emitter=pch_emitter,
- source_scanner=SCons.Tool.SourceFileScanner)
-res_action = SCons.Action.Action('$RCCOM', '$RCCOMSTR')
-res_builder = SCons.Builder.Builder(action=res_action,
- src_suffix='.rc',
- suffix='.res',
- src_builder=[],
- source_scanner=SCons.Tool.SourceFileScanner)
-SCons.Tool.SourceFileScanner.add_scanner('.rc', SCons.Defaults.CScan)
-
-def generate(env):
- """Add Builders and construction variables for MSVC++ to an Environment."""
- static_obj, shared_obj = SCons.Tool.createObjBuilders(env)
-
- for suffix in CSuffixes:
- static_obj.add_action(suffix, SCons.Defaults.CAction)
- shared_obj.add_action(suffix, SCons.Defaults.ShCAction)
- static_obj.add_emitter(suffix, static_object_emitter)
- shared_obj.add_emitter(suffix, shared_object_emitter)
-
- for suffix in CXXSuffixes:
- static_obj.add_action(suffix, SCons.Defaults.CXXAction)
- shared_obj.add_action(suffix, SCons.Defaults.ShCXXAction)
- static_obj.add_emitter(suffix, static_object_emitter)
- shared_obj.add_emitter(suffix, shared_object_emitter)
-
- env['CCPDBFLAGS'] = SCons.Util.CLVar(['${(PDB and "/Z7") or ""}'])
- env['CCPCHFLAGS'] = SCons.Util.CLVar(['${(PCH and "/Yu%s /Fp%s"%(PCHSTOP or "",File(PCH))) or ""}'])
- env['CCCOMFLAGS'] = '$CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS /c $SOURCES /Fo$TARGET $CCPCHFLAGS $CCPDBFLAGS'
- env['CC'] = 'cl'
- env['CCFLAGS'] = SCons.Util.CLVar('/nologo')
- env['CFLAGS'] = SCons.Util.CLVar('')
- env['CCCOM'] = '$CC $CFLAGS $CCFLAGS $CCCOMFLAGS'
- env['SHCC'] = '$CC'
- env['SHCCFLAGS'] = SCons.Util.CLVar('$CCFLAGS')
- env['SHCFLAGS'] = SCons.Util.CLVar('$CFLAGS')
- env['SHCCCOM'] = '$SHCC $SHCFLAGS $SHCCFLAGS $CCCOMFLAGS'
- env['CXX'] = '$CC'
- env['CXXFLAGS'] = SCons.Util.CLVar('$CCFLAGS $( /TP $)')
- env['CXXCOM'] = '$CXX $CXXFLAGS $CCCOMFLAGS'
- env['SHCXX'] = '$CXX'
- env['SHCXXFLAGS'] = SCons.Util.CLVar('$CXXFLAGS')
- env['SHCXXCOM'] = '$SHCXX $SHCXXFLAGS $CCCOMFLAGS'
- env['CPPDEFPREFIX'] = '/D'
- env['CPPDEFSUFFIX'] = ''
- env['INCPREFIX'] = '/I'
- env['INCSUFFIX'] = ''
-# env.Append(OBJEMITTER = [static_object_emitter])
-# env.Append(SHOBJEMITTER = [shared_object_emitter])
- env['STATIC_AND_SHARED_OBJECTS_ARE_THE_SAME'] = 1
-
- env['RC'] = 'rc'
- env['RCFLAGS'] = SCons.Util.CLVar('')
- env['RCCOM'] = '$RC $_CPPDEFFLAGS $_CPPINCFLAGS $RCFLAGS /fo$TARGET $SOURCES'
- env['BUILDERS']['RES'] = res_builder
- env['OBJPREFIX'] = ''
- env['OBJSUFFIX'] = '.obj'
- env['SHOBJPREFIX'] = '$OBJPREFIX'
- env['SHOBJSUFFIX'] = '$OBJSUFFIX'
-
- env['CFILESUFFIX'] = '.c'
- env['CXXFILESUFFIX'] = '.cc'
-
- env['PCHPDBFLAGS'] = SCons.Util.CLVar(['${(PDB and "/Yd") or ""}'])
- env['PCHCOM'] = '$CXX $CXXFLAGS $CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS /c $SOURCES /Fo${TARGETS[1]} /Yc$PCHSTOP /Fp${TARGETS[0]} $CCPDBFLAGS $PCHPDBFLAGS'
- env['BUILDERS']['PCH'] = pch_builder
-
- if not env.has_key('ENV'):
- env['ENV'] = {}
- if not env['ENV'].has_key('SystemRoot'): # required for dlls in the winsxs folders
- env['ENV']['SystemRoot'] = SCons.Platform.win32.get_system_root()
-
-def exists(env):
- return env.Detect('cl')
-
-# vim:set ts=4 sw=4 et:
diff --git a/scons/winsdk.py b/scons/winsdk.py
deleted file mode 100644
index 255f9c5..0000000
--- a/scons/winsdk.py
+++ /dev/null
@@ -1,139 +0,0 @@
-"""winsdk
-
-Tool-specific initialization for Microsoft Windows SDK.
-
-"""
-
-#
-# Copyright (c) 2001-2007 The SCons Foundation
-# Copyright (c) 2008 Tungsten Graphics, Inc.
-# Copyright (c) 2009 VMware, Inc.
-#
-# Permission is hereby granted, free of charge, to any person obtaining
-# a copy of this software and associated documentation files (the
-# "Software"), to deal in the Software without restriction, including
-# without limitation the rights to use, copy, modify, merge, publish,
-# distribute, sublicense, and/or sell copies of the Software, and to
-# permit persons to whom the Software is furnished to do so, subject to
-# the following conditions:
-#
-# The above copyright notice and this permission notice shall be included
-# in all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
-# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
-# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-#
-
-import os.path
-import platform
-
-import SCons.Errors
-import SCons.Util
-
-import msvc_sa
-import mslib_sa
-import mslink_sa
-
-
-def get_vs_root(env):
- # TODO: Check HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\SxS\VS7
- path = os.path.join(os.getenv('ProgramFiles', r'C:\Program Files'), 'Microsoft Visual Studio 9.0')
- return path
-
-def get_vs_paths(env):
- vs_root = get_vs_root(env)
- if vs_root is None:
- raise SCons.Errors.InternalError, "WINSDK compiler not found"
-
- tool_path = os.path.join(vs_root, 'Common7', 'IDE')
-
- env.PrependENVPath('PATH', tool_path)
-
-def get_vc_root(env):
- # TODO: Check HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\SxS\VC7
- path = os.path.join(os.getenv('ProgramFiles', r'C:\Program Files'), 'Microsoft Visual Studio 9.0', 'VC')
- return path
-
-def get_vc_paths(env):
- vc_root = get_vc_root(env)
- if vc_root is None:
- raise SCons.Errors.InternalError, "WINSDK compiler not found"
-
- target_cpu = env['machine']
-
- if target_cpu in ('generic', 'x86'):
- bin_dir = 'bin'
- lib_dir = 'lib'
- elif target_cpu == 'x86_64':
- # TODO: take in consideration the host cpu
- bin_dir = r'bin\x86_amd64'
- lib_dir = r'lib\amd64'
- else:
- raise SCons.Errors.InternalError, "Unsupported target machine"
- include_dir = 'include'
-
- exe_path = os.path.join(vc_root, bin_dir)
- include_path = os.path.join(vc_root, include_dir)
- lib_path = os.path.join(vc_root, lib_dir)
-
- env.PrependENVPath('INCLUDE', include_path)
- env.PrependENVPath('LIB', lib_path)
- env.PrependENVPath('PATH', exe_path)
-
-def get_sdk_root(env):
- if SCons.Util.can_read_reg:
- key = r'SOFTWARE\Microsoft\Microsoft SDKs\Windows\CurrentInstallFolder'
- try:
- path, t = SCons.Util.RegGetValue(SCons.Util.HKEY_LOCAL_MACHINE, key)
- except SCons.Util.RegError:
- pass
- else:
- return path
-
- return None
-
-def get_sdk_paths(env):
- sdk_root = get_sdk_root(env)
- if sdk_root is None:
- raise SCons.Errors.InternalError, "WINSDK not found"
-
- target_cpu = env['machine']
-
- bin_dir = 'Bin'
- if target_cpu in ('generic', 'x86'):
- lib_dir = 'Lib'
- elif target_cpu == 'x86_64':
- lib_dir = 'Lib/x64'
- else:
- raise SCons.Errors.InternalError, "Unsupported target machine"
- include_dir = 'Include'
-
- exe_path = os.path.join(sdk_root, bin_dir)
- include_path = os.path.join(sdk_root, include_dir)
- lib_path = os.path.join(sdk_root, lib_dir)
-
- env.PrependENVPath('INCLUDE', include_path)
- env.PrependENVPath('LIB', lib_path)
- env.PrependENVPath('PATH', exe_path)
-
-def generate(env):
- if not env.has_key('ENV'):
- env['ENV'] = {}
-
- get_vs_paths(env)
- get_vc_paths(env)
- get_sdk_paths(env)
-
- msvc_sa.generate(env)
- mslib_sa.generate(env)
- mslink_sa.generate(env)
-
-def exists(env):
- return get_vc_root(env) is not None and get_sdk_root(env) is not None
-
-# vim:set ts=4 sw=4 et:
diff --git a/src/SConstruct b/src/SConstruct
index 3a91dc7..7150a59 100644
--- a/src/SConstruct
+++ b/src/SConstruct
@@ -38,7 +38,7 @@ vars.Add(EnumVariable('platform', 'target platform', default_platform,
vars.Add(EnumVariable('machine', 'use machine-specific assembly code', default_machine,
allowed_values=('generic', 'ppc', 'x86', 'x86_64')))
vars.Add(EnumVariable('toolchain', 'compiler toolchain', 'default',
- allowed_values=('default', 'crossmingw', 'winsdk')))
+ allowed_values=('default', 'crossmingw')))
vars.Add(PathVariable('prefix', 'installation prefix', default_prefix, PathVariable.PathIsDirCreate))
if platform.machine() == 'win32':
vars.Add(EnumVariable('MSVS_VERSION', 'Microsoft Visual Studio version', None,