Simple Sunbird build

Building Sunbird is no longer supported. You can give it a try, but its likely that the build system will present you an error. Instead it is suggested to build Thunderbird with Lightning. Please refer to the Simple Thunderbird build guide.

You can build a bleeding-edge, development version of Sunbird 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 sunbird
sudo apt-get install mercurial libasound2-dev libcurl4-openssl-dev libnotify-dev libiw-dev autoconf2.13 cvs
Fedora Linux:
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
  • 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

Problems? See Mac OS X build prerequisites.

  • If you're using Windows XP, you must have Windows XP Service Pack 2 and .NET Framework 2.0.
  • Install Visual C++ 2005 or 2008. Both the professional edition and the express edition will work.
  • 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).

Problems? See Windows build prerequisites.

Building Sunbird

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

  • On Windows, if you open the command prompt you are usually in your user profile folder which often contains spaces ( C:\Documents and Settings\...). This causes problems while building. To avoid this issue, change to a directory without spaces (i.e. C:\ ) before doing the following steps. You can use the "cd" command to do so.
# Get the source
hg clone
cd comm-central
python checkout

# Setup a basic .mozconfig file
echo 'ac_add_options --enable-application=calendar' > .mozconfig               # let's build Sunbird...
echo 'mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/objdir-sb-release' >> .mozconfig   # 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
  • 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-sb-debug
    ac_add_options --enable-application=calendar
    ac_add_options --enable-debug
    ac_add_options --disable-optimize

Running Sunbird

The Sunbird executable can be found in objdir-sb-release/mozilla/dist/bin/ (on Mac, objdir-sb-release/dist/ 

Building Sunbird 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" command above (you can do the addition before running make for the first time).

This will build the lightning extension into src/../objdir-sb/mozilla/dist/xpi-stage/. See this section for information on how to easily integrate Lightning into a nightly version of Thunderbird.

How to build again later

In your comm-central directory, run these commands:

# Get the latest source
python checkout

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

Building just Lightning

After you have completed a full build, if you would like to rebuild Lightning you don't need to go through the whole build process:

# Enter the calendar directory in the object-directory
cd src/../objdir-sb-release/calendar

# Make the Lightning extension
make -C lightning