Cross-compiling swfdec over DirectFB

By | January 23, 2008

This guide tries to explain how to cross-compile the OSS Flash player Swfdec for DirectFB.
This procedure is somehow experimental since it uses Swfdec and Swfdec-directfb from their git repositories. These are not stable releases, they were git-cloned the 22/01/08.

It assumes you already have the following packages installed:

  • DirectFB-1.0.1
  • glib-2.14.4
  • atk-1.20.0
  • freetype-2.3.5
  • fontconfig-2.5.0
  • zlib-1.2.3
  • pixman from git repository 02/01/08
  • cairo from git repository 02/01/08
  • pango-1.19.2
  • libmad-0.15.1b
  • liboil-0.3.12
  • libsoup-2.1.13

For a guide on how to compile stables releases of the above packages you can check the GTK+ on DirectFB and Swfdec on DirectFB.

Notice that if your root NFS filesystem is /opt/STM/STLinux-2.2/devkit/sh4/target and you installed all the above packages including Swfdec in /opt/STM/STLinux-2.2/devkit/sh4/target/usr/local, you have to decompress and compile swfdec-directfb inside /opt/STM/STLinux-2.2/devkit/sh4/target/usr/local.

Let’s start with Swfdec

Set the following environment variables:

$ export PREFIX=/opt/STM/STLinux-2.2/devkit/sh4/target/usr/local
$ export COMPILER=sh4-linux-gcc
$ export STRIP=sh4-linux-strip
$ export HOST=sh4-linux
$ export BUILD=i386-linux


$ PANGO_CFLAGS="-I$PREFIX/include/pango-1.0 
  -lpango-1.0 -lgobject-2.0 -lgmodule-2.0 -ldl -lglib-2.0" 
  -lsoup-2.2 -lxml2 -lglib-2.0" 

Edit all Makefiles:
Remove the flag -Werror from the variable GLOBAL_CFLAGS

Edit the Makefile:
Remove the directory test from the variable SUBDIRS

Edit tools/Makefile:

Set the LIBS variable to the following value:

LIBS = -lfontconfig -lpangoft2-1.0 -lpangocairo-1.0 -lpango-1.0 -lcairo -ldirectfb -ldirect -lfusion

Compile and install:

$ make
$ make install

Now, we configure and compile swfdec-directfb:


  -lswfdec-0.5 -loil-0.3 -lm -lpangocairo-1.0 -lpango-1.0 -lcairo 
  -lgobject-2.0 -lgmodule-2.0 -ldl -lglib-2.0" 

Edit player/Makefile, swfdec-directfb/Makefile and test/Makefile:
Add to the LIBS variable the following value:

LIBS = -lfontconfig

Compile and install:

$ make
$ make install

For executing swfdec-directfb, connect to your board:

$ cd /usr/local/swfdec-directfb/player
$ ./swfdec-directfb-player sample.swf

That’s it.

2 thoughts on “Cross-compiling swfdec over DirectFB

  1. cagatay

    I tried to start X11 on ST 7109 reference board. After loading Frame Buffer drivers for ST7109, I try to start Xserver with “Xfbdev” command I get the following errors:

    root@cagatay:~# Xfbdev
    _XSERVTransSocketOpenCOTSServer: Unable to open socket for inet6
    _XSERVTransOpen: transport open failed for inet6/cagatay:0
    _XSERVTransMakeAllCOTSServerListeners: failed to open listener for inet6
    FBIOPUT_VSCREENINFO: Invalid argument

    Fatal server error:
    no screens found
    Segmentation fault

    I wonder where the problem is. How can I run Xfbdev?
    Could you please help me about this issue?

    Thanks for your time.

  2. paguilar


    I’ve never tried X on this platform because several months ago I read (but I don’t remember where) that X had some problems running in this board. But I do remember that this was for STLinux2.2 and STLinux2.3ear.
    However, this error seems to be a configuration issue in the xorg.conf file.

    I don’t know what you want to run on X, but if you’re interested in GTK+ or Swfdec you don’t need X, you can do everything with DirectFB. Version 0.5.2 of Swfdec has a backend for DirectFB and according to its main developer it should be difficult to port to the recent 0.8.x series.

    Hope this helps.



Leave a Reply

Your email address will not be published. Required fields are marked *