总结《TQ210编译tslib》如下:
ubuntu每次重启需要看下arm-linux-gcc-v, 没有的话需要source /etc/environment
(1)tarxvzf tslib-1.4.tar.gz
(2)第二步:进入tslib之后关键是要设置交叉编译环境(下面是根据我自己的实际情况所添加的)——如果不设置交叉编译环境,在移植到开发板时,执行./ts_calibrate程序时会出现以下错误:
./ts_calibrate:line 1: syntax error :”(” unexpected.
$exportPATH=$PATH:/opt/tools/4.4.6/4.4.6/bin
$exportCC=arm-linux-gcc
$exportCXX=arm-linux-g++
设置好交叉编译环境后就可以开始安装了:
执行./autogen.sh
(3)接着执行以下命令:
./configure--prefix=/usr/local/tslib/ --host=arm-linuxac_cv_func_malloc_0_nonnull=yes
(4)make& make install
然后修改:/etc/ts.conf
module_rawinput
modulepthres pmin=1
modulevariance delta=30
moduledejitter delta=100
modulelinear
安装好tslib之后将动态链接库文件拷贝到根文件系统中,(注意tslib依赖的是动态链接库文件)即将/tslib/lib/下的库拷贝到文件系统的/lib下
(5)vim /etc/profile 见文件系统rootfs里的
exportTSLIB_ROOT=/usr/local/tslib
exportTSLIB_TSDEVICE=/dev/event4
exportTSLIB_FBDEVICE=/dev/fb0
exportTSLIB_CALIBFILE=/etc/pointercal
exportTSLIB_CONFFILE=$TSLIB_ROOT/etc/ts.conf
exportTSLIB_PLUGINDIR=$TSLIB_ROOT/lib/ts
exportTSLIB_CONSOLEDEVICE=none
exportLD_LIBRARY_PATH=$LD_LIBRARY_PATH:$TSLIB_ROOT/lib
exportQTDIR=/usr/local/qt
exportLD_LIBRARY_PATH=$QTDIR/lib:$LD_LIBRARY_PATH
exportLD_LIBRARY_FILE=/etc/pointercal
exportQWS_MOUSE_PROTO=Tslib:/dev/event0
exportset QT_QWS_FONTDIR=$QTDIR/lib/fonts
出现的问题:
./autogen.sh:4: autoreconf: not found
是在不同版本的 tslib 下执行 autogen.sh 产生。它们产生的原因一样,是
因为没有安装
automake 工具,(ubuntu 8.04)用下面的命令安装好就可以了。
sudo apt-get install autoconf automake libtool
tslib1.4已经安装到ubuntu上,将上个文件系统rootfs挂载到TQ210试试。
[root@wwsbin]# ./ts_calibrate
xres= 800, yres = 480
selecteddevice is not a touchscreen I understand
百度TQ210 selected device is nota touchscreen I understand
原因这里应该是编译器版本不一致导致的,内核是用4.4.6编译的,上个tslib是用4.3.2编译的,再试试刚编译好的tslib:这次用4.4.6编译后的tslib放到开发板触摸屏好用。
[root@wwsbin]# ./ts_calibrate
./ts_calibrate:line 1: syntax error: "(" unexpected
参考《交叉编译tslib1.4过程详述,配合QT4.5.3成功在Mini2440运行成功》
『本文转载自网络,版权归原作者所有,如有侵权请联系删除』