Simple Thunderbird build

  • Revision slug: Simple_Thunderbird_build
  • Revision title: Simple Thunderbird build
  • Revision id: 36334
  • Created:
  • Creator: kewisch
  • Is current revision? No
  • Comment Added libGL packages; 10 words added

Revision Content

You can build a bleeding-edge, development version of Thunderbird using the commands below. For complete information, see the build documentation.

Installing build tools

If your system is not listed below, see the build prerequisites page.

Ubuntu Linux:
sudo apt-get build-dep thunderbird
sudo apt-get install mercurial libasound2-dev libcurl4-openssl-dev libnotify-dev libiw-dev autoconf2.13 
sudo apt-get install yasm mesa-common-dev
Fedora Linux:
sudo yum groupinstall 'Development Tools' 'Development Libraries' 'GNOME Software Development'
sudo yum install mercurial autoconf213 yasm
Mac:
  • Install Xcode Tools. Insert "Mac OS X Install Disc 2", then open XcodeTools.mpkg. (For some Mac OS X versions, you will find it in a directory called "Optional Installs".)
  • Install MacPorts.
  • Run these commands to install the other build tools:
    sudo port sync
    sudo port install mercurial libidl autoconf213 yasm
    

Problems? See Mac OS X build prerequisites.

Windows:
  • If you're using Windows XP, you must have Windows XP Service Pack 2 and .NET Framework 2.0.
  • Install Visual C++ 2005 Professional, or VC++ 2008 Professional or Express with SP1. VC++ 2008 Express without SP1 is known to not work. Visual Studio 2010 is unofficially supported.
  • You may need to install one or more Windows SDKs. See Windows SDK versions for a quick guide.
  • Install MozillaBuild, a package of additional build tools. (If you get a message saying this application did not install properly then you should see a windows dialog giving you the option to re-install with the 'correct settings'. After that all should be well.)
  • Open a shell window by running: c:\mozilla-build\start-msvcX.bat (where X is 8 for VS 2005, and 9 for VS 2008). Even if you're on 64-bit Windows, do not use the files ending in -x64.bat.

Problems? See Windows build prerequisites.

Building Thunderbird

Building Thunderbird requires at least 2.5 GB of disk space, 500 MB of RAM, and lots of available swap space.

# Get the source
hg clone http://hg.mozilla.org/comm-central/
cd comm-central
python client.py checkout

# Setup a basic .mozconfig file
echo 'ac_add_options --enable-application=mail' > .mozconfig                   # let's build Thunderbird...
echo 'mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/objdir-tb-release' >> .mozconfig   # ...in this directory...

# USE THIS ONLY IF NOT ON WINDOWS!  Parallel compilation on Windows is
# unreliable now due to bug 524149.
echo 'mk_add_options MOZ_MAKE_FLAGS="-j4"' >> .mozconfig                       # ...quickly.

# Build
make -f client.mk
By default running these steps will get the latest trunk version of Thunderbird. If you want to build a specific branch of Thunderbird, replace http://hg.mozilla.org/comm-central/ with the required branch location.
If your build fails, check the Problems Building section below.
  • For a debug build, you need different configuration options in your .mozconfig file.  This requires more disk space, about 2.5 GB.
    mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/objdir-tb-debug
    ac_add_options --enable-application=mail
    ac_add_options --enable-debug
    ac_add_options --disable-optimize
    
  • On Windows, the above commands will create the comm-central directory in %USERPROFILE% which will likely be some subfolder of c:\Documents and Settings on XP or below. The space in this directory name, or in your user name if it contains one, will cause the configure script to break.  To (possibly) fix this, cd to a dir without spaces before doing the "hg clone" command above.
  • comm-1.9.1 and 1.9.2 do not support 64 bit compilation. See the various prerequisite pages above for more information.

Running Thunderbird

On Windows and Linux, the thunderbird executable can be found in objdir-tb-release/mozilla/dist/bin/

On Mac the thunderbird executable can be found in objdir-tb-release/mozilla/dist/<codename><debug>.app/Contents/MacOS/ where <codename> is the branch codename, e.g. Shredder, Lanikai, Thunderbird (Thunderbird is used for official builds)... and <debug> is an optional value of Debug depending if you've built a debug build or not.

Building Thunderbird and Lightning

If you've set up you build environment as above, then all you need to do is:

echo 'ac_add_options --enable-calendar' >> .mozconfig

or just add the ac_add_options --enable-calendar line to your .mozconfig with your favourite editor.

Then just re-run the "make -f client.mk" command above (you can do the addition before running make for the first time).

How to build again later

In your comm-central directory, run these commands:

# Get the latest source
python client.py checkout

Then just re-run the "make -f client.mk" command above. make will only recompile files that changed, but it's still a long haul. An incremental build can be faster.

Problems Building?

Have you:

  • Checked the Thunderbird tinderbox for known failures at the time you pulled the code?
    • If the trunk is broken, you may wish to consider building one of the branches (to pull the source code from a branch, just replace the url to the repository in the hg clone instruction)
  • Have you searched the bug database for issues relating to your problem (e.g. platform specific issues)?
  • Try asking in mozilla.dev.builds - don't forget to include details of what is in your mozconfig, and what the actual error is.

