Simple Thunderbird build

  • Revision slug: Simple_Thunderbird_build
  • Revision title: Simple Thunderbird build
  • Revision id: 36347
  • Created:
  • Creator: Sid0
  • Is current revision? No
  • Comment 241 words added

Revision Content

This page covers the basic steps needed to build a bleeding-edge, development version of Thunderbird. For additional, more detailed information, see the build documentation.

Preparing your system
Edit section

Before you can build Thunderbird, you'll need the build tools listed below and a few gigabytes of free disk space. Builds will be slow unless you have at least 2GB of RAM.

Linux
Edit section

Run the following commands in a shell to install the needed tools:

Ubuntu users:

sudo apt-get build-dep thunderbird
sudo apt-get install mercurial libasound2-dev libcurl4-openssl-dev libnotify-dev libxt-dev libiw-dev mesa-common-dev autoconf2.13 yasm

Debian users: Same as Ubuntu, but replace the first command with sudo apt-get build-dep icedove

Fedora users:

sudo yum groupinstall 'Development Tools' 'Development Libraries' 'GNOME Software Development'
sudo yum install mercurial autoconf213 glibc-static libstdc++-static yasm wireless-tools-devel mesa-libGL-devel

Problems? See Linux build prerequisites.

Mac
Edit section

  • Install Xcode 3. You can download this from Apple, or install it from the OS DVDs that came with your Mac.
  • If you're using OS X 10.6.5 or later, install Java Developer Package for Mac (for a file required by the MacPorts packages we install below).
  • Install MacPorts, and then run these commands in a shell:
    sudo port sync
    sudo port install mercurial libidl autoconf213 yasm
    
  • homebrew is an alternative to MacPorts. As of 06/07/11, it does not have a recipe for autoconf, but that can be obtained here. After adding that recipe, do
    sudo easy_install pip
    sudo pip install Mercurial
    sudo brew install libidl autoconf yasm

Problems? See Mac OS X build prerequisites.

Windows
Edit section

  • Make sure your system is up-to-date through Windows Update. Windows XP needs at least Service Pack 2 and .NET Framework 2.0.
  • Install Visual C++ 2005 Professional, VC++ 2008 Professional or Express with SP1, or Visual C++ 2010 Professional. VC++ 2008 Express without SP1 will not work.
  • You may need to install one or more Windows SDKs. See Windows SDK versions for a quick guide.
  • Install the June 2010 DirectX SDK.
  • Install MozillaBuild, a package of additional build tools. (If you see a Windows error dialog giving you the option to re-install with the 'correct settings', choose that option and after that all should be well.)

The rest of the build steps are done from the MSYS shell installed with MozillaBuild. Use the shortcuts on your desktop, or run c:\mozilla-build\start-msvcX.bat (where X is 8 for VS 2005, 9 for VS 2008 and 10 for VS 2010). Even if you're on 64-bit Windows, do not use the start-msvcX-x64.bat files (unless you know what you're doing). Those files are experimental and unsupported. See the Build:MozillaBuild For x64 wiki page.

Problems? See Windows build prerequisites.

Building Thunderbird

