Chinaunix首页 | 论坛 | 博客
  • 博客访问: 263886
  • 博文数量: 84
  • 博客积分: 3742
  • 博客等级: 中校
  • 技术积分: 870
  • 用 户 组: 普通用户
  • 注册时间: 2009-09-20 19:38
文章分类

全部博文(84)

文章存档

2012年(6)

2011年(21)

2010年(54)

2009年(3)

分类: LINUX

2010-08-08 11:12:04

平台简介:
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

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


阅读(812) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~