QT交叉编译与移植

QT交叉编译与移植

 

ruihanL@126.com

 

在ARM上开发运行QT有两种方法,一种是移植Qtopia,一种是移植Qte。Qtopia实际上是QT2.0,现在比较老了,一般使用最新的Qte开发。

 

1.交叉编译目标

通过交叉编译QT源代码,得到一套开发的库,复制库到开发板上,这样在PC上编译好的文件就可以复制到开发板上运行。在PC上主要是要获得qmake和库,在开发板上需要的是库。

 

2.交叉编译步骤

2.1.编译环境

编译QT的PC版本需要JPEG等库的支持,编译ARM版本的需要触摸控制库的支持,因此必须事先安装好各种库。PC上推荐使用深度Linux进行编译开发。

 

2.2.编译触摸库

tar xvzf tslib-1.4.tar.gz

cd tslib-1.4.1

mkdir _install

./autogen.sh

echo "ac_cv_func_malloc_0_nonnull=yes">arm-linux.cache

./configure--prefix=./_install/ --host=arm-linux av_cv_func_malloc_0_nonnull=yes--cache-file=arm-linux.cache

make

makeinstall

在这个配置中./_install/就是我们指定的安装路径,也就是执行make install后,tslib就被安装到这个目录了。

通过上述操作,就可以在./_install目录下看到相关的应用程序、共享库、配置文件等,这些库和配置文件都是要拷到ARM板的根文件系统中的。

修改/ etc/ts.conf,去掉module_rawinput的注释符,文字顶格。

 

2.3.编译源代码

 

./configure -prefix ./_install/ -shared-no-fast -no-largefile -no-exceptions -qt-sql-sqlite -qt3support-no-xmlpatterns -multimedia -no-svg -no-mmx -no-3dnow -no-sse -no-sse2 -qt-zlib-qt-libtiff -qt-libpng -qt-libjpeg -make libs -nomake examples -nomake docs-nomake demo -no-optimized-qmake -no-nis -no-cups -no-iconv -no-dbus-no-separate-debug-info -no-openssl -xplatform qws/linux-arm-g++ -embedded arm-little-endian -opensource -confirm-license -no-freetype -depths 4,8,16,32 -qt-gfx-linuxfb-no-gfx-multiscreen -no-gfx-vnc -no-gfx-qvfb -qt-kbd-linuxinput -no-kbd-tty-no-glib -armfpa -no-mouse-qvfb -qt-mouse-pc -qt-mouse-tslib-I/opt/EmbedSky/qt483/tslib-1.4.1/_install/include-L/opt/EmbedSky/qt483/tslib-1.4.1/_install/lib

make

make install

 

配置的时候注意引入触摸库,还有安装路径。

 

2.4.复制字体和库

将编译之后的include、lib(*.so、frons文件夹的*.qpf)、plugins(imageformats)复制到开发板上,在开发板的配置文件上写明QTDIR等变量的路径。

 

 

3. configure配置选项

运行configure -h,可以看到

This is the Qt for Embedded Linux OpenSource Edition.

 

Usage: configure [-prefix <dir>] [-prefix-install] [-bindir <dir>][-libdir <dir>]

       [-docdir <dir>] [-headerdir <dir>] [-plugindir <dir> ][-datadir <dir>]

       [-translationdir <dir>] [-sysconfdir <dir>] [-examplesdir<dir>]

       [-demosdir <dir>] [-buildkey <key>] [-release] [-debug]

       [-debug-and-release] [-shared] [-static] [-no-fast] [-fast][-no-largefile]

       [-largefile] [-no-exceptions] [-exceptions] [-no-accessibility]

       [-accessibility] [-no-stl] [-stl] [-no-sql-<driver>][-sql-<driver>]

       [-plugin-sql-<driver>] [-system-sqlite] [-no-qt3support][-qt3support]

       [-platform] [-D <string>] [-I <string>] [-L <string>][-help]

       [-qt-zlib] [-system-zlib] [-no-gif] [-qt-gif] [-no-libtiff][-system-libtiff]

       [-no-libpng] [-qt-libpng] [-system-libpng] [-no-libmng] [-qt-libmng]

       [-system-libmng] [-no-libjpeg] [-qt-libjpeg] [-system-libjpeg] [-make<part>]

       [-no-make <part>] [-R <string>]  [-l <string>] [-no-rpath]  [-rpath] [-continue]

       [-verbose] [-v] [-silent] [-no-nis] [-nis] [-no-cups] [-cups][-no-iconv]

       [-iconv] [-no-pch] [-pch] [-no-dbus] [-dbus] [-dbus-linked]

       [-no-separate-debug-info] [-no-mmx] [-no-3dnow] [-no-sse] [-no-sse2]

       [-qtnamespace <namespace>] [-separate-debug-info] [-armfpa]

       [-no-optimized-qmake] [-optimized-qmake] [-no-xmlpatterns][-xmlpatterns]

       [-no-phonon] [-phonon] [-no-phonon-backend] [-phonon-backend]

       [-no-gtkstyle] [-gtkstyle] [-no-svg] [-svg] [-no-webkit] [-webkit]

       [-no-scripttools] [-scripttools]

 

       [additional platform specific options (see below)]

具体选项的含义见文档。

 

 

 

 

 

 

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值