2013年9月3日 星期二

Static cross compile gtk-2.16.6+gtk-directfb+arm-linux (arm-linux-gcc-3.4.3+uClibc-0.9.28)

Refer to zsfly.cublog.cn GTK+/DirectFB

Donwload address:
1. libiconv-1.9.2 http://ftp.gnu.org/pub/gnu/libiconv/

2. gettext-0.14.6 http://ftp.gnu.org/pub/gnu/gettext/

In Ubuntu 10.4 Desktop and "root" login

mkdir usr/local/armlinux, extract arm-linux-gcc-3.4.4-glib-2.3.5-static.tar.gz to usr/local/armlinux
edit /etc environment document file add /usr/local/armlinux/bin

apt-get install build-essential libncurses5-dev

apt-get install autoconf

apt-get install libtool

apt-get install gettext

apt-get install libglib2.0-dev

apt-get install libgtk2.0-dev


//libiconv-1.9.2
make clean

export PREFIX=/usr/gtkdfb

export LDFLAGS=-L$PREFIX/lib

export CFLAGS="-I$PREFIX/include"

export PKG_CONFIG_PATH=$PREFIX/lib/pkgconfig

CC=arm-hisi-linux-gcc CXX=arm-hisi-linux-g++ AR=arm-hisi-linux-ar RANLIB=arm-hisi-linux-ranlib LD=arm-hisi-linux-ld STRIP=arm-hisi-linux-strip ./configure --prefix=$PREFIX --host=arm-hisi-linux --enable-static=yes --enable-shared=no

make
make install

//gettext-0.14.6

make clean

export PREFIX=/usr/gtkdfb

export LDFLAGS=-L$PREFIX/lib

export CFLAGS="-I$PREFIX/include"

export PKG_CONFIG_PATH=$PREFIX/lib/pkgconfig

CC=arm-hisi-linux-gcc CXX=arm-hisi-linux-g++ AR=arm-hisi-linux-ar RANLIB=arm-hisi-linux-ranlib LD=arm-hisi-linux-ld STRIP=arm-hisi-linux-strip ./configure --prefix=$PREFIX --host=arm-hisi-linux --enable-static=yes --enable-shared=no

make
make install

//tslib-1.4

make clean

export PREFIX=/usr/gtkdfb

./autogen.sh

echo "ac_cv_func_malloc_0_nonnull=yes" >arm-linux.cache

CC=arm-hisi-linux-gcc ./configure --host=arm-hisi-linux --prefix=$PREFIX --cache-file=arm-linux.cache --enable-static=yes --enable-shared=no

make

make install


//zlib-1.2.3

make clean

export LDFLAGS=-L$PREFIX/lib

export CFLAGS="-I$PREFIX/include"

export PKG_CONFIG_PATH=$PREFIX/lib/pkgconfig

CC=arm-hisi-linux-gcc ./configure --prefix=$PREFIX

make

make install


Ps:its default static


//glib 2.24.1

make clean

export LDFLAGS=-L$PREFIX/lib

export CFLAGS="-g -I$PREFIX/include"

export PKG_CONFIG_PATH=$PREFIX/lib/pkgconfig

echo ac_cv_type_long_long=yes>arm-linux.cache

echo glib_cv_stack_grows=no>>arm-linux.cache

echo glib_cv_uscore=no>>arm-linux.cache

echo ac_cv_func_posix_getpwuid_r=yes>>arm-linux.cache

echo ac_cv_func_posix_getgrgid_r=yes>>arm-linux.cache

CC=arm-hisi-linux-gcc ./configure --host=arm-hisi-linux --build=i386-linux --prefix=$PREFIX --cache-file=arm-linux.cache --enable-static=yes --enable-shared=no

make

make install


//atk 1.30.0

make clean

CC=arm-hisi-linux-gcc ./configure --host=arm-hisi-linux --build=i386-linux --prefix=$PREFIX --enable-static=yes --enable-shared=no

make

make install


//jpeg6b

make clean

export CC=arm-hisi-linux-gcc

CC=arm-hisi-linux-gcc AR=arm-linux-ar AR2=arm-linux-ranlib ./configure --host=arm-hisi-linux --prefix=$PREFIX --enable-static=yes --enable-shared=no

mkdir $PREFIX/man

mkdir $PREFIX/man/man1

make

make install

make install-lib


6、libpng-1.2.33

make clean

CC=arm-hisi-linux-gcc ./configure --host=arm-hisi-linux --prefix=$PREFIX --enable-static=yes --enable-shared=no

