Build and Install

  • Revision slug: Build_and_Install
  • Revision title: Build and Install
  • Revision id: 61257
  • Created:
  • Creator: NetRolller 3D
  • Is current revision? No
  • Comment /* Installing Your Build */

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.

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

{{wiki.template(':en/Build_Documentation/TOC')}}

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 in the configuring your build section.

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 <tt>make</tt> 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.

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 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 <tt>--enable-debug</tt>, 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

Installing Your Build

On POSIX platforms, you can install your build to the system by running gmake install. However, it is often better to follow the steps below to make a tarball, then unpack the tarball.

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

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

Real life example: If you use the Firefox Optimized Static .mozconfig file then

  • Firefox: <tt>$ make -C ff-opt-static/browser/installer</tt>

This will create a <tt>firefox-2.0.0.3.en-US.linux-i686.tar.gz</tt> file inside the directory <tt> ff-opt-static/dist </tt>which you can unpack where ever you want.

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

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

NOTE: To make the highly compressed installer used by Firefox and Thunderbird using a Cygwin-based build system, you must install a few additional programs:

  • 7-zip
  • UPX (Windows users: this package is available in Cygwin setup so you can select to install (Utils category). Do not use the DOS version, it will not work)

Both of these utilities must exist in the PATH. In addition, MOZ_INSTALLER_USE_7ZIP must be exported in your environment. If you are using the MozillaBuild system, 7-Zip and UPX will be installed automatically.

{{ wiki.languages( { "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;benjamin@smedbergs.us&gt;   or one of the build-config peers.</span>
</p>
<div class="note"><b>NOTE</b>: Do not begin a build without <a href="en/Configuring_Build_Options">configuring your build options</a> first!</div>
<p>{{wiki.template(':en/Build_Documentation/TOC')}}
</p>
<h3 name="Building"> Building </h3>
<p>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".
</p><p>Once you have checked out the source, be sure to configure an application as described in the <a href="#Configuring_Build_Options">configuring your build section</a>.
</p><p>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 <tt>make</tt> 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 untaring the source tar ball 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, cd to your objdir, run configure, and then run make/gmake. 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 non-macintosh build system, the finished build can be found in <i>objdir</i>/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 <i>objdir</i>/dist/<i>AppName</i>.app, for example <i>objdir</i>/dist/Minefield.app.
</p><p>Please <b>note</b> that when you are building with <tt>--enable-debug</tt>, the application is placed in <i>objdir</i>/dist/<i>AppName</i>Debug.app, e.g. <i>objdir</i>/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>
<h3 name="Installing_Your_Build"> Installing Your Build </h3>
<p>On POSIX platforms, you can install your build to the system by running <i>gmake install</i>. However, it is often better to follow the steps below to make a tarball, then unpack the tarball.
</p><p>For most apps, prepare a tarball/zip of your build by making in an app-specific directory:
</p>
<ul><li> Firefox: <tt>$ make -C objdir/browser/installer</tt>
</li><li> Thunderbird: <tt>$ make -C objdir/mail/installer</tt>
</li><li> SeaMonkey: <tt>$ make -C objdir/xpinstall/packager</tt>
</li></ul>
<p><i>Real life example:</i> If you use the <a href="en/Configuring_Build_Options#Firefox_Optimized_Static"> Firefox Optimized Static</a> .mozconfig file then
</p>
<ul><li> Firefox: <tt>$ make -C ff-opt-static/browser/installer</tt>
</li></ul>
<p>This will create a <tt>firefox-2.0.0.3.en-US.linux-i686.tar.gz</tt> file inside the directory <tt> ff-opt-static/dist </tt>which you can unpack where ever you want.
</p><p>To make a windows installer, make the "installer" target in the above directory:
</p>
<ul><li> Firefox: <tt>$ make -C objdir/browser/installer installer</tt>
</li><li> Thunderbird: <tt>$ make -C objdir/mail/installer installer</tt>
</li><li> SeaMonkey: <tt>$ make -C objdir/xpinstall/packager installer</tt>
</li></ul>
<p><i>NOTE:</i> To make the highly compressed installer used by Firefox and Thunderbird using a Cygwin-based build system, you must install a few additional programs:
</p>
<ul><li> <a class="external" href="http://www.7-zip.org/">7-zip</a>
</li><li> <a class="external" href="http://upx.sourceforge.net/">UPX</a> (Windows users: this package is available in <a class="external" href="http://cygwin.com/">Cygwin</a> setup so you can select to install (Utils category). Do not use the DOS version, it will not work)
</li></ul>
<p>Both of these utilities must exist in the PATH. In addition, MOZ_INSTALLER_USE_7ZIP must be exported in your environment.
If you are using the MozillaBuild system, 7-Zip and UPX will be installed automatically.
</p>{{ wiki.languages( { "fr": "fr/Compilation_et_installation", "ja": "ja/Build_and_Install", "zh-cn": "cn/\u7f16\u8bd1\u4e0e\u5b89\u88c5" } ) }}
Revert to this revision