--- a.msvc9compiler.py 2009-12-19 16:20:24.000000000 +0100 +++ b.msvc9compiler.py 2009-12-19 17:20:50.000000000 +0100 @@ -206,7 +206,7 @@ newVariable = os.pathsep.join(newList) return newVariable -def find_vcvarsall(version): +def find_vcvarsall(version, arch): """Find the vcvarsall.bat file At first it tries to find the productdir of VS 2008 in the registry. If @@ -235,6 +235,20 @@ if not productdir: log.debug("No productdir found") return None + + f = os.path.join(productdir, "bin\\amd64\\vcvarsamd64.bat") + if arch in ["amd64", "x86_amd64", "x86_ia64"] and not os.path.isfile(f): + # Visual Studio Express with SDK 64-bit tools, workaround + # for broken paths in vcvarsall.bat. + path = "bin\\vcvars64.bat" + if arch != "amd64": + path = "bin\\vcvars" + arch + ".bat" + f = os.path.join(productdir, path) + if not os.path.isfile(f): + raise ValueError("Visual Studio Express: need 64-bit " + "tools from the SDK") + return f + vcvarsall = os.path.join(productdir, "vcvarsall.bat") if os.path.isfile(vcvarsall): return vcvarsall @@ -244,7 +258,7 @@ def query_vcvarsall(version, arch="x86"): """Launch vcvarsall.bat and read the settings from its environment """ - vcvarsall = find_vcvarsall(version) + vcvarsall = find_vcvarsall(version, arch) interesting = set(("include", "lib", "libpath", "path")) result = {}