CedarX/XBMC

Native Compile of XBMC
This is a little howto of my steps to compile xbmc (github.com/empatzero/xbmca10) native on the Mele A2000. Result should be a debian/unstable(armel) system with xbmc.

Create SD-Card
First step was to create a bootable debian system on sd-card based on this excellent howto: http://rhombus-tech.net/allwinner_a10/hacking_the_mele_a1000/Building_Debian_From_Source_Code_for_Mele/

Differences to the howto:
 * I created a rootfs for debian sid - not for squeeze
 * I changed the display in the fex-file to vga)

Host system for image-creation was a Debian (sid/unstable) - virtual machine in VMWare

Boot into Debian
Boot the new debian sid from the sdcard directly from the mele and bring the system up to date: root@mele:/# apt-get update root@mele:/# apt-get upgrade root@mele:/# apt-get install git Create our workspace directory: root@mele:/# mkdir /opt/melehacking root@mele:/# cd opt/melehacking

Install dependencies and do some modifications
root@mele:/opt/melehacking# git clone git://github.com/empatzero/xbmca10.git (or use "git://github.com/rellla/xbmca10.git" if you don't want to do the changes below) root@mele:/opt/melehacking# apt-get build-dep xbmc

this should install the following packages: autoconf automake autopoint autotools-dev binutils bsdmainutils build-essential bzip2 cmake cmake-data comerr-dev cpp cpp-4.4 cpp-4.6 curl debhelper dpkg-dev emacsen-common fontconfig-config g++ g++-4.4 g++-4.6 gawk gcc gcc-4.4 gcc-4.4-base gcc-4.6 gcc-4.6-base gettext gettext-base gperf groff-base html2text intltool-debian krb5-multidev libao-common libao-dev libao4 libarchive12 libasound2 libasound2-dev libasprintf0c2 libass-dev libass4 libasyncns0 libavahi-client-dev libavahi-client3 libavahi-common-data libavahi-common-dev libavahi-common3 libavcodec-dev libavcodec53 libavfilter-dev libavfilter2 libavformat-dev libavformat53 libavutil-dev libavutil51 libbluetooth-dev libbluetooth3 libbluray-dev libbluray1 libboost-date-time1.49-dev libboost-date-time1.49.0 libboost-dev libboost-serialization1.49-dev libboost-serialization1.49.0 libboost-thread-dev libboost-thread1.49-dev libboost-thread1.49.0 libboost1.49-dev libbz2-dev libc-dev-bin libc6-dev libcaca-dev libcaca0 libcdio-dev libcdio13 libcec-dev libcec1 libcroco3 libcurl3 libcurl4-gnutls-dev libcwiid-dev libcwiid1 libdbus-1-3 libdbus-1-dev libdirac-encoder0 libdirectfb-1.2-9 libdirectfb-dev libdirectfb-extra libdpkg-perl libdrm-dev libdrm-nouveau1a libdrm-omap1 libdrm-radeon1 libdrm2 libegl1-mesa libegl1-mesa-dev libegl1-mesa-drivers libelf1 libenca-dev libenca0 libexpat1-dev libflac-dev libflac8 libfontconfig1 libfontconfig1-dev libfreetype6 libfreetype6-dev libfribidi-dev libfribidi0 libgbm1 libgcrypt11-dev libgettextpo0 libgl1-mesa-dev libgl1-mesa-glx libglapi-mesa libgles2-mesa libgles2-mesa-dev libglew-dev libglew1.7 libglib2.0-bin libglib2.0-dev libglu1-mesa libglu1-mesa-dev libgmp10 libgnutls-dev libgnutls-openssl27 libgnutlsxx27 libgomp1 libgpg-error-dev libgsm1 libgssrpc4 libhal-dev libhal-storage-dev libhal-storage1 libhal1 libice-dev libice6 libicu48 libidn11-dev libiso9660-8 libiso9660-dev libjasper-dev libjasper1 libjbig-dev libjbig0 libjpeg8 libjpeg8-dev libjson0 libkadm5clnt-mit8 libkadm5srv-mit8 libkdb5-6 libkms1 libkrb5-dev liblcms1 libldap2-dev libltdl-dev libltdl7 liblzo2-2 liblzo2-dev libmad0 libmad0-dev libmicrohttpd-dev libmicrohttpd10 libmikmod2 libmikmod2-dev libmodplug-dev libmodplug1 libmp3lame-dev libmp3lame0 libmpc2 libmpeg2-4 libmpeg2-4-dev libmpfr4 libmysqlclient-dev libmysqlclient18 libnettle4 libnfs-dev libnfs1 libogg-dev libogg0 libomxil-bellagio-dev libomxil-bellagio0 libopencv-core2.3 libopencv-imgproc2.3 libopenjpeg2 libopenvg1-mesa liborc-0.4-0 libp11-kit-dev libpcre3-dev libpcrecpp0 libpipeline1 libplist-dev libplist1 libpng12-0 libpng12-dev libpopt0 libpostproc-dev libpostproc52 libpthread-stubs0 libpthread-stubs0-dev libpulse-dev libpulse-mainloop-glib0 libpulse0 libpython2.7 librtmp-dev libsamplerate0 libsamplerate0-dev libschroedinger-1.0-0 libsdl-image1.2 libsdl-image1.2-dev libsdl-mixer1.2 libsdl-mixer1.2-dev libsdl1.2-dev libsdl1.2debian libshairport-dev libshairport1 libsigsegv2 libslang2-dev libsm-dev libsm6 libsmbclient libsmbclient-dev libsndfile1 libspeex1 libsqlite3-0 libsqlite3-dev libssh2-1-dev libssl-dev libstdc++6-4.4-dev libstdc++6-4.6-dev libswscale-dev libswscale2 libtalloc2 libtasn1-3-dev libtdb1 libtheora0 libtiff4 libtiff4-dev libtiffxx0c2 libtimedate-perl libtinyxml-dev libtinyxml2.6.2 libtool libts-0.0-0 libts-dev libudev-dev libunistring0 libva-dev libva-egl1 libva-glx1 libva-tpi1 libva-x11-1 libva1 libvdpau-dev libvdpau1 libvorbis-dev libvorbis0a libvorbisenc2 libvorbisfile3 libvpx1 libwayland0 libwbclient0 libwebp-dev libwebp2 libx11-dev libx11-xcb-dev libx11-xcb1 libx264-123 libxau-dev libxcb-dri2-0 libxcb-glx0 libxcb-glx0-dev libxcb-render0 libxcb-shape0 libxcb-xfixes0 libxcb1-dev libxdamage-dev libxdamage1 libxdmcp-dev libxext-dev libxfixes-dev libxfixes3 libxi6 libxml2-dev libxmlrpc-core-c3 libxmu-dev libxmu-headers libxmu6 libxrandr-dev libxrandr2 libxrender-dev libxrender1 libxt-dev libxt6 libxtst6 libxvidcore4 libxxf86vm-dev libxxf86vm1 libyajl-dev libyajl2 linux-libc-dev m4 make man-db mesa-common-dev mysql-common patch pkg-config po-debconf python python-dev python-imaging python-minimal python-support python2.7 python2.7-dev python2.7-minimal tsconf ttf-dejavu-core ucf x11-common x11proto-core-dev x11proto-damage-dev x11proto-dri2-dev x11proto-fixes-dev x11proto-gl-dev x11proto-input-dev x11proto-kb-dev x11proto-randr-dev x11proto-render-dev x11proto-xext-dev x11proto-xf86vidmode-dev xorg-sgml-doctools xtrans-dev yasm zip zlib1g-dev

