tslib是touch screen lib,即支持触摸屏的库文件。要交叉编译qte4.5.2,就必须先要编译tslib1.4.今天做了这个工作,记录一下。
平台:VMware + Centos5.4
交叉编译器:arm-linux-3.4.1
参考资料:http://blog.chinaunix.net/u1/34474/showart.php?id=1882664
http://blog.youkuaiyun.com/lxb316/archive/2009/12/05/4948726.aspx
tslib.tar.bz2下载地址:http://blog.chinaunix.net/u2/75270/showart_1793535.html
具体步骤如下:
我将软件包放在了opt目录下,进入该目录
#tar. xzvf tslib-1.4.tar.gz(下载的文件名可能不是tslib-1.4,以具体的文件名而定)
#cd tslib
#export CC=/usr/local/arm/3.4.1/bin/arm-linux-gcc
#export CXX=/usr/local/arm/3.4.1/bin/arm-linux-g++
#./autogen.sh
#export PATH=/usr/local/arm/3.4.1/bin:PATH
#echo ‘ac_cv_func_malloc_0_nonnull=yes'>arm-linux.cache//没有此句会出错,因为configure里有#define malloc rpl_malloc一行。分析configure 脚本相关的代码,原来是ac_cv_func_malloc_0_nonnull引起的,我们产生一个cache文件arm-linux.cache,欺骗configure。
#./configure --host=arm-linux --cache-file=arm-linux.cache --enable-inputapi=no PLUGIN_DIR=/home/tslib/plugins -prefix=/home/tslib/build -host=arm-linux --cache-file=arm-linux.cache 2>&1 | tee conf_log//它是用来把configure的输出结果放到conf_log里面,便于我们查看。
#make 2>&1 | tee make_log
#make install
我将其安装在home目录下,进入该目录就可以看到编译好的文件。
这时,我们就可以挂载测试了。但测试前还需要以下几步。
#cd /home/tslib/build/etc
#vi ts。conf
去掉module_raw input前面的#和空格
然后将tslib放入nfs共享文件夹中,进行挂载。板子的环境变量设置为:
#export T_ROOT=/home/tslib/build
#export LD_LIBRARY_PATH=$T_ROOT/lib
#export TSLIB_CONSOLEDEVICE=none
#export TSLIB_FBDEVICE=/dev/fb0
#export TSLIB_TSDEVICE=/dev/event0
#export TSLIB_PLUGINDIR=$T_ROOT/lib/ts
#export TSLIB_CONFFILE=$T_ROOT/etc/ts.conf
#export TSLIB_CALIBFILE=/home/tslib/build/etc/pointercal
FROM: http://blog.sina.com.cn/s/blog_645508ba0100i3sm.html