Visit Mozilla.org

Build and Install

From MDC


Note: Do not begin a build without configuring your build options first!

Contents

[edit] Building

You must use GNU make to check out and build Mozilla. No other "make" program is acceptable. On Windows, Mac OS X, and GNU/Linux use "make" to run GNU make; on most non-GNU unixes, use "gmake".

Once you have checked out the source, be sure to configure an application as described on the Configuring Build Options page.

For Windows, 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 command:

$ make -f client.mk build

Note for Mac OS X: The path to the source directory that is created on untaring the source tar ball 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 objdir, run configure, and then run make/gmake. Configure will still pick up options specified in your .mozconfig file.

[edit] 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.

[edit] Windows and Linux

On 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".

[edit] 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

$ objdir/dist/AppName[Debug].app/Contents/MacOS/appname

for instance

$ objdir/dist/MinefieldDebug.app/Contents/MacOS/firefox

[edit] Building a .dmg for a XULRunner build

These instructions are for building a .dmg file from a Mac OS X Universal binary build.

  1. Perform a Universal Binary Build
  2. Create a chown_root.c and chown_revert.c source files from mxr:chown_root.c and mxr:chown_revert.c
  3. Use gcc to compile these files somewhere: gcc -o chown_root chown_root.c and gcc -o chown_revert chown_revert.c
  4. Set the correct permissions on the files: sudo chown root chown_root chown_revert and sudo chmod a+s chown_root chown_revert
  5. 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.

[edit] 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.

[edit] For trunk (Firefox 3)

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.gz file in objdir/dist which you can then unpack anywhere. To build a Windows installer, simply use make installer in your object directory.

[edit] For the 1.8 branch (Firefox 2)

For most apps, prepare a tarball/zip of your build by making in an app-specific directory:

  • Firefox: $ make -C objdir/browser/installer
  • Thunderbird: $ make -C objdir/mail/installer
  • SeaMonkey: $ make -C objdir/xpinstall/packager

To make a Windows installer, make the "installer" target in the above directory:

  • Firefox: $ make -C objdir/browser/installer installer
  • Thunderbird: $ make -C objdir/mail/installer installer
  • SeaMonkey: $ make -C objdir/xpinstall/packager installer

The installer will be written to the objdir/dist/install/sea directory.