Show
Ignore:
Timestamp:
09/17/08 15:39:01 (1 year ago)
Author:
nyx.linden
Message:

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

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/llmozlib2/README-win32.txt

    r11 r19  
    22======================================================================= 
    33 
    4 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. 
     4 
     5Table of Contents 
     6 
     7A. Getting, Patching and Building using Microsoft Visual Studio 2005 (vc8) 
     8B. Getting, Patching and Building using Microsoft Visual Studio 2003 (vc7.1) 
     9 
     10======================================================================== 
     11 
     12A. Getting, Patching and Building using Microsoft Visual Studio 2005 (vc8) 
     13These 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 
     15LLMozLib2 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 
     17Here are the steps necessary to get, patch, and build LLMozlib2 from a standard development setup: 
     18 
     191. Prepare the Mozilla prerequisites. 
     20 
     211.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 
     36The 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). 
     37To install, untar this archive into your cygwin/bin directory. 
     38 
     39If 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 
     411.b. Download and install mozilla-build and moztools 
     42 
     43The 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 
     45This 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 
     47Next, 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 
     48When 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 
     50If 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 
     521.c. Download and install the Windows Platform SDK 
     53 
     54It is recommended to use the windows SDK for Windows Vista located at: 
     55http://www.microsoft.com/downloads/details.aspx?familyid=4377F86D-C913-4B5C-B87E-EF72E5B4E065&displaylang=en 
     56 
     57However, the Windows Server 2003 SP1 platform SDK has also been successfully used.  
     58 
     592. Checkout LLMozlib2 from Linden Labs 
     60As of the time of this writing, the latest version of LLMozlib2 is available via SVN checkout at: 
     61https://svn.secondlife.com/svn/llmozlib/trunk/llmozlib2 
     62 
     63Use your favorite SVN client software to download this branch to your local machine. 
     64 
     653. Open an MSYS console and obtain the mozilla source 
     66Run 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 
     68http://developer.mozilla.org/en/Windows_Build_Prerequisites 
     69 
     70and 
     71 
     72http://developer.mozilla.org/en/Windows_Build_Prerequisites_on_the_1.7_and_1.8_Branches 
     73 
     74Once 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 
     80Next, 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 
     85This will take a little while. Take your first coffee break while this finishes. 
     86 
     874. Copy over linden-specific files and patch the mozilla source 
     88 
     89copy 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 
     95Once this is done, apply the patch by executing the following command (still in the MSYS console): 
     96 
     97        patch -p0 < linden.patch 
     98 
     99If you get patch errors, verify that you checked out the correct version of Mozilla/gecko. 
     100 
     1015. Build the optimized version of gecko: 
     102 
     103First, set the active config to optimized with the following command: 
     104 
     105        cp .mozconfig.optimized .mozconfig 
     106 
     107Next, start the build process: 
     108 
     109        make -f client.mk build 
     110 
     111NOTE: 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 
     117Now 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 
     1216. Build the debug version of gecko: 
     122This is the same process as building the optimized version, but using a different config file and a different object directory. Note the differences: 
     123 
     124First, set the active config to optimized with the following command: 
     125 
     126        cp .mozconfig.debug .mozconfig 
     127 
     128Next, start the build process: 
     129 
     130        make -f client.mk build 
     131 
     132NOTE: 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 
     138Now 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 
     1427. Unify the runtime libraries for both builds (this will improve runtime performance) 
     143 
     144First, 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         
     151Next, 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 
     1588. copy results of mozilla/gecko build to LLMozLib2 
     159 
     160From a windows command prompt, run the batch file labeled copy_products_windows.bat from the LLMozLib2 directory. 
     161NOTE: the script assumes you used C:\mozilla\ to checkout and build gecko. 
     162 
     1639. Build LLMozlib2 
     164 
     165Open the solution named llmozlib2_vc8.sln and proceed to build BOTH the debug and release versions in the normal fashion. 
     166 
     167NOTE: 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 
     169NOTE: 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 
     17110. Copy LLMozLib2 products to the branch of your viewer 
     172 
     173First, edit the batch file called copy_llmozlib2_to_branch.bat located in your LLMozlib2 checkout. 
     174You 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 
     176Then, 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 
     17811. Compile the viewer and test your configuration 
     179 
     180Now 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 
     182If 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 
     188B. 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. 
    5191 
    6192LLMozLib2 currently uses code from the 1.8.1.x branch of the Mozilla codebase - somewhat similar to what is used in Firefox 2.0.