This guide explains how to cross-compile GTK+ over DirectFB.
Intro
This guide is based in the wiki GTK on DirectFB for Embedded Systems from the DirectFB site, but it uses the latest packages available to this date. Since this procedure has some unstable packages and is still experimental, it’s not in the mentioned wiki. Hopefully, once this procedure becomes stable, the wiki will be updated.
I tested this procedure in a STMicroelectronics ST40 processor (SH architecture). If you’re using this processor, this is the configuration I have:
- Board: STB7109 cut 3.0, also called cocoref_gold_7109
- Linux distribution: STLinux 2.2
- ST drivers and API: STFAE A16
Warnings
- This documentation assumes you already have DirectFB install in $PREFIX/usr. Change it accordingly to your installation.
- This documentation is still a work in progress, some steps of this procedure could be useless, ugly and/or dangerous. In order to make this procedure easier, it might be that there is the need of some patches.
- The autotools are not very user-friendly when cross-compiling, thus, several configure files and Makefile (that are generated by the autotools) have to be edited by hand.
- This procedure uses unstable or development versions of some packages like Glib and Cairo. However, the procedure should be the same for the latest stable release.
- GTK+ and all the packages underneath need a considerable amount of space and processor. If your embedded device provides a hard-drive/compact-flash and supports hardware accelerated graphics you can use GTK+ without problems.
Requirements
Typically, when developing applications for an embedded system a cross-toolchain is needed. If you already have a cross-toolchain you don’t have to worry about building it yourself. Otherwise, a well known resource for building one is http://www.kegel.com/crosstool
When developing for embedded systems, there are very few Linux distributions or packages that contain all the required software for building GTK+, therefore you have to build everything from scratch.
The order in which the packages are compiled is important since some of them won’t compile without the others. The packages, their versions and the order used for building GTK+ are the following:
- Glib from git repository 15/02/08
- atk-1.20.0
- freetype-2.3.5
- zlib-1.2.3
- libxml2-2.6.30
- fontconfig-2.5.0
- libpng-1.2.24
- Pixman from git repository 15/02/08
- Cairo from git repository 15/02/08
- pango-1.19.2
- gtk+-2.12.3
Environment configuration
Suppose that the libraries will be installed in /opt/gtkdfb/usr/local (may be /opt/gtkdfb is the root fs of your embedded target) and that the cross-toolchain (compiler, linker…) is in your path.
Set the following environment variables that will make our life easier:
$ export PREFIX=/opt/gtkdfb/usr/local
$ export LD_LIBRARY_PATH=$PREFIX/lib
$ export PKG_CONFIG_PATH=$LD_LIBRARY_PATH/pkgconfig
$ export COMPILER=sh4-linux-gcc
$ export HOST=sh4-linux
$ export BUILD=i386-linux
$ export STRIP=sh4-linux-strip
Building GTK+ and its requirements
Glib
Edit the “configure” file:
Search for the texts “cannot run test program while cross compiling” and “cross-compiling”. Remove the following code that appears a couple of lines below the searched texts:
{ (exit 1); exit 1; };
Compile and install:
$ CC=$COMPILER ./configure --build=$BUILD --host=$HOST
--prefix=$PREFIX --disable-selinux --disable-fam
--disable-largefile --enable-debug=no --disable-gtk-doc
--disable-man
$ make
$ make install
Atk
Compile and install:
$ CC=$COMPILER ./configure --host=$HOST --build=$BUILD
--prefix=$PREFIX --disable-glibtest --disable-gtk-doc
$ make
$ make install
Freetype
Compile and install:
$ CC=$COMPILER ./configure --host=$HOST --build=$BUILD
--prefix=$PREFIX
$ make
$ make install
Zlib
Compile and install:
$ CC=$COMPILER ./configure --prefix=$PREFIX --shared
$ make
$ make install
libxml2
Compile and install:
$ CC=$COMPILER ./configure --host=$HOST --build=$BUILD
--prefix=$PREFIX --without-debug
$ make
$ make install
Fontconfig
Change the value of the flag –with-arch according to your architecture.
Compile and install:
$ CC=$COMPILER ./configure --build=$BUILD --host=$HOST
--prefix=$PREFIX
--with-freetype-config=$PREFIX/bin/freetype-config
--enable-libxml2 --with-arch=sh4 --disable-docs
$ make
$ make install
libpng
Edit the “configure” file:
Set to ‘yes’ the following variable:
ac_cv_lib_z_zlibVersion=yes
Compile and install:
$ CC=$COMPILER ./configure --host=$HOST --build=$BUILD
--prefix=$PREFIX
$ make
$ make install
Pixman
Compile and install:
$ CC=$COMPILER ./autogen.sh --host=$HOST --build=$BUILD
--prefix=$PREFIX
$ make
$ make install
Cairo
Compile and install:
$ CC=$COMPILER
directfb_CFLAGS="-I$PREFIX/../include/directfb"
directfb_LIBS="$PREFIX/../lib/libdirectfb.so
$PREFIX/../lib/libdirect.so
$PREFIX/../lib/libfusion.so"
png_CFLAGS="-I$PREFIX/include"
png_LIBS=$PREFIX/lib/libpng12.so
FONTCONFIG_CFLAGS="-I$PREFIX/include/fontconfig"
FONTCONFIG_LIBS=$PREFIX/lib/libfontconfig.so
FREETYPE_CFLAGS="-I$PREFIX/include/freetype2"
FREETYPE_LIBS=$PREFIX/lib/libfreetype.so
./configure --host=$HOST --build=$BUILD
--prefix=$PREFIX --enable-directfb=yes --without-x
--disable-xlib --disable-xlib-xrender --disable-win32
--enable-pdf=no --enable-ps=no --enable-png
$ make
$ make install
Pango
Configure:
$ CC=$COMPILER
GLIB_CFLAGS="-I$PREFIX/include/glib-2.0
-I$PREFIX/lib/glib-2.0/include"
GLIB_LIBS="$PREFIX/lib/libglib-2.0.so
$PREFIX/lib/libgmodule-2.0.so
$PREFIX/lib/libgobject-2.0.so
$PREFIX/lib/libfontconfig.so
$PREFIX/lib/libxml2.so
$PREFIX/lib/libfreetype.so"
CAIRO_CFLAGS="-I$PREFIX/include/cairo"
CAIRO_LIBS=$PREFIX/lib/libcairo.so
FONTCONFIG_CFLAGS="-I$PREFIX/include/fontconfig"
FONTCONFIG_LIBS=$PREFIX/lib/libfontconfig.so
FREETYPE_CFLAGS="-I$PREFIX/include/freetype2"
FREETYPE_LIBS=$PREFIX/lib/libfreetype.so
FREETYPE_CONFIG=$PREFIX/bin/freetype-config
./configure --host=$HOST --build=$BUILD
--prefix=$PREFIX --without-x
Edit the examples/Makefile:
Add to the GLIB_LIBS variable the following:
/opt/gtkdfb/usr/local/lib/libpng12.so
/opt/gtkdfb/usr/lib/libdirectfb.so
/opt/gtkdfb/usr/lib/libdirect.so
/opt/gtkdfb/usr/lib/libfusion.so
Edit the tests/Makefile:
Set the LIBS variables to the following value:
LIBS = $(GLIB_LIBS)
Compile and install:
$ gmake
$ gmake install
GTK+
Configure:
$ CC=$COMPILER
BASE_DEPENDENCIES_CFLAGS="-I$PREFIX/include
-I$PREFIX/lib/glib-2.0/include -I$PREFIX/include/glib-2.0
-I$PREFIX/include/pango-1.0
-I$PREFIX/include/cairo
-I$PREFIX/include/atk-1.0"
BASE_DEPENDENCIES_LIBS="-L$PREFIX/lib
$PREFIX/lib/libglib-2.0.so
$PREFIX/lib/libgobject-2.0.so $PREFIX/lib/libgmodule-2.0.so
$PREFIX/lib/libfontconfig.so $PREFIX/lib/libxml2.so"
GLIB_CFLAGS="-I$PREFIX/include
-I$PREFIX/lib/glib-2.0/include
-I$PREFIX/include/glib-2.0"
GLIB_LIBS="-L$PREFIX/lib
$PREFIX/lib/libglib-2.0.so
$PREFIX/lib/libgobject-2.0.so
$PREFIX/lib/libgmodule-2.0.so
$PREFIX/lib/libfontconfig.so
$PREFIX/lib/libxml2.so"
PANGO_CFLAGS="-I$PREFIX/include/pango-1.0"
PANGO_LIBS="-L$PREFIX/lib
$PREFIX/lib/libpango-1.0.so
$PREFIX/lib/libpangoft2-1.0.so
$PREFIX/lib/libpangocairo-1.0.so"
GDK_DEP_CFLAGS="-pthread -I$PREFIX/include/glib-2.0
-I$PREFIX/lib/glib-2.0/include
-I$PREFIX/include/pango-1.0
-I$PREFIX/include/cairo
-I$PREFIX/include
-D_REENTRANT -D_GNU_SOURCE
-I$PREFIX/../include
-I$PREFIX/../include/directfb"
GDK_DEP_LIBS="-L$PREFIX/lib -lpthread -ldl -lpangocairo-1.0
-lpango-1.0 -lcairo -lgobject-2.0 -lgmodule-2.0 -lglib-2.0 -lpng12 -lm
$PREFIX/../lib/libdirectfb.so
$PREFIX/../lib/libdirect.so
$PREFIX/../lib/libfusion.so"
GDK_PIXBUF_DEP_CFLAGS="-pthread -I$PREFIX/include/glib-2.0
-I$PREFIX/lib/glib-2.0/include
-I$PREFIX/include
-I$PREFIX/../include"
GDK_PIXBUF_DEP_LIBS="-L$PREFIX/lib
-lgmodule-2.0 -ldl -lgobject-2.0 -lglib-2.0 -lpng12 -lm"
GTK_DEP_CFLAGS="-pthread -I$PREFIX/include/glib-2.0
-I$PREFIX/lib/glib-2.0/include
-I$PREFIX/include/pango-1.0
-I$PREFIX/include/cairo
-I$PREFIX/include -D_REENTRANT -D_GNU_SOURCE
-I$PREFIX/../include/directfb
-I$PREFIX/include/atk-1.0
-I$PREFIX/../include"
GTK_DEP_LIBS="-L$PREFIX/lib
-lpangocairo-1.0 -lpango-1.0 -latk-1.0 -lgobject-2.0 -lgmodule-2.0
-ldl -lglib-2.0 -lcairo -lpng12 -lm
$PREFIX/../lib/libdirectfb.so
$PREFIX/../lib/libdirect.so
$PREFIX/../lib/libfusion.so"
GDK_EXTRA_CFLAGS="-I$PREFIX/../include"
GDK_EXTRA_LIBS="-L$PREFIX/../lib -lz -lpthread -ldl
$PREFIX/../lib/libdirectfb.so
$PREFIX/../lib/libdirect.so
$PREFIX/../lib/libfusion.so"
./configure
--host=$HOST
--build=$BUILD
--prefix=$PREFIX
--with-gdktarget=directfb
--without-libtiff
--disable-glibtest
--disable-largefile
--disable-modules
--with-included-loaders=gif,jpeg,png,xpm
Dangerous/ugly step:
GTK needs a cairo-pdf/ps printing support for compiling, but it’s unlikely that PDF/PS will be needed in an embedded system. There is no flag to compile it without this setting. There are some patches in development to solve this issue, meanwhile it was compiled without the cairo-pdf support by doing the following very ugly and dangerous step. If you want to add to add PDF/PS support you can try Poppler.
Edit the files:
- gtk/gtkprintoperation.c
- gtk/gtkprintoperation-unix.c
- modules/printbackends/lpr/gtkprintbackendlpr.c
- modules/printbackends/file/gtkprintbackendfile.c
Comment the lines in all these files that contains the following includes or function calls:
#include
#include
cairo_pdf_surface_set_size()
cairo_pdf_surface_create()
cairo_ps_surface_create_for_stream()
Compile and install:
$ make
$ make install
That’s it.
Keep in mind that this procedure is still experimental and uses unstable versions of Glib and Cairo. In fact, with a stable version of Cairo, there’s no need for compiling Pixman because it’s already included in Cairo.
Any help, suggestions and/or ideas are welcome.
Very good howto. I know this is an experimental version of glib and pango but I have some questions.
Do you use hardware acceleration with directfb on your configuration and is there rendering problems with GTK?
Hi! Thanks.
Yes, some operations are hardware accelerated by the DirectFB driver such as “fill rectangles”.
I haven’t experienced rendering problems with GTK+, I’ve tested some simple GUIs with a few buttons and images without problems. But with heavy apps such as a Flash player (swfdec with the default GTK+ backend) I had performance issues due mainly to Cairo, not GTK+.
Hi,
We have to design UI .we desided to go with gtk+.I was searching for something like this …blv me !!!!!!!.I have some basic confusions.Hope u can address.
My dev environment is as follows:
* Board: STB7100ref cut 3.0, also called cocoref_MB442
* Linux distribution: STLinux 2.2
* ST drivers and API: REL -1.0
1)Do i have to install DirectFB separetly.
2)Can u load the links to find all these packages.
Hi Ali,
I’ve tested GTK+ over DirectFB with MIPS and SH4 archs.
In the SH4 case it was exactly the same board (STB7100ref c3.0) and Linux distribution (STLinux 2.2) as yours.
ST has developed a couple of drivers for DirectFB, one proprietary that is inside the ST API, and one Open Source that is inside the STLinux dist.
I used the Open Source driver for building our GTK+ app. You can find this driver in /opt/STM/STLinux-2.2/devkit/sources/stgfb.
DirectFB is already provided by STLinux, you only need to follow the steps mentioned here.
If you google the package names, the first search result in most cases will be the home page of the project. You can download the latest package from there.
Regards.
Hi Paguilar,
Thanks a lot !!!!!!!!
ST Micro have all the above mentioned pre-compiled packages
on there ftp site .I am not sure about the versions ,Can i use them in the same order except that i dont have to compile them just install the packages.
Regards
Hi,
The packages provided by ST with their STLinux distribution are compiled for X11, not for DirectFB. This is valid for some packages like Cairo and, of course, GTK+. Other packages are nor relevant, like libjpeg. It’s better if you compile all the mentioned requirements setting DirectFB as the backend.
Regards.
Hi,
1) I have latest stgfb ie:stgfb-2.0_stm22_0006 installed on
my system will that be okay .
2)Can u please specify the versions of Glib / pixmap /cairo
you have used.
Thanks
Hi,
That version of stgfb could be ok. In fact, I used that version when I tested GTK+.
However, there are newer versions that improve significantly several operations, you could check the stlinux ftp site for newer versions: ftp://ftp.stlinux.com
I downloaded snapshots of glib/pixmap/cairo from their respective git repositories on the given date (15/02/08). They are not stable nor development versions. The later ones are generated from these repositories. Once they are tested significantly, a stable version is released.
Regards.
Hi ,
What exactly we are supposed to use pixmap / pixman. Because in the initial list you have mentioned pixmap but at the configuration steps you have mentioned pixman.
Anyways there is no autogen.sh in the both .
Thanks & Regards!!!!!!!
Hi,
It was a typo: it should be pixman, not pixmap.
You need to compile pixman if you download cairo from a git repo because the developers mantain the two packages separated while developing. Once they release a stable/unstable version they merge them an generate a single cairo version.
Snapshots like these ones are normally provided with a autogen.sh script instead of a configure used in version releases.
Regards.
Hi,
I m getting error wen i ma building pixman.I did the following after untar pixman-0.9.4.
1)CC=$COMPILER ./configure –host=$HOST –build=$BUILD –prefix=$PREFIX
2)Make ( I m getting error here)
make[2]: Entering directory `/opt/pixman-0.9.4/test’
/bin/sh ../libtool –tag=CC –mode=link sh4-linux-gcc -g -O2 -Wall -o composite-test composite-test.o ../pixman/libpixman-1.la -Wl,–export-dynamic -L/opt/local/lib -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgdk_pixbuf-2.0 -lm -lpangoxft-1.0 -lpangox-1.0 -lpango-1.0 -lgobject-2.0 -lgmodule-2.0 -ldl -lglib-2.0
libtool: link: cannot find the library `/usr/lib/libgobject-2.0.la’ or unhandled argument `/usr/lib/libgobject-2.0.la’
make[2]: *** [composite-test] Error 1
make[2]: Leaving directory `/opt/pixman-0.9.4/test’
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/opt/pixman-0.9.4′
make: *** [all] Error 2
were did i messed.?
Regards
Hi,
Anyways i have cairo-1.6.4 .Do i still need to use pixman.
I think this version is stable.
Regads
Hi,
If you use a stable Cairo release you don’t need pixman because it’s already inside Cairo.
Anyway, the error you’re getting when compiling pixman is because it’s searching glib in the standard path (/usr/lib) instead of the path where you installed it. Check if you set the environment variables correctly.
Regards.
Hi,
can u explain this configuration steps in cairo as there is no directfb installed.
directfb_CFLAGS=”-I$PREFIX/../include/directfb”
directfb_LIBS=”$PREFIX/../lib/libdirectfb.so
Regards
Hi,
In the STLinux distro, DirectFB is already provided in /usr, since the PREFIX is set to /usr/local I need to go back one dir and enter the /usr/include and /usr/lib dirs.
Notice that these dirs are relative to the /opt/gtkdfb/usr/local (PREFIX) path that is where the rootfs resides.
Regards.
Hi,
When i try to configure cairo wihtout building pixman.IT gives error pixman-10.0 is required.But when i ma trying to build Pixman-10.0 I ma getting this error.Struck!!!!!!!
1) CC=$COMPILER ./configure -build=$BUILD -host=$HOST -prefix=$PREFIX
2),–export-dynamic -L/opt/STM/STLinux-2.2/devkit/sh4/target/usr/local/lib -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgdk_pixbuf-2.0 -lm -lpangoxft-1.0 -lpangox-1.0 -lpango-1.0 -lgobject-2.0 -lgmodule-2.0 -ldl -lglib-2.0
sh4-linux-gcc -g -O2 -Wall -fvisibility=hidden -o .libs/composite-test composite-test.o -Wl,–export-dynamic ../pixman/.libs/libpixman-1.so -L/opt/STM/STLinux-2.2/devkit/sh4/target/usr/local/lib -lgtk-x11-2.0 -lgdk-x11-2.0 /opt/local/lib/libatk-1.0.so -L/opt/local/lib /opt/local/lib/libgobject-2.0.so /opt/local/lib/libgmodule-2.0.so /opt/local/lib/libglib-2.0.so -lgdk_pixbuf-2.0 -lm -lpangoxft-1.0 -lpangox-1.0 -lpango-1.0 /opt/STM/STLinux-2.2/devkit/sh4/target/usr/local/lib/libgobject-2.0.so /opt/STM/STLinux-2.2/devkit/sh4/target/usr/local/lib/libgmodule-2.0.so -ldl /opt/STM/STLinux-2.2/devkit/sh4/target/usr/local/lib/libglib-2.0.so -Wl,–rpath -Wl,/opt/STM/STLinux-2.2/devkit/sh4/target/usr/local/lib -Wl,–rpath -Wl,/opt/local/lib
/opt/STM/STLinux-2.2/devkit/sh4/lib/gcc/sh4-linux/4.1.1/../../../../sh4-linux/bin/ld: cannot find -lgtk-x11-2.0
collect2: ld returned 1 exit status
make[2]: *** [composite-test] Error 1
make[2]: Leaving directory `/opt/pixman-0.10.0/test’
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/opt/pixman-0.10.0′
make: *** [all] Error 2
Hi,
You have to disable GTK+.
Try this:
$ ./configure –host=$HOST –build=$BUILD –prefix=$PREFIX
–disable-mmx –disable-sse2 –disable-gtk
$ make
This works with pixmap from git rep from yesterday (22/07/08)
Regards.
Hi,
I overcame the last error by avoiding pixman and cairo-1.6.4 .Instead i have used cairo-1.4.6 which is stable and had pixman package.
Regards
Hi,
GTk+ it seems not able to find directfb. Bbcas i have checke dthat direct fb is in path and the libraries as well.
When i am configuring GTk+ Im getting this error:
this is configuration command:
1) CC=$COMPILER BASE_DEPENDENCIES_CFLAGS=”-IPREFIX/include -I$PREFIX/lib/glib-2.0/include -I$PREFIX/include/glib-2.0 -I$PREFIX/include/pango-1.0 -I$PREFIX/include/cairo -I$PREFIX/include/atk-1.0″ BASE_DEPENDENCIES_LIBS=”-L$PREFIX/lib $PREFIX/lib/libglib-2.0.so $PREFIX/lib/libgobject-2.0.so $PREFIX/lib/libgmodule-2.0.so $PREFIX/lib/libfontconfig.so $PREFIX/lib/libxml2.so” GLIB_CFLAGS=”-I$PREFIX/include -I$PREFIX/lib/glib-2.0/include -I$PREFIX/include/glib-2.0″ GLIB_LIBS=”-L$PREFIX/lib $PREFIX/lib/libglib-2.0.so $PREFIX/lib/libgobject-2.0.so $PREFIX/lib/libgmodule-2.0.so $PREFIX/lib/libfontconfig.so $PREFIX/lib/libxml2.so” PANGO_CFLAGS=”-I$PREFIX/include/pango-1.0″ PANGO_LIBS=”-L$PREFIX/lib $PREFIX/lib/libpango-1.0.so $PREFIX/lib/libpangoft2-1.0.so $PREFIX/lib/libpangocairo-1.0.so” GDK_DEP_CFLAGS=”-pthread -I$PREFIX/include/glib-2.0 -I$PREFIX/lib/glib-2.0/include -I$PREFIX/include/pango-1.0-I$PREFIX/include/cairo -I$PREFIX/include -D_REENTRANT -D_GNU_SOURCE -ISPREFIX/../include -I$PREFIX/../include/directfb” GDK_DEP_LIBS=”-L$PREFIX/lib -lpthread -ldl -lpangocairo-1.0 -lpango-1.0 -lcairo -lgobject-2.0 -lgmodule-2.0 -lglib-2.0 -lpng12 -lm $PREFIX/../lib/libdirectfb.so $PREFIX/../lib/libdirect.so $PREFIX/../lib/libfusion.so” GDK_PIXBUF_DEP_CFLAGS=”-pthread -I$PREFIX/include/glib-2.0 -I$PREFIX/lib/glib-2.0/include -I$PREFIX/include -I$PREFIX/../include” GDK_PIXBUF_DEP_LIBS=”-L$PREFIX/lib -lgmodule-2.0 -ldl -lgobject-2.0 -lglib-2.0 -lpng12 -lm” GTK_DEP_CFLAGS=”-pthread -I$PREFIX/include/glib-2.0 -I$PREFIX/lib/glib-2.0/include -I$PREFIX/include/pango-1.0 -I$PREFIX/include/cairo -I$PREFIX/include -D_REENTRANT -D_GNU_SOURCE -I$PREFIX/../include/directfb -I$PREFIX/include/atk-1.0 -I$PREFIX/../include” GTK_DEP_LIBS=”-L$PREFIX/lib -lpangocairo-1.0 -lpango-1.0 -latk-1.0 -lgobject-2.0 -lgmodule-2.0 -ldl -lglib-2.0 -lcairo -lpng12 -lm $PREFIX/../lib/libdirectfb.so $PREFIX/../lib/libdirect.so $PREFIX/../lib/libfusion.so” GDK_EXTRA_CFLAGS=”-I$PREFIX/../include” GDK_EXTRA_LIBS=”-L$PREFIX/../lib -lz -lpthread -ldl $PREFIX/../lib/libdirectfb.so $PREFIX/../lib/libdirect.so $PREFIX/../lib/libfusion.so” ./configure –host=$HOST –build=$BUILD –prefix=$PREFIX –with-gdktarget=directfb –without-libtiff –disable-glibtest –disable-largefile –disable-modules –with-included-loaders=gif,jpeg,png,xpm
———————————————————–
But i m getting error as
checking for DirectFB… configure: error:
*** DirectFB 0.9.24 or newer and the cairo backend
*** are required. The latest version of DirectFB is always available
*** from http://www.directfb.org/.
……………………………………………………
I have checked th path the directfb is there in my rootfs/usr/include and the modules are also there in rootfs/usr/local/lib.
I have checked the configure script ..It is checking for directfb and generating error…confused
Regards
Hi,
Try this:
Set PKG_CONFIG_PATH environment var:
$ export PKG_CONFIG_PATH=$PREFIX/lib/pkgconfig:$PREFIX/../lib/pkgconfig
Edit the files directfb.pc direct.pc and fusion.pc in PREFIX/../lib/pkgconfig (make a copy of the original files)
Set the prefix var to the following value:
prefix=/opt/oe/STM/STLinux-2.2/devkit/sh4/target/usr
Then, if necessary, modify the files libdirectfb.la and libfusion.la (again, make copies of the originals)
inside PREFIX../lib
Set the var dependency_libs of libdirectfb.la to the following value:
dependency_libs=’/opt/STM/STLinux-2.2/devkit/sh4/target/usr/lib/libdirect.la /opt/STM/STLinux-2.2/devkit/sh4/target/usr/lib/libfusion.la /opt/STM/STLinux-2.2/devkit/sh4/target/usr/lib/libdirect.la -lz -ldl -lpthread’
Set the var dependency_libs of libfusion.la to the following value:
dependency_libs=’/opt/oe/STM/STLinux-2.2/devkit/sh4/target/usr/lib/libdirect.la -lz -ldl -lpthread’
Then configure again adding the option –without-libjpeg and modifying
–with-included-loaders=gif,png,xpm
These steps are not very nice|clean, but remember that this procedure is experimental.
Regards.
Hi,
When configure the gtk+, i meet with the following issue after solved the above directfb config issue:
checking for DirectFB… found
checking Pango flags… -D_REENTRANT -I/home/goralf/Exercise/gtkdfb/usr/local/include/pango-1.0 -I/home/goralf/Exercise/gtkdfb/usr/local/include/glib-2.0 -I/home/goralf/Exercise/gtkdfb/usr/local/lib/glib-2.0/include -I/home/goralf/Exercise/gtkdfb/usr/local/include/cairo -I/home/goralf/Exercise/gtkdfb/usr/local/include/freetype2 -I/home/goralf/Exercise/gtkdfb/usr/local/include -I/home/goralf/Exercise/gtkdfb/usr/local/include/libpng12 -I/home/goralf/Exercise/gtkdfb/usr/local/include/pixman-1 -I/opt/STM/STLinux-2.2/devkit/sh4/target/usr/include/directfb -I/usr/include/pango-1.0 -L/home/goralf/Exercise/gtkdfb/usr/local/lib -lpangocairo-1.0 -lpango-1.0 -lcairo -lgobject-2.0 -lgmodule-2.0 -ldl -lglib-2.0
configure: error:
*** Can’t link to Pango. Pango is required to build
*** GTK+. For more information see http://www.pango.org
And i find the libpango-1.0.so and libpangoft2-1.0.so, but not find the libpangocairo-1.0.so.
Regars.
Hi
I find the reason why can’t find the libpangocairo-1.0.so and solved.
But the error is still.
Hi,
I’ve did the changes suggested by you. DirectFb was detected but it is giving pango flags configure error.I have installed
pango-1.19.2 successfully.
checking for DirectFB… found
checking Pango flags… configure: error:
*** Pango not found. Pango built with Cairo support is required
*** to build GTK+. See http://www.pango.org for Pango information.
Thanks and regards
Hi,
If you use the versions described you shouldn’t have this problem. However, I tried a couple of days ago GTK+ 2.12.11 and I had the same problem.
Even if Pango is installed correctly, the configure script is not finding it for some reason.
If you’re using GTK+ 2.12.11 or >2.12.3 you could edit the configure file:
Search for the texts “Can’t link to Pango”, “Can’t find cairo-ps.h” and “Can’t find cairo-pdf.h”.
Remove the following code that appears a couple of lines below the searched texts:
{ (exit 1); exit 1; };
Regards.
Hi,
Hi,
I’ve did the changes suggested by you. DirectFb was detected but it is giving pango flags configure error.I have installed
pango-1.19.2 successfully.
checking for DirectFB… found
checking Pango flags… configure: error:
*** Pango not found. Pango built with Cairo support is required
*** to build GTK+. See http://www.pango.org for Pango informatio
I am using gtk+-2.12.3
Thanks and regards
Hi
Is it fine that comment out the { (exit 1); exit 1; }; for *** Can’t link to Pango. Pango is required to build?
Hi,
I have tried configuring GTK+ .By following these steps.
I have Removed the following:
{ (exit 1); exit 1; };
accompanying these messages.
“Can’t link to Pango”, “Can’t find cairo-ps.h” and “Can’t find cairo-pdf.h”.
===========================================================
I m getting pango link error n cups error as well pls foloow the log:
checking for DirectFB… found
checking Pango flags… -D_REENTRANT -I/opt/STM/STLinux-2.2/devkit/sh4/target/usr/local/include/pango-1.0 -I/opt/STM/STLinux-2.2/devkit/sh4/target/usr/local/include/glib-2.0 -I/opt/STM/STLinux-2.2/devkit/sh4/target/usr/local/lib/glib-2.0/include -I/opt/STM/STLinux-2.2/devkit/sh4/target/usr/local/include/cairo -I/opt/STM/STLinux-2.2/devkit/sh4/target/usr/local/include/freetype2 -I/opt/STM/STLinux-2.2/devkit/sh4/target/usr/local/include -I/opt/STM/STLinux-2.2/devkit/sh4/target/usr/local/include/libpng12 -I/opt/STM/STLinux-2.2/devkit/sh4/target/usr/include/directfb -L/opt/STM/STLinux-2.2/devkit/sh4/target/usr/local/lib -L/opt/STM/STLinux-2.2/devkit/sh4/target/usr/lib -lpangocairo-1.0 -lpango-1.0 -lcairo -lgobject-2.0 -lgmodule-2.0 -lglib-2.0 -lfreetype -lfontconfig-ldirectfb -lz -lpng12 -lfusion -ldirect -lpthread -ldl
configure: error:
*** Can’t link to Pango. Pango is required to build
*** GTK+. For more information see http://www.pango.org
checking ATK flags… -I/opt/STM/STLinux-2.2/devkit/sh4/target/usr/local/include/atk-1.0 -I/opt/STM/STLinux-2.2/devkit/sh4/target/usr/local/include/glib-2.0 -I/opt/STM/STLinux-2.2/devkit/sh4/target/usr/local/lib/glib-2.0/include -L/opt/STM/STLinux-2.2/devkit/sh4/target/usr/local/lib -latk-1.0 -lgobject-2.0-lgmodule-2.0 -ldl -lglib-2.0
checking for cups-config… /usr/bin/cups-config
checking cups/cups.h usability… no
checking cups/cups.h presence… no
checking for cups/cups.h… no
configure: error: *** Sorry, cups-config present but cups/cups.h missing.
Thanks
Hi goralf,
Yes, Pango is required for building GTK+ because it’s the piece of software in charge of handling the fonts. Pango uses Cairo for rendering them.
Regards.
Hi Ali,
I’ve never had a problem with cups. Have you checked the parameters passed to the configure script? Did set the environment variables correctly (including the PKG_CONFIG_PATH mentioned in comment #20) ?
Regards.
Hi Paguilar,
When i compile the gtk+, i have the following issue:
/bin/sh ../libtool –mode=link sh4-linux-gcc -DG_DISABLE_DEPRECATED -g -O2 -Wall -o libgdk-directfb-2.0.la -version-info 1000:14:1000 -export-dynamic -rpath /home/goralf/Exercise/gtkdfb/usr/local/lib -export-symbols-regex “^[^_].*” gdk.lo gdkcairo.lo gdkcolor.lo gdkcursor.lo gdkdisplay.lo gdkdnd.lo gdkdraw.lo gdkevents.lo gdkfont.lo gdkgc.lo gdkglobals.lo gdkkeys.lo gdkkeyuni.lo gdkimage.lo gdkdisplaymanager.lo gdkpango.lo gdkpixbuf-drawable.lo gdkpixbuf-render.lo gdkpixmap.lo gdkpolyreg-generic.lo gdkrgb.lo gdkrectangle.lo gdkregion-generic.lo gdkscreen.lo gdkselection.lo gdkvisual.lo gdkwindow.lo gdkenumtypes.lo directfb/libgdk-directfb.la -L/home/goralf/Exercise/gtkdfb/usr/local/lib -L/home/goralf/Exercise/gtkdfb/usr/lib -lcairo -ldirectfb -lz -lfusion -ldirect -lpthread -ldl -L/home/goralf/Exercise/gtkdfb/usr/local/lib -lpangocairo-1.0 -lpango-1.0 -lcairo -lgobject-2.0 -lgmodule-2.0 -ldl -lglib-2.0 -L/home/goralf/Exercise/gtkdfb/usr/local/lib -lpng12 -lm ../gdk-pixbuf/libgdk_pixbuf-2.0.la
libtool: link: warning: library `/home/goralf/Exercise/gtkdfb/usr/lib/libdirectfb.la’ was moved.
grep: /usr/lib/libfusion.la: No such file or directory
/bin/sed: can’t read /usr/lib/libfusion.la: No such file or directory
libtool: link: `/usr/lib/libfusion.la’ is not a valid libtool archive
gmake[4]: *** [libgdk-directfb-2.0.la] 错误 1
gmake[4]: Leaving directory `/home/goralf/Exercise/gtk_some/gtk+-2.10.14/gdk’
gmake[3]: *** [all-recursive] 错误 1
gmake[3]: Leaving directory `/home/goralf/Exercise/gtk_some/gtk+-2.10.14/gdk’
gmake[2]: *** [all] 错误 2
gmake[2]: Leaving directory `/home/goralf/Exercise/gtk_some/gtk+-2.10.14/gdk’
gmake[1]: *** [all-recursive] 错误 1
gmake[1]: Leaving directory `/home/goralf/Exercise/gtk_some/gtk+-2.10.14′
gmake: *** [all] 错误 2
[root@szx-training6 gtk+-2.10.14]# gmake
Hi Paguilar,
Thanks for taking interest in my issues.
I am really stuck with this .Pls have a look at my config parameters. Nothing is moving at my side due to this isssue.I have did the changes suggested by u in comment 20
=============================================================
CC=$COMPILER
BASE_DEPENDENCIES_CFLAGS=”-I$PREFIX/include
-I$PREFIX/lib/glib-2.0/include -I$PREFIX/include/glib-2.0
-I$PREFIX/include/pango-1.0
-I$PREFIX/include/cairo
-I$PREFIX/include/atk-1.0″
BASE_DEPENDENCIES_LIBS=”-L$PREFIX/lib
$PREFIX/lib/libglib-2.0.so
$PREFIX/lib/libgobject-2.0.so $PREFIX/lib/libgmodule-2.0.so
$PREFIX/lib/libfontconfig.so $PREFIX/lib/libxml2.so”
GLIB_CFLAGS=”-I$PREFIX/include
-I$PREFIX/lib/glib-2.0/include
-I$PREFIX/include/glib-2.0″
GLIB_LIBS=”-L$PREFIX/lib
$PREFIX/lib/libglib-2.0.so
$PREFIX/lib/libgobject-2.0.so
$PREFIX/lib/libgmodule-2.0.so
$PREFIX/lib/libfontconfig.so
$PREFIX/lib/libxml2.so”
PANGO_CFLAGS=”-I$PREFIX/include/pango-1.0″
PANGO_LIBS=”-L$PREFIX/lib
$PREFIX/../lib/libpango-1.0.so
$PREFIX/../lib/libpangoft2-1.0.so”
$PREFIX/../lib/libpangcairo-1.0.so”
GDK_DEP_CFLAGS=”-pthread -I$PREFIX/include/glib-2.0
-I$PREFIX/lib/glib-2.0/include
-I$PREFIX/include/pango-1.0
-I$PREFIX/include/cairo
-I$PREFIX/include
-D_REENTRANT -D_GNU_SOURCE
-I$PREFIX/../include
-I$PREFIX/../include/directfb”
GDK_DEP_LIBS=”-L$PREFIX/lib -lpthread -ldl -lpangocairo-1.0
-lpango-1.0 -lcairo -lgobject-2.0 -lgmodule-2.0 -lglib-2.0 -lpng12 -lm
$PREFIX/../lib/libdirectfb.so
$PREFIX/../lib/libdirect.so
$PREFIX/../lib/libfusion.so”
GDK_PIXBUF_DEP_CFLAGS=”-pthread -I$PREFIX/include/glib-2.0
-I$PREFIX/lib/glib-2.0/include
-I$PREFIX/include
-I$PREFIX/../include”
GDK_PIXBUF_DEP_LIBS=”-L$PREFIX/lib
-lgmodule-2.0 -ldl -lgobject-2.0 -lglib-2.0 -lpng12 -lm”
GTK_DEP_CFLAGS=”-pthread -I$PREFIX/include/glib-2.0
-I$PREFIX/lib/glib-2.0/include
-I$PREFIX/include/pango-1.0
-I$PREFIX/include/cairo
-I$PREFIX/include -D_REENTRANT -D_GNU_SOURCE
-I$PREFIX/../include/directfb
-I$PREFIX/include/atk-1.0
-I$PREFIX/../include”
GTK_DEP_LIBS=”-L$PREFIX/lib
-lpangocairo-1.0 -lpango-1.0 -latk-1.0 -lgobject-2.0 -lgmodule-2.0
-ldl -lglib-2.0 -lcairo -lpng12 -lm
$PREFIX/../lib/libdirectfb.so
$PREFIX/../lib/libdirect.so
$PREFIX/../lib/libfusion.so”
GDK_EXTRA_CFLAGS=”-I$PREFIX/../include”
GDK_EXTRA_LIBS=”-L$PREFIX/../lib -lz -lpthread -ldl
$PREFIX/../lib/libdirectfb.so
$PREFIX/../lib/libdirect.so
$PREFIX/../lib/libfusion.so”
./configure
–host=$HOST
–build=$BUILD
–prefix=$PREFIX
–with-gdktarget=directfb
–without-libtiff
–disable-glibtest
–without-libjpeg
–disable-largefile
–disable-modules
–with-included-loaders=gif,png,xpm
============================================================
Environment varaibles modified
PKG_CONFIG_PATH=”/opt/STM/STLinux-2.2/devkit/sh4/target/usr/local/lib/pkgconfig:/opt/STM/STLinux-2.2/devkit/sh4/target/usr/local/../lib/pkgconfig”
Hi goralf,
Check my comment #20. It describe how to overcome this issue.
Regards.
Hi Ali,
I don’t see anything wrong with the configure params and options. Sometimes when I screw up the installation and get strange behaviour/results, I reinstall everything checking the environment vars and the paths.
During this week I was able to compile the latest versions of the whole chain (glib-2.15.4, cairo-1.6.4, pango-1.21.3, gtk+-2.12.11). Hopefully during this weekend I can post it. This could help you to solve the whole thing.
Regards.
Hi Paguilar,
Thanks, the pango link error is ok.But i have a new error when building the gtk:
sh4-linux-gcc -shared .libs/gdk.o .libs/gdkcairo.o .libs/gdkcolor.o .libs/gdkcursor.o .libs/gdkdisplay.o .libs/gdkdnd.o .libs/gdkdraw.o .libs/gdkevents.o .libs/gdkfont.o .libs/gdkgc.o .libs/gdkglobals.o .libs/gdkkeys.o .libs/gdkkeyuni.o .libs/gdkimage.o .libs/gdkdisplaymanager.o .libs/gdkpango.o .libs/gdkpixbuf-drawable.o .libs/gdkpixbuf-render.o .libs/gdkpixmap.o .libs/gdkpolyreg-generic.o .libs/gdkrgb.o .libs/gdkrectangle.o .libs/gdkregion-generic.o .libs/gdkscreen.o .libs/gdkselection.o .libs/gdkvisual.o .libs/gdkwindow.o .libs/gdkenumtypes.o -Wl,–whole-archive directfb/.libs/libgdk-directfb.a -Wl,–no-whole-archive -Wl,–rpath -Wl,/opt/STM/STLinux-2.2/devkit/sh4/target/usr/lib -Wl,–rpath -Wl,/home/goralf/Exercise/gtkdfb/usr/lib -Wl,–rpath -Wl,/home/goralf/Exercise/gtkdfb/usr/local/lib -Wl,–rpath -Wl,/home/goralf/Exercise/gtk_some/gtk+-2.12.6/gdk-pixbuf/.libs -Wl,–rpath -Wl,/opt/STM/STLinux-2.2/devkit/sh4/target/usr/lib -Wl,–rpath -Wl,/home/goralf/Exercise/gtkdfb/usr/lib -Wl,–rpath -Wl,/home/goralf/Exercise/gtkdfb/usr/local/lib -L/home/goralf/Exercise/gtkdfb/usr/local/lib -L/home/goralf/Exercise/gtkdfb/usr/lib /opt/STM/STLinux-2.2/devkit/sh4/target/usr/lib/libdirectfb.so -L/opt/STM/STLinux-2.2/devkit/sh4/target/usr/lib -lz /opt/STM/STLinux-2.2/devkit/sh4/target/usr/lib/libfusion.so /home/goralf/Exercise/gtkdfb/usr/lib/libdirect.so -lpthread /home/goralf/Exercise/gtkdfb/usr/local/lib/libpangocairo-1.0.so /home/goralf/Exercise/gtkdfb/usr/local/lib/libpango-1.0.so /home/goralf/Exercise/gtkdfb/usr/local/lib/libcairo.so /home/goralf/Exercise/gtkdfb/usr/local/lib/libgobject-2.0.so /home/goralf/Exercise/gtkdfb/usr/local/lib/libgmodule-2.0.so -ldl /home/goralf/Exercise/gtkdfb/usr/local/lib/libglib-2.0.so /home/goralf/Exercise/gtkdfb/usr/local/lib/libpng12.so -lm ../gdk-pixbuf/.libs/libgdk_pixbuf-2.0.so -Wl,-soname -Wl,libgdk-directfb-2.0.so.0 -Wl,-version-script -Wl,.libs/libgdk-directfb-2.0.ver -o .libs/libgdk-directfb-2.0.so.0.1200.6
/opt/STM/STLinux-2.2/devkit/sh4/lib/gcc/sh4-linux/4.1.1/../../../../sh4-linux/bin/ld: skipping incompatible /lib/ld-linux.so.2 when searching for /lib/ld-linux.so.2
/opt/STM/STLinux-2.2/devkit/sh4/lib/gcc/sh4-linux/4.1.1/../../../../sh4-linux/bin/ld: cannot find /lib/ld-linux.so.2
collect2: ld returned 1 exit status
make[4]: *** [libgdk-directfb-2.0.la] 错误
Hi goralf,
I had this problem long time ago, but I don’t remember exactly how I fixed it. It’s trying to use your host’s linker, instead of the target’s in your rootfs.
Set the ld environment variable to
May be this helps.
Regards.
Hi paguilar,
Thanks, but i have set the ld environment variable to
export LD_LIBRARY_PATH=$PREFIX/lib:$PREFIX/../lib
and the error is still.
Hi paguilar,
I guess this error is caused by libtool and the absolute paths embedded in its code.But i can’t find where.
Hi goralf,
In this link I found how to solve several problems with libtool:
http://www.metastatic.org/text/libtool.html
Regards.
Hi paguilar,
How do you set the cross-toolchain (compiler, linker…) in your path?
Thanks!
Hi Peguliar,
I was expecting a post on this with new version used.
Regards
Hi goralf,
My cross-toolchain is installed in
/opt/STM/STLinux-2.2/devkit/sh4/bin
so I set my path to:
That’s it.
Hi Ali,
I was very busy at home this weekend (we have a new born baby!!!)
I will post it between today and tomorrow.
Regards.
Hi Peguliar,
Congratulations!!!!!!!!!!!.God bless your “bundle of joy”!!!
Regards
Ali
Thanks a lot!
We’re really happy at home!
Even if I don’t have much time left for other things.
Regards.
Hi paguilar,
Congratulations too:)
Thanks!!!
Yesterday at luch time I had a bit of time for posting the new version of Cross-compiling GTK+ over DirectFB v0.2.
As I mentioned, I haven’t had much time for testing it, but it worked at least with gtk-demo.
I hope it can help you!
“… can you tell me how to get the STAPI (STFAE)?”
oops made a typo in my email address, this comment has the correct one.
Hi Arvy,
IIRC, you get the STAPI/STFAE through an FTP site that needs a login/passwd that ST gives you when you buy one their products such as a reference board.
The code there is proprietary, that’s why you cannot download from a public site.
Regards.