mozilla

Revision 179706 of Unix Detailed Build Instructions

  • Revision slug: Unix_Detailed_Build_Instructions
  • Revision title: Unix Detailed Build Instructions
  • Revision id: 179706
  • Created:
  • Creator: Mgjbot
  • Is current revision? No
  • Comment robot Adding: [[ja:Unix Detailed Build Instructions]] <<langbot>>

Revision Content

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

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
cvs login
<span class="comment">(password: anonymous) (You only need to login once)</span>
cvs co mozilla/client.mk
cd mozilla
gmake -f client.mk checkout

The makefile pulls the right source for building mozilla, which includes some tagged branches (e.g., NSPR).

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

  1. cd mozilla
  2. ./configure {{mediawiki.external('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.
  3. 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)

  1. Save the script from Unix Build Configurator as ~/.mozconfig.
  2. cvs co -f mozilla/client.mk
  3. cd mozilla
  4. 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 {{template.Source("browser/config/mozconfig", "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 and mozilla-viewer.sh.
  • If the scripts do not work, set LD_LIBRARY_PATH and run mozilla-bin and viewer directly. Set LD_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.
  • 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

Original Document Information

  • Author(s): Daniel Nunes
  • Last Updated Date: October 9, 2004
  • Copyright Information: Portions of this content are © 1998–2007 by individual mozilla.org contributors; content available under a Creative Commons license | Details.
{{ wiki.languages( { "ja": "ja/Unix_Detailed_Build_Instructions" } ) }}

Revision Source

<p>This is a guide to building Mozilla on Unix including,
</p>
<ul><li> A list of the required development tools.
</li><li> Commands to build Mozilla using the Autoconf build system.
</li></ul>
<p>For documentation on developing features or fixing bugs, look at the <a href="en">Mozilla Technical Documents</a> or <a class="external" href="http://www.mozilla.org/library.html">Mozilla Library</a>. For general Unix issues, look at the <a class="external" href="http://www.mozilla.org/unix/">Mozilla Unix</a>.
</p>
<h3 name="Other_Unix_Build_pages"> Other Unix Build pages </h3>
<ul><li> <a href="en/Adding_Files_to_the_Build">How to add files and not break the build</a>.
</li><li> <a class="external" href="http://www.mozilla.org/build/configurator-faq.html">Build Configuator FAQ</a>: FAQ for the <a class="external" href="http://webtools.mozilla.org/build/config.cgi">Unix Build Configurator</a>.
</li></ul>
<h3 name="Requirements"> Requirements </h3>
<p>See the <a href="en/Linux_Build_Prerequisites">Unix build requirements</a>.
</p>
<h3 name="Get_the_Code"> Get the Code </h3>
<p>There are two ways to get the code:
</p>
<h4 name="FTP"> <a href="en/Mozilla_Source_Code_(HTTP%2f%2fFTP)">FTP</a> </h4>
<p>Drops are generally produced at least once per week (usually daily), and are known to compile and even run on a few platforms.
</p>
<h4 name="CVS"> <a href="en/Mozilla_Source_Code_(CVS)">CVS</a> </h4>
<p>Provides the most current code, but is slower than ftp. (First check that <a class="external" href="http://tinderbox.mozilla.org/showbuilds.cgi?tree=SeaMonkey">Tinderbox</a> is green to be sure it will compile.)
</p>
<pre class="code">setenv CVSROOT :pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot
cvs login
&lt;span class="comment"&gt;(password: anonymous) (You only need to login once)&lt;/span&gt;
cvs co mozilla/client.mk
cd mozilla
gmake -f client.mk checkout
</pre>
<p>The makefile pulls the right source for building mozilla, which includes some tagged branches (e.g., NSPR).
</p><p>Do not try to manually check out the mozilla/ CVS tree on the HEAD branch. It will not work.
</p>
<h3 name="Build_the_Lizard"> Build the Lizard </h3>
<h4 name="Manually_drive_the_build"> Manually drive the build </h4>
<ol><li> <code>cd mozilla</code>
</li><li> <code>./configure <var>{{mediawiki.external('options')}}</var></code><br>For configure options, run <code>./configure --help</code>, or use the <a class="external" href="http://webtools.mozilla.org/build/config.cgi">Unix Build Configurator</a>. <i>If you don't know what a configure option does</i>, 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 <code>--disable-debug --enable-optimize</code>.
</li><li> <code>gmake</code>
</li></ol>
<p>Once you have configured, you only have to run <b><code>configure</code></b> if you add or remove Makefile.in files (cvs update can do this. Beware!). The list of makefiles is in <b><code>mozilla/allmakefiles.sh</code></b>
</p><p>For build system hackers: If you change configure.in, cd to mozilla, and run <b><code>autoconf-2.13</code></b>. This generates a new configure script. (When you checkin configure.in, cvs will run autoconf and check in a new configure script for you).
</p>
<h4 name="Automated_build_.28client.mk.29"> Automated build (client.mk) </h4>
<ol><li> Save the script from <a class="external" href="http://webtools.mozilla.org/build/config.cgi">Unix Build Configurator</a> as <b><code>~/.mozconfig</code></b>.
</li><li> <code>cvs co -f mozilla/client.mk</code>
</li><li> <code>cd mozilla</code>
</li><li> <code>gmake -f client.mk</code>
</li></ol>
<p>If you want to build without pulling the tree (as in, you already have the
source lying around), <code>gmake -f client.mk build</code>
</p><p>If you just want to pull the tree, <code>gmake -f client.mk checkout</code>
</p><p>If you want to build <a class="external" href="http://www.mozilla.com/firefox/">Firefox</a>, use the {{template.Source("browser/config/mozconfig", "example mozconfig file")}} in the mozilla/browser/config source directory.
</p>
<h3 name="After_the_build"> After the build </h3>
<ul><li> <b><code>cd dist/bin</code></b> and you should see links to the scripts to run the executables: <code>mozilla</code> and <code>mozilla-viewer.sh</code>.
</li><li> If the scripts do not work, set <b><code>LD_LIBRARY_PATH</code></b> and run <code>mozilla-bin</code> and <code>viewer</code> directly. Set <b><code>LD_LIBRARY_PATH</code></b> to include dist/bin, and the NSPR and GTK libraries. (For example, you might set it to <code>.:../../nspr/lib</code>).
<ul><li> On HP-UX, the equivalent environment variable is <code>SHLIB_PATH</code>.
</li><li> On AIX, the equivalent environment variable is <code>LIBPATH</code>.
</li></ul>
</li><li> If you run the executables from anywhere other than dist/bin, you must set the environment variable <b><code>MOZILLA_FIVE_HOME</code></b> to point to the <i>absolute path</i> of the dist/bin directory.
</li><li> Update your tree by re-checking out the source, e.g. repeating the initial checkout process.
</li></ul>
<h3 name="etc."> etc. </h3>
<p>Parallel builds: just adding -j4 to gmake doesn't work, you need to do this:
</p>
<pre>setenv MAKE gmake -j4
</pre>
<div class="originaldocinfo">
<h2 name="Original_Document_Information"> Original Document Information </h2>
<ul><li> Author(s): <a class="external" href="mailto:leaf@mozilla.org">Daniel Nunes</a>
</li><li> Last Updated Date: October 9, 2004
</li><li> Copyright Information: Portions of this content are © 1998–2007 by individual mozilla.org contributors; content available under a Creative Commons license | <a class="external" href="http://www.mozilla.org/foundation/licensing/website-content.html">Details</a>.
</li></ul>
</div>
<div class="noinclude">
</div>
{{ wiki.languages( { "ja": "ja/Unix_Detailed_Build_Instructions" } ) }}
Revert to this revision