Chinaunix首页 | 论坛 | 博客
  • 博客访问: 965761
  • 博文数量: 261
  • 博客积分: 10026
  • 博客等级: 上将
  • 技术积分: 3420
  • 用 户 组: 普通用户
  • 注册时间: 2009-02-24 12:10
个人简介

https://smart888.taobao.com/ 立观智能监控

文章分类

全部博文(261)

文章存档

2011年(1)

2010年(4)

2009年(256)

我的朋友

分类: LINUX

2009-07-05 22:07:57

基本上是由《嵌入式linux GUI--DirectFB + GTK至尊秘笈》来的,整理的一起主要为了以后重新编译找起来方便!!

1) Tslib
export PREFIX=/usr/local/directfb
export CFLAGS="-g -Wall -W -DUSE_INPUT_API -I$PREFIX/include"
export PKG_CONFIG_PATH=$PREFIX/lib/pkgconfig
echo "ac_cv_func_malloc_0_nonnull=yes">arm-linux.cache
打patch
--- tslib.orig/plugins/Makefile.am
+++ tslib/plugins/Makefile.am
@@ -107,15 +107,19 @@ pluginexec_LTLIBRARIES = \

variance_la_SOURCES = variance.c
variance_la_LDFLAGS = -module $(LTVSN)
+variance_la_LIBADD = $(top_builddir)/src/libts.la

dejitter_la_SOURCES = dejitter.c
dejitter_la_LDFLAGS = -module $(LTVSN)
+dejitter_la_LIBADD = $(top_builddir)/src/libts.la

linear_la_SOURCES = linear.c
linear_la_LDFLAGS = -module $(LTVSN)
+linear_la_LIBADD = $(top_builddir)/src/libts.la

pthres_la_SOURCES = pthres.c
pthres_la_LDFLAGS = -module $(LTVSN)
+pthres_la_LIBADD = $(top_builddir)/src/libts.la

# hw access
corgi_la_SOURCES = corgi-raw.
./configure --host=arm-linux --prefix=$PREFIX --cache-file=arm-linux.cache --enable-debug
make
make install

env.sh
#/bin/sh
export PREFIX=/usr/local/directfb
export LDFLAGS=-L$PREFIX/lib
export CFLAGS="-g -I$PREFIX/include"
export PKG_CONFIG_PATH=$PREFIX/lib/pkgconfig

$source env.sh

2) glib
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-linux-gcc ./configure --host=arm-linux --build=i686-pc-linux --prefix=$PREFIX --cache-file=arm-linux.cache --enable-debug=yes

3) atk
./configure --host=arm-linux --prefix=$PREFIX
4) jpeg-6b
./configure --prefix=$PREFIX --enable-shared --enable-static
修改生成的Makefile文件:
       # The name of your C compiler:
       CC= gcc 该成 CC=arm-linux-gcc (根据你自己交叉编译器的位置修改)
       # library (.a) file creation command
       AR= ar rc 该成 AR= arm-linux-ar rc (同上)
       # second step in .a creation (use "touch" if not needed)
       AR2= ranlib 该成 AR2=arm-linux-ranlib (同上)
mkdir -p $PREFIX/man/man1
make
make install-lib
5) zlib
CC=arm-linux-gcc ./configure --prefix=$PREFIX --shared
make
make install
6) libpng
./configure --host=arm-linux --prefix=$PREFIX
make
make install
7) expat
./configure --host=arm-linux --prefix=$PREFIX
make
make install
8) freetype
./configure --host=arm-linux --prefix=$PREFIX
make
make install
9) libxml
./configure --host=arm-linux --prefix=$PREFIX
make
make install
10) fontconfig
export LIBXML2_CFLAGS=-I$PREFIX/include/libxml2
export LIBXML2_LIBS="-L$PREFIX/lib -lxml2"
./configure --host=arm-linux --prefix=$PREFIX --with-freetype-config=$PREFIX/bin/freetype-config --with-arch=arm

!!maybe you need export LDFLAGS="$LDFLAGS -lexpat -lz -lfreetype -lxml2" before configure!!

make
make install
11) tiff
./configure --host=arm-linux --prefix=$PREFIX --enable-shared
make
make install

12)pixman-0.13.2