make

make install


7、expat-2.0.1

make clean

CC=arm-hisi-linux-gcc ./configure --host=arm-hisi-linux --prefix=$PREFIX --enable-static=yes --enable-shared=no

make

make install


8、freetype-2.3.7

make clean

CC=arm-hisi-linux-gcc ./configure --host=arm-hisi-linux --prefix=$PREFIX --enable-static=yes --enable-shared=no

make

make install


9、libxml2-2.6.31

make clean

CC=arm-hisi-linux-gcc ./configure --host=arm-hisi-linux --prefix=$PREFIX --enable-static=yes --enable-shared=no

make

make install


10、fontconfig-2.6.0

make clean

export LIBXML2_CFLAGS=-I$PREFIX/include/libxml2

export LIBXML2_LIBS="-L$PREFIX/lib -lxml2"

CC=arm-hisi-linux-gcc ./configure --host=arm-hisi-linux --prefix=$PREFIX --with-freetype-config=$PREFIX/bin/freetype-config --with-arch=arm --enable-static=yes --enable-shared=no

make

make install


11、tiff-3.7.4

make clean

CC=arm-hisi-linux-gcc ./configure --host=arm-hisi-linux --prefix=$PREFIX --enable-static=yes --enable-shared=no

make

make install


12、DirectFB-1.3.0

modify configure:

CFLAGS="-O3 -ffast-math -pipe $CFLAGS" -> CFLAGS="-O2 -ffast-math -pipe $CFLAGS"

have_linux=no ==> have_linux=yes

make clean

export PREFIX=/usr/gtkdfb

export LDFLAGS=-L$PREFIX/lib

export CFLAGS="-I$PREFIX/include"

export PKG_CONFIG_PATH=$PREFIX/lib/pkgconfig

CC=arm-hisi-linux-gcc ./configure --host=arm-hisi-linux --prefix=$PREFIX --enable-static=yes --enable-shared=no --enable-x11=no --enable-multi=no --enable-sdl=no --enable-fbdev=yes --with-gfxdrivers=none --enable-freetype=yes --enable-zlib=yes --enable-png=yes --enable-gif=no --enable-jpeg=no --enable-tiff=no

make
make install

Rember after making execute file, need add those links or system core error:
/usr/gtkdfb/lib/directfb-1.3-0/systems/libdirectfb_fbdev.o
/usr/gtkdfb/lib/directfb-1.3-0/wm/libdirectfbwm_default.o
/usr/gtkdfb/lib/directfb-1.3-0/inputdrivers/libdirectfb_keyboard.o
/usr/gtkdfb/lib/directfb-1.3-0/inputdrivers/libdirectfb_linux_input.o
/usr/ubuntufb/lib/directfb-1.3-0/inputdrivers/libdirectfb_ps2mouse.o /usr/x11dfb/lib/directfb-1.3-0/interfaces/IDirectFBImageProvider/libidirectfbimageprovider_png.o


13、pixman-0.12.0

make clean

export PKG_CONFIG_LIBDIR="$PREFIX/lib/pkgconfig"

CC=arm-hisi-linux-gcc ./configure --host=arm-hisi-linux --prefix=$PREFIX --enable-static=yes --enable-shared=no

make

make install


14、cairo-1.8.10

make clean

CC=arm-hisi-linux-gcc ./configure --host=arm-hisi-linux --prefix=$PREFIX --enable-static=yes --enable-shared=no --without-x --enable-xlib=no --enable-xlib-xrender=no --enable-win32=no --enable-win32-font=no --enable-directfb=yes --enable-ft=yes --enable-png=yes --enable-pdf=yes --enable-ps=yes

make
make install

15、pango-1.24.5

修改configure文件,將下面一些參數修改

have_cairo=true

have_cairo_png=true

have_cairo_ps=true

have_cairo_pdf=true

have_cairo_xlib=false

have_cairo_freetype=true

make clean

CC=arm-hisi-linux-gcc ./configure --host=arm-hisi-linux --prefix=$PREFIX --enable-static=yes --enable-shared=no --without-x --with-included-modules=basic-fc

make

make install

16、gtk+-2.16.6

//gtk+-2.16.6
modify gdkwindow-directfb.c to
//#ifdef DIRECT_ENABLE_DEBUG
GdkWindowImplDirectFB *wimpl = GDK_WINDOW_IMPL_DIRECTFB (private->impl);
//#endif

