Will's blog

purpose: Will Kahn-Greene's blog of Python, Linux, random content, PyBlosxom, Miro, and other projects mixed in there ad hoc, half-baked, and with a twist of lemon

Getting Started: Firefox

The Firefox code base is intertwined with the rest of the Mozilla products. The primary documentation for getting, configuring, and building the code is at http://developer.mozilla.org/en/docs/Build_Documentation (developer.mozilla.org).

Getting the code

To get the code with CVS from head, follow the instructions here (developer.mozilla.org).

In summary, do:

$ cvs -d :pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot co mozilla/client.mk
$ cvs -d :pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot co mozilla/browser/config/mozconfig
$ cd mozilla
$ make -f client.mk checkout MOZ_CO_PROJECT=browser

Configuring

After you get the code, you need to configure your .mozconfig file. Instructions for that are here (developer.mozilla.org).

My .mozconfig looks like this:

# details here: http://developer.mozilla.org/en/docs/Configuring_Build_Options

# objdir
mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/obj-@CONFIG_GUESS@

# source FF stuff in
. $topsrcdir/browser/config/mozconfig

# enable debugging stuff to make patching easier
ac_add_options --enable-debug 

# ui toolkit
ac_add_options --enable-default-toolkit=cairo-gtk2

# extensions
ac_add_options --enable-extensions=default

# no java-xpcom bridge
ac_add_options --disable-javaxpcom

# tests
ac_add_options --enable-tests

Building

After you've configured your .mozconfig, you can build Firefox like this:

  make -f client.mk build

Running

To run the resulting build, do:

  % cd <objdir>/dist/bin
  % ./firefox

after replacing <objdir> with your objdir. Mine is obj-i686-pc-linux-gnu.

Updating to the latest

To update your codebase from what's in CVS do:

  % make -f client.mk fast-update

I didn't see this anywhere in the documentation--I found it by reading through the makefiles. I'm not entirely sure if this is a good idea, but it's pretty fast and seems to be a good way to update.

Quick makes

To rebuild things that you're working on, run make in the obj.../ tree in the parallel directory to the one you're working in. For example, if I was working on toolkit/components/feeds/src/FeedProcessor.js then I would run make in obj.../toolkit/components/feeds/ and that'll rebuild those bits.

Tests

To run tests, make sure you have --enable-tests in your .mozconfig. Then do make check in the binary directory. For example, if I was working on toolkit/components/feeds/src/FeedProcessor.js then I would run make check in obj.../toolkit/components/feeds/ and that'll run the tests.

Other useful things

On irc.mozilla.org:

  • #firefox is a channel for users
  • #granparadiso is a channel for planning Firefox 3.0 and some 3.0 related chatter
  • #developers is for all developers of Mozilla stuff

Caveats

I think this is all true as of 12/12/2007. It's possible it's changed by the time you've read it. It's also possible that this is somewhat/mostly wrong, but I'll be correcting the wrong bits as I discover them.

Comments, suggestions, and ways to fix this are more than welcome below.

Please keep comments appropriate. I reserve the right to remove anonymous comments, flames, spammy, inappropriate, and other comments that I deem to be worth removing.

Note: New comments get placed in a "draft" status and will NOT show up on the site until I explicitly approve it. Usually that happens within 24 hours, but sometimes I go away and it takes a day or two.

Note 2: There is now a preview button for those of you who want to see a preview! However, it doesn't quite work the way you'd think it should work. I'll look into adjusting it some day.

Note 3: If you can't for some reason post a comment, send me an email: willg at bluesock dot org.

Your name:


Your e-mail address (this doesn't get displayed to anyone--I use it to contact you if there are issues):


URL of your website (optional):


Comment:


Yes, I am a human!

pyblosxom::2.0 dev

All contents Copyright 1996 to 2008 Will Guaraldi.
Creative Commons License
This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 United States License.