六.安装QT for Embedded for X86 嵌入式X86
1.1、解压qt-everywhere-opensource-src-4.7.4.tar.gz 并更改目录名
tar xvzf qt-everywhere-opensource-src-4.7.4.tar.gz -C /opt/FriendlyARM/mini2440/Qt
cd /opt/FriendlyARM/mini2440/Qt
mv qt-everywhere-opensource-src-4.7.4 qt-for-x86
1.2、 进入对应文件夹并配置
#cd /opt/FriendlyARM/mini2440/Qt/qt-for-x86
#./configure -embedded x86 -qt-gfx-qvfb -qt-kbd-qvfb -qt-mouse-qvfb //配置
接着提示要使用商业版还是开源版:输入o后回车选择开源版;
然后提示可以使用开源协议:输入yes后回车即可。
1.3.、#gmake //编译,这个过程要等几个小时的时间
1.4、#gmake install
1.5、安装目录在/usr/local/Trolltech/QtEmbedded-4.7.4/
1.6、使用时需添加
#export PATH=” /usr/local/Trolltech/QtEmbedded-4.7.1/bin:$PATH”
然后输入#qmake –v (如能输出版本号,则说明安装成功)
1.1 安装qvfb
将第五步中1.8中编译成功的qvfb复制到/usr/local/Trolltech/QtEmbedded-4.7.4/bin/中,则可。
七. 为安装QT for Embedded for ARM 的准备工作
1.安装交叉编译工具arm-linux-gcc-4.3.2
1.1、tar xvzf arm-linux-gcc-4.3.2.tgz –C / (C需要大写,解压后安装在/usr/local/arm/4.3.2/)
1.2、#vi /etc/profile (添加PATH)
export PATH="$PATH:/usr/local/arm/4.3.2/bin"
保存退出后在终端输入:
# source /etc/profile
1.3、测试是否安装成功 arm-linux-gcc -v 会显示arm-linux-gcc版本,则说明安装成功。
2.交叉编译tslib-1.4 安装移植 (需要交叉编译工具, QT4只是支持tslib-1.4)
1.1、解压tslib-1.4.tar.gz
tar xvzf tslib-1.4.tar.gz –C /opt/FriendlyARM/mini2440/Qt
1.2、#cd /opt/FriendlyARM/mini2440/Qt /tslib/
进入tslib之后关键是要设置交叉编译环境(下面是根据我自己的实际情况所添加的)——如果不设置交叉编译环境,在移植到开发板时,执行./ts_calibrate程序时会出现以下错误:
./ts_calibrate: line 1: syntax error :”(” unexpected.
#export PATH=$PATH:/usr/local/arm/4.3.2/bin
#export CC=/usr/local/arm/4.3.2/bin/arm-linux-gcc //设定C编译器
#export CXX=/usr/local/arm/4.3.2/bin/arm-linux-g++ //设定C++编译器
1.3、#./autogen.sh (如果运行有错误则需要安装autoconf、automake、libtool (如yum install autoconf))
1.4、#echo "ac_cv_func_malloc_0_nonnull=yes" >arm-linux.cache //避免检查ac_cv_func_malloc_0_nonnull
1.5、# ./configure --host=arm-linux --cache-file=arm-linux.cache -prefix=/usr/local/tslib
1.6、gmake
1.7、gmake install (安装在/usr/local/tslib里面)
1.8、#vi /usr/local/tslib/etc/ts.conf (修改ts.conf) 最后内容如下:
module_raw input //前面不能有空格,否则会出现段错误
module pthres pmin=1
module variance delta=30
module dejitter delta=100
module linear
1.9、(以下是在对应的开发版上使用)
将上面整个tslib的内容打包,下载到开发版里的对应路径下 (/usr/local/),或自己指定的路径下,然后设置相应的环境变量。
配置环境变量,可以在/etc/profile最后添加以下内容:
#export QTDIR=/usr/local/lib-for-QtE //这是预先设置的,因为安装完QtE后会用到这个环境变量
#export T_ROOT=/tslib
#export PATH=$QTDIR/bin:$T_ROOT/bin:$PATH
#export TSLIB_CONSOLEDEVICE=none
#export TSLIB_FBDEVICE=/dev/fb0
#export TSLIB_TSDEVICE=/dev/input/event0
#export TSLIB_PLUGINDIR=$T_ROOT/lib/ts
#export TSLIB_CONFFILE=$T_ROOT/etc/ts.conf
#export TSLIB_CALIBFILE=/etc/pointercal
#export QWS_MOUSE_PROTO=tslib:/dev/input/event0
#export LD_LIBRARY_PATH=$T_ROOT/lib:$QTDIR/lib
若在相应的文件夹里没有相应的fb0、event0模块,则cd到开发板的根目录里,然后执行:
mknod /dev/fb0 c 29 0
mknod /dev/input c 13 64
而对于/etc/pointercal文件,需要再开发板的触摸屏执行完五点校正后才会生成此文件。
重启MINI2440,在终端下输入
#ts_calibrate
出现tslib的触摸屏五点校准画面,至此,tslib的安装移植成功完成。
# ts_test //触摸屏测试
可以参考以下链接来编译安装tslib:
http://www.linuxidc.com/Linux/2012-08/68410.htm
http://www.linuxidc.com/Linux/2012-08/68411.htm

