Unix Detailed Build Instructions
Daniel Nunes, leaf@mozilla.org
This is a guide to building Mozilla on Unix including,
- A list of the required development tools.
- Commands to build Mozilla using the Autoconf build system.
For documentation on developing features or fixing bugs, look at the Mozilla Technical Documents or Mozilla Library. For general Unix issues, look at the Mozilla Unix.
Other Unix Build pages
- How to add files and not break the build.
- Build Configuator FAQ: FAQ for the Unix Build Configurator.
Requirements
See the unix build requirements
Get the Code
There are two ways to get the code:
- ftp: Drops are generally produced at least once per week (usually daily), and are known to compile and even run on a few platforms.
-
CVS:
Provides the most current code, but is slower than ftp. (First check that
Tinderbox is
green to be sure it will compile.)
setenv CVSROOT :pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot
The makefile pulls the right source for building mozilla, which includes some tagged branches (e.g., NSPR).
cvs login
(password: anonymous) (You only need to login once) cvs co mozilla/client.mk cd mozilla gmake -f client.mk checkout - Do not try to manually check out the mozilla/ CVS tree on the HEAD branch. It will not work.
Build the Lizard
Manually drive the build
cd mozilla
./configure [options]
For configure options, run./configure --help
, or use the Unix Build Configurator. If you don't know what a configure option does, don't use it. The default is to create a un-optimized build with debugging information. If you want an optimized build, use the configure options--disable-debug --enable-optimize
.gmake
Once you have configured, you only have to run
configure
if you add or remove Makefile.in files (cvs
update can do this. Beware!). The list of makefiles is in
mozilla/allmakefiles.sh
For build system hackers: If you change configure.in, cd to mozilla, and run
autoconf-2.13
. This generates a new configure script.
(When you checkin configure.in, cvs will run autoconf and check in a new configure
script for you).
Automated build (client.mk)
- Save the script from Unix Build Configurator as
~/.mozconfig
. cvs co -f mozilla/client.mk
cd mozilla
gmake -f client.mk
- If you want to build without pulling the tree (as in, you already have the source lying around),
-
gmake -f client.mk build
If you just want to pull the tree,gmake -f client.mk checkout
If you want to build Firefox, use the example mozconfig file in the mozilla/browser/config source directory.
After the build
cd dist/bin
and you should see links to the scripts to run the executables:mozilla
andmozilla-viewer.sh
.- If the scripts do not work, set
LD_LIBRARY_PATH
and runmozilla-bin
andviewer
directly. SetLD_LIBRARY_PATH
to include dist/bin, and the NSPR and GTK libraries. (For example, you might set it to.:../../nspr/lib
).- On HP-UX, the equivalent environment variable is
SHLIB_PATH
. - On AIX, the equivalent environment variable is
LIBPATH
.
- On HP-UX, the equivalent environment variable is
- If you run the executables from anywhere other than dist/bin, you must set
the environment variable
MOZILLA_FIVE_HOME
to point to the absolute path of the dist/bin directory. - Update your tree by re-checking out the source, e.g. repeating the initial checkout process.
etc.
- Parallel builds: just adding -j4 to gmake doesn't work, you need to do
this:
setenv MAKE gmake -j4