Install build prerequisites
Before building Firefox, we will need the build tools listed below and a few gigabytes of free disk space. Builds will be slow unless we have at least 2GB of RAM.
Run the following commands in a shell to install the needed tools:
sudo apt-get build-dep firefox sudo apt-get install mercurial libasound2-dev libcurl4-openssl-dev libnotify-dev libxt-dev libiw-dev mesa-common-dev autoconf2.13 yasm uuid
Debian users: Same as Ubuntu, but replace the first command with
sudo apt-get build-dep iceweasel
sudo yum groupinstall 'Development Tools' 'Development Libraries' 'GNOME Software Development' sudo yum install mercurial autoconf213 glibc-static libstdc++-static yasm wireless-tools-devel mesa-libGL-devel alsa-lib-devel libXt-devel
Getting the source
Getting the latest source code from Mozilla’s Mercurial code repository. It may take a while, it’s a lot of code!
hg clone http://hg.mozilla.org/mozilla-central
Build configuration (optional)
By default, the build system creates a release build of Firefox roughly equivalent to the official Firefox release builds. If that’s not exactly what you want, there are many build configuration options to choose from, although it’s strongly recommended that you only use options that you fully understand. The normal way to specify build options is to place them in a file called ‘.mozconfig’ at the root of your mozilla source tree. For example, to create a debug build instead of a release build, that file would contain:
For more on configuration options, see the page Configuring build options.
make -f client.mk
How to update and build again
For pulling the latest changes and update the code in your
mozilla-central working directory, run the command:
hg pull -u
Then just re-run the “
make -f client.mk” command above.
make will only recompile files that changed, but it’s still a long haul.