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:
#firefoxis a channel for users#granparadisois a channel for planning Firefox 3.0 and some 3.0 related chatter#developersis 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.