首页 > 代码库 > Port gtk2 with directfb as backend for arm

Port gtk2 with directfb as backend for arm

I have all the tar packages in netdisk http://mail.sina.com.cn/netdisk/download.php?id=04366451404ccd7717d6cf292e1cd92609 

I download them from below links:

 

http://ftp.gnome.org/pub/gnome/sourcesglib-2.19.0 :ftp://ftp.gtk.org/pub/glib/2.19/pango-1.20.2 :http://ftp.gnome.org/pub/gnome/sources/pango/1.20/ gtk+-2.12.9 :http://ftp.gnome.org/pub/gnome/sources/gtk+/2.12/DirectFB-1.4.17 :http://www.directfb.org/downloads/zlib-1.2.3 :http://www.zlib.net/ jpegsrc.v6b :ftp://ftp.gtk.org/pub/gtk/v2.10/dependencies/ (http://sourceforge.net/projects/libjpeg/files/libjpeg/6b/)freetype-2.3.7 :http://freetype.sourceforge.net/index2.html    fontconfig-2.6.0 :http://www.fontconfig.org/release/libxml2-2.6.31 :http://xmlsoft.org/sources/ (/linux/gnome.org/sources/libxml2/2.6)

 

I write a build.sh file as below to do all the build work, this is also a list or a procedure.

