diff --git a/Lib/distutils/msvc9compiler.py b/Lib/distutils/msvc9compiler.py
--- a/Lib/distutils/msvc9compiler.py
+++ b/Lib/distutils/msvc9compiler.py
@@ -424,10 +424,16 @@ class MSVCCompiler(CCompiler) :
                                           '/Z7', '/D_DEBUG']
 
         self.ldflags_shared = ['/DLL', '/nologo', '/INCREMENTAL:NO']
+        if self.__version >= 10:
+            self.ldflags_shared = ['/DLL', '/nologo', '/INCREMENTAL:NO', '/Manifest']
         if self.__version >= 7:
             self.ldflags_shared_debug = [
                 '/DLL', '/nologo', '/INCREMENTAL:no', '/DEBUG', '/pdb:None'
                 ]
+        if self.__version >= 10:
+            self.ldflags_shared_debug = [
+                '/DLL', '/nologo', '/INCREMENTAL:no', '/DEBUG', '/pdb:None', '/Manifest'
+                ]
         self.ldflags_static = [ '/nologo']
 
         self.initialized = True

Add 'msvc9compiler' patch to support VS10
Add 'msvc9compiler' patch to support VS10

This patch should be applied to 'msvc9compiler.py' in order to allow
successful compilation of python module (for example numpy) using recent
version of visual studio (VS10 and above).

The issue has been discussed here:

   http://bugs.python.org/issue16296


It solves the following error occurring when building Numpy:

// -------------------------------------------------------
c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\amd64\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -Inumpy\cor
e\src\private -Inumpy\core\src -Inumpy\core -Inumpy\core\src\npymath -Inumpy\core\src\multiarray -Inumpy\core\src\umath
-Inumpy\core\include -IC:\P\SarrpTPS-64-R\Slicer-build\python-install\include -IC:\P\SarrpTPS-64-R\Slicer-build\python-i
nstall\PC /Tc_configtest.c /Fo_configtest.obj
Found executable c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\amd64\cl.exe
c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\amd64\link.exe /nologo /INCREMENTAL:NO _configtest.obj /OUT:_
configtest.exe /MANIFESTFILE:_configtest.exe.manifest
Found executable c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\amd64\link.exe
mt.exe -nologo -manifest _configtest.exe.manifest -outputresource:_configtest.exe;1
Found executable C:\Program Files\Microsoft SDKs\Windows\v7.1\bin\x64\mt.exe

_configtest.exe.manifest : general error c1010070: Failed to load and parse the manifest. The system cannot find the fil
e specified.
failure.
removing: _configtest.c _configtest.obj
Traceback (most recent call last):
  File "setup.py", line 187, in <module>
    setup_package()
  File "setup.py", line 180, in setup_package
    configuration=configuration )
  File "C:\P\SarrpTPS-64-R\Slicer-build\NUMPY\numpy\distutils\core.py", line 186, in setup
    return old_setup(**new_attr)
  File "C:\P\SarrpTPS-64-R\Slicer-build\python-install\Lib\distutils\core.py", line 152, in setup
    dist.run_commands()
  File "C:\P\SarrpTPS-64-R\Slicer-build\python-install\Lib\distutils\dist.py", line 953, in run_commands
    self.run_command(cmd)
  File "C:\P\SarrpTPS-64-R\Slicer-build\python-install\Lib\distutils\dist.py", line 972, in run_command
    cmd_obj.run()
  File "C:\P\SarrpTPS-64-R\Slicer-build\NUMPY\numpy\distutils\command\build.py", line 37, in run
    old_build.run(self)
  File "C:\P\SarrpTPS-64-R\Slicer-build\python-install\Lib\distutils\command\build.py", line 127, in run
    self.run_command(cmd_name)
  File "C:\P\SarrpTPS-64-R\Slicer-build\python-install\Lib\distutils\cmd.py", line 326, in run_command
    self.distribution.run_command(command)
  File "C:\P\SarrpTPS-64-R\Slicer-build\python-install\Lib\distutils\dist.py", line 972, in run_command
    cmd_obj.run()
  File "C:\P\SarrpTPS-64-R\Slicer-build\NUMPY\numpy\distutils\command\build_src.py", line 152, in run
    self.build_sources()
  File "C:\P\SarrpTPS-64-R\Slicer-build\NUMPY\numpy\distutils\command\build_src.py", line 163, in build_sources
    self.build_library_sources(*libname_info)
  File "C:\P\SarrpTPS-64-R\Slicer-build\NUMPY\numpy\distutils\command\build_src.py", line 298, in build_library_sources
    sources = self.generate_sources(sources, (lib_name, build_info))
  File "C:\P\SarrpTPS-64-R\Slicer-build\NUMPY\numpy\distutils\command\build_src.py", line 385, in generate_sources
    source = func(extension, build_dir)
  File "numpy\core\setup.py", line 657, in get_mathlib_info
    raise RuntimeError("Broken toolchain: cannot link a simple C program")
RuntimeError: Broken toolchain: cannot link a simple C program
// -------------------------------------------------------


Note that an alternative approach consisting in changing

   mfinfo = self.manifest_get_embed_info(target_desc, ld_args)

into

   mfinfo = None

has also been discussed here:

  http://mail.scipy.org/pipermail/numpy-discussion/2012-November/064488.html
