NOTE: Do not make substantive changes to this document without consulting Benjamin Smedberg <email@example.com> or one of the build-config peers.
Once you have checked out the source, be you may want to configure an application as described on the Configuring Build Options page. Generally, the defaults are selected to produce something that is almost identical to the Firefox binaries as shipped.
On all other platforms, you should use GNU make to build Mozilla - no other "make" program is acceptable. On Mac OS X, and GNU/Linux use "make" to run GNU make; on most non-GNU unixes, use "gmake".
For Mac OS X, and GNU/Linux, make sure that you are in the top level of the source directory ("mozilla"), when you invoke the
$ make -f client.mk build
Note for Mac OS X: The path to the source directory that is created on untarring the source tarball should not have spaces in it!
For most non-GNU unixes:
$ gmake -f client.mk build
If you wish to manually configure and build,
cd to your object directory, run
configure, and then run
gmake. Configure will still pick up options specified in your .mozconfig file.
Building can take a significant amount of time, depending on your system, OS and chosen build options. Linux builds on a fast box may take under 15 minutes, but Windows builds on a slow box may take several hours. Tips for making builds faster.
Running Your New Build
It is possible to run your new build directly from the directory in which it was built. However, the build directory may contain symlinks into the build tree; you must run the installation/packaging step to produce a standalone build which can be shared or moved.
Windows and Linux
On a non-Macintosh build system, the finished build can be found in objdir/dist/bin. On POSIX platforms (BSD, GNU/Linux, Solaris), you should run the file "mozilla" or "firefox", not the binary "mozilla-bin" or "firefox-bin".
Mac OS X
On Macintosh, the build system produces an application bundle at objdir/dist/AppName.app, for example objdir/dist/Minefield.app.
Please note that when you are building with
--enable-debug, the application is placed in objdir/dist/AppNameDebug.app, e.g. objdir/dist/MinefieldDebug.app.
You can run the application by either opening the application bundle via the Finder, or from the command line using
Building a .dmg for a XULRunner build
These instructions are for building a .dmg file from a Mac OS X Universal binary build.
- Perform a Universal Binary Build
- Create a chown_root.c and chown_revert.c source files from mxr:chown_root.c and mxr:chown_revert.c
- Use gcc to compile these files somewhere:
gcc -o chown_root chown_root.cand
gcc -o chown_revert chown_revert.c
- Set the correct permissions on the files:
sudo chown root chown_root chown_revertand
sudo chmod a+s chown_root chown_revert
- cd to «objdir»/«arch»/xulrunner/installer and issue
make CHOWN_ROOT=«absolute_path_to_your_chown_root_binary» CHOWN_REVERT=«absolute_path_to_your_chown_revert_binary»
This should build a binary at «arch»/dist.
Installing Your Build
On POSIX platforms, you can install your build to the system by running
gmake install. However, this is not recommended, and you should instead follow the steps below to make a tarball, then unpack the tarball.
For trunk (Firefox 3 and later)
For trunk builds, you can simply run
make package in your object directory to create a packaged build. This will create a zip or tar.bz2 file in objdir/dist which you can then unpack anywhere. To build a Windows installer, simply use
make installer in your object directory.