全部博文(252)
分类:
2012-07-11 17:53:23
移植QtEmbedded-4.5.2到mini2440开发板
http://blog.163.com/yuan_xihua/blog/static/30740544200966103422494/
1,下载解压源码:
# wget
# tar xzvf arm-linux-gcc-4.3.2.tgz
# mkdir /home/yuanxh/mini2440/
# cd /home/yuanxh/mini2440/
# wget
# wget
# tar xjvf qt-x11-opensource-src-4.5.2.tar.bz2
# tar xjvf qt-embedded-linux-opensource-src-4.5.2.tar.bz2
2,配置编译Qt源码:
# cd qt-x11-opensource-src-4.5.2
# ./configure
选择o确定开源版本,选择yes接受版权;
# make
# make install
# cd ..
# cd qt-x11-opensource-src-4.5.2/tools/qvfb
# make
# make install
# cd ../../../
# file qt-x11-opensource-src-4.5.2/bin/qvfb
3,配置编译QtE源码X86版本:
# mv qt-embedded-linux-opensource-src-4.5.2 qt-embedded-linux-opensource-src-4.5.2-x86
# cd qt-embedded-linux-opensource-src-4.5.2-x86
# ./configure -prefix /usr/local/Trolltech/QtEmbedded-4.5.2-x86 -embedded x86 -qvfb
选择o确定开源版本,选择yes接受版权;
# make
# make install
# cd ..
# file /usr/local/Trolltech/QtEmbedded-4.5.2-x86/examples/widgets/analogclock/analogclock
# cp qt-x11-opensource-src-4.5.2/bin/qvfb /usr/local/Trolltech/QtEmbedded-4.5.2-x86/bin
4,在QVFB上运行DEMO代码
建立配置脚本
# cd /usr/local/Trolltech/QtEmbedded-4.5.2-x86
# vi setenv-x86.sh
添加如下内容:
QTEDIR=/usr/local/Trolltech/QtEmbedded-4.5.2-x86
PATH=/usr/local/Trolltech/QtEmbedded-4.5.2-x86/bin:$PATH
LD_LIBRARY_PATH=/usr/local/Trolltech/QtEmbedded-4.5.2-x86/lib:$LD_LIBRARY_PATH
保存退出.
# source setenv-x86.sh
# cd /examples/widgets/analogclock
# qvfb -width 640 -height 480 &
# ./analogclock -qws
5,配置编译QtE源码ARM版本:
# tar xvjf qt-embedded-linux-opensource-src-4.5.2.tar.bz2
# mv qt-embedded-linux-opensource-src-4.5.2 qt-embedded-linux-opensource-src-4.5.2-arm
# cd qt-embedded-linux-opensource-src-4.5.2-arm/
# cd mkspecs/qws/linux-arm-g++/
++# cp qmake.conf qmake.conf.org
++# vi qmake.conf
把所有的 arm-linux- 修改为:/usr/local/arm/4.3.2/bin/arm-linux- 后保存
++# cd ../../../
# ./configure -prefix /usr/local/QtEmbedded-4.5.2 -embedded arm -no-webkit
选择o确定开源版本,选择yes接受版权;
# make
# make install
# cd ..
# file /usr/local/QtEmbedded-4.5.2/examples/widgets/analogclock/analogclock
# cd /usr/local/
# tar czvf QtEmbedded-4.5.2.tgz QtEmbedded-4.5.2
# sz QtEmbedded-4.5.2.tgz
6,在ARM板上运行DEMO
建立配置脚本
[root@FriendlyARM /]# mkdir /usr/local/QtEmbedded-4.5.2/
[root@FriendlyARM /]# cd /usr/local/QtEmbedded-4.5.2/
[root@FriendlyARM QtEmbedded-4.5.2]# vi setenv-arm.sh
添加如下内容:
export QTDIR=/usr/local/QtEmbedded-4.5.2
export QPEDIR=/usr/local/QtEmbedded-4.5.2
export LD_LIBRARY_PATH=$QTDIR/lib:/usr/local/lib:$LD_LIBRARY_PATH
/usr/local/QtEmbedded-4.5.2/analogclock -qws &
保存退出,并执行。
[root@FriendlyARM QtEmbedded-4.5.2]# mkdir lib/
[root@FriendlyARM QtEmbedded-4.5.2]# mkdir lib/fonts/
把以下的库文件从编译生成的QtEmbedded-4.5.2.tgz文件包的/lib复制到目标板的/usr/local/QtEmbedded-4.5.2/lib
libQtCore.so.4
libQtGui.so.4
libQtNetwork.so.4
libQtSql.so.4
把例子程序analogclock从编译生成的QtEmbedded-4.5.2.tgz文件包的/examples/widgets/analogclock复制到目标板的/usr/local/QtEmbedded-4.5.2/
常用字库文件从从编译生成的QtEmbedded-4.5.2.tgz文件包的lib/fonts/复制到目标板的/usr/local/QtEmbedded-4.5.2/lib/fonts/
......
运行例子
[root@FriendlyARM QtEmbedded-4.5.2]# ./analogclock -qws
[root@FriendlyARM /]# vi /etc/init.d/rcS
在文件中加入:
/usr/local/QtEmbedded-4.5.2/setenv-arm.sh
#/bin/qtopia &
添加自动启动。
7,裁剪编译QtE源码ARM版本:
# ./configure -prefix /usr/local/QtEmbedded-4.5.2 -embedded arm \
-release -shared -fast -no-largefile -qt-sql-sqlite -no-qt3support -no-xmlpatterns -no-mmx -no-3dnow -no-sse -no-sse2 -no-svg -no-webkit -qt-zlib -qt-gif \
-qt-libtiff -qt-libpng -qt-libmng -qt-libjpeg -make libs -nomake tools -nomake examples -nomake docs -nomake demo -no-nis -no-cups -no-iconv -no-dbus \
-no-openssl -xplatform qws/linux-arm-g++ -little-endian -qt-freetype -depths 16,18 -qt-gfx-linuxfb -no-gfx-transformed -no-gfx-multiscreen \
-no-gfx-vnc -no-gfx-qvfb -qt-kbd-usb -no-glib -qt-mouse-tslib
# make
# make install