summaryrefslogtreecommitdiffstats
path: root/Lib/distutils/command
diff options
context:
space:
mode:
authorChristian Heimes <christian@cheimes.de>2007-12-03 13:47:29 (GMT)
committerChristian Heimes <christian@cheimes.de>2007-12-03 13:47:29 (GMT)
commit3305c52de76821ec03db37c8afa81eb017eedb07 (patch)
treebfc39d80ad7220631f1fe8840097f2be13781d54 /Lib/distutils/command
parentef01d822aaea11ae25f78cb0be32865a5df07620 (diff)
downloadcpython-3305c52de76821ec03db37c8afa81eb017eedb07.zip
cpython-3305c52de76821ec03db37c8afa81eb017eedb07.tar.gz
cpython-3305c52de76821ec03db37c8afa81eb017eedb07.tar.bz2
Applied my patch #1455 with some extra fixes for VS 2005
The new msvc9compiler module supports VS 2005 and VS 2008. I've also fixed build_ext to support PCbuild8 and PCbuild9 and backported my fix for xxmodule.c from py3k. The old code msvccompiler is still in place in case somebody likes to build an extension with VS 2003 or earlier. I've also updated the cygwin compiler module for VS 2005 and VS 2008. It works with VS 2005 but I'm unable to test it with VS 2008. We have to wait for a new version of cygwin.
Diffstat (limited to 'Lib/distutils/command')
-rw-r--r--Lib/distutils/command/build_ext.py14
1 files changed, 13 insertions, 1 deletions
diff --git a/Lib/distutils/command/build_ext.py b/Lib/distutils/command/build_ext.py
index 12d4083..ecfa177 100644
--- a/Lib/distutils/command/build_ext.py
+++ b/Lib/distutils/command/build_ext.py
@@ -17,6 +17,10 @@ from distutils.dep_util import newer_group
from distutils.extension import Extension
from distutils import log
+if os.name == 'nt':
+ from distutils.msvccompiler import get_build_version
+ MSVC_VERSION = int(get_build_version())
+
# An extension name is just a dot-separated list of Python NAMEs (ie.
# the same as a fully-qualified module name).
extension_name_re = re.compile \
@@ -176,7 +180,15 @@ class build_ext (Command):
# Append the source distribution include and library directories,
# this allows distutils on windows to work in the source tree
self.include_dirs.append(os.path.join(sys.exec_prefix, 'PC'))
- self.library_dirs.append(os.path.join(sys.exec_prefix, 'PCBuild'))
+ if MSVC_VERSION == 9:
+ self.library_dirs.append(os.path.join(sys.exec_prefix,
+ 'PCBuild9'))
+ elif MSVC_VERSION == 8:
+ self.library_dirs.append(os.path.join(sys.exec_prefix,
+ 'PCBuild8', 'win32release'))
+ else:
+ self.library_dirs.append(os.path.join(sys.exec_prefix,
+ 'PCBuild'))
# OS/2 (EMX) doesn't support Debug vs Release builds, but has the
# import libraries in its "Config" subdirectory