免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 857 | 回复: 0
打印 上一主题 下一主题

qtopia-free-2.2.0编译过程 一 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2009-04-08 10:40 |只看该作者 |倒序浏览

host环境:fedora-10系统完全安装,交叉编译工具arm-linux-gcc-2.95.3
target环境:arm s3c2410,320x240屏外加触摸屏
          (驱动已经装好),yaffs 文件系统。

软件: arm-linux-gcc 2.95.3
    qtopia-free-src-2.2.0.tar.gz
    e2fsprogs-1.40.2.tar.gz=>(e2fs)
jpegsrc.v6b.tar.gz=>(jpeg)  
      tslib-0.1.1tar.bz2=>(tslib)
上面的软件包放在/MY2410/qtopia-2.2.0

(1)安装arm-linux-gcc-2.95.3
由于在用arm-linux-gcc-3.4.1编译qtopia-free-2.2.0的时候会报错,所以就安装arm-linux-gcc-2.95.3了.
[bingchuan@ARM ~]$ cd /MY2410/qtopia-2.2.0/
[bingchuan@ARM qtopia-2.2.0]$ tar xzf arm-linux-gcc-2.95.3.tgz
[bingchuan@ARM qtopia-2.2.0]$cd usr/local/arm
[bingchuan@ARM arm]$ sudo mv 2.95.3 /usr/local/arm
然后在/etc/profile 里面最后以后加上环境变量:
export PATH=/usr/local/arm/2.95.3/bin

(2)安装e2fs:
[bingchuan@ARM ~]$ cd /MY2410/qtopia-2.2.0/
[bingchuan@ARM qtopia-2.2.0]$ tar xzf e2fsprogs-1.40.2.tar.gz

[bingchuan@ARM e2fsprogs-1.40.2]$ mkdir build; cd build
[bingchuan@ARM build]$ ../configure --host=arm-linux --with-cc=/usr/local/arm/2.95.3/bin/arm-linux-gcc --with-linker=/usr/local/arm/2.95.3/bin/arm-linux-ld --enable-elf-shlibs --prefix=/usr/local/arm/2.95.3/arm-linux
[bingchuan@ARM build]$ make
[bingchuan@ARM build]$ make install
进行上面几步操作以后e2fs文件就安装到/usr/local/arm/2.95.3/arm-linux里面了。

(3)安装jpeg:
[bingchuan@ARM qtopia-2.2.0]$ tar xzf jpegsrc.v6b.tar.gz
[bingchuan@ARM qtopia-2.2.0]$ cd jpeg
[bingchuan@ARM qtopia-2.2.0]$ cd jpeg-6b/
[bingchuan@ARM jpeg-6b]$ ./configure --enable-shared --enable-static  --prefix=/usr/local/arm/3.4.1/arm-linux --build=i386 --host=arm
[bingchuan@ARM jpeg-6b]$ vi Makefile
修改:
CC= arm-linux-gcc
AR= arm-linux-ar rc
AR2=arm-linux-ranlib
保存后,执行”make”,”make install”命令即可。

(4)编译tslib
[bingchuan@ARM ~]$ cd /MY2410/qtopia-2.2.0/
[bingchuan@ARM qtopia-2.2.0]$ mkdir test
[bingchuan@ARM qtopia-2.2.0]$ tar xjf tslib-0.1.1tar.bz2
[bingchuan@ARM qtopia-2.2.0]$ cd tslib
[bingchuan@ARM tslib]$ ./autogen.sh  //生成config文件
[bingchuan@ARM tslib]$ export PATH=/usr/local/arm/2.95.3/bin:$PATH
[bingchuan@ARM tslib]$ echo "ac_cv_func_malloc_0_nonnull=yes" >arm-linux.cache
[bingchuan@ARM tslib]$ ./configure --host=arm-linux --cache-file=arm-linux.cache --enable-inputapi=no  --prefix=/MY2410/qtopia-2.2.0/test
[bingchuan@ARM tslib]$  make
[bingchuan@ARM tslib]$  make install
经过上面操作后,生成的tslib库文件就安装在/MY2410/qtopia-2.2.0/test下面了。

