平台简介: 1、主 机:Fedora11 2、目标机:mini2440 3、源码包: qt-x11-opensource-src-4.5.2.tar.gz qt-embedded-linux-opensource-src-4.5.2.tar.gz 在此链接中可以找到相应代码: 编译移植过程: 1,解压源码: 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