Building Songbird

Songbird is meant to be built under multiple environments. Pick the one below that best matches your situation.

If someone would like to help us create a compatible XCode or Eclipse harness, we would love you for it.

In the examples, below, we assume you have already unpacked the trunk into /sbird and your platform dependencies in their proper /sbird/dependencies/<platform> folder. If you put them somewhere else, you should start from your own trunk folder accordingly.

If you have not got them at all, please go get the code and set all that up, first. You also might want to uninstall any old versions you might have currently and delete any old profiles.

Configure Options

There are a handful of customization options that you can pass to the build system.

The preferred way is to set them through the songbird.config file. You can create this file in the root folder of your source code tree ( /sbird/trunk ) and add the lines to enable/disable functionality.

You do this by adding the options with the ac_add_options command, one per line, like so:

  ac_add_options --enable-debug
  ac_add_options --disable-installer

Here is a list of all the possible options available (pulled from ./configure --help):

  --enable-debug                         whether or not to compile a debug version (disabled by default)
  --enable-jars                          whether or not to create jar files (enabled by default)
  --enable-installer                     whether or not to create installer (disabled by default)
  --enable-official                      whether or not to create an official build (disabled by default)
  --enable-nightly                       whether or not to create an nightly build (disabled by default)
  --enable-tests                         whether or not to build tests (defaults: debug:enabled rel:disabled)
  --enable-update-channel=CHANNEL        which update channel to use ("default")
  --enable-breakpad                      whether or not to enable breakpad (disabled by default in non-official builds)
  --enable-static                        experimental single-component static build support (disabled by default)
  --enable-compiler-environment-checks   only allow officially-supported compiler versions (enabled by default)

Win32: MSYS

The currently preferred method for building Songbird for Win32 is through the use of a specialized MSYS build environment provided by Mozilla. It is based on MinGW and contains the correct versions of all support packages required to build a Mozilla application. It is significantly faster than using Cygwin, to boot.

Mozilla's documentation for their use of MSYS can be found here: http://developer.mozilla.org/en/docs/Windows_Build_Prerequisites#MozillaBuild

