2.3 Install XBMC from Source

The method to install XBMC from source is no different in principle to the one we have used on the previous chapter. There are however some minor modifications that need to take place in order to be successful with libRTMP support; Otherwise streaming will not work or errors like the following snippet are likely to occur during compile
In function CDVDFactoryInputStream::CreateInputStream(IDVDPlayer*....blah...blah...blah....
/xbmc/cores/dvdplayer/DVDInputStreams/DVDFactoryInputStream.cpp:83: undefined
reference to `CDVDInputStreamRTMP::CDVDInputStreamRTMP()'
collect2: ld returned 1 exit status
make: *** [xbmc.bin] Error 1

First things first; Lets uncompress the XBMC 10.1 package sources into /usr/local using the following command
DarkStar:~#cd /usr/local
DarkStar:/usr/local#tar -zxvf xbmc-10.1.tar.gz

Moving on, to get over the above mentioned problems the following actions need to take place prior to compiling the XBMC source code
  • Make the libRTMP code available from rtmpdump into the XBMC source code
    DarkStar:/usr/local#cp -r rtmpdump-2.3/librtmp/ xbmc-10.1/xbmc/lib/libRTMP
    DarkStar:/usr/local#cd xbmc-10.1/xbmc/lib/libRTMP
    DarkStar:/usr/local/xbmc-10.1/xbmc/lib/libRTMP#make clean
    DarkStar:/usr/local/xbmc-10.1/xbmc/lib/libRTMP#joe Makefile
    Change the line prefix=/usr/local into prefix=/usr and then press Ctrl+K followed by X to exit Joe editor and save changes. Then install the library from this new location as follows
    DarkStar:/usr/local/xbmc-10.1/xbmc/lib/libRTMP#make;make install

  • Remove obsolete (in our case) Windows library declarations
    DarkStar:/usr/local/xbmc-10.1/xbmc/lib/libRTMP#cd ../../cores/dvdplayer/DVDInputStreams/
    DarkStar:/usr/local/xbmc-10.1/xbmc/cores/dvdplayer/DVDInputStreams#joe DVDInputStreamRTMP.cpp
    Modify the following snippet of the file
    #ifdef _WIN32
    #include "system.h" // just for HAS_LIBRTMP
    ,into the following code
    //#ifdef _WIN32
    #include "system.h" // just for HAS_LIBRTMP
    Now press Ctrl+K followed by X to exit Joe editor and save all changes to the modified file. Also we have to get back to the root directory of the XBMC source code ready for our installation
    DarkStar:/usr/local/xbmc-10.1/xbmc/cores/dvdplayer/DVDInputStreams#cd ../../../../

At this point we can resume the XBMC source code installation as follows
DarkStar:/usr/local/xbmc-10.1#./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var;make -j3;make install

XBMC should now be installed on the HTPC system and can be tested by initially issuing the "startx" command to get fluxbox running and then in a terminal window (right click on the desktop!) the "xbmc.bin" command.


Ar said...

I followed your procedure - and now ./configre with --enable-rtmp fails with this error:

configure: error: Unable to determine soname of librtmp library

any clue?

Analekto said...

Hi Ar,

Did you install the OpenGL/VDPAU package provided on Section 2.1?
If not give it a go and let me know if that solve your problem.

Anonymous said...

tested with latest svn sources and it corrects the problem. Thank you!

Bhanche said...

Kudos to you for making this turorial :)

Can confirm that it is working, just compiled successfully on x64 Salix (Slackware variant)


Analekto said...

Rock on... };)

GaleRie said...

Hi found this link from SBo, tried to build xbmc with slackbuilds scritp downloaded from SBo, it ended up with this error :

SmbFile.cpp:30:26: fatal error: libsmbclient.h: No such file or directory
compilation terminated.
make[1]: *** [SmbFile.o] Error 1
make: *** [xbmc/filesystem/filesystem.a] Error 2

any solution for this matter please.
tnx b4

Analekto said...

Hi GaleRie,

You'll most probably need to install samba before compiling your xbmc source code. The official Slackware samba package did work for me when I compiled xbmc for SlaXBMC.

I hope this help.