HOW-TO:Compile XBMC for Linux

Prerequisites

 * Supported Linux Operating-System installed on a supported computer, currently the officially supported OS are:
 * Ubuntu Desktop Edition
 * Ubuntu Desktop Edition 12.04 LTS (Precise Pangolin) 32-bit for x86
 * Ubuntu Desktop Edition 12.10 (Quantal Quetzal) 32-bit for x86
 * Ubuntu Server Edition
 * Ubuntu Server Edition 12.04 LTS (Precise Pangolin) 32-bit for x86
 * Ubuntu Server Edition 12.10 (Quantal Quetzal) 32-bit for x86
 * Ubuntu Minimal
 * Ubuntu Minimal 12.04 LTS (Precise Pangolin) 32-bit for x86
 * Ubuntu Minimal 12.10 (Quantal Quetzal) 32-bit for x86
 * Ubuntu for ARM
 * Ubuntu for ARM 12.04 LTS (Precise Pangolin)
 * Ubuntu for ARM 12.10 (Quantal Quetzal)


 * Other working distributions (but officially unsupported) are:
 * Fedora RedHat Enterprise Linux, and CentOS
 * OpenSUSE
 * Debian
 * Moblin

x86-based computer. No other special hardware is required for development, as developers can compile using the "make sdl_2d option" (see README.linux). However for end-users the minimum requirement is a 3D GPU (Graphics Processing Unit) that at least supports Shader Model 3.0 and OpenGL 2.0 (that features 24bpp or 32bpp for 3D hardware-acceleration support, which XBMC GUI need to run smootly at an acceptable frame-rate). Graphic adapters that support DirectX version 9.0c or later usually meet all of those mentioned requirements, (Team-XBMC recommends NVIDIA GeForce 6150 or later as NVIDIA are currently the manufacturer that offers good device-drivers for Linux (and NVIDIA GeForce 6150 or later supports OpenGL 2.0).
 * Some hardware requirements:


 * Correctly installed graphics device-drivers which supports 24bpp or 32bpp for 3D hardware-acceleration, (Team-XBMC recommends that you run Envy which is a application that automatically downloads and installs the correct proprietary device-driver for your ATI or NVIDIA graphic chip).

Getting the source code
For the first time:

In order to update the source code (and clean old make files):

Installing required Ubuntu packages
The current list of required packages for each supported version is located in the README.linux file in the GIT

Use a single command to get all build dependencies

For this, you need to specify the PPA in your apt sources.Where are XBMC packages in Ubuntu.

With ppa
 * Method 1:

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


 * Method 2:

Without ppa (only Dependencies including the ones on Method 1

Default compile and install
Requires 3D GPU that has supported OpenGL 3D hardware acceleration, set bitdepth to 24bpp or 32bpp

Compiling Libtag
libtag 1.8 is a requirement to compile XBMC from GIT, If you are using Ubuntu 12.04LTS or older use method below.

./configure command line switches
These switches are possible when running configure:


 * --prefix=/path
 * Install XBMC to /path rather than default (/usr/local)
 * --disable-gl
 * Much much slower GUI rendering but works on all adapters and bitdepths. For development purposes only.
 * --disable-debug
 * No debug information (smaller executable, no FreeMem text in screens)
 * open issue: FreeMem is still shown even with --disable-debug

It is also possible to combine these options, for example:

Quicker compilation
By adding -j to the make command, you describe how many cores will be used. So for dual core the commands are:

or

Experimental: You could add distcc if you have more than one computer networked. This will run make on several computers sharing the workload between them.

How to run
Everything is now taken care of by the install script. Simply run the xbmc command from anywhere:

Fullscreen
Toggle FS with \ key while XBMC is running.

Multi-monitor Fullscreen
If you have a multi-monitor setup and you want to use fullscreen, make sure to set the env variable SDL_VIDEO_FULLSCREEN_HEAD to the display no. which you want SDL to use for the fullscreen mode.

For e.g. "SDL_VIDEO_FULLSCREEN_HEAD=1 ./xbmc.bin -fs" to tell SDL to use display no.1

Weblinks

 * HOW-TO: Ubuntu – XBMC-Repository-Overview – 10.1 Dharma und 11.0 Eden – with and without PVR - XBMC-Repository for 8.04, 9.04, 9.10, 10.04, 10.10, 11.04, 11.10 & 12.04
 * HOW-TO: HowTo – Ubuntu 10.04 – Installation & Konfiguration von NVIDIA VDPAU, VDR mit VNSI-Server & XBMC PVR-TESTING2 - Hierbei handelt es sich um ein deutsches All-in-One Tutorial wie man XBMC (pvr-testing2) inkl. VDR mit dem VNSI-SERVER und LIRC zum laufen bringt. English translation


 * HOW-TO Compile XBMC from GIT - Script - (If using keep an eye on dependencies see Readme.Ubuntu for more information)