Assignment1 (mojo)

From CDOT Wiki
Revision as of 05:08, 20 September 2006 by Mattar1 (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Assignment 1 - Build the Fox

Hardware & Software

Processor: Intel Centrino Duo 1.66mhz

Ram: 1 Gigabyte

Operating System: Windows XP SP2

Development Tools: Microsoft Visual Studio 2005 Professional, Cygwin, GNU Make 3.80

Initial Steps

Did the Windows Prerequisities

  1. Install Microsoft Visual Studio 2005 Professional
  2. Install Cygwin
  3. Install Moztools


I went over a few build tutorials to get an idea of what is going to happen. I used the following links:

After getting an idea of the basic process I setup my environment and downloaded the source according to the tutorials.

My setup is as follows:

  • C:\proj
  • C:\proj\moztools
  • C:\cygwin

Add to the Environment Variables %MOZ_TOOLS% = C:\proj\moztools;

I don't like putting libraries or applications in the root directory of C:\, but Cygwin won't work with spaces in the path. I tried to use C:\Program Files\Cygwin, but that failed so I reinstalled it to the root.

Downloads, Configrations, Builds, and Runs

filename: cygwin.bat

set HOME=C:\home
set VCVARS=C:\Program Files\Microsoft Visual Studio 8\VC\bin\vcvars32.bat
set MOZ_TOOLS=C:\proj\moztools
set CYGWINBASE=C:\cygwin
set CYGWIN=nodosfilewarning
call "%VCVARS%"
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

filename: buildsetup.bat

@echo off
rem --- CVS Setup
rem --- Setup the paths to the moztools build libraries
set MOZ_TOOLS=C:\proj\moztools
rem --- Scrub these variables first
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
rem --- moztools comes last after glib/libIDL

Open a command prompt, go to the project directory (c:\proj) and run buildsetup.bat.

Download the source

In project directory:

cvs login
cvs co mozilla/browser/config mozilla/

Create the file .mozconfig in proj\mozilla with the following:

filename: .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
ac_add_options --disable-installer

Checkout and Build it

make -f checkout
make -f build

Run It

After the build is done. Go to: proj\mozilla\firefox-objdir\dist\bin and run firefox.exe.

Finally minefield.JPG

Problems on the way

First problem I encountered was some configuration problems. I needed to modify them to use work with my environemnt. I remember changing .mozconfig, buildsetup.bat, and cygwin.bat to get this error to go away, but not sure which one actually fixed the issue:


This error occurred when I was using bash rather than cmd. I switched to cmd after my fascination with bash running on windows was over.

Second problem was the Make version. I used the cygwin version, but reading from Liz's problems I found I needed to install 3.80 rather than using 3.81. That cleared it up.

Third problem was after the build worked I ran the program but it would load my current installed version of firefox I remember somebody talking about this on IRC, but I didn't pay attention. The important thing is somebody else had this issue which probably means my build worked. I tried running it as another user, right click Run As..., and a command prompt and window appeared, but I started to get lots of error prompts. This might have something to do with me changing make versions without removing the old objects. I was too lazy to start building again, so I kept hitting Ignore.


Finally Minefield came up.

My Build Screenshot



Liz Chak

Paul St-Denis

My Thoughts

I found building firefox from source had more problems than my previous experiences. I have built bsd kernels through a similar process and building binaries for *nix. Even thought I built firefox I am not happy with the errors I got. I don't have time tonight to keep building until I got it the way I liked. I found it interesting running *nix tools in Windows, but still prefer the real thing. Overall, it was a good experience. Running into problems teaches you more than you may want to, but it is valuable to have gone through it.