tekkamanninja's tslib-1.4 移植记录

在移植好触摸屏的驱动后,一般都要移植一个tslib来配合,在用户层对触摸屏的数据进行滤波和矫正,同时也可以给应用程序一个统一的接口,很多GUI都支持tslib的接口。对于tslib的基础知识和移植,网上google一下就是一大把,在这里我提供一些较好的网页,这些已是我此次移植的参考。

http://blog.chinaunix.net/u1/33412/showart_282396.html

http://blog.chinaunix.net/u2/61322/showart.php?id=1357736

http://www.mangbar.com/document/8a80809d19bd3a240119ccd45b90399e

http://www.shengfang.org/blog/p/20070912tslibdownload.php

http://www.directfb.com.cn/viewthread.php?tid=388&extra=page%3D1

http://blog.csdn.net/mzl626/archive/2008/04/18/2304169.aspx

http://ccoolloorr.blogspot.com/2008/06/tslib-13-touch-screen-lib.html

http://weibing.blogbus.com/logs/4723645.html

交叉编译场景分析(arm-linux)(二)--编译tslib

下面简要地介绍一下我的交叉编译过程:
(1)下载最新版本的tslib,目前最新的是1.4版,下载方法是通过CVS下载:

$export CVSROOT=:pserver:anoncvs@cvs.handhelds.org:/cvs
$cvs login
Logging in to :pserver:anoncvs@cvs.handhelds.org:2401/cvs
CVS password: anoncvs
cvs login: CVS password file /home/tekkaman/.cvspass does not exist - creating a new file
$cvs co apps/tslib

这样会在你的$PWD下建立一个apps文件夹,其中的tslib就是我们下载下来的源码。

(2)产生configure文件。

tekkaman@MAGI:~/working/tslib$ ./autogen.sh 
Libtoolize...libtoolize: putting auxiliary files in `.'.
libtoolize: copying file `./ltmain.sh'
libtoolize: You should add the contents of the following files to `aclocal.m4':
libtoolize: `/usr/share/aclocal/libtool.m4'
libtoolize: `/usr/share/aclocal/ltoptions.m4'
libtoolize: `/usr/share/aclocal/ltversion.m4'
libtoolize: `/usr/share/aclocal/ltsugar.m4'
libtoolize: `/usr/share/aclocal/lt~obsolete.m4'
libtoolize: Consider adding `AC_CONFIG_MACRO_DIR([m4])' to configure.ac and
libtoolize: rerunning libtoolize, to keep the correct libtool macros in-tree.
libtoolize: Consider adding `-I m4' to ACLOCAL_AMFLAGS in Makefile.am.
Done.
Aclocal...Done.
Autoheader...Done.
Automake...configure.ac: installing `./install-sh'
configure.ac: installing `./missing'
plugins/Makefile.am: installing `./depcomp'
configure.ac:21: installing `./config.guess'
configure.ac:21: installing `./config.sub'
Done.
Autoconf...Done.
Now you can do ./configure, make, make install.

在执行./autogen.sh 的时候,有可能你会得到:

tekkaman@MAGI:~/working/tslib$ ./autogen.sh 
Libtoolize..../autogen.sh: line 4: libtoolize:找不到命令
Done.
Aclocal..../autogen.sh: line 7: aclocal:找不到命令
Done.
Autoheader..../autogen.sh: line 10: autoheader:找不到命令
Done.
Automake..../autogen.sh: line 13: automake:找不到命令
Done.
Autoconf..../autogen.sh: line 16: autoconf:找不到命令
Done.
Now you can do ./configure, make, make install.

说明有些工具你没有安装,我使用ubuntu8.10就会这样,碰到这种情况就可用新立得安装:autoconf、automake1.9和 libtool等软件包(新立得会自动添加其他需要的软件包)。

(3)产生缓冲文件和配置。

tekkaman@MAGI:~/working/tslib$ echo "ac_cv_func_malloc_0_nonnull=yes" >tekkaman_tslib.cache

tekkaman@MAGI:~/working/tslib$ ./configure --host=arm-9tdmi-linux-gnu --prefix=$PWD/build --target=arm-9tdmi-linux-gnu --disable-hp3600 --disable-arctic2 --disable-mk712 --disable-collie --disable-corgi --disable-ucb1x00 --disable-linear-h2200 --cache-file=tekkaman_tslib.cache --enable-inputapi=no

这里由于驱动是使用input子系统,所以很多都可以禁用,那些是针对别的特殊输出格式的驱动的。但是 --enable-inputapi=no一定要加。

(4)以上都顺利通过的话就可以make、make install了。

用以上的配置得到的编译好的代码在当前目录的build下。这由--prefix=决定。

之后就是将代码拷贝到根文件系统中(注意tslib依赖的动态链接库文件,记得要拷贝到根文件系统的/lib里),并修改/etc/porfile就好了。这些在我提供的网页里都有,我就不在这重复了。

如果忘了拷贝动态库,就会出现以下提示:

error while loading shared libraries: libdl.so.2: cannot open shared object file: No such file or directory

注意:如果使用了我移植的带滤波的触摸屏驱动,在ts.conf文件中可以屏蔽

#module pthres pmin=1
#module variance delta=30
#module dejitter delta=100

这三行,因使用内核滤波也可以保障稳定。但是再加上tslib的滤波也可以,效果更好。

以下是我做好的带有tslib的根文件系统,编译好的tslib代码在/lib下:

文件:rootfs.tar.bz2
大小:1366KB
下载:下载

以下是在mini2440上运行的情况:

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值