Windows manifest changes based upon architecture

Apparently, using * for the architecture has the potential to not work on
on some amd64 systems.  Added checks and split the manifest based upon
architecture.
This commit is contained in:
Jason Erickson 2011-02-11 10:01:38 -07:00
parent da68119f7c
commit 560f52106c
3 changed files with 23 additions and 2 deletions

View File

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
<security>
<requestedPrivileges>
<requestedExecutionLevel level="asInvoker" uiAccess="false"></requestedExecutionLevel>
</requestedPrivileges>
</security>
</trustInfo>
<dependency>
<dependentAssembly>
<assemblyIdentity type="win32" name="Microsoft.VC90.CRT" version="9.0.21022.8" processorArchitecture="amd64" publicKeyToken="1fc8b3b9a1e18e3b"></assemblyIdentity>
</dependentAssembly>
</dependency>
</assembly>

View File

@ -9,7 +9,7 @@
</trustInfo> </trustInfo>
<dependency> <dependency>
<dependentAssembly> <dependentAssembly>
<assemblyIdentity type="win32" name="Microsoft.vc90.CRT" version="9.0.21022.8" processorArchitecture="*" publicKeyToken="1fc8b3b9a1e18e3b"></assemblyIdentity> <assemblyIdentity type="win32" name="Microsoft.VC90.CRT" version="9.0.21022.8" processorArchitecture="x86" publicKeyToken="1fc8b3b9a1e18e3b"></assemblyIdentity>
</dependentAssembly> </dependentAssembly>
</dependency> </dependency>
</assembly> </assembly>

View File

@ -55,6 +55,7 @@ from distutils.command.build_ext import build_ext
from distutils.sysconfig import get_python_inc from distutils.sysconfig import get_python_inc
from distutils.ccompiler import get_default_compiler from distutils.ccompiler import get_default_compiler
from distutils.dep_util import newer_group from distutils.dep_util import newer_group
from distutils.util import get_platform
try: try:
from distutils.command.build_py import build_py_2to3 as build_py from distutils.command.build_py import build_py_2to3 as build_py
except ImportError: except ImportError:
@ -158,8 +159,13 @@ class psycopg_build_ext(build_ext):
sysVer = sys.version_info[:2] sysVer = sys.version_info[:2]
if self.get_compiler().lower().startswith('msvc') and \ if self.get_compiler().lower().startswith('msvc') and \
sysVer in ((2,6), (2,7)): sysVer in ((2,6), (2,7)):
platform = get_platform()
# Default to the x86 manifest
manifest = '_psycopg.vc9.x86.manifest'
if platform == 'win-amd64':
manifest = '_psycopg.vc9.amd64.manifest'
self.compiler.spawn(['mt.exe', '-nologo', '-manifest', self.compiler.spawn(['mt.exe', '-nologo', '-manifest',
os.path.join('psycopg', '_psycopg.vc9.manifest'), os.path.join('psycopg', manifest),
'-outputresource:%s;2' % (os.path.join(self.build_lib, 'psycopg2', '_psycopg.pyd'))]) '-outputresource:%s;2' % (os.path.join(self.build_lib, 'psycopg2', '_psycopg.pyd'))])
def finalize_win32(self): def finalize_win32(self):