[cairo-commit] [cairo-www] src/end_to_end_build_for_win32.mdwn
Carl Worth
cworth at freedesktop.org
Mon Nov 2 15:33:18 PST 2009
src/end_to_end_build_for_win32.mdwn | 29 +++++++++++++++++++++--------
1 file changed, 21 insertions(+), 8 deletions(-)
New commits:
commit b5b58cbd4daf9ec199b1b54fc0b4e85d1d4e9dde
Author: travisgriggs <travisgriggs at web>
Date: Mon Nov 2 15:33:18 2009 -0800
diff --git a/src/end_to_end_build_for_win32.mdwn b/src/end_to_end_build_for_win32.mdwn
index dcf1155..a4c81a1 100644
--- a/src/end_to_end_build_for_win32.mdwn
+++ b/src/end_to_end_build_for_win32.mdwn
@@ -37,13 +37,15 @@ Make sure curl is in your path.
You don't technically need this. You can download the links to your build directory interactively using your favorite web browser. If you're not interesting in scripting it up, doing that is probably lighter weight than installing curl, unless you've just been waiting for a reason to do so.
-### Open a command shell
+### Open a command shell/Setup environment
Open cmd32.exe. We'll use a command shell from here on out. If you need to close this and start again, you'll need to reproduce any of the environment variable settings we setup in here.
set PATH=%PATH%;C:\Program Files\msys\bin
-(adjust appended path as fits your installation)
+ "%VS90COMNTOOLS%/vsvars32.bat"
+
+(adjust appended path as fits your installation; quotation marks on second command are necessary if you have spaces in said path)
### Create/Clean/Set Build Directory
@@ -75,17 +77,28 @@ Use curl to download FOUR tarballs: zlib, libpng, pixman, cairo. Adjust specific
Why the last 4 move commands? The default directory names are things like pixman-0.1.16 (version numbers included in the name). Some of the packages have compile paths dependent on the simpler names. So we do all 4 of them to keep them simple and consistent.
-### Setup Compilation Environment
+### Build zlib
-This is a single step. Visual C++ Express has a .bat file we can run to get various environment variables set for compiling. If you're using a different version of Microsoft tools, you'll need to locate and run that .bat here.
+Zlib has a project (vcproj_ file, but only for old Visual C++ 6.0 versions. Our free version of Visual Studio 2009 won't upgrade it. Fortunately, the libpng project, is nice enough to include a project file that is new enough for our free version. So we create a directory for it, and copy it over:
- "%VS90COMNTOOLS%/vsvars32.bat"
+ mkdir %ROOTDIR%\zlib\projects\visualc71
+ cd %ROOTDIR%\zlib\projects\visualc71
+ copy %ROOTDIR%\libpng\projects\visualc71\zlib.vcproj .
-(The quotation marks are important if you have spaces anywhere in your path).
+Now we can upgrade it. This does whatever needs to happen so we can build it with our new and free version of Express.
-### Build zlib
+ vcbuild /upgrade zlib.vcproj
-In progress
+Our next problem is, that the project file, by default is configured to build with the /MD option, which means it will be dynamically linked to the Microsoft runtime. This will be a problem if it links to the current MS runtime library, because target deployment machines won't necessarily have that specific version. There is no real dependency on a particular version. So it's easier to compile that statically in. It doesn't make the library that much bigger.
+
+"Now patch the proj file to build MT (static) instead of MD (dynamic)"
+projFile := zlibDir / 'projects' / 'visualc71' / 'zlib.vcproj'.
+proj := projFile contentsOfEntireFile copyWithRegex: 'RuntimeLibrary="2"' matchesReplacedWith: 'RuntimeLibrary="0"'.
+projFile contentsOfEntireFile: proj.
+
+Finally build it
+
+ vcbuild zlib.vcproj LIB Release
### Build libpng
More information about the cairo-commit
mailing list