现在的位置: 首页 > 综合 > 正文

Ubuntu移植qt4.4.3到mips平台

2013年08月04日 ⁄ 综合 ⁄ 共 2321字 ⁄ 字号 评论关闭

                    
Ubuntu
移植qt4.4.3mips平台

                                     
---Harish hu

一:下载源码和配置mips交叉编译工具

qt官网上下载qt-embedded-linux-commercial-src-4.4.3.tar.gz

下载tslib-1.4.tar.gz

配置mips编译工具:

exportPATH={toolchain}:$PATH

二:编译tslib

设置环境变量:

#exportCC=mipsel-linux-gcc

#exportCXX=mipsel-linux-g++

安装如下软件:

#sudoapt-get install autoconf

     #sudo apt-getinstall automake
     #sudo apt-get installlibtool

#tar -xf tslib-1.4.tar.gz

#cdtslib

#./autogen.sh

执行autogen.sh结束後,在运行如下命令:

./configure --prefix=/usr/local/tslib/ 
--host=mips-linux  ac_cv_func_malloc_0_nonnull=yes

如果要了解其它配置参数,可以自己查看configure文件

接着:

#make

#makeinstall

然后在机子的/usr/local/tslib文件夹下面会出现:

libinclude
bin etc

四个文件夹,将tslib这个文件夹拷贝到板子的/usr/local/

然后设置如下环境变量:

exportLD_LIBRARY_PATH=/usr/local/tslib/lib:$LD_LIBRARY_PATH

exportTSLIB_ROOT=/usr/local/tslib

exportTSLIB_CONSOLEDEVICE=none

exportTSLIB_FBDEVICE=/dev/fb

exportTSLIB_TSDEVICE=/dev/input/event0

exportTSLIB_CALIBFILE=/etc/pointercal

exportTSLIB_CONFFILE=$TSLIB_ROOT/etc/ts.conf

exportTSLIB_PLUGINDIR=$TSLIB_ROOT/lib/ts

修改tslib/etc/ts.conf

支持module_rawinput,修改後的ts.conf如下:
module_raw input
module pthres pmin=1
module variance delta=30
module dejitter delta=100
module linear

然后运行tslib/bin的几个testapp,如果没问题的话,说明tslib已经成功移植到板子上

三:编译QT

#tar-xf
qt-embedded-linux-commercial-src-4.4.3.tar.gz

#cd
qt-embedded-linux-commercial-src-4.4.3

#./configure-qconfig
qpe -qvfb -depths 4,8,16,32 -xplatform qws/linux-mips-g++-embedded mips -no-xcursor -no-mouse-linuxtp -qt-mouse-tslib-I/usr/local/tslib/include -L/usr/local/tslib/lib -prefix /opt/qte

由于目标板子不需要鼠标,所以加上-no-xcursor-no-mouse-linuxtp

去除鼠标,还需修改./src/gui/embedded/qwscursor_qws.h,在文件头部加上

#defineQT_NO_QWS_CURSOR

另外,如果板子需要qt的转屏功能,需加上如下选项:

-qt-gfx-linuxfb-qt-gfx-transformed
-qt-gfx-multisceen

然后在板子上加上如下环境变量来控制转屏:

exportQWS_DISPLAY=Transformed:Rot90

配置问成後

make

makeinstall

opt/qte拷贝到板子/opt

在板子上设置如下环境变量:

QTOPIADIR=/opt/qte

exportQPEDIR=$QTOPIADIR

exportQTDIR=$QTOPIADIR

exportPATH=$QTDIR/bin:$PATH

exportLD_LIBRARY_PATH=$QTDIR/lib:$LD_LIBRARY_PATH

exportQWS_MOUSE_PROTO=Tslib:/dev/input/event0

exportQWS_KEYBOARD=TTY:/dev/tty0

exportQT_QWS_FONTDIR=$QTDIR/lib/fonts
//
如果confgure时指定了prefix,这个可以不设置

exportQWS_DISPLAY=Transformed:Rot90//支持转屏需要设置

然后运行/op/qte/bin下的qt程序,如果能正常跑起来,说明QT已经移植成功

三:编译qt程序

ubuntu下设置如下环境变量:

exportQTEDIR=/opt/qte

exportPATH=$QTEDIR/bin:$PATH

exportLD_LIBRARY_PATH=$QTEDIR/lib:$LD_LIBRARY_PATH

进入编写好的qt程序目录:

qmake-project

qmake

make

将生成的可执行文件拷贝到板子上,运行即可。

抱歉!评论已关闭.