References

Revision Source

<p>You can build a bleeding-edge, development version of Thunderbird using the commands below. For complete information, see the <a class="internal" href="/En/Developer_Guide/Build_Instructions" title="En/Build Documentation">build documentation</a>.</p>
<h2>Installing build tools</h2>
<p>If your system is not listed below, see the <a class="internal" href="/En/Developer_Guide/Build_Instructions#Build_prerequisites" title="En/Build Documentation#Build prerequisites">build prerequisites page</a>.</p>
<table style="margin-left: 2.5em;"> <tbody> <tr> <td style="vertical-align: baseline;">Ubuntu Linux:</td> <td> <pre>
sudo apt-get build-dep thunderbird
sudo apt-get install mercurial libasound2-dev libcurl4-openssl-dev libnotify-dev libiw-dev autoconf2.13 
sudo apt-get install yasm mesa-common-dev
</pre> </td> </tr> <tr> <td style="vertical-align: baseline;">Fedora Linux:</td> <td> <pre>
sudo yum groupinstall 'Development Tools' 'Development Libraries' 'GNOME Software Development'
sudo yum install mercurial autoconf213 yasm
</pre> </td> </tr> <tr> <td style="vertical-align: baseline;">Mac:</td> <td> <ul> <li>Install Xcode Tools. Insert "Mac OS X Install Disc 2", then open <code>XcodeTools.mpkg</code>. (For some Mac OS X versions, you will find it in a directory called "Optional Installs".)</li> <li>Install <a class="external" href="http://www.macports.org/install.php">MacPorts</a>.</li> <li>Run these commands to install the other build tools: <pre class="eval">
sudo port sync
sudo port install mercurial libidl autoconf213 yasm
</pre> </li> </ul> <p>Problems? See <a class="internal" href="/En/Developer_Guide/Build_Instructions/Mac_OS_X_Prerequisites" title="en/Mac_OS_X_Build_Prerequisites">Mac OS X build prerequisites</a>.</p> </td> </tr> <tr> <td style="vertical-align: baseline;">Windows:</td> <td> <ul> <li>If you're using Windows XP, you must have <a class="external" href="http://www.microsoft.com/windowsxp/sp2/default.mspx">Windows XP Service Pack 2</a> and <a class="external" href="http://www.microsoft.com/downloads/info.aspx?na=47&amp;p=3&amp;SrcDisplayLang=en&amp;SrcCategoryId=&amp;SrcFamilyId=4377f86d-c913-4b5c-b87e-ef72e5b4e065&amp;u=details.aspx?familyid=0856EACB-4362-4B0D-8EDD-AAB15C5E04F5&amp;displaylang=en">.NET Framework 2.0</a>.</li> <li>Install Visual C++ 2005 Professional, or VC++ 2008 Professional or <a class="external" href="http://www.microsoft.com/downloads/details.aspx?FamilyId=F3FBB04E-92C2-4701-B4BA-92E26E408569&amp;displaylang=en" rel="external nofollow" target="_blank" title="http://www.microsoft.com/downloads/details.aspx?FamilyId=F3FBB04E-92C2-4701-B4BA-92E26E408569&amp;displaylang=en">Express with SP1</a>. VC++ 2008 Express without SP1 is known to not work. Visual Studio 2010 is unofficially supported.</li> <li>You may need to install one or more Windows SDKs. See <a class="internal" href="/En/Windows_SDK_versions" title="En/Windows SDK versions">Windows SDK versions</a> for a quick guide.</li> <li>Install <a class="external" href="http://ftp.mozilla.org/pub/mozilla.org/mozilla/libraries/win32/MozillaBuildSetup-Latest.exe" title="http://ftp.mozilla.org/pub/mozilla.org/mozilla/libraries/win32/MozillaBuildSetup-Latest.exe">MozillaBuild</a>, a package of additional build tools. (If you get a message saying this application did not install properly then you should see a windows dialog giving you the option to re-install with the 'correct settings'. After that all should be well.)</li> <li>Open a shell window by running: <code>c:\mozilla-build\start-msvcX.bat</code> (where X is 8 for VS 2005, and 9 for VS 2008). <strong>Even if you're on 64-bit Windows, do not use the files ending in <code>-x64.bat</code>.</strong></li> </ul> <p>Problems? See <a class="internal" href="/En/Developer_Guide/Build_Instructions/Windows_Prerequisites" title="en/Windows_Build_Prerequisites">Windows build prerequisites</a>.</p> </td> </tr> </tbody>
</table>
<h2>Building Thunderbird</h2>
<p>Building Thunderbird requires at least 2.5 GB of disk space, 500 MB of RAM, and lots of available swap space.</p>
<pre># Get the source
hg clone http://hg.mozilla.org/comm-central/
cd comm-central
python client.py checkout

# Setup a basic .mozconfig file
echo 'ac_add_options --enable-application=mail' &gt; .mozconfig                   # let's build Thunderbird...
echo 'mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/objdir-tb-release' &gt;&gt; .mozconfig   # ...in this directory...

