Firefox Build Instructions for Linux
This page outlines the steps you need to take in order to build your own Firefox on Linux. This process should work regardless of the Linux distro you're using. I have tested the following platforms myself: Red Hat 8/9, Fedora Core 4, Vine 3.0/3.1, and Turbolinux 10 Desktop. I'd also recommend that you read the Unix Build Instructions to understand the system requirements.
1. Set the CVS environment variable
Make sure you set the following CVSROOT environment variable.CVSROOT=:pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot
To set the environment variable in Korn Shell, run the following command:export CVSROOT=:pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot
2. Create your configuration (mozconfig) file
Second, create the file called ".mozconfig" and save it under your $HOME directory. Please note that the format of the file has changed for the TRUNK build recently. The sample mozconfig shown below is for the TRUNK build.
# options to build Firefox
mk_add_options MOZ_CO_PROJECT=browser
ac_add_options --enable-application=browser
# Options for 'configure' (same as command-line options).
ac_add_options --disable-accessibility
ac_add_options --disable-debug
ac_add_options --disable-freetype2
ac_add_options --disable-installer
ac_add_options --disable-jsd
ac_add_options --disable-pedantic
ac_add_options --disable-shared
ac_add_options --disable-tests
ac_add_options --enable-default-toolkit=gtk2
ac_add_options --enable-plaintext-editor-only
ac_add_options --enable-static
ac_add_options --enable-xft
## processor optimization options
ac_add_options --enable-optimize="-O2"
export MOZCONFIG=$HOME/source/firefox/mymozconfig
3. Create your source directory
Create an empty directory where the source tree will be downloaded, as in the following example. Change to that directory once it's created.
mkdir $HOME/fx_source
cd $HOME/fx_source
4. Log onto CVS
This process is necessary only for the first time. Run the following command. Enter "anonymous" when prompted for the password.cvs login
5. Obtain the root makefile
Run the following command from your source directory in order to obtain the root makefile. Note that this is for the TRUNK build.cvs co -f mozilla/client.mk
In order to create a BRANCH build (i.e. for 0.9/1.0), run the following commands instead.
cvs co -r AVIARY_1_0_20040515_BRANCH mozilla/client.mk
cvs co -r AVIARY_1_0_20040515_BRANCH mozilla/browser/config
6. Download the entire source tree
Change to the newly created "mozilla" subdirectory and run the following command to download the entire Firefox source tree:
cd mozilla
gmake -f client.mk checkout
7. Build Firefox
Run the following command to build your own Firefox:gmake -f client.mk build
8. Create a distributable package
Change to the "xpinstall/packager" subdirectory and run the following command to create a distributable Firefox package. You can change the PKG_BASENAME variable to customize the resulting name of the package. Note that it's all in one line starting "make."
cd xpinstall/packager
make MOZ_PKG_FORMAT="BZ2" MOZILLA_BIN="\$(DIST)/bin/firefox-bin" MOZ_PKG_APPNAME="Firefox" PKG_BASENAME="fx-p4sse-pc-linux-gnu331.`date +%Y-%m-%d`"
9. Run your Firefox
Run the newly-built Firefox by going to the "dist/bin" subdirectory and run "Firefox":
cd $HOME/fx_source/mozilla/dist/bin
./firefox