HOW-TO:Compile XBMC for Ubuntu

This guide will show you how to compile XBMC for Ubuntu.

We currently recommend Ubuntu Precise(12.04) or later. A gfx-adapter with OpenGL acceleration is highly recommended and 24/32 bitdepth is required with OpenGL.

Getting the source code
Enter the following into the command line.

Installing the required Ubuntu packages
Two methods exist to install the required Ubuntu packages:

Use a single command to get all build dependencies
You can get all build dependencies used for building the packages on the PPA

Add the unstable and build-depends PPAs:

Here is the magic command to get the build dependencies (used to compile the version on the PPA).

Optional: If you do not want xbmc to be installed via PPA, you can removed the PPAs again:

For developers and anyone else who compiles frequently it is recommended to use ccache

A tip for those with multiple computers at home is to check out distcc (totally unsupported from xbmc of course)

Alternative: Manual dependency installation
For Ubuntu (all versions >= 7.04):

For >= 10.10:

On 8.10 and older versions, libcurl is outdated and thus XBMC will not compile properly. In this case you will have to manually compile the latest version.

For >= 12.10

For <= 12.04.
 * We need a new version of taglib than what is available. We supply a Makefile in lib/taglib to make it easy to install into /usr/local.

Unless you are proficient with how linux libraries and versions work, do not try to provide it yourself, as you will likely mess up for other programs.

How to compile
To create the XBMC executable manually perform these steps:


 * Notes
 * A full listing of supported options can be viewed by typing
 * By adding -j to the make command, you describe how many concurrent jobs will be used. So for dualcore the command is:
 * You may need to run this with sudo (sudo make install) if your user doesn't have write permissions to the prefix you have provided (as in the default case, /usr/local).


 * Enter the following into the command line

This will install XBMC in the prefix provided in 4.1 as well as a launcher script.

To override the location that XBMC is installed, use PREFIX=. For example:

Test Suite
XBMC has a test suite which uses the Google C++ Testing Framework. The framework is provided directly in XBMC's source tree and has very little requirements in order to build and run. See the README file for the framework at 'lib/gtest/README' for specific requirements.

To compile and run XBMC's test suite, the configure option '--enable-gtest' has to be explicitely set during the configure stage. Once configured, to build the testsuite, type the following.

To compile the test suite without running it, type the following.

The test suite program can be run manually as well. The name of the test suite program is 'xbmc-test' and will build in the XBMC source tree. To bring up the 'help' notes for the program, type the following.

The most useful options are,


 * gtest_list_tests
 * List the names of all tests instead of running them. The name of TEST(Foo, Bar) is "Foo.Bar".


 * gtest_filter=POSTIVE_PATTERNS[-NEGATIVE_PATTERNS]
 * Run only the tests whose name matches one of the positive patterns but none of the negative patterns. '?' matches any single character; '*' matches any substring; ':' separates two patterns.

How to run
How to run xbmc depends on the type of installation you have done. It is possible to run XBMC without the requirement to install xbmc anywhere else. In this case, type the following from the top source directory.

If you chose to install XBMC using '/usr' or '/usr/local' as the PREFIX, you can just issue 'xbmc' in a teminal session.

If you overridden PREFIX to install XBMC into some non-standard location, you will have to run xbmc by directly running 'xbmc.bin'. For example.

Uninstalling
Issue " " (" " if you user doesn't have write permission to the install directory) from your source tree. If you would like to also remove any settings and 3rd party addons (skins, scripts, etc) you should also run