HOW-TO:Compile XBMC for Linux

From XBMC
Jump to: navigation, search
Cleanup.png This page or section may require cleanup, updating, spellchecking, reformatting and/or updated images. Please improve this page if you can. The discussion page may contain suggestions.

Warning: This is only a copy and paste from the README.linux just to get this article started. Please refer to the GIT version of README.linux to be sure you got the latest edition!
Information: The compile process below is basic and further information about compiling in own platform can be found in Readme.your-platform


Note: XBMC is open source (GPL) software and as so the source code is available for anyone to modify and/or compile (under the rules of the GPL).

Contents

1 Prerequisites

Supported Linux Operating-System installed on a supported computer, currently the officially supported OS are
Ubuntu Desktop Edition
Ubuntu Server Edition
Ubuntu Minimal
Ubuntu for ARM
Note: Note that it is also possible to compile and run 32-bit XBMC under 64-bit (AMD64/EMT64) Ubuntu if you run it in a 32bit chroot.
Other working distributions (but officially unsupported) are
Some hardware requirements

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).

2 Getting the source code

For the first time:

sudo apt-get install git-core -y
cd $HOME
git clone git://github.com/xbmc/xbmc.git

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

cd $HOME/xbmc
git clean -xfd
git reset --hard
git pull --rebase

3 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.

Method 1

With ppa

sudo apt-get update

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

sudo apt-get build-dep xbmc
Method 2
sudo apt-get update

Without ppa (only Dependencies including the ones on Method 1

sudo apt-get install libvdpau-dev ccache autopoint libltdl-dev git-core build-essential gawk pmount libtool nasm yasm automake cmake gperf zip unzip bison libsdl-dev libsdl-image1.2-dev libsdl-gfx1.2-dev
libsdl-mixer1.2-dev libfribidi-dev liblzo2-dev libfreetype6-dev libsqlite3-dev libogg-dev libasound2-dev python-sqlite libglew-dev libcurl3 libcurl4-gnutls-dev libxrandr-dev libxrender-dev libmad0-dev
libogg-dev libvorbisenc2 libsmbclient-dev libmysqlclient-dev libpcre3-dev libdbus-1-dev libhal-dev libhal-storage-dev libjasper-dev libfontconfig-dev libbz2-dev libboost-dev libenca-dev libxt-dev libxmu-dev 
libpng-dev libjpeg-dev mesa-utils libcdio-dev libsamplerate-dev libmpeg3-dev libflac-dev libiso9660-dev libass-dev libssl-dev fp-compiler gdc libmpeg2-4-dev libmicrohttpd-dev libmodplug-dev libssh-dev gettext
cvs python-dev libyajl-dev libboost-thread-dev libplist-dev libusb-dev libudev-dev libtinyxml-dev libcap-dev curl swig default-jre libavcodec-dev libavfilter-dev libavformat-dev libavutil-dev libbluetooth-dev
libbluray-dev libbluray1 libcec-dev libcec1 libcrystalhd-dev libcrystalhd3 libcurl4-gnutls-dev libcwiid-dev libcwiid1 libnfs-dev libpostproc-dev libshairport-dev libswscale-dev libva-dev libva-egl1 
libva-tpi1 libmp3lame-dev libtiff-dev -y

4 How to compile

4.1 Default compile and install

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

cd $HOME/XBMC
./bootstrap
./configure
make
sudo make install

5 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.

make -C lib/taglib
make -C lib/taglib install

6 Compiling libnfs

make -C lib/libnfs
make -C lib/libnfs install

6.1 ./configure command line switches

These switches are possible when running configure:

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

./configure --disable-debug --disable-gl

6.2 Quicker compilation

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

make -j2

or

make -j2 sdl_2d

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.

7 How to run

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

xbmc

8 Fullscreen

Toggle FS with \ key while XBMC is running.

9 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

10 Weblinks

Personal tools
Namespaces
Variants
Actions
Navigation
Wiki help
Google Search
Toolbox