From: Brian Gladman Date: Wed, 8 Oct 2008 08:41:55 +0000 (-0000) Subject: svn path=/trunk/yasm/; revision=2150 X-Git-Tag: v0.8.0~36 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0f79103a3f3d79fdf1bce7e9181aae8e7e056395;p=yasm svn path=/trunk/yasm/; revision=2150 --- diff --git a/Mkfiles/vc9/readme.vc9.txt b/Mkfiles/vc9/readme.vc9.txt index 50cf1616..14b21d69 100644 --- a/Mkfiles/vc9/readme.vc9.txt +++ b/Mkfiles/vc9/readme.vc9.txt @@ -91,12 +91,12 @@ that use absolute addresses. 6. Building with Visual Studio 2005 ----------------------------------- -The program vc928.c will convert VC9 build projects into those -needed for Visual Studio 2005 (VC8). It will also convert files -that have been converted in this way back into their original -form. It does this conversion by looking for *.vcproj files -in the current working directory and its sub-directories and -changing the following line in each of them: +The Python program vc98_swap.py will convert VC9 build projects +into those needed for Visual Studio 2005 (VC8). It will also +convert files that have been converted in this way back into their +original form. It does this conversion by looking for *.vcproj +and *.sln files in the current working directory and its sub-directories and changing the following line in each *.vcproj +file: Version="9.00" @@ -105,18 +105,28 @@ to: Version="8.00" or vice versa. + +The lines + + Microsoft Visual Studio Solution File, Format Version 10.00 + # Visual Studio 2008 -It is used by compiling it, placing it in a root build directory -and running it from there. +in *.sln files are changed to: + + Microsoft Visual Studio Solution File, Format Version 9.00 + # Visual Studio 2005 + +or vice versa. -Because it acts recursively on all sub-directories of this directory -it is important not to run it at a directory level in which not all -projects are to be converted. +Because it acts recursively on all sub-directories of this +directory it is important not to run it at a directory level +in which not all projects are to be converted. 7. Acknowledgements ------------------- I am most grateful for the fantastic support that Peter Johnson, -YASM's creator, has given me in tracking down this issue. +YASM's creator, has given me in tracking down issues in using +YASM for the production of Windows x64 code. - Brian Gladman, 28th March 2008 + Brian Gladman, 10th October 2008 diff --git a/Mkfiles/vc9/vc98_swap.py b/Mkfiles/vc9/vc98_swap.py new file mode 100644 index 00000000..d5237a2f --- /dev/null +++ b/Mkfiles/vc9/vc98_swap.py @@ -0,0 +1,52 @@ + +# Convert between Visual Studio 2008 and 2005 Project Files +# (with thanks to Tommi Vainikainen) + +l05 = "# Visual Studio 2005\n" +l08 = "# Visual Studio 2008\n" +l09 = "Microsoft Visual Studio Solution File, Format Version 9.00\n" +l10 = "Microsoft Visual Studio Solution File, Format Version 10.00\n" + +import os, shutil, string, fileinput, sys + +def vcproj_convert(sp) : + for l in fileinput.input(sp, inplace = 1) : + p8 = l.find("Version=\"8.00\"") + p9 = l.find("Version=\"9.00\"") + if p8 != -1 or p9 != -1 : + if p8 != -1 : + l = l[ : p8 + 9] + '9' + l[ p8 + 10 : ] + else : + l = l[ : p9 + 9] + '8' + l[ p9 + 10 : ] + sys.stdout.write(l) + +def sln_convert(sp) : + cnt = 0 + for l in fileinput.input(sp, inplace = 1) : + cnt = cnt + 1 + if cnt < 3 : + p09 = l.find(l09) + p10 = l.find(l10) + if p09 != -1 or p10 != -1 : + if p09 != -1 : + l = l10 + else : + l = l09 + p05 = l.find(l05) + p08 = l.find(l08) + if p05 != -1 or p08 != -1 : + if p05 != -1 : + l = l08 + else : + l = l05 + sys.stdout.write(l) + +if os.getcwd().endswith('Mkfiles\\vc9') : + for root, dirs, files in os.walk("./") : + for file in files : + if file.endswith(".sln") : + sln_convert(os.path.join(root, file)) + if file.endswith(".vcproj") : + vcproj_convert(os.path.join(root, file)) +else : + print "This script must be run in the 'Mkfiles\vc9' directory"