移植QtEmbedded-4.5.2到mini2440开发板
1,下载解压源码:
root@yuanxh-desktop:/# wget http://www.arm123.com.cn/linux/arm-linux-gcc-4.3.2.tgz
root@yuanxh-desktop:/# tar xzvf arm-linux-gcc-4.3.2.tgz
root@yuanxh-desktop:/# mkdir /home/yuanxh/mini2440/
root@yuanxh-desktop:/# cd /home/yuanxh/mini2440/
root@yuanxh-desktop:/home/yuanxh/mini2440# wget ftp://ftp.qtsoftware.com/qt/source/qt-x11-opensource-src-4.5.2.tar.bz2
root@yuanxh-desktop:/home/yuanxh/mini2440# wget ftp://ftp.qtsoftware.com/qt/source/qt-embedded-linux-opensource-src-4.5.2.tar.bz2
root@yuanxh-desktop:/home/yuanxh/mini2440# tar xjvf qt-x11-opensource-src-4.5.2.tar.bz2
root@yuanxh-desktop:/home/yuanxh/mini2440# tar xjvf qt-embedded-linux-opensource-src-4.5.2.tar.bz2
2,配置编译Qt源码:
root@yuanxh-desktop:/home/yuanxh/mini2440# cd qt-x11-opensource-src-4.5.2
root@yuanxh-desktop:/home/yuanxh/mini2440/qt-x11-opensource-src-4.5.2# ./configure
选择o确定开源版本,选择yes接受版权;
root@yuanxh-desktop:/home/yuanxh/mini2440/qt-x11-opensource-src-4.5.2# make
root@yuanxh-desktop:/home/yuanxh/mini2440/qt-x11-opensource-src-4.5.2# make install
root@yuanxh-desktop:/home/yuanxh/mini2440/qt-x11-opensource-src-4.5.2# cd ..
root@yuanxh-desktop:/home/yuanxh/mini2440# cd qt-x11-opensource-src-4.5.2/tools/qvfb
root@yuanxh-desktop:/home/yuanxh/mini2440/qt-x11-opensource-src-4.5.2/tools/qvfb# make
root@yuanxh-desktop:/home/yuanxh/mini2440/qt-x11-opensource-src-4.5.2/tools/qvfb# make install
root@yuanxh-desktop:/home/yuanxh/mini2440/qt-x11-opensource-src-4.5.2/tools/qvfb# cd ../../../
root@yuanxh-desktop:/home/yuanxh/mini2440# file qt-x11-opensource-src-4.5.2/bin/qvfb
3,配置编译QtE源码X86版本:
root@yuanxh-desktop:/home/yuanxh/mini2440# mv qt-embedded-linux-opensource-src-4.5.2 qt-embedded-linux-opensource-src-4.5.2-x86
root@yuanxh-desktop:/home/yuanxh/mini2440# cd qt-embedded-linux-opensource-src-4.5.2-x86
root@yuanxh-desktop:/home/yuanxh/mini2440/qt-embedded-linux-opensource-src-4.5.2-x86# ./configure -prefix /usr/local/Trolltech/QtEmbedded-4.5.2-x86 -embedded x86 -qvfb
选择o确定开源版本,选择yes接受版权;
root@yuanxh-desktop:/home/yuanxh/mini2440/qt-embedded-linux-opensource-src-4.5.2-x86# make
root@yuanxh-desktop:/home/yuanxh/mini2440/qt-embedded-linux-opensource-src-4.5.2-x86# make install
root@yuanxh-desktop:/home/yuanxh/mini2440/qt-embedded-linux-opensource-src-4.5.2-x86# cd ..
root@yuanxh-desktop:/home/yuanxh/mini2440# file /usr/local/Trolltech/QtEmbedded-4.5.2-x86/examples/widgets/analogclock/analogclock
root@yuanxh-desktop:/home/yuanxh/mini2440# cp qt-x11-opensource-src-4.5.2/bin/qvfb /usr/local/Trolltech/QtEmbedded-4.5.2-x86/bin
4,在QVFB上运行DEMO代码
建立配置脚本
root@yuanxh-desktop:/home/yuanxh/mini2440# cd /usr/local/Trolltech/QtEmbedded-4.5.2-x86
root@yuanxh-desktop:/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
保存退出.
root@yuanxh-desktop:/usr/local/Trolltech/QtEmbedded-4.5.2-x86# source setenv-x86.sh
root@yuanxh-desktop:/usr/local/Trolltech/QtEmbedded-4.5.2-x86# cd /examples/widgets/analogclock
root@yuanxh-desktop:/usr/local/Trolltech/QtEmbedded-4.5.2-x86/examples/widgets/analogclock# qvfb -width 640 -height 480 &
root@yuanxh-desktop:/usr/local/Trolltech/QtEmbedded-4.5.2-x86/examples/widgets/analogclock# ./analogclock -qws
5,配置编译QtE源码ARM版本:
root@yuanxh-desktop:/home/yuanxh/mini2440# tar xvjf qt-embedded-linux-opensource-src-4.5.2.tar.bz2
root@yuanxh-desktop:/home/yuanxh/mini2440# mv qt-embedded-linux-opensource-src-4.5.2 qt-embedded-linux-opensource-src-4.5.2-arm
root@yuanxh-desktop:/home/yuanxh/mini2440# cd qt-embedded-linux-opensource-src-4.5.2-arm/
root@yuanxh-desktop:/home/yuanxh/mini2440/qt-embedded-linux-opensource-src-4.5.2-arm# cd mkspecs/qws/linux-arm-g++/
root@yuanxh-desktop:/home/yuanxh/mini2440/qt-embedded-linux-opensource-src-4.5.2-arm/mkspecs/qws/linux-arm-g++# cp qmake.conf qmake.conf.org
root@yuanxh-desktop:/home/yuanxh/mini2440/qt-embedded-linux-opensource-src-4.5.2-arm/mkspecs/qws/linux-arm-g++# vi qmake.conf
把所有的 arm-linux- 修改为:/usr/local/arm/4.3.2/bin/arm-linux- 后保存
root@yuanxh-desktop:/home/yuanxh/mini2440/qt-embedded-linux-opensource-src-4.5.2-arm/mkspecs/qws/linux-arm-g++# cd ../../../
root@yuanxh-desktop:/home/yuanxh/mini2440/qt-embedded-linux-opensource-src-4.5.2-arm# ./configure -prefix /usr/local/QtEmbedded-4.5.2 -embedded arm -no-webkit
选择o确定开源版本,选择yes接受版权;
root@yuanxh-desktop:/home/yuanxh/mini2440/qt-embedded-linux-opensource-src-4.5.2-arm# make
root@yuanxh-desktop:/home/yuanxh/mini2440/qt-embedded-linux-opensource-src-4.5.2-arm# make install
root@yuanxh-desktop:/home/yuanxh/mini2440/qt-embedded-linux-opensource-src-4.5.2-arm# cd ..
root@yuanxh-desktop:/home/yuanxh/mini2440# file /usr/local/QtEmbedded-4.5.2/examples/widgets/analogclock/analogclock
root@yuanxh-desktop:/home/yuanxh/mini2440# cd /usr/local/
root@yuanxh-desktop:/usr/local# tar czvf QtEmbedded-4.5.2.tgz QtEmbedded-4.5.2
root@yuanxh-desktop:/usr/local# 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版本:
root@yuanxh-desktop:/home/yuanxh/mini2440/qt-embedded-linux-opensource-src-4.5.2-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
root@yuanxh-desktop:/home/yuanxh/mini2440/qt-embedded-linux-opensource-src-4.5.2-arm# make
root@yuanxh-desktop:/home/yuanxh/mini2440/qt-embedded-linux-opensource-src-4.5.2-arm# make install
离线