You should launch MSYS using the start-msvc71.bat, start-msvc8.bat or start-msvc9.bat, depending upon the compiler you are using. (--disable-compiler-environment-checks must be used when compiling with MSVC9, as it is unsupported.  Please do not files bugs about that configuration.)

  • Required Tools
    • Mozilla Build; Download version 1.4
    • Visual Studio 2005 SP1 (VC8) with C++ compiler installed
    • Windows Media Format SDK (No longer necessary as a separate install; it comes with the Vista SDK below).
    • Vista SDK
    • You must be using MozillaBuild >= 1.3; 1.1 no longer works with VC8
    • MozillaBuild 1.4 has a broken install.exe, remove it by deleting c:\mozilla-build\vim\vim72\install.exe
  1. (This step is not strictly necessary if you don't want to access additional tools provided by Visual Studio. On Vista, you need to disable User accout control in order to modify the following file.) vsvars32.bat file to add %VSINSTALLDIR%\Common7\Tools\bin\winnt; to the path block.  The vsvars32.bat file is located in your Microsoft Visual Studio 8 directory under Common7\Tools.
    PATH=%DevEnvDir%;%MSVCDir%\BIN;%VCINSTALLDIR%\Common7\Tools;%VCINSTALLDIR%\Common7\Tools\bin\prerelease;%VCINSTALLDIR%\Common7\Tools\bin;%VCINSTALLDIR%\Common7\Tools\bin\winnt;%FrameworkSDKDir%\bin;%FrameworkDir%\%FrameworkVersion%;%PATH%;
  2. Run make -f songbird.mk from your songbird source directory. You can build a debug mode Songbird by adding the keyword "debug" as the last parameter to make.
    1. Release mode:
      %~/sbird: make -f songbird.mk 
    2. Debug mode:
      %~/sbird: make -f songbird.mk debug
  3. Change directory to compiled/dist/ and launch the application by typing ./Songbird (or just doubleclick the Songbird.exe from Explorer).
    %~/sbird: cd compiled/dist
    %~/sbird/compiled/dist: ./Songbird

If you ever need to rebuild, it's probably wise to call songbird.mk with "clobber" first. Like so:

%~/sbird: make -f songbird.mk clobber
%~/sbird: make -f songbird.mk

NOTE: There are also useful Environment Variables that control various options when building.

MacOSX

These instructions are also probably valid for most *BSD.

  1. Check for the port command.
    1. If the port command is not in your path, install the MacPorts client.
    2. Add /opt/local/bin to your path so port is available.
    3. Update MacPorts: (sudo port -d selfupdate)
  2. Check for and install the following required tools:
    • Required Tools
      • GNU Compiler C and C++ v4.x. (Install XCode)
      • GNU make 3.80 or newer. (sudo port install gmake)
      • GNU autoconf v2.59 or newer. (sudo port install autoconf)
      • GNU coreutils. (sudo port install coreutils)
      • libIDL (sudo port install libidl; ONLY REQUIRED IF YOU'RE BUILDING XULRUNNER YOURSELF)
  3. Now you can finally build the bird.
    %~/sbird: make -f songbird.mk 
    
  4. Change directory to compiled/dist/ and launch the application by typing open ./Songbird (or just doubleclick Songbird.app in Finder).
    %~/sbird: cd compiled/dist
    %~/sbird/compiled/dist: open ./Songbird.app
    

If you ever need to rebuild, it's probably wise to call songbird.mk with "clobber" first. Like so:

%~/sbird: make -f songbird.mk clobber
%~/sbird: make -f songbird.mk

NOTE: There are also useful Environment Variables that control various options when building.

Linux

  • Required Tools (via apt-get, rpm, yum, what-have-you) (note, our configure script doesn't currently check for the version you have installed for these items, that will be fixed with bug 428).
  • GNU make 3.80 or newer.
  • GNU autoconf v2.59 or newer.
  • GNU Compiler C and C++ v4.x.

A current install of Ubuntu (Gutsy 7.10) required the following additional packages be installed to compile, as of 1/18/2008.

 subversion
 autoconf
 g++
 g++-4.1
 libgstreamer0.10-dev
 libgstreamer-plugins-base0.10-dev
 libgtk2.0-dev
 
 // The following should only be for iPod plugin
 libdbus-1-dev
 libdbus-glib-1-dev
 libhal-dev
  1. In your trunk folder
    %~/sbird: make -f songbird.mk 
    
  2. Go into compiled/dist/ and run Songbird (eg. ./Songbird).
    %~/sbird: cd compiled/dist 
    %~/sbird/compiled/dist: ./songbird
    

If you ever need to rebuild, it's probably wise to call songbird.mk with "clobber" first. Like so:

%~/sbird: make -f songbird.mk clobber
%~/sbird: make -f songbird.mk

If you are making changes in subdirectories you can go into the compiled directory and type "make". If you make changes to app or component you can make from there, the other dirs require a build from the compiled directory.

NOTE: There are also useful Environment Variables that control various options when building.

Additional Dependencies For Known Linux Distros

Every flavor of Linux has its own idiosyncracies. We're not sure exactly what it's going to take to get Songbird going on all the different distributions in the world. If you need to do anything special to get it working on a different distro than we have listed here -- or if the information listed is incorrect -- please make an entry in Bugzilla.

If you spin a Linux distribution-specific build, we'd love to host or point to it from our Contributed Builds page.

  • Required for Building - The GStreamer development packages are required to build Songbird. On Ubuntu, you must install "libgstreamer0.10-dev" and "libgstreamer-plugins-base0.10-dev". Please check your distribution's package manager for its version of these development packages.
  • Required for Playback ALL DISTROS - Check out the following pages for information on playback dependencies. In short we use gstreamer on linux and will only play what gstreamer is set up for.
  • 64-bit
    • We've resolved the 64bit issues with building so this should work just fine now. The only big difference is to make sure to pull the proper dependencise ( linux-x86_64 instead of linux ).
  • Fedora Core 4
    • You will need svn as for some reason this distro doesn't include it by default. (as per our general build instructions)
  • Fedora Core 5
    • svn comes already installed here, so you're golden.
  • Fedora 9 
    • Recent builds have shown these Fedora packages are necessary:
      • gstreamer-plugins-base-devel
      • gstreamer-devel
      • gtk2-devel
      • dbus-glib-devel
      • hal-devel

Environment Variables

(for make builds)

  • SB_ENABLE_JARS - this var is only checked in debug builds. It will turn ON jarring of chrome files, which is by default disabled in debug builds.
  • SB_ENABLE_INSTALLER - this var is checked regardless of release or debug status. It will turn ON building of the installer for your platform.
  • SB_DISABLE_JARS - this var is only checked in release builds. It will turn OFF jarring of chrome files, which is by default enabled in release builds.
  • SB_DISABLE_COMPILER_ENVIRONMENT_CHECKS - this var disables compiler version checking. This is necessary when using MSVC9, for example.
  • SB_DISABLE_PKG_AUTODEPS - prevent the build system from managing various cross-repository software package dependencies. Required for building offline.
  • MOZBROWSER_DEP_CHECKOUT - the command used to checkout dependencies/mozbrowser; override if you need a non-standard approach
  • MOZBROWSER_DEP_UPDATE - the command used to update dependencies/mozbrowser; override if you need a non-standard approach
Tag page
Viewing 15 of 19 comments: view all
I can not get step 2 to work under Win32: MSYS
the error is: make command not found
Posted 15:49, 2 Sep 2008
I had an issue where "cp -d" was throwing errors in make.

See this for resolution:
http://bugzilla.songbirdnest.com/show_bug.cgi?id=12742#c2
Posted 17:54, 5 Oct 2008
Is there a way to ignore the version of the Visual Studio installed. I have visual studio 2008, which throws a version unsupported error.
Posted 05:51, 11 Dec 2008
@millitaryman69,

You must "cd trunk", then "make -f songbird.mk".
Posted 16:07, 13 Mar 2009
I am getting stuck at Win32: MSYS step 2.

Is this something I set up in VS8 or each time I need to compile the application?

Also, my PATH for vsvars32.bat looks like this... that OK?:
@set PATH=C:\Program Files\Microsoft Visual Studio 8\Common7\IDE;C:\Program Files\Microsoft Visual Studio 8\VC\BIN;C:\Program Files\Microsoft Visual Studio 8\Common7\Tools;C:\Program Files\Microsoft Visual Studio 8\Common7\Tools\bin;C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\bin;C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\bin;C:\Windows\Microsoft.NET\Framework\v2.0.50727;C:\Program Files\Microsoft Visual Studio 8\VC\VCPackages;%PATH%;%VSINSTALLDIR%\Common7\Tools\bin\winnt;
Posted 22:49, 17 Jul 2009
MozillaBuild 1.4 seems to work, with only one issue: https://bugzilla.mozilla.org/show_bug.cgi?id=506020
Posted 05:39, 1 Sep 2009
Using the Win32: MSYS build with Visual C++ 2005 Express kept failing--couldn't open two header files: devioctl.h and ntddstor.h. Following Mozilla's suggestion I downloaded Windows Server 2003 R2 Platform SDK (http://download.cnet.com/Windows-Server-2003-R2-Platform-SDK-ISO-Download/3000-10248_4-10731094.html) in addition to Windows Vista SDK, but neither of these SDKs has these two files. Finally I downloaded Windows Server 2003 DDK which does contain these two headers (http://download.microsoft.com/download/9/0/f/90f019ac-8243-48d3-91cf-81fc4093ecfd/1830_usa_ddk.iso). Despite adding the location of these includes to the vsvars32.bat file (in the INCLUDE environment variable) the build still could not find them. On the possibility that the build script is unable to deal with the space in "Program Files" (the DDK's default installation), I created an include folder in my C:\mozilla-build folder, copied into it these two files from the DDK folder, and updated the vsvars32.bat file. Build succeeds.

Since there is no mention of the DDK in the instructions here or at the Mozilla site referenced above, I wonder if I missed something, or maybe this is just a quirky side-effect of using Visual C++ 2005 Express.
Posted 23:23, 6 Oct 2009
EDIT: as of jan-2010 Songbird has changed and the following instructions no longer work.

I had the same problem as blisshome but i put those two files in <songbird trunk directory>/dependencies\windows-i686-msvc8\private\windows_ddk\release\include directory and it all worked.
I didnt have to modify vsvars32.bat nor the system PATH environment variable.

Not sure if there is instructions somewhere about putting the Windows DDK there (considering the directory names) but I got the hint from looking at the command line used to compile the file that threw the error (its one of the -I parameters)

Maybe this is a more "compliant" way of resolving this issue? edited 17:27, 27 Jan 2010
Posted 19:36, 3 Nov 2009
If you wish to just browse sources in Visual Studio without having to install MSYS (or MingW) then you can generate the dummy Visual Studio project files with the following command:

NOTES:
1. \Projects\Songbird\ is the path to the Songbird source folder without the drive specifier
2. vc8 and SongbirdVC8 are dependent on your version of Visual Studio as follows:
2003 = vc7, SongbirdVC7
2005 = vc8, SongbirdVC8
2008 = vc9, SongbirdVC9

3. Run the command from the folder \Projects\Songbird\vcproj\mkvcproj\


mkvcproj.exe -vc8 -outfiles:SongbirdVC8 -project:Songbird -root:\Projects\Songbird\ -prefix:\Projects\Songbird\ -outpath:\Projects\Songbird\vcproj -e:obj,idb,lib,pch,pdb,ilk,exe,dll,dsp,sln,vcproj,dsw,opt,plg,ncb,suo,user,log,m4,bak -d:compiled,dependencies -p:.svn -m:*.,.*
Posted 08:12, 17 Nov 2009
I followed MissUBill's solution but now the build fails as follows:

C:/Songbird/components/mediacore/metadata/handler/wma/src/MetadataHandlerWMA.cpp(56): fatal error C1083: Cannot open include file: 'atlbase.h': No such file or directory
Posted 09:01, 26 Nov 2009
You can't build the windows media media core using the express compilers, so add --with-media-core=gstreamer to your songbird.config
Posted 23:20, 9 Dec 2009
Got trunk compiled today using Visual Studio 2008 trial in Windows 7.. To get it running, I had to:
1) Install MozillaBuild 1.4
2) Install Windows Visual Studio 2008
3) Installed Windows Driver Kit (needed to compile the iPod extension): http://www.microsoft.com/downloads/details.aspx?FamilyID=2105564e-1a9a-4bf4-8d74-ec5b52da3d00&displaylang=en
4) Installed the Windows 7 SDK: http://www.microsoft.com/downloads/details.aspx?FamilyID=c17ba869-9671-4330-a63e-1fd44e0e2505&displaylang=en
5) searched for notepad++ (or any good text editing tool) in the start menu, right click, run as administrator (or be dodgy and turn off UAC, but not a good idea)
6) Edited C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\Tools\vsvars32.bat
7) You must add the WinDDK includes, path and lib's to vsvars32.bat or it will have an issue finding a header.. An example is below:
/////SNIP////////////////
@set PATH=C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE;C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\BIN;C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\Tools;C:\Windows\Microsoft.NET\Framework\v3.5;C:\Windows\Microsoft.NET\Framework\v2.0.50727;C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\VCPackages;C:\WinDDK\7600.16385.0\bin;%PATH%
@set INCLUDE=C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\ATLMFC\INCLUDE;C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\INCLUDE;C:\WinDDK\7600.16385.0\inc\api;%INCLUDE%
@set LIB=C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\ATLMFC\LIB;C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\LIB;C:\WinDDK\7600.16385.0\lib;%LIB%
@set LIBPATH=C:\Windows\Microsoft.NET\Framework\v3.5;C:\Windows\Microsoft.NET\Framework\v2.0.50727;C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\ATLMFC\LIB;C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\LIB;%LIBPATH%
///////////SNIP//////////
8)run c:\mozilla-build\start-msvc9.bat
9) cd into your songbird svn path (so /sbird in my case). (fyi, outside of Mozilla build, this will be under the msys path in mozilla build directory)
10) create a songbird.config file.. Inside, put:
ac_add_options --disable-compiler-environment-checks (and if you want installer, on the same line after a space, put --enable-installer, but you also need to mess with nsis plugins first).
11) make -f songbird.mk (and the thing should build.. If not, grab your config.log and try to get help)
12) the compiled version is under sbird/compiled/dist


13) if you mess around with code, and want to recompile the safest way, run make -f songbird.mk clobber before running make -f songbird.mk again.
14) Any probs, try IRC ;) edited 21:19, 17 Jan 2010
Posted 23:14, 16 Jan 2010
Btw, for building the installer, you have to copy the dependencies/nsis/extra-plugin files into their correct NSIS locations (which is pretty obvious)..

For building the ipod addon, more info is at http://blog.songbirdnest.com/2009/08/05/open-sourcing-the-ipod-add-on/
Posted 22:19, 6 Mar 2010
You might also need to add the following into the beginning of your mozilla-build/start-msvc9.bat too (after the echo off):

SET "INCLUDE=C:\WinDDK\7600.16385.0\inc\api;%INCLUDE%"
SET "LIB=%LIB%;C:\WinDDK\7600.16385.0\lib"
Posted 08:18, 15 Mar 2010
HOW TO CHECK IF YOUR VARS ARE SET UP PROPERLY:
Use env | grep <name of variable, like include>

If it doesn't have the WinDDK thing listed, its kaboom..
Posted 08:22, 15 Mar 2010
Viewing 15 of 19 comments: view all
You must login to post a comment.