Difference between revisions of "Building the Fox"

From CDOT Wiki
Jump to: navigation, search
(Method)
(Method)
Line 53: Line 53:
 
# Execute the batch file created in step # 6 above.  This should set all the required environment variables and automatically open a cygwin prompt window.
 
# Execute the batch file created in step # 6 above.  This should set all the required environment variables and automatically open a cygwin prompt window.
 
#Checkout the code.
 
#Checkout the code.
** For the build to work properly we must ensure we are in the c:\proj folder before logging on to CVS to checkout the source files. Issue the following commands at the Cygwin prompt accomplish this:
+
## For the build to work properly we must ensure we are in the c:\proj folder before logging on to CVS to checkout the source files. Issue the following commands at the Cygwin prompt accomplish this:
 
***cd c:
 
***cd c:
 
***cd proj
 
***cd proj
  
** Logon to CVS.
+
## Logon to CVS.
 
#* At the command prompt type: cvs logon
 
#* At the command prompt type: cvs logon
 
#* Enter "anonymous" as the password (without the quotes)
 
#* Enter "anonymous" as the password (without the quotes)

Revision as of 23:43, 17 September 2006

WORK IN PROGRESS

Aim

To build the Mozilla Firefox browser from source code.

Hypothesis

Apparatus

Hardware

AMD Athlon XP @ 1.82 GHz 512 MB RAM

Software

Method

Install all software in the default directory unless otherwise specified as it will save time and effort in the long run.

  1. Install Visual Studio .NET 2003 (with Visual C++ modules)
  2. Install Microsoft ® Windows Server® 2003 R2 Platform SDK
  3. Install Cygwin . Remember to install all the package binaries listed below as specified in the Windows Build Pre-requisites made available by the Mozilla Developer Center. To install a package simply expand the desired category and place a check in the bin check box. Source files are not required. Don't worry if you realize you made an error i.e. forgotten a required package. The Cygwin installer is smart enough to accomodate this situation. Simply re-run the Cygwin setup.exe and select the packages you want to add, remove or re-install).:
    • ash -- UNIX-like command line interpreter shell (Base category)
    • coreutils -- GNU core utilities (includes fileutils, install, sh-utils, and textutils) (Base category)
    • cvs -- concurrent versions system (Devel category)
    • diffutils -- file comparison utility (Base category)
    • findutils (Base category)
    • gawk -- pattern matching language (Base and Interpretors categories)
    • grep -- text search tool (Base category)
    • libiconv -- character set conversion (Devel category)
    • make -- dependency analyzer for software builds (Devel category) (Don't worry if it is ver 3.81, we will correct this problem later).
    • patchutils -- a small collection of programs that operate on patch files (Devel category)
    • perl -- a scripting language used to control parts of the build (Interpreters category)
    • sed -- a search and replace language (Base category)
    • unzip -- zip file extraction (Archive category)
    • zip -- zip file creation (Archive category)
  4. Install Make 3.80
    1. Download and extract Make 3.80 (make-3.80-1.tar.bz2) to any folder of your choosing. A file named make-3.80-1.tar is created.
    2. Proceed to extract the make-3.80-1.tar file.
    3. Copy the make.exe file located within the usr/bin folder and overwrite the make.exe located in C:\cygwin\bin
    4. To Confirm that the version has changed to 3.80 by launching Cygwin. At the prompt type: make -v
    5. type exit to close Cygwin
  5. Download and Extract moztools to a folder of your chosing.
  6. Create an batch file containing steps needed to properly configure your build environment prior to proceeding with the build. The contents of the this batch file can be found within the #Batch File section of the #Appendix. Make changes to the batch file as necessary to reflect the different installation paths of the various applications in question. This will ensure that all the environment variables needed for the build to succeed are properly initialized.
  7. Rename \bin\link.exe located within the Cygwin installation folder to any different name (e.g. oldlink.exe). This prevents the receipt of an error message stating that the "incremental linker version does not match the compiler suite version" as documented in the Configure the environment section of the Windows Build Pre-requiste guide from the Mozilla Developer Center.
  8. Create the c:\proj folder to store the source and object files that will result from the checkout and build respectively.
  9. Execute the batch file created in step # 6 above. This should set all the required environment variables and automatically open a cygwin prompt window.
  10. Checkout the code.
    1. For the build to work properly we must ensure we are in the c:\proj folder before logging on to CVS to checkout the source files. Issue the following commands at the Cygwin prompt accomplish this:
      • cd c:
      • cd proj
    1. Logon to CVS.
    • At the command prompt type: cvs logon
    • Enter "anonymous" as the password (without the quotes)

Observations

Conclusion

Appendix

Batch File

SET CVSROOT=:pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot
SET CVS_RSH=ssh
rem --- Set HOME so that cvs and ssh work correctly rem --- cvs uses HOME to locate your .cvspass file, and ssh to locate your .ssh file rem --- if you are using ssh, your HOME should match the home directory specified in /etc/passwd. See http://www.cygwin.com/faq/faq0.html. set HOME=C:\home
rem --- Set VCVARS to wherever the MSVC vcvars.bat file is found set VCVARS=C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\bin\vcvars32.bat
rem --- Set MSSDK to wherever the MS SDK is installed rem --- Only required for MSVC7 or the Free MSVC editions that don't come with an SDK set MSSDK=C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2
rem --- Set MOZ_TOOLS to wherever you have the moztools packaged installed set MOZ_TOOLS=C:\moztools\moztools-static\moztools
rem --- Set CYGWINBASE to wherever cygwin is installed rem --- Do not use CYGWIN or else cygserver, cygrunsrv, and Cygwin services will not function properly rem --- Variable CYGWIN is also used to modify Cygwin's behaviour a little bit. set CYGWINBASE=C:\cygwin rem --- Make sure Cygwin does not print out a DOS style path warning set CYGWIN=nodosfilewarning
rem --- Prepend Cygwin path rem --- This is necessary so that cygwin find is ahead of windows find.exe in the PATH, but cgywin link is after MSVC link.exe. set PATH=%CYGWINBASE%\bin;%PATH%
rem --- Set MSVC environment vars call "%VCVARS%"
rem --- Prepend SDK paths rem --- Only required for MSVC7 or the Free MSVC editions that don't come with an SDK set PATH=%MSSDK%\bin;%PATH% set INCLUDE=%MSSDK%\include;%INCLUDE% set LIB=%MSSDK%\lib;%LIB%
rem --- moztools comes last set PATH=%PATH%;%MOZ_TOOLS%\bin
rem --- Now the PATH variable contains: rem MS-SDK; MSVC; Cygwin; Windows; glib/libIDL; Moztools
rem --- Typically the last thing the script does is launch a cygwin shell rem --- watch for your ~/.profile and /etc/profile which may overwrite your carefully setup PATH! bash --login -i

.mozconfig File

# Building Firefox Trunk with Debugging
. $topsrcdir/browser/config/mozconfig
# Put all obj files in one place, not in src tree mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/firefox-objdir ac_add_options --disable-static ac_add_options --enable-shared
# Debug Build Setup Options ac_add_options --disable-optimize ac_add_options --enable-debug
# I'm using Canvas for my work ac_add_options --enable-canvas
ac_add_options --disable-installer