# USE THIS ONLY IF NOT ON WINDOWS!  Parallel compilation on Windows is
# unreliable now due to bug 524149.
echo 'mk_add_options MOZ_MAKE_FLAGS="-j4"' &gt;&gt; .mozconfig                       # ...quickly.

# Build
make -f client.mk</pre>
<div class="note">By default running these steps will get the latest trunk version of Thunderbird. If you want to build a specific branch of Thunderbird, replace <code><a class=" external" href="http://hg.mozilla.org/comm-central/" rel="freelink">http://hg.mozilla.org/comm-central/</a></code> with the <a href="/en/comm-central#Branches" title="en/comm-central#Branches">required branch location</a>.</div>
<div class="note">If your build fails, check the <a href="/en/Simple_Thunderbird_build#Problems_Building.3f" title="https://developer.mozilla.org/en/Simple_Thunderbird_build#Problems_Building.3f">Problems Building</a> section below.</div>
<ul> <li>For a debug build, you need different configuration options in your <code>.mozconfig</code> file.  This requires more disk space, about 2.5 GB.<br> <pre>mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/objdir-tb-debug
ac_add_options --enable-application=mail
ac_add_options --enable-debug
ac_add_options --disable-optimize
</pre> </li> <li>On Windows, the above commands will create the <code>comm-central</code> directory in <code>%USERPROFILE%</code> which will likely be some subfolder of <code>c:\Documents and Settings</code> on XP or below. The space in this directory name, or in your user name if it contains one, will cause the configure script to break.  To (possibly) fix this, <code>cd</code> to a dir without spaces before doing the "<code>hg clone</code>" command above.</li> <li>comm-1.9.1 and 1.9.2 do not support 64 bit compilation. See the various prerequisite pages above for more information.</li>
</ul>
<h4>Running Thunderbird</h4>
<p>On Windows and Linux, the thunderbird executable can be found in <code>objdir-tb-release/mozilla/dist/bin</code>/</p>
<p>On Mac the thunderbird executable can be found in <code>objdir-tb-release/mozilla/dist/&lt;codename&gt;&lt;debug&gt;.app/Contents/MacOS/</code> where &lt;codename&gt; is the branch codename, e.g. <code>Shredder, Lanikai, Thunderbird</code> (<code>Thunderbird</code> is used for official builds)... and &lt;debug&gt; is an optional value of <code>Debug</code> depending if you've built a debug build or not.</p>
<h2>Building Thunderbird and Lightning</h2>
<p>If you've set up you build environment as above, then all you need to do is:</p>
<pre>echo 'ac_add_options --enable-calendar' &gt;&gt; .mozconfig
</pre>
<p>or just add the <code>ac_add_options --enable-calendar</code> line to your .mozconfig with your favourite editor.</p>
<p>Then just re-run the "<code>make -f client.mk</code>" command above (you can do the addition before running make for the first time).</p>
<h2>How to build again later</h2>
<p>In your <span style="font-family: monospace;">comm</span><code>-central</code> directory, run these commands:</p>
<pre># Get the latest source
python client.py checkout
</pre>
<p>Then just re-run the "<code>make -f client.mk</code>" command above. <code>make</code> will only recompile files that changed, but it's still a long haul. An <a class="internal" href="/en/Incremental_Build" title="En/Incremental Build">incremental build</a> can be faster.</p>
<h2>Problems Building?</h2>
<p>Have you:</p>
<ul> <li>Checked the <a class="external" href="http://tinderbox.mozilla.org/showbuilds.cgi?tree=Thunderbird" title="http://tinderbox.mozilla.org/showbuilds.cgi?tree=Thunderbird">Thunderbird tinderbox</a> for known failures at the time you pulled the code? <ul> <li>If the trunk is broken, you may wish to consider building <a href="/En/Developer_Guide/Source_Code/Getting_comm-central" title="https://developer.mozilla.org/En/Developer_Guide/Source_Code/Getting_comm-central">one of the branches</a> (to pull the source code from a branch, just replace the url to the repository in the hg clone instruction)</li> </ul> </li> <li>Have you searched the <a class="link-https" href="https://bugzilla.mozilla.org/" title="https://bugzilla.mozilla.org/">bug database</a> for issues relating to your problem (e.g. platform specific issues)?</li> <li>Try asking in <a class="external" href="http://groups.google.com/group/mozilla.dev.builds/" title="http://groups.google.com/group/mozilla.dev.builds/">mozilla.dev.builds</a> - don't forget to include details of what is in your mozconfig, and what the actual error is.</li>
</ul>
<h3>References</h3>
<ul> <li><a class="internal" href="/En/Developer_Guide/Build_Instructions" title="En/Developer Guide/Build Instructions">General Build Documentation</a></li> <li><a class="internal" href="/en/comm-central" title="en/comm-central">comm-central</a></li> <li><a href="/en/Using_the_Mozilla_symbol_server" title="en/Using the Mozilla symbol server">Using the Mozilla symbol server</a></li>
</ul>
Revert to this revision