need to install 3 more dependencies: root@mele:/opt/melehacking# apt-get install swig default-jre cmake

and remove all EGL/GLES-stuff to avoid conflicts root@mele:/opt/melehacking# apt-get remove libegl1-mesa libegl1-mesa-dev libegl1-mesa-drivers libgles2-mesa libgles2-mesa-dev

go on create the download directory for the mali/cedarx tarballs root@mele:/opt/melehacking# mkdir /root/tarballs

and create an swap-file, because otherwise the compiler runs out of memory during compiling and aborts root@mele:/opt/melehacking# dd if=/dev/zero of=/swap bs=1M count=384 root@mele:/opt/melehacking# mkswap -c /swap root@mele:/opt/melehacking# swapon /swap

do some adaptions to compile cleanly Line 15: +# enable, if you want to use hardware layer +export A10HWR=1 Line 44 (that has to be changed...maybe to "armel-linux"): -export BUILD=i686-linux +export BUILD=amd64-linux # armel-linux?? Line 81: -export CFLAGS=-pipe -O3 -mtune=cortex-a8 -D__ARM_NEON__ -DALLWINNERA10 +export CFLAGS=-pipe -O3 -mfloat-abi=softfp -mtune=cortex-a8 -mcpu=cortex-a8 -D__ARM_NEON__ -DALLWINNERA10 Line 103: -export PATH:=${PREFIX}/bin:${TOOLCHAIB}/bin:$(PATH) +export PATH:=${PREFIX}/bin:${TOOLCHAIN}/bin:$(PATH) add "--no-check-certificates" to the wget command in depends/cedarv/Makefile, depends/opengles/Makefile, depends/taglib/Makefile in order to get the download from https
 * to depends.mk (already done in git://github.com/rellla/xbmca10.git)
 * to some Makefiles (already done in git://github.com/rellla/xbmca10.git)

Start copying cedarx, gles libs etc.
root@mele:/opt/melehacking# cd xbmca10/tools/a10/depends root@mele:/opt/melehacking/xbmca10/tools/a10/depends# make

Compile xbmc
root@mele:/opt/melehacking/xbmca10/tools/a10/depends# make -C xbmc

Create Debian package
Because memory (tmpfs) of our mele is too small to build the temporary tar-file in /tmp, we have to umount it from tmpfs and write directly to disk: (The better way would be to use another directory and change settings in package/Makefile) root@mele:/opt/melehacking/xbmca10/tools/a10/depends# umount /tmp Ok, lets build the deb: root@mele:/opt/melehacking/xbmca10/tools/a10/depends# cp /opt/melehacking/xbmca10/xbmc.bin /allwinner/xbmc-pvr-bin/lib/xbmc/xbmc.bin root@mele:/opt/melehacking/xbmca10/tools/a10/depends# make -C package Remount /tmp: root@mele:/opt/melehacking/xbmca10/tools/a10/depends# mount /tmp

Some hints:

 * If you get a compiler error when processing h264.o, then check, if swap is enabled. The compiler ran out of memory!