在Ubuntu下移植好觸摸屏的驅動後,一般都要移植一個tslib來配合,在用戶層對觸摸屏的數據進行濾波和矯正,同時也可以給應用程序一個統一的接口,很多GUI都支持tslib的接口.對於tslib的基礎知識和移植,網上google一下就是一大把,下面簡要地介紹一下我的交叉編譯過程:
(1)下載最新版本的tslib,目前最新的是1.4版,下載方法是通過CVS下載:
$ mkdir - m777 cvs
$ cd 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 / daiq / . cvspass does not exist - creating a new file
$ cvs co apps / tslib
這樣會在你的$PWD/cvs下建立一個 apps文件夾,其中的 tslib就是我們下載下來的源碼.
(2)產生configure文件.
這裡要先安裝一些工具,我使用ubuntu9.10就不用安裝,但是還是用新立得安裝:autoconf、automake和libtool等軟件包(新立得會自動添加其他需要的軟件包).
sudo apt - get install m4 autoconf automake libtool
先設置好交叉編譯環境:
$ export PATH = $ PATH : / work / cross / toolchain / gcc - 3 . 4 . 5 - glibc - 2 . 3 . 6 / arm - softfloat - linux - gnu / bin
$ export CC = arm - softfloat - linux - gnu - gcc
$ export CXX = arm - softfloat - linux - gnu - g + +
執行 ./autogen.sh
daiq@daiq - desktop : / work / cvs / apps / 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 : 21 : installing ` . / config . guess '
configure.ac:21: installing `./config.sub'
configure . ac : 7 : installing ` . / install - sh '
configure.ac:7: installing `./missing'
plugins / Makefile . am : installing ` . / depcomp
Done.
Autoconf...Done.
Now you can do ./configure, make, make install.