Open main menu

CDOT Wiki β

User:DavidBertenshaw/Assignment 01: Build the Fox

Revision as of 15:22, 19 September 2006 by Davenrathh (talk | contribs) (Process)

Introduction

I started working on the project on September 17th. The first thing I did was follow the link to developer.mozilla.org. From there I managed to find a link to guide for building Firefox on a windows platform. This guide was the key to finishing this assignment, without it I would be lost and would never have gotten firefox to build properly. Even with this guide I suffered some hardships but eventually managed to complete my build.

Build Prerequists

From the start I closely followed two websites. The Mozilla build documentation and David Humprey's guide to building Firefox . The following is the software needed to build Firefox on a Windows XP SP2 computer:

7-Zip

This software is used to unpack the zip archive from the Mozilla FTP. If you are using cvs to download the Firefox source then you shouldn't need this.

Cygwin

From what I can tell, this software emulates a Unix shell and in doing so downloads many commands and tools you need to compile Firefox. Once you download Cygwin follow the steps for installation. I used Unix shell endings and I also checked the following options.

   *  patchutils (under Interpreters).
   *  perl (under Interpreters).
   *  zip, unzip (under Archive).  

Don't check Make unless it's version 3.80.

Make 3.80

I am putting this seperate because I had to download the Make software seperatly as I coulnd't find it in the Cywin tools. From what I can tell this utility does the actually building of Firefox.

Visual Studio 2003 or Visual Studio 2005

Both Visual studios have tools that are neccesary to build Mozzila's Firefox. I personally had 2003 installed but switched to 2005 to try and fix a bug, which it didn't. Although you can get free tools out on the net, this is what I used and can say works.

MozTools

These tools created by Mozilla are used to build Firefox but I couldn't tell exsactly what they do.


NSIS

From what I can tell this software is needed to create an installer for Firefox.

Process

This process outlines the second time I attemped at building Firefox. The first time was not a success and I will report it in the Conflicts section.

1) Firstly I created a directory called Proj under the c:\ drive. (I am going to outline the small steps as they were the ones that tripped me up the first time).

2) Next download the MozTools, extracted them, and placed the directory in c:\proj\moztools\. I also added this to my path, not sure if that's required though.

3)Once those tasks were done I installed cygwin and configured it as per the Cygwin Configuration.

4)A batch script is needed to configure the system so that the right variables are in the path and such. I created a batch script called SetupFireFox.bat with the following code inside.

@echo off

rem --- CVS Setup
SET CVSROOT=:pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot
SET CVS_RSH=ssh

rem --- Setup the paths to the moztools build libraries
set MOZ_TOOLS=C:\proj\moztools
set GLIB_PREFIX=%MOZ_TOOLS%
set LIBIDL_PREFIX=%MOZ_TOOLS%

rem --- Scrub these variables first
SET INCLUDE=
SET LIB=
SET PATH=C:\;C:\windows\system32;C:\windows\system32\wbem

rem --- Prepend cygwin
SET PATH=C:\cygwin\bin;%PATH%

rem --- Setup VC8 compiler environment vars
CALL "C:\Program Files\Microsoft Visual Studio 8\VC\vcvarsall.bat" x86

rem --- Add glib/libidl to build environment
SET PATH=%PATH%;%GLIB_PREFIX%;%GLIB_PREFIX%\bin
SET INCLUDE=%GLIB_PREFIX%\include;%INCLUDE%
SET LIB=%GLIB_PREFIX%\lib;%LIB%

rem --- moztools comes last after glib/libIDL
SET PATH=%PATH%;%MOZ_TOOLS%\bin

5) Check out the build via cvs by typing 'cvs login' from c:\proj. Then type:

cvs co mozilla/browser/config mozilla/client.mk

This will create the mozilla directory.

6) I then proceeded to move into the mozilla directory and create a file called mozconfig. I added the following code to mozconfig:

# 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

7)While in the same directory I typed:

make -f client.mk checkout

Which will check out the client.

8) Before building I had to ensure that I had all of the tools installed. I installed Visual Studio 2005 and then NSIS. After I added NSIS to the path. This step also ment downloading make 3.80 and adding it to the path.

9) While in c:\proj I ran my batch script. Once the environment was setup I typed 'make -f client.mk build' to build the software.

Conflicts

Contributers

Reources

Screenshot

conclusion