CC=arm-linux-gcc ./configure --host=arm-linux --build=i386-linux --prefix=$PREFIX
修改makefile
SUBDIRS = pixman
13) DirectFB
修改configure文件,改MODULEDIR=/usr/local/directfb/lib/$MODULEDIRNAME
修改configure文件,改所有O3到O2
./configure --host=arm-linux --prefix=$PREFIX --with-gfxdrivers=none --with-inputdrivers=linuxinput,tslib --enable-png --enable-jpeg --enable-gif=no --enable-tiff --enable-zlib --enable-sdl=no --disable-x11 --enable-debug --enable-trace
make
make install
14) cairo
./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
make
make install

15) Pango
     修改configure文件,将下面一些参数改成true
have_cairo=true
have_cairo_png=true        
have_cairo_ps=true
have_cairo_pdf=true
have_cairo_freetype=true
./configure --host=arm-linux --prefix=$PREFIX --enable-cairo --without-x
make
make install

16) gtk
export LDFLAGS="-L$PREFIX/lib -Wl,-rpath,$PREFIX/lib"
!!
maybe you need export LDFLAGS="-L$PREFIX/lib -lexpat -lxml2 -lpangoft2-1.0 -lfreetype -lz -lfontconfig -lpixman-1 -ldirectfb -lfusion -ldirect -lpng12 -lpango-1.0 -lgobject-2.0 -lgmodule-2.0 -lglib-2.0"
!!
export CPPFLAGS="-I$PREFIX/include"
./configure --host=arm-linux --prefix=$PREFIX --with-gdktarget=directfb --without-x --enable-debug=yes
make
make install

编译过程到此结束,剩下把生成文件拷贝到开发版对应位置,再配置一下就好了!!
$cp -R /usr/local/directfb /home/lee/opt/FriendlyARM/QQ2440/root_nfs/usr/local/

cd c
配置文件:
1) Pangorc
mkdir etc/pango
创建文件 /home/lee/opt/FriendlyARM/QQ2440/root_nfs/usr/local/directfb/etc/pango/pangorc文件内容如下
# pangorc file for uninstalled operation.
# We set the path as ../modules, such that it works from any of
# top level build subdirs.
#

[Pango]
ModuleFiles = /usr/local/directfb/etc/pango/pango.modules
ModulesPath = /usr/local/directfb/lib/pango/1.6.0/modules

上面在宿主系统上运行
下面的命令在开发板上运行
$./bin/pango-querymodules>./etc/pango/pango.modules

2) gfxdrivers
    下面的命令本行在开发板上运行,只是消除一个警告
$mkdir /usr/local/directfb/lib/directfb-1.3-0/gfxdrivers
3) gdk-pixbuf.loaders
    下面的命令本行在开发板上运行
mkdir ./etc/gtk-2.0
./bin/gdk-pixbuf-query-loaders>./etc/gtk-2.0/gdk-pixbuf.loaders

4) gtk.immodules
    下面的命令本行在开发板上运行
./bin/gtk-query-immodules-2.0>./etc/gtk-2.0/gtk.immodules

下面是开发板上一些环境变量和directfbrc,ts.conf文件
[root@FriendlyARM lib]# cat /dfbenv                                            
#!/bin/sh                                                                      
                                                                               
export PATH=/usr/local/directfb/bin:$PATH                                      
export LD_LIBRARY_PATH=/lib:/usr/local/directfb/lib:/usr/local/directfb/lib/dirs
export TSLIB_CONSOLEDEVICE=none                                                
export TSLIB_FBDEVICE=/dev/fb/0                                                
export TSLIB_TSDEVICE=/dev/input/event0                                        
export TSLIB_CALIBFILE=/usr/local/directfb/etc/pointercal                      
export TSLIB_CONFFILE=/usr/local/directfb/etc/ts.conf                          
export TSLIB_PLUGINDIR=/usr/local/directfb/lib/ts     

[root@FriendlyARM bin]# cat /usr/local/directfb/etc/directfbrc                 
system=fbdev                                                                   
fbdev=/dev/fb/0                                                                
wm=default                                                                     
mode=240x320                                                                   
depth=16                                                                       
pixelformat=RGB16             

[root@FriendlyARM bin]# cat /usr/local/directfb/etc/ts.conf                    
module_raw input                                                               
module pthres pmin=1                                                           
module variance delta=30                                                       
module dejitter delta=100                                                      
module linear               

至此基本工作应该算是完成了!!
$source /dfbenv
$./bin/gtk-demo

阅读(2186) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~