First, if you're on Windows, you'll need to start work in a directory with no spaces in the path (e.g. don't use "Documents and Settings"). You can pick any other location, but the root of C: is handy:

cd /c

Now let's grab the latest source code from Mozilla's comm-central Mercurial code repository.

hg clone http://hg.mozilla.org/comm-central/

Then, we need to get all the repositories it depends on. The comm-central repository includes a script to do just that. This may take a while, it's a lot of code! First, cd into the comm-central subdirectory (created automatically by the previous command), then run:

python client.py checkout

To start the build, run:

make -f client.mk

This step will also take a while, depending on your system and OS. Linux builds on a fast box may take under 10 minutes, Windows builds on a slow box may take an hour.

Various compiled files, libraries, and the Firefox executable will be found in your object directory (under comm-central/), which is prefixed with obj-. The exact name depends on your system and OS. For example, a Mac user may get an object directory name of obj-x86_64-apple-darwin10.7.3/.

From the object directory, Windows users should run mozilla/dist/bin/thunderbird.exe, Linux users should run mozilla/dist/bin/firefox, and OS X users should run dist/Shredder.app/Contents/MacOS/thunderbird-bin. (Note: if you run dist/bin/thunderbird on OS X, the app will crash or behave oddly!)

Configuring options
Edit section

Additional configuration options are available, notably enabling debug builds and increasing build speed by using parallel compiles. These options are stored in a file named mozconfig (in the past this file was required, now default settings are used automatically). It is strongly recommended that you either use these defaults, or change as few options as your needs require.

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

in the comm-central directory, 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>This page covers the basic steps needed to build a bleeding-edge, development version of Thunderbird. For additional, more detailed information, see the <a class="internal" href="../../../../En/Developer_Guide/Build_Instructions" rel="internal">build documentation</a>.</p>
<h2 class="editable"><span>Preparing your system</span>
<div class="editIcon"><a href="/../../../../En/Simple_Firefox_build#" style="visibility: hidden;" title="Edit section"><span class="icon"><img alt="Edit section" class="sectionedit" src="../../../../skins/common/icons/icon-trans.gif"></span></a></div>
</h2>
<p>Before you can build Thunderbird, you'll need the build tools listed below and a few gigabytes of free disk space. Builds will be slow unless you have at least 2GB of RAM.</p>
<h3 class="editable"><span>Linux</span>
<div class="editIcon"><a href="/../../../../En/Simple_Firefox_build#" style="visibility: hidden;" title="Edit section"><span class="icon"><img alt="Edit section" class="sectionedit" src="../../../../skins/common/icons/icon-trans.gif"></span></a></div>
</h3>
<p>Run the following commands in a shell to install the needed tools:</p>
<p><strong>Ubuntu</strong> users:</p>
<pre>sudo apt-get build-dep thunderbird
sudo apt-get install mercurial libasound2-dev libcurl4-openssl-dev libnotify-dev libxt-dev libiw-dev mesa-common-dev autoconf2.13 yasm
</pre>
<p><strong>Debian</strong> users: Same as Ubuntu, but replace the first command with <code>sudo apt-get build-dep icedove</code></p>
<p><strong>Fedora</strong> users:</p>
<pre>sudo yum groupinstall 'Development Tools' 'Development Libraries' 'GNOME Software Development'
sudo yum install mercurial autoconf213 glibc-static libstdc++-static yasm wireless-tools-devel mesa-libGL-devel
</pre>
<p>Problems? See <a href="../../../../En/Developer_Guide/Build_Instructions/Linux_Prerequisites" rel="internal">Linux build prerequisites</a>.</p>
<h3 class="editable"><span>Mac</span>
<div class="editIcon"><a href="/../../../../En/Simple_Firefox_build#" style="visibility: hidden;" title="Edit section"><span class="icon"><img alt="Edit section" class="sectionedit" src="../../../../skins/common/icons/icon-trans.gif"></span></a></div>
</h3>
<ul> <li>Install <a class=" link-https" href="https://connect.apple.com/cgi-bin/WebObjects/MemberSite.woa/wa/getSoftware?bundleID=20792" rel="external nofollow" target="_blank" title="https://connect.apple.com/cgi-bin/WebObjects/MemberSite.woa/wa/getSoftware?bundleID=20792">Xcode 3</a>. You can download this from Apple, or install it from the OS DVDs that came with your Mac.</li> <li>If you're using OS X 10.6.5 or later, install <a class=" external" href="http://connect.apple.com/cgi-bin/WebObjects/MemberSite.woa/wa/getSoftware?bundleID=20719" rel="external nofollow" target="_blank" title="http://connect.apple.com/cgi-bin/WebObjects/MemberSite.woa/wa/getSoftware?bundleID=20719">Java Developer Package for Mac</a> (for a file required by the MacPorts packages we install below).</li> <li>Install <a class="external" href="http://www.macports.org/install.php" rel="external nofollow" target="_blank" title="http://www.macports.org/install.php">MacPorts</a>, and then run these commands in a shell: <pre class="eval">sudo port sync
sudo port install mercurial libidl autoconf213 yasm
</pre> </li> <li><a class=" link-https" href="https://github.com/mxcl/homebrew" rel="external nofollow" target="_blank" title="https://github.com/mxcl/homebrew">homebrew</a> is an alternative to MacPorts. As of 06/07/11, it does not have a recipe for autoconf, but that can be obtained <a class=" link-https" href="https://gist.github.com/1010716" rel="external nofollow" target="_blank" title="https://gist.github.com/1010716">here</a>. After adding that recipe, do<br> <pre>sudo easy_install pip
sudo pip install Mercurial
sudo brew install libidl autoconf yasm</pre> </li>
</ul>
<p>Problems? See <a class="internal" href="../../../../En/Developer_Guide/Build_Instructions/Mac_OS_X_Prerequisites" rel="internal">Mac OS X build prerequisites</a>.</p>
<h3 class="editable"><span>Windows</span>
<div class="editIcon"><a href="../../../../En/Simple_Firefox_build#" style="visibility: hidden;" title="Edit section"><span class="icon"><img alt="Edit section" class="sectionedit" src="../../../../skins/common/icons/icon-trans.gif"></span></a></div>
</h3>
<ul> <li>Make sure your system is up-to-date through Windows Update. Windows XP needs at least <a class="external" href="http://www.microsoft.com/windowsxp/sp2/default.mspx" rel="external nofollow" target="_blank" title="http://www.microsoft.com/windowsxp/sp2/default.mspx">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" rel="external nofollow" target="_blank" title="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, 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>, or Visual C++ 2010 Professional. VC++ 2008 Express without SP1 will not work.</li> <li>You may need to install one or more Windows SDKs. See <a class="internal" href="../../../../En/Windows_SDK_versions" rel="internal">Windows SDK versions</a> for a quick guide.</li> <li>Install the <a class=" external" href="http://www.microsoft.com/download/en/details.aspx?displaylang=en&amp;id=6812" rel="external nofollow" target="_blank" title="http://www.microsoft.com/download/en/details.aspx?displaylang=en&amp;id=6812">June 2010 DirectX SDK</a>.</li> <li>Install <a class="external" href="http://ftp.mozilla.org/pub/mozilla.org/mozilla/libraries/win32/MozillaBuildSetup-Latest.exe" rel="external nofollow" target="_blank" title="http://ftp.mozilla.org/pub/mozilla.org/mozilla/libraries/win32/MozillaBuildSetup-Latest.exe">MozillaBuild</a>, a package of additional build tools. (If you see a Windows error dialog giving you the option to re-install with the 'correct settings', choose that option and after that all should be well.)</li>
</ul>
<p>The rest of the build steps are done from the MSYS shell installed with MozillaBuild. Use the shortcuts on your desktop, or run <code>c:\mozilla-build\start-msvcX.bat</code> (where X is 8 for VS 2005, 9 for VS 2008 and 10 for VS 2010). <strong>Even if you're on 64-bit Windows, do not use the <code>start-msvcX-x64.bat</code> files </strong>(unless you know what you're doing). Those files are <strong>experimental</strong> and <strong>unsupported</strong>. See the <a class=" external" href="http://wiki.mozilla-x86-64.com/How_To_Build_Windows_x64_Build" rel="external nofollow" target="_blank" title="http://wiki.mozilla-x86-64.com/How_To_Build_Windows_x64_Build">Build:MozillaBuild For x64 wiki page</a>.</p>
<p>Problems? See <a class="internal" href="../../../../En/Developer_Guide/Build_Instructions/Windows_Prerequisites" rel="internal">Windows build prerequisites</a>.</p>
<h2>Building Thunderbird</h2>
<p>First, if you're on Windows, you'll need to start work in a directory with no spaces in the path (e.g. don't use "Documents and Settings"). You can pick any other location, but the root of C: is handy:</p>
<pre>cd /c</pre>
<p>Now let's grab the latest source code from Mozilla's <code>comm-central</code> Mercurial code repository.</p>
<pre>hg clone http://hg.mozilla.org/comm-central/
</pre>
<p>Then, we need to get all the repositories it depends on. The comm-central repository includes a script to do just that. This may take a while, it's a lot of code! First, cd into the <code>comm-</code><code>central </code>subdirectory (created automatically by the previous command), then run:</p>
<pre>python client.py checkout
</pre>
<p>To start the build, run:</p>
<pre>make -f client.mk
</pre>
<p>This step will also take a while, depending on your system and OS. Linux builds on a fast box may take under 10 minutes, Windows builds on a slow box may take an hour.</p>
<p>Various compiled files, libraries, and the Firefox executable will be found in your object directory (under <code>comm</code><code>-central/</code>), which is prefixed with <code>obj-</code>. The exact name depends on your system and OS. For example, a Mac user may get an object directory name of <code>obj-x86_64-apple-darwin10.7.3/</code>.</p>
<p>From the object directory, <strong>Windows</strong> users should run <code>mozilla/dist/bin/thunderbird.exe</code>, <strong>Linux</strong> users should run <code>mozilla/dist/bin/firefox</code>, and <strong>OS X</strong> users should run <code>dist/Shredder.app/Contents/MacOS/thunderbird-bin</code>. (Note: if you run dist/bin/thunderbird on OS X, the app will crash or behave oddly!)</p>
<div id="section_6">
<h3 class="editable"><span>Configuring options</span>
<div class="editIcon"><a href="/../../../../En/Simple_Firefox_build#" style="visibility: hidden;" title="Edit section"><span class="icon"><img alt="Edit section" class="sectionedit" src="../../../../skins/common/icons/icon-trans.gif"></span></a></div>
</h3>
<p>Additional <a href="../../../../en/Configuring_Build_Options" rel="internal">configuration options </a>are available, notably enabling debug builds and increasing build speed by using parallel compiles. These options are stored in a file named <code>mozconfig</code> (in the past this file was required, now default settings are used automatically). It is <strong>strongly</strong> recommended that you either use these defaults, or change as few options as your needs require.</p>
</div>
<h4>Building Thunderbird and Lightning</h4>
<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>in the <code>comm-central </code>directory, 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 <code>comm-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