Build and Install

  • Revision slug: Build_and_Install
  • Revision title: Build and Install
  • Revision id: 61274
  • Created:
  • Creator: edmorley
  • Is current revision? No
  • Comment Actually mention that PyMake is preferable on Windows, otherwise we're relying upon people stumbling upon the PyMake page; 95 words added, 53 words removed

Revision Content

NOTE: Do not make substantive changes to this document without consulting Benjamin Smedberg <benjamin@smedbergs.us> or one of the build-config peers.

{{ :en/Build_Documentation/TOC() }}

Building

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.

Windows users are strongly advised to use PyMake, since Windows parallel builds are not reliable when using GNU make. In addition, PyMake recurses in a single process reducing the number of shell invocations, which are particularly expensive on Windows.

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 command:

$ 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 make/gmake. Configure will still pick up options specified in your .mozconfig file.

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

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

for instance

$ objdir/dist/MinefieldDebug.app/Contents/MacOS/firefox
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.

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.

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.

{{ languages( { "es": "es/Compilar_e_instalar", "fr": "fr/Compilation_et_installation", "ja": "ja/Build_and_Install", "zh-cn": "cn/\u7f16\u8bd1\u4e0e\u5b89\u88c5" } ) }}

Revision Source

<p><span class="comment">NOTE: Do not make substantive changes to this document without consulting Benjamin Smedberg &lt;<a class=" link-mailto" href="mailto:benjamin@smedbergs.us" rel="freelink">benjamin@smedbergs.us</a>&gt; or one of the build-config peers.</span></p>
<p>{{ :en/Build_Documentation/TOC() }}</p>
<h3 name="Building">Building</h3>
<p>Once you have checked out the source, be you may want to configure an application as described on the <a href="/en/Configuring_Build_Options" title="en/Configuring_Build_Options">Configuring Build Options</a> page. Generally, the defaults are selected to produce something that is almost identical to the Firefox binaries as shipped.</p>
<p>Windows users are strongly advised to use <a href="/en/pymake" title="pymake">PyMake</a>, since Windows parallel builds are not reliable when using GNU make. In addition, PyMake recurses in a single process reducing the number of shell invocations, which are <a class=" external" href="http://benjamin.smedbergs.us/blog/2009-04-02/pymake-25-faster-than-msys-make/" title="http://benjamin.smedbergs.us/blog/2009-04-02/pymake-25-faster-than-msys-make/">particularly expensive on Windows</a>.</p>
<p>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".</p>
<p>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 <code>make</code> command:</p>
<pre class="eval">$ make -f client.mk build
</pre>
<p>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!</p>
<p>For most non-GNU unixes:</p>
<pre class="eval">$ gmake -f client.mk build
</pre>
<p>If you wish to manually configure and build, <code>cd</code> to your object directory, run <code>configure</code>, and then run <code>make</code>/<code>gmake</code>. Configure will still pick up options specified in your .mozconfig file.</p>
<h3 name="Running_Your_New_Build">Running Your New Build</h3>
<p>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.</p>
<h4 name="Windows_and_Linux">Windows and Linux</h4>
<p>On a non-Macintosh build system, the finished build can be found in <em>objdir</em>/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".</p>
<h4 name="Mac_OS_X">Mac OS X</h4>
<p>On Macintosh, the build system produces an application bundle at <em>objdir</em>/dist/<em>AppName</em>.app, for example <em>objdir</em>/dist/Minefield.app.</p>
<p>Please <strong>note</strong> that when you are building with <code>--enable-debug</code>, the application is placed in <em>objdir</em>/dist/<em>AppName</em>Debug.app, e.g. <em>objdir</em>/dist/MinefieldDebug.app.</p>
<p>You can run the application by either opening the application bundle via the Finder, or from the command line using</p>
<pre class="eval">$ objdir/dist/AppName[Debug].app/Contents/MacOS/appname
</pre>
<p>for instance</p>
<pre class="eval">$ objdir/dist/MinefieldDebug.app/Contents/MacOS/firefox
</pre>
<h5 name="Building_a_.dmg_for_a_XULRunner_build">Building a .dmg for a XULRunner build</h5>
<p>These instructions are for building a .dmg file from a Mac OS X Universal binary build.</p>
<ol> <li>Perform a Universal Binary Build</li> <li>Create a chown_root.c and chown_revert.c source files from <a class="external" href="http://mxr.mozilla.org/seamonkey/source/build/macosx/permissions/chown_root.c">mxr:chown_root.c</a> and <a class="external" href="http://mxr.mozilla.org/seamonkey/source/build/macosx/permissions/chown_revert.c">mxr:chown_revert.c</a></li> <li>Use gcc to compile these files somewhere: <code>gcc -o chown_root chown_root.c</code> and <code>gcc -o chown_revert chown_revert.c</code></li> <li>Set the correct permissions on the files: <code>sudo chown root chown_root chown_revert</code> and <code>sudo chmod a+s chown_root chown_revert</code></li> <li>cd to «objdir»/«arch»/xulrunner/installer and issue <code>make CHOWN_ROOT=«absolute_path_to_your_chown_root_binary» CHOWN_REVERT=«absolute_path_to_your_chown_revert_binary» </code></li>
</ol>
<p>This should build a binary at «arch»/dist.</p>
<h3 name="Installing_Your_Build">Installing Your Build</h3>
<p>On POSIX platforms, you can install your build to the system by running <code>gmake install</code>. However, this is not recommended, and you should instead follow the steps below to make a tarball, then unpack the tarball.</p>
<h4 name="For_trunk_.28Firefox_3.29">For trunk (Firefox 3 and later)</h4>
<p>For trunk builds, you can simply run <code>make package</code> in your object directory to create a packaged build. This will create a zip or tar.bz2 file in <em>objdir</em>/dist which you can then unpack anywhere. To build a Windows installer, simply use <code>make installer</code> in your object directory.</p>
<h4 name="For_the_1.8_branch_.28Firefox_2.29">For the 1.8 branch (Firefox 2)</h4>
<p>For most apps, prepare a tarball/zip of your build by making in an app-specific directory:</p>
<ul> <li>Firefox: <code>$ make -C objdir/browser/installer</code></li> <li>Thunderbird: <code>$ make -C objdir/mail/installer</code></li> <li>SeaMonkey: <code>$ make -C objdir/xpinstall/packager</code></li>
</ul>
<p>To make a Windows installer, make the "installer" target in the above directory:</p>
<ul> <li>Firefox: <code>$ make -C objdir/browser/installer installer</code></li> <li>Thunderbird: <code>$ make -C objdir/mail/installer installer</code></li> <li>SeaMonkey: <code>$ make -C objdir/xpinstall/packager installer</code></li>
</ul>
<p>The installer will be written to the <em>objdir</em>/dist/install/sea directory.</p>
<p>{{ languages( { "es": "es/Compilar_e_instalar", "fr": "fr/Compilation_et_installation", "ja": "ja/Build_and_Install", "zh-cn": "cn/\u7f16\u8bd1\u4e0e\u5b89\u88c5" } ) }}</p>
Revert to this revision