Building DirectFB

From DirectFB

Jump to: navigation, search

This page explains which steps you need to go from source to installed libraries. If your distribution already comes with precompiled packages, this still might be of interest if you are going to program with DirectFB: it will give you an idea of the way the libraries are connected, and maybe you will need to change the precompiled options.


Get the sources

The DirectFB webpage is the place to get the sources. If you are interested in sharing your changes, you want to have a look at GIT access, which can give you the latest status. If you are only interested in a compressed archive with everything pre-packaged, check the Download section. It's are best off with the latest version of DirectFB, and the latest version of linux-fusion.

Build fusion

If you are planning to run multiple DirectFB applications simultaneously, you need to build the linux-fusion kernel module. You will also need the kernel headers for your DirectFB target. Have a look at the README file in the fusion source code tree that you downloaded.

If you are making a build targeted for the PC your working on, the Makefile is already correct. If you are making a build for another target you need to cross compile. Please edit the top-level Makefile by hand and change the options listed at the top of the file. Then you can:

make install

if you have appropriate priviliges. Afterwards make sure the module is insmod'ed (check with lsmod) and that your device nodes are created in /dev, as it is described in the README.

Build DirectFB

The GIT archive and the packaged releases are slightly different. The GIT archive does not have the ./configure script, so you will need to generate that by running ./ which will accept the same commands as ./configure.

For building DirectFB, the best reference is the README file as provided in the sources. ./configure --help will list all the configuration options. Advisable is the option --enable-debug which is by default off. This will compile debug log code, which you can conditionally turn on by configuration in directfbrc.

Now you should be able to

make install

Build without pkg-config

For cross-builds of packages depending on DirectFB it's quite handy to override pkg-config usage, e.g. by calling configure like this:

DIRECTFB_CFLAGS="-I/opt/embedded-root-fs/opt/dfb/include/directfb -I/opt/embedded-root-fs/opt/dfb/include/directfb-internal" \
DIRECTFB_LIBS="-L/opt/embedded-root-fs/opt/dfb/lib -ldirectfb -lfusion -ldirect" \
MODULEDIR="/opt/dfb/lib/directfb-1.6-0" \
CFLAGS="-O3 -Wno-error -Werror-implicit-function-declaration -pipe" \
   ./configure --enable-maintainer-mode \
	--prefix=/root/dfb \
	--build=x86_64 \
	--host=arm-none-linux-gnueabi \
	--enable-debug \

This works for DiVine, FusionDale, SaWMan and other packages will be changed to support that as well.

further steps

If everything has installed correctly, some basic utilities are present. You should be able to run dfbinfo or dfbdump and get some meaningful output. You can now also build and install DirectFB-examples which contain some example applications and some benchmarks.

Personal tools