#!/bin/sh
export SRCDIR=$(pwd)export PREFIX=/opt/gtk_dfb_armexport PATH=$PATH:$PREFIX/binexport C_INCLUDE_PATH=$PREFIX/includeexport LD_LIBRARY_PATH=$PREFIX/libexport PKG_CONFIG_PATH=$LD_LIBRARY_PATH/pkgconfigexport LDFLAGS=-L$LD_LIBRARY_PATHexport CFLAGS=-I$PREFIX/includeexport MK="make -j4"export MK_INS="make install"# http://downloads.sourceforge.net/project/giflib/giflib-5.1.0.tar.bz2# http://downloads.sourceforge.net/project/libpng/libpng12/1.2.44/libpng-1.2.44.tar.xz# http://ftp.gnome.org/pub/gnome/sources/atk/1.12/atk-1.12.2.tar.bz2# http://cairographics.org/releases/cairo-1.12.18.tar.xz# http://cairographics.org/releases/pixman-0.18.4.tar.gz# http://linux.thai.net/pub/thailinux/software/libthai/libthai-0.1.21.tar.xz# http://linux.thai.net/pub/thailinux/software/libthai/libdatrie-0.2.8.tar.xztar xf atk-1.12.2.tar.bz2tar xf cairo-1.12.18.tar.xztar xf DirectFB-1.4.17.tar.gztar xf fontconfig-2.6.0.tar.gztar xf freetype-2.3.7.tar.gztar xf giflib-5.1.0.tar.bz2tar xf glib-2.19.0.tar.gztar xf gtk+-2.12.9.tar.gztar xf jpegsrc.v6b.tar.gztar xf libdatrie-0.2.8.tar.xztar xf libpng-1.2.44.tar.gztar xf libthai-0.1.21.tar.xztar xf libxml2-2.6.30.tar.gztar xf pango-1.20.2.tar.gztar xf pixman-0.18.4.tar.gztar xf tslib-1.4.tar.gztar xf zlib-1.2.3.tar.gzsudo mkdir -p $PREFIXsudo chmod a+rw $PREFIX# tslib-1.4cd $SRCDIR/tslib./autogen.shecho "ac_cv_func_malloc_0_nonnull=yes" >arm-linux.cacheCC=arm-linux-gcc ./configure --host=arm-linux --prefix=$PREFIX --cache-file=arm-linux.cache$MK$MK_INS# giflibcd $SRCDIR/giflib-5.1.0CC=arm-linux-gcc ./configure --host=arm-linux --prefix=$PREFIX$MK$MK_INS# libjpegcd $SRCDIR/jpeg-6bCC=arm-linux-gcc AR="arm-linux-ar rc" AR2=arm-linux-ranlib ./configure --host=arm-linux --prefix=$PREFIXmkdir $PREFIX/manmkdir $PREFIX/man/man1$MK$MK_INS$MK_INS-lib# zlibcd $SRCDIR/zlib-1.2.3CC=arm-linux-gcc ./configure --prefix=$PREFIX -shared$MK$MK_INS#libpng-1.2.44 cd $SRCDIR/libpng-1.2.44CC=arm-linux-gcc ./configure --host=arm-linux --prefix=$PREFIX$MK$MK_INS#freetype2cd $SRCDIR/freetype-2.3.7CC=arm-linux-gcc ./configure --host=arm-linux --prefix=$PREFIX$MK$MK_INS# DirectFB-1.4.17cd $SRCDIR/DirectFB-1.4.17CC=arm-linux-gcc ./configure --host=arm-linux --prefix=$PREFIX --with-gfxdrivers=none --enable-png --enable-jpeg --enable-gif --enable-zlib --enable-sdl=no --disable-x11 --with-inputdrivers=tslib --enable-debug --enable-trace$MK$MK_INS#glib-2.19.0cd $SRCDIR/glib-2.19.0echo ac_cv_type_long_long=yes>arm-linux.cacheecho glib_cv_stack_grows=no>>arm-linux.cacheecho glib_cv_uscore=no>>arm-linux.cacheecho ac_cv_func_posix_getpwuid_r=yes>>arm-linux.cacheecho ac_cv_func_posix_getgrgid_r=yes>>arm-linux.cacheCC=arm-linux-gcc ./configure --host=arm-linux --prefix=$PREFIX --cache-file=arm-linux.cache --enable-debug=no$MK$MK_INS#atk-1.12.2cd $SRCDIR/atk-1.12.2CC=arm-linux-gcc ./configure --host=arm-linux --prefix=$PREFIX$MK$MK_INS#libxml2-2.6.30cd $SRCDIR/libxml2-2.6.30echo ac_cv_type_long_long=yes>arm-linux.cacheCC=arm-linux-gcc ./configure --host=arm-linux --prefix=$PREFIX --cache-file=arm-linux.cache $MK$MK_INS#build pass at archlinux 32bit, fail on opensuse 64bit#fontconfig-2.6.0cd $SRCDIR/fontconfig-2.6.0export LIBXML2_CFLAGS=-I$PREFIX/include/libxml2export LIBXML2_LIBS="-L$PREFIX/lib -lxml2"CC=arm-linux-gcc ./configure --host=arm-linux --prefix=$PREFIX --with-freetype-config=$PREFIX/bin/freetype-config --with-arch=arm --enable-libxml2 --enable-shared$MK$MK_INScp fontconfig $PREFIX/include -r#pixman-0.18.4cd $SRCDIR/pixman-0.18.4CC=arm-linux-gcc ./configure --host=arm-linux --prefix=$PREFIX --disable-gtk$MK$MK_INS#cairo-1.12.18#cairo 1.12 , need pixman>=0.16cd $SRCDIR/cairo-1.12.18CC=arm-linux-gcc ./configure --host=arm-linux --prefix=$PREFIX --without-x --disable-xlib --disable-xlib-xrender --enable-directfb --enable-freetype --disable-win32 --enable-pdf --enable-ps --disable-svg --enable-png --enable-ft --disable-xcb-shm --disable-xcb$MK$MK_INS#libdatrie-0.2.8cd $SRCDIR/libdatrie-0.2.8CC=arm-linux-gcc ./configure --host=arm-linux --prefix=$PREFIX$MK$MK_INS#libthai-0.1.21cd $SRCDIR/libthai-0.1.21CC=arm-linux-gcc ./configure --host=arm-linux --prefix=$PREFIX$MK$MK_INS #pango-1.20.2cd $SRCDIR/pango-1.20.2echo have_cairo=true>>arm-linux.cacheecho have_cairo_png=true>>arm-linux.cacheecho have_cairo_ps=true>>arm-linux.cacheecho have_cairo_pdf=true>>arm-linux.cacheecho have_cairo_freetype=true>>arm-linux.cacheexport CAIRO_CFLAGS="-fno-strict-aliasing -I$PREFIX/include/cairo -I$PREFIX/include/fontconfig -I$PREFIX/include -I$PREFIX/include/pixman-1 -I$PREFIX/include/freetype2 -I$PREFIX/include/libpng12"export CAIRO_LIBS="-L$PREFIX/lib -lcairo"export GLIB_CFLAGS="-I$PREFIX/include -I$PREFIX/include/glib-2.0 -I$PREFIX/lib/glib-2.0/include"export GLIB_LIBS="-L$PREFIX/lib -lgobject-2.0 -lgmodule-2.0 -lglib-2.0"export FONTCONFIG_CFLAGS="-I$PREFIX/include/fontconfig -I$PREFIX/include"export FONTCONFIG_LIBS="-L$PREFIX/lib -lfontconfig"export FREETYPE_CFLAGS="-I$PREFIX/include/freetype2 -I$PREFIX/include"export FREETYPE_LIBS="-L$PREFIX/lib -lfreetype -lz"export FREETYPE_CONFIG="${PREFIX}/bin/freetype-config"export CAIRO_PREFIX=$prefixCC=arm-linux-gcc ./configure --host=arm-linux --prefix=$PREFIX --cache-file=arm-linux.cache --without-x$MK$MK_INS#gtk+-2.12.9cd $SRCDIR/gtk+-2.12.9export LDFLAGS="-L$PREFIX/lib -Wl,-rpath,$PREFIX/lib"export CPPFLAGS="-I$PREFIX/include"CC=arm-linux-gcc ./configure --host=arm-linux --prefix=$PREFIX --with-gdktarget=directfb --without-x --without-libtiff --disable-cups$MK$MK_INS

 

mv /opt/gtk_dfb_arm to root filesystem /opt/opt/gtk_dfb_arm

then add .directfbrc to root filesystem $HOME/.directfbrc content as below

# .directfbrc
system=fbdevfbdev=/dev/fb0mode=240x320depth=16pixelformat=RGB16# print info,warining,error,once# quiet=info# for send text output at remote with: "socat - udp4-listen:8088,fork"#Send all messages via UDP to the specified host and port.## log-udp=192.168.1.110:8088# debug## debug

 

The /etc/profile in root filesystem 

#!/bin/shexport TSLIB_PLUGINDIR=/lib/tsexport TSLIB_FBDEVICE=/dev/fb0export TSLIB_TSDEVICE=/dev/input/event0export TSLIB_CONFFILE=/etc/ts.confexport TSLIB_CALIBFILE=/etc/pointercalexport TSLIB_CONSOLEDEVICE=none# directfbexport DIRECTFB=/opt/gtk_dfb_armexport PATH=$PATH:$DIRECTFB/bin

 

Port gtk2 with directfb as backend for arm