root/trunk/llmozlib2/README-win32.txt

Revision 19, 13.9 kB (checked in by nyx.linden, 1 year ago)

Updated win32 instructions to add a version for building on Visual Studio 2005 (vc8) in preparation for switchover.

Line 
1 Getting, patching, building and using LLMozLib2 on the Windows platform
2 =======================================================================
3
4
5 Table of Contents
6
7 A. Getting, Patching and Building using Microsoft Visual Studio 2005 (vc8)
8 B. Getting, Patching and Building using Microsoft Visual Studio 2003 (vc7.1)
9
10 ========================================================================
11
12 A. Getting, Patching and Building using Microsoft Visual Studio 2005 (vc8)
13 These instructions describe how to build the Windows version of LLMozlib2 for use within the Second Life client. THey have been tested using Microsoft Visual Studio 2005 (vc8) - instructions for 2003 (vc7.1) can be found later in this document. Other versions may work but not have been tried or tested.
14
15 LLMozLib2 currently uses code from 1.8.1.x branc of the mozilla codebase -similar to Firefox 2.0. Officially, compiling this version of mozilla with Visual Studio 2005 is not supported. However, with a few adjustments, it is possible. As of the time of this writing, Visual Studio 2005 is the officially supported development environment of Linden Lab. Instructions for using Visual Studio 2003 are included at the end of this document for historical and compatibility purposes.
16
17 Here are the steps necessary to get, patch, and build LLMozlib2 from a standard development setup:
18
19 1. Prepare the Mozilla prerequisites.
20
21 1.a. Install Cygwin with a minimum of the following packages:
22  * ash
23  * coreutils
24  * diffutils
25  * findutils
26  * gawk
27  * grep
28  * libiconv
29  * make 3.80 (NOT 3.81)
30  * patchutils
31  * perl
32  * sed
33  * unzip
34  * zip
35
36 The default cygwin installer no longer has access to make 3.80. As such, you can get it from paracoda (http://cygwin.paracoda.com/release/make/make-3.80-1.tar.bz2).
37 To install, untar this archive into your cygwin/bin directory.
38
39 If you have any difficulty with this step or wish to get more details about the packages, please refer to http://developer.mozilla.org/en/docs/Windows_Build_Prerequisites
40
41 1.b. Download and install mozilla-build and moztools
42
43 The Mozilla-build package contains all of the essential tools for building mozilla. Download it at http://ftp.mozilla.org/pub/mozilla.org/mozilla/libraries/win32/MozillaBuildSetup-1.3.exe
44
45 This guide was written based on the 1.3 version of mozilla-build. In order to check for a more up to date version, check http://developer.mozilla.org/en/Windows_Build_Prerequisites
46
47 Next, download the static version of moztools. You can download the archive at http://ftp.mozilla.org/pub/mozilla.org/mozilla/libraries/win32/moztools-static.zip
48 When unzipping, be certain to preserve the directory structure. It is easiest to place the extracted directory in C:\mozilla-build\moztools. If you decide to leave this directory elsewhere, be certain to set the environment variable MOZ_TOOLS.
49
50 If you have any difficulty getting moztools downloaded or installed, please refer to http://developer.mozilla.org/en/Windows_Build_Prerequisites_on_the_1.7_and_1.8_Branches
51
52 1.c. Download and install the Windows Platform SDK
53
54 It is recommended to use the windows SDK for Windows Vista located at:
55 http://www.microsoft.com/downloads/details.aspx?familyid=4377F86D-C913-4B5C-B87E-EF72E5B4E065&displaylang=en
56
57 However, the Windows Server 2003 SP1 platform SDK has also been successfully used.
58
59 2. Checkout LLMozlib2 from Linden Labs
60 As of the time of this writing, the latest version of LLMozlib2 is available via SVN checkout at:
61 https://svn.secondlife.com/svn/llmozlib/trunk/llmozlib2
62
63 Use your favorite SVN client software to download this branch to your local machine.
64
65 3. Open an MSYS console and obtain the mozilla source
66 Run start-msvc8.bat located in C:\mozilla-build to start a MSYS console. Continue using this console for any console commands for the rest of this document until specified otherwise. If you have difficulty opening the console, consult the windows build prerequisites pages for mozilla, located at
67
68 http://developer.mozilla.org/en/Windows_Build_Prerequisites
69
70 and
71
72 http://developer.mozilla.org/en/Windows_Build_Prerequisites_on_the_1.7_and_1.8_Branches
73
74 Once you have your MSYS console open, execute the following commands to check out the client.mk file to your C:\mozilla directory. NOTE: this will fail if the directory C:\mozilla exists. Please delete this folder and its contents if it already exists.
75
76         cd /c
77         export CVSROOT=':pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot'
78         cvs checkout -r FIREFOX_2_0_0_13_RELEASE mozilla/client.mk
79
80 Next, use the client.mk file to obtain the rest of the mozilla source & build tree:
81
82         cd mozilla
83         make -f client.mk checkout MOZ_CO_PROJECT=xulrunner
84
85 This will take a little while. Take your first coffee break while this finishes.
86
87 4. Copy over linden-specific files and patch the mozilla source
88
89 copy the necessary linden-specific files to your C:\mozilla directory from the LLMozLib2 checkout:
90
91  * .mozconfig.debug
92  * .mozconfig.optimized
93  * linden.patch
94
95 Once this is done, apply the patch by executing the following command (still in the MSYS console):
96
97         patch -p0 < linden.patch
98
99 If you get patch errors, verify that you checked out the correct version of Mozilla/gecko.
100
101 5. Build the optimized version of gecko:
102
103 First, set the active config to optimized with the following command:
104
105         cp .mozconfig.optimized .mozconfig
106
107 Next, start the build process:
108
109         make -f client.mk build
110
111 NOTE: this process will take a while, but ultimately will fail, claiming to be unable to find MSVCr80.dll. This is due to one of the issues with compiling gecko 1.8.1 under vc8. However, in the process of attempting the build, the proper manifest files will be generated. To move these files into the correct location, execute the following commands:
112
113         cd objdir-opt-xulrunner-small/
114         find ./ -iname *.exe.manifest -print0 | xargs -0 -t -i cp {} dist/bin
115         cd ..
116
117 Now that the manifest files have been moved into the proper directory, your build should succeed. You should be in the /c/mozilla directory again while running this command (this will take a while):
118
119         make -f client.mk build
120
121 6. Build the debug version of gecko:
122 This is the same process as building the optimized version, but using a different config file and a different object directory. Note the differences:
123
124 First, set the active config to optimized with the following command:
125
126         cp .mozconfig.debug .mozconfig
127
128 Next, start the build process:
129
130         make -f client.mk build
131
132 NOTE: this process will take a while, but ultimately will fail, claiming to be unable to find MSVCr80.dll. This is due to one of the issues with compiling gecko 1.8.1 under vc8. However, in the process of attempting the build, the proper manifest files will be generated. To move these files into the correct location, execute the following commands:
133
134         cd objdir-debug-xulrunner-small/
135         find ./ -iname *.exe.manifest -print0 | xargs -0 -t -i cp {} dist/bin
136         cd ..
137
138 Now that the manifest files have been moved into the proper directory, your build should succeed. You should be in the /c/mozilla directory again while running this command (this will take a while):
139
140         make -f client.mk build
141
142 7. Unify the runtime libraries for both builds (this will improve runtime performance)
143
144 First, unify the libraries for the optimized build:
145
146         cd /c/mozilla/objdir-opt-xulrunner-small/dist/bin/
147         ./xpt_link all.tmp components/*.xpt
148         rm components/*.xpt
149         mv all.tmp components/all.xpt
150        
151 Next, do the same for the debug build:
152
153         cd /c/mozilla/objdir-debug-xulrunner-small/dist/bin/
154         ./xpt_link all.tmp components/*.xpt
155         rm components/*.xpt
156         mv all.tmp components/all.xpt
157
158 8. copy results of mozilla/gecko build to LLMozLib2
159
160 From a windows command prompt, run the batch file labeled copy_products_windows.bat from the LLMozLib2 directory.
161 NOTE: the script assumes you used C:\mozilla\ to checkout and build gecko.
162
163 9. Build LLMozlib2
164
165 Open the solution named llmozlib2_vc8.sln and proceed to build BOTH the debug and release versions in the normal fashion.
166
167 NOTE: If you would like to update both the vc8 and vc7 versions of the library, get both versions to compile up to this point before proceeding.
168
169 NOTE: LLMozLib2 must successfully compile - the other two projects in the solution are sample programs for testing LLMozlib and are not required in order to use LLMozLib2 in the SecondLife viewer.
170
171 10. Copy LLMozLib2 products to the branch of your viewer
172
173 First, edit the batch file called copy_llmozlib2_to_branch.bat located in your LLMozlib2 checkout.
174 You should only have to modify the second line, which sets a variable called DEST_DIR which should point to the root folder of your viewer source checkout (the root folder not indra).
175
176 Then, run this batch file from a windows command prompt from the LLMozLib2 checkout directory to copy the products of LLMozLib2 to your viewer source checkout.
177
178 11. Compile the viewer and test your configuration
179
180 Now you are ready to compile the viewer. If you have already built the viewer, you need to at least ensure the windows libraries are copied to the correct location and re-link the viewer. However, a full rebuild is recommended.
181
182 If your newly-compiled viewer brings up the main window of the login screen properly, then it is correctly finding and utilizing LLMozlib2.
183
184
185 ========================================================================
186
187
188 B. Getting, Patching and Building using Microsoft Visual Studio 2003 (vc7.1)
189
190         These instructions describe how to build the Windows version of LLMozLib2 for use within the Second Life client. They have been tested using Microsoft Visual Studio 2003 (v7.1) - other versions of the Microsoft compiler may also work but they have not been tried or tested.
191
192 LLMozLib2 currently uses code from the 1.8.1.x branch of the Mozilla codebase - somewhat similar to what is used in Firefox 2.0.
193
194 Here are the steps you need to take to set up your build environment, get the Mozilla source, patch it, build it and copy it to the right place in the LLMozLib2 source tree. After that, you can build LLMozLib2 normally using the Visual Studio solution file.
195
196 * Checkout llmozlib2 from the Second Life public SVN repository: https://svn.secondlife.com/svn/llmozlib/trunk/llmozlib2/
197
198 * Follow the instructions on the Mozilla Windows Build Prerequisites page - http://developer.mozilla.org/en/docs/Windows_Build_Prerequisites
199
200 * Typically this consists of downloading and installing the MozillaBuild package into C:\mozilla-build - refer to the Web page for details since it's likely this will change over time and that page will obviously always have the most recent version.
201
202 * Get to an MSYS command prompt as per instructions described in the aforementioned Web page.
203
204 * Change directory to the MSYS /c drive (the C: drive in Windows)
205
206    cd /c
207
208 * Checkout the Mozilla configuration file
209
210     export CVSROOT=':pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot'
211     cvs checkout -r FIREFOX_2_0_0_13_RELEASE mozilla/client.mk
212    
213     Notes:  * replace the FIREFOX_2_0_0_13_RELEASE tag with one that refers to the version you want
214             * the CVS password is 'anonymous'
215    
216 * Change to the directory you checked out in
217
218     cd mozilla
219
220 * Checkout the source code
221
222     make -f client.mk checkout MOZ_CO_PROJECT=xulrunner
223
224 * Copy the following files from the llmozlib2/build_mozilla directory into the C:\mozilla directory you just checked out
225
226     * .mozconfig.debug
227     * .mozconfig.optimized
228     * linden.patch
229
230 * Patch the Mozilla source with the Linden patch
231
232     patch -p0 < linden.patch
233
234 * Copy over the .mozconfig file for the optimized (release) build
235
236     cp .mozconfig.optimized .mozconfig
237
238 * Start a build:
239
240     make -f client.mk build
241
242 * Wait - takes about 20 minutes on a typical development system
243
244 * Copy over the .mozconfig file for the debug build
245
246     cp .mozconfig.debug .mozconfig
247
248 * Start a build:
249
250     make -f client.mk build
251
252 * Wait - takes about 40 minutes on a typical development system
253
254 * Unify the Mozilla runtime type libraries - convert the *.xpt files into a single, unified one - improves startup time considerably.
255
256     * Using the MSYS shell from the /c/mozilla/objdir-opt-xulrunner-small/dist/bin directory:
257
258         ./xpt_link all.tmp components/*.xpt
259         rm components/*.xpt
260         mv all.tmp components/all.xpt
261
262     * Using the MSYS shell from the /c/mozilla/objdir-debug-xulrunner-small/dist/bin directory:
263
264         ./xpt_link all.tmp components/*.xpt
265         rm components/*.xpt
266         mv all.tmp components/all.xpt
267
268 * Copy over the necessary Mozilla files into the LLMozLib2 directory
269
270     copy_products_windows.bat
271    
272     Note: (run from the LLMozLib2 directory)
273
274 * Build LLMozLib2 using Microsoft Visual Studio 2003 (v7.1)
275
276     Open the LLMozLib2 solution file llmozlib2.sln.
277
278 * Build the LLMozLib Debug and Release configurations in the normal fashion.
279
280 * Copy the LLMozLib2 files to the Second Life client branch
281
282     copy_llmozlib2_to_branch.bat
283    
284     Note1: (run from the LLMozLib2 directory)
285     Note2: (edit the batch file to reflect the branch you want to copy to)
286
287 * That completes the process - you should now have a new set of LLMozLib2/Mozilla runtime files in the branch you specified. The files that are copied are:
288     * Header file (llmozlib2.h) in libraries\include\
289     * Static library (llmozlib2.lib) (debug) in libraries\i686-win32\lib_debug\
290     * Static library (llmozlib2d.lib) (release) in libraries\i686-win32\lib_release\
291     * DLLs (debug) in libraries\i686-win32\lib_debug\
292     * DLLs (release) in libraries\i686-win32\lib_release\
293     * Runtime misc files (debug) in indra\newview\app_settings\mozilla_debug\
294     * Runtime misc files (release) in indra\newview\app_settings\mozilla_release\
295
296 * If you want to experiment with the test applications (uBrowser, testGL for example), you can change the startup project in Visual Studio and build the one you want. A separate document in this directory contains notes on using each test app.
297
298 ---- end of doc ----
Note: See TracBrowser for help on using the browser.