diff options
author | Zachary Ware <zachary.ware@gmail.com> | 2015-07-16 05:24:48 (GMT) |
---|---|---|
committer | Zachary Ware <zachary.ware@gmail.com> | 2015-07-16 05:24:48 (GMT) |
commit | 4734372aa0c7ae481bb6b9de0b5c3f9323c670fd (patch) | |
tree | 256a901ba2990cd1427852a2c9a83fc0313fd003 /PC/VS9.0/vs9to8.py | |
parent | 10c997ae9c522e323fe430ef67507376fad835b3 (diff) | |
download | cpython-4734372aa0c7ae481bb6b9de0b5c3f9323c670fd.zip cpython-4734372aa0c7ae481bb6b9de0b5c3f9323c670fd.tar.gz cpython-4734372aa0c7ae481bb6b9de0b5c3f9323c670fd.tar.bz2 |
Close #24508: Backport the 3.5 MSBuild project files.
The old project files move to PC/VS9.0 and remain supported.
VS2008 is still required to build 2.7; VS2010 (or later, plus Windows SDK 7.1)
is *also* required to use the new project files.
Diffstat (limited to 'PC/VS9.0/vs9to8.py')
-rw-r--r-- | PC/VS9.0/vs9to8.py | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/PC/VS9.0/vs9to8.py b/PC/VS9.0/vs9to8.py new file mode 100644 index 0000000..a4e6801 --- /dev/null +++ b/PC/VS9.0/vs9to8.py @@ -0,0 +1,36 @@ +from __future__ import with_statement +import os + +def vs9to8(src, dest): + for name in os.listdir(src): + path, ext = os.path.splitext(name) + if ext.lower() not in ('.sln', '.vcproj', '.vsprops'): + continue + + filename = os.path.normpath(os.path.join(src, name)) + destname = os.path.normpath(os.path.join(dest, name)) + print("%s -> %s" % (filename, destname)) + + with open(filename, 'rU') as fin: + lines = fin.read() + lines = lines.replace('Version="9,00"', 'Version="8.00"') + lines = lines.replace('Version="9.00"', 'Version="8.00"') + lines = lines.replace('Format Version 10.00', 'Format Version 9.00') + lines = lines.replace('Visual Studio 2008', 'Visual Studio 2005') + + lines = lines.replace('wininst-9.0', 'wininst-8.0') + lines = lines.replace('..\\', '..\\..\\') + lines = lines.replace('..\\..\\..\\..\\', '..\\..\\..\\') + + # Bah. VS8.0 does not expand macros in file names. + # Replace them here. + lines = lines.replace('$(sqlite3Dir)', '..\\..\\..\\sqlite-3.6.21') + lines = lines.replace('$(bsddbDir)\\..\\..', '..\\..\\..\\db-4.7.25.0\\build_windows\\..') + lines = lines.replace('$(bsddbDir)', '..\\..\\..\\db-4.7.25.0\\build_windows') + + with open(destname, 'wb') as fout: + lines = lines.replace("\n", "\r\n") + fout.write(lines) + +if __name__ == "__main__": + vs9to8(src=".", dest="../PC/VS8.0") |