Building XULRunner for Songbird

Overview

In general, the steps are:

  1. Pull the Songbird source code (needed to get the right configuration
  2. Configure your environment
  3. Pull the Mozilla XULRunner source code
  4. Patch the XULRunner source from Songbird repository
  5. Build XULRunner

The caveat to this is that learning to build any Mozilla project normally takes around a week of installing the right stuff, tweaking settings, figuring out why one small segment of the build process isn't working right. The most straight forward platform to build on tends to be Linux because everything you need is (normally) installed by default. Although with the new Mozilla msys enviornment windows is coming along.

At this point I suggest you go read the Mozilla build documentation for your platform of choice. Then come back here and peruse the section for that platform below for specifics to building for Songbird. Mozilla build documentation.

Machine Requirements

A recent clean install of Ubuntu (Gutsy 7.10) required the following additional packages be installed in order to build XULRunner. All other packages were either installed by default or added as part of building Songbird already.

cvs
curl (for crashreporter)
libcurl4-openssl-dev (for curl.h)
libidl-dev
libxt-dev

Step Detail

  1. Get the Songbird sourcecode. Follow the instructions on either the Download Source Page or the Subversion Source Page to get the source. You'll need both the core tree and the vendor-binaries for your platform, if for no other reason than to lay out the directory structure to copy your XULRunner build into.
  2. Configure your environment. Set your environment to point to the proper mozconfig file for your build. Assuming you use Bash on Linux that would look like:
    export MOZCONFIG=/builds/songbird/trunk/build/mozconfig/xulrunner.linux.debug.mozconfig
    export CVSROOT=:pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot
    
  3. Pull XULRunner. Once in the right dir you can just checkout the client.mk file and then pull the source. The mozconfigs checked in to the Songbird tree make sure you pull the proper SONGBIRD_... branch of mozilla.
    cd /builds/xulrunner
    cvs login
    # password is anonymous
    cvs co mozilla/client.mk
    cd mozilla
    make -f client.mk checkout
    
  4. Patch XULRunner. There is a script that will apply all the correct patches for you. It takes 3 args, the first is the path to the directory that holds the patches and the second is the path to the directory to patch. The third is an optional '-R' to revert the patch if you have a tree you want to back the changes out of. The script is designed to only pull the patches that begin with "bug" to exclude a couple of purely debugging patches we keep around. To patch the trunk of XULRunner you would use the following commands:
    cd /builds/songbird/trunk/tools/scripts/
    ./apply-patches.sh /builds/songbird/trunk/patches/mozilla/mozilla_trunk /builds/xulrunner/mozilla
    
  5. Build XULRunner. You must create the compiled dir first because the XULRunner build scripts are not able to create multiple directories (for some reason they doesn't use |mkdir -p| for this step)
    cd /builds/xulrunner/mozilla
    mkdir compiled
    make -f client.mk build
    

Wrap Up

At this point you will have a completely built XULRunner tree capable of running XUL applications, like Songbird. The next step is to copy the proper files out of the XULRunner source and compiled directories in order to build Songbird. Now on to Packaging XULRunner for Songbird.

© 2005-2008 POTI, Inc. Mozilla and Firefox are registered trademarks of the Mozilla Foundation.