(5)编译Qtopia
[bingchuan@ARM qtopia-2.2.0]$ tar xzf qtopia-free-src-2.2.0.tar.gz
[bingchuan@ARM qtopia-2.2.0]$ cd qtopia-free-2.2.0/
修改文件
   /qtopia-free-2.2.0/qtopia/mkspecs/qws/linux-arm-g++/qmake.conf(由于些文件为只读文件,可用chmod命令给些文件加上W的权限,否则修改不了!)
将此行
   QMAKE_LIBS_QT = -lqte
修改为
   QMAKE_LIBS_QT= -lqte  -lts  -luuid -ljpeg
如果想让Qtopia自己支持触摸屏,需要修改$QPEDIR/qtopia/src/qt/qconfig-qpe.h文件,定义相应的宏,在最后加上
#define QT_QWS_IPAQ
#define QT_QWS_IPAQ_RAW
如果想让Qtopia支持鼠标,需要修改$QPEDIR/src/qt/qconfig-qpe.h文件
注释如下部分:
/*
#ifndef QT_NO_QWS_CURSOR
#define QT_NO_QWS_CURSOR
#endif
#ifndef QT_NO_QWS_MOUSE_AUTO
#define QT_NO_QWS_MOUSE_AUTO
#endif
#ifndef QT_NO_QWS_MOUSE_PC
#define QT_NO_QWS_MOUSE_PC
#endif
*/
在配置之前还要执行以下操作
[bingchuan@ARM qtopia-free-2.2.0]$ cd qtopia/src/libraries/qtopia/

[bingchuan@ARM qtopia]$ cp custom-linux-cassiopeia-g++.h custom-linux-arm-g++.h

[bingchuan@ARM qtopia]$ cp custom-linux-cassiopeia-g++.cpp  custom-linux-arm-g++.cpp

[bingchuan@ARM qtopia]$ cd -
/MY2410/qtopia-2.2.0/qtopia-free-2.2.0

[bingchuan@ARM qtopia-free-2.2.0]$ pwd
/MY2410/qtopia-2.2.0/qtopia-free-2.2.0

[bingchuan@ARM qtopia-free-2.2.0]$ ./configure -qte "-embedded -no-xft -xplatform linux-arm-g++ -qconfig qpe  -depths 16,32 -no-qvfb -system-jpeg   -gif -thread -no-xft -release  -tslib -I/MY2410/qtopia-2.2.0/test/include -L/MY2410/qtopia-2.2.0/test/lib  -lts " -qpe '-xplatform linux-arm-g++ -edition pda -displaysize 320x240 ' -qt2 '-no-xft' -dqt '-no-xft'
   
yes
[bingchuan@ARM qtopia-free-2.2.0]$ make  //这个过程很漫长不出错的话约一小时吧

[bingchuan@ARM qtopia-free-2.2.0]$ make install
/qtopia/image/opt/Qtopia   里面就是这次编译所生成的镜像文件

(6)出现的错误:
  “canot find lqt-mt”
解决办法:直接搜索拷贝:

[bingchuan@ARM ~]$ sudo find /  -name libqt-mt*
/usr/lib/qt-3.3/lib/libqt-mt.so.3.3
/usr/lib/qt-3.3/lib/libqt-mt.prl
/usr/lib/qt-3.3/lib/libqt-mt.so.3.3.8
/usr/lib/qt-3.3/lib/libqt-mt.so
/usr/lib/qt-3.3/lib/libqt-mt.so.3

[bingchuan@ARM ~]$ cp /usr/lib/qt-3.3/lib/libqt-mt*  /MY2410/qtopia-2.2.0/qtopia-
qtopia-2.2.0bianyiguocheng    qtopia-free-2.2.0/
qtopia-2.2.0bianyiguocheng~   qtopia-free-src-2.2.0.tar.gz
[bingchuan@ARM ~]$ cp /usr/lib/qt-3.3/lib/libqt-mt*  /MY2410/qtopia-2.2.0/qtopia-free-2.2.0/qtopia/lib/
重新make 没有报错。



本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u3/94352/showart_1893396.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP