6. Building with Visual Studio 2005\r
-----------------------------------\r
\r
-The program vc928.c will convert VC9 build projects into those \r
-needed for Visual Studio 2005 (VC8). It will also convert files \r
-that have been converted in this way back into their original \r
-form. It does this conversion by looking for *.vcproj files \r
-in the current working directory and its sub-directories and \r
-changing the following line in each of them:\r
+The Python program vc98_swap.py will convert VC9 build projects \r
+into those needed for Visual Studio 2005 (VC8). It will also \r
+convert files that have been converted in this way back into their\r
+original form. It does this conversion by looking for *.vcproj \r
+and *.sln files in the current working directory and its sub-directories and changing the following line in each *.vcproj \r
+file:\r
\r
Version="9.00"\r
\r
Version="8.00"\r
\r
or vice versa.\r
+\r
+The lines\r
+\r
+ Microsoft Visual Studio Solution File, Format Version 10.00\r
+ # Visual Studio 2008\r
\r
-It is used by compiling it, placing it in a root build directory \r
-and running it from there. \r
+in *.sln files are changed to:\r
+\r
+ Microsoft Visual Studio Solution File, Format Version 9.00\r
+ # Visual Studio 2005\r
+\r
+or vice versa.\r
\r
-Because it acts recursively on all sub-directories of this directory \r
-it is important not to run it at a directory level in which not all \r
-projects are to be converted.\r
+Because it acts recursively on all sub-directories of this \r
+directory it is important not to run it at a directory level \r
+in which not all projects are to be converted.\r
\r
7. Acknowledgements\r
-------------------\r
\r
I am most grateful for the fantastic support that Peter Johnson,\r
-YASM's creator, has given me in tracking down this issue.\r
+YASM's creator, has given me in tracking down issues in using\r
+YASM for the production of Windows x64 code.\r
\r
- Brian Gladman, 28th March 2008\r
+ Brian Gladman, 10th October 2008\r
--- /dev/null
+\r
+# Convert between Visual Studio 2008 and 2005 Project Files\r
+# (with thanks to Tommi Vainikainen)\r
+\r
+l05 = "# Visual Studio 2005\n"\r
+l08 = "# Visual Studio 2008\n"\r
+l09 = "Microsoft Visual Studio Solution File, Format Version 9.00\n"\r
+l10 = "Microsoft Visual Studio Solution File, Format Version 10.00\n"\r
+\r
+import os, shutil, string, fileinput, sys\r
+\r
+def vcproj_convert(sp) :\r
+ for l in fileinput.input(sp, inplace = 1) :\r
+ p8 = l.find("Version=\"8.00\"")\r
+ p9 = l.find("Version=\"9.00\"")\r
+ if p8 != -1 or p9 != -1 :\r
+ if p8 != -1 :\r
+ l = l[ : p8 + 9] + '9' + l[ p8 + 10 : ]\r
+ else :\r
+ l = l[ : p9 + 9] + '8' + l[ p9 + 10 : ]\r
+ sys.stdout.write(l)\r
+\r
+def sln_convert(sp) :\r
+ cnt = 0\r
+ for l in fileinput.input(sp, inplace = 1) :\r
+ cnt = cnt + 1\r
+ if cnt < 3 :\r
+ p09 = l.find(l09)\r
+ p10 = l.find(l10)\r
+ if p09 != -1 or p10 != -1 :\r
+ if p09 != -1 :\r
+ l = l10\r
+ else :\r
+ l = l09\r
+ p05 = l.find(l05)\r
+ p08 = l.find(l08)\r
+ if p05 != -1 or p08 != -1 :\r
+ if p05 != -1 :\r
+ l = l08\r
+ else :\r
+ l = l05\r
+ sys.stdout.write(l)\r
+\r
+if os.getcwd().endswith('Mkfiles\\vc9') :\r
+ for root, dirs, files in os.walk("./") :\r
+ for file in files :\r
+ if file.endswith(".sln") :\r
+ sln_convert(os.path.join(root, file))\r
+ if file.endswith(".vcproj") :\r
+ vcproj_convert(os.path.join(root, file)) \r
+else :\r
+ print "This script must be run in the 'Mkfiles\vc9' directory"\r