modify gtk+-2.16.6/perf/marshalers.c
//void _gtk_marshal_OBJECT__VOID

modify configure
*** Can't link to Pango. Pango is required to build
*** GTK+. For more information see http://www.pango.org" >&2;}
{ (exit 1); exit 1; }; }
to
{ (echo 1); echo 1; }; }

make clean

export PREFIX=/usr/gtkdfb

export LDFLAGS="-L$PREFIX/lib -Wl,-rpath,$PREFIX/lib"

export CFLAGS="-I$PREFIX/include"

export PKG_CONFIG_PATH=$PREFIX/lib/pkgconfig

echo gio_can_sniff=yes>arm-linux.cache

echo ac_cv_path_GTK_UPDATE_ICON_CACHE=/usr/bin/gtk-update-icon-cache>>arm-linux.cache

echo ac_cv_path_GDK_PIXBUF_CSOURCE=/usr/bin/gdk-pixbuf-csource>>arm-linux.cache

CC=arm-hisi-linux-gcc ./configure --prefix=$PREFIX --host=arm-hisi-linux --with-gdktarget=directfb --without-x --enable-static=yes --enable-shared=no --without-libtiff --without-libjpeg --without-libjasper --disable-glibtest --with-included-immodules=am-et,cedilla,cyrillic-translit,inuktitut,ipa,multipress,thai,ti-er,ti-et,viqr --with-included-loaders=ani,bmp,ico,icns,pcx,png,gif,pnm,ras,tga,wbmp,xbm,xpm --cache-file=arm-linux.cache

or

CC=arm-hisi-linux-gcc ./configure --prefix=$PREFIX --host=arm-hisi-linux --with-gdktarget=directfb --without-x --enable-static=yes --enable-shared=no --without-libtiff --without-libjpeg --without-libjasper --disable-glibtest --disable-largefile --disable-modules --with-included-loaders=ani,bmp,ico,gif,icns,pcx,png,pnm,ras,tga,wbmp,xbm,xpm --cache-file=arm-linux.cache

make
make install

If you still get error:
(!) DirectFB/core/system: No system found!
(#) DirectFBError [gdk_display_open: DirectFBCreate]: No (suitable) implementation found!

check those links first
/usr/gtkdfb/lib/directfb-1.3-0/systems/libdirectfb_fbdev.o
/usr/gtkdfb/lib/directfb-1.3-0/wm/libdirectfbwm_default.o
/usr/gtkdfb/lib/directfb-1.3-0/inputdrivers/libdirectfb_keyboard.o
/usr/gtkdfb/lib/directfb-1.3-0/inputdrivers/libdirectfb_linux_input.o
/usr/ubuntufb/lib/directfb-1.3-0/inputdrivers/libdirectfb_ps2mouse.o

/usr/ubuntufb/lib/directfb-1.3-0/interfaces/IDirectFBImageProvider/libidirectfbimageprovider_png.o
(if run dfbtest_blit will need it)

If get cairo initial directfb surface errors as follows:

(gtk-demo:1130): Gdk-DirectFB-WARNING **: gdk_display_request_selection_notification Unimplemented function

(gtk-demo:1130): Gdk-DirectFB-WARNING **: gdk_window_set_keep_above() not implemented.

(gtk-demo:1130): Gdk-DirectFB-WARNING **: gdk_window_set_keep_below() not implemented.

(!) [ 1130: 1.130] --> Caught signal 11 (at (nil), invalid address)

It's mean you need to find GTK correct version with directfb.

The latest directfb nice work version is 2.17.2, and 2.16.x projects work,too

If want to make more faster, remove follows

gtk+-2.17.2/makefile.in
SRC_SUBDIRS = gdk-pixbuf gdk gtk modules demos tests perf contrib
remove tests perf contrib

gtk+-2.17.2/gtk/makefile.in
SUBDIRS = theme-bits . tests
DIST_SUBDIRS = theme-bits tests
remove SUBDIRS [. tests] and SUBDIRS [tests]

gtk+-2.17.2_f/demos/Makefile.in
PROGRAMS = $(noinst_PROGRAMS)
remove $(noinst_PROGRAMS)

gedit /usr/ubuntufb/etc/directfbrc or gedit userhome/.directfbrc
system=FBDev
fbdev=/dev/fb0
wm=default
mode=800x600
depth=32
pixelformat=ARGB

1 則留言:

  1. try this new framebuffer tool kit
    https://fatalfeel.blogspot.com/2013/12/awtk-framebuffer-gui.html

    回覆刪除