您的位置:首页 > 编程语言 > Qt开发

关于交叉编译Qtopia-opensource-src-4.3.2 (参考)

2009-07-10 16:04 435 查看

关于交叉编译Qtopia-opensource-src-4.3.2 (参考)

标签
:
编译

交叉

2009-03-10 21:59

主机系统:FC6

目标板:Arm 9200

目标板文件系统:cramfs

可以在网上下载该Qtopia版本:ftp://ftp.trolltech.com/qtopia/source/qtopia-opensource-src-4.3.2.tar.gz

总共大小:109.89M

交叉编译器:cross-3.3.2

export PATH=$PATH:/usr/local/arm/3.3.2/bin

解压到目录:/root/Qtopia4/source

创建目标:/root/Qtopia4/target 存放make 所产生的文件

创建安装目录:/mnt/nfs/image 存放make install 所产生的文件,也是arm板上所执行文件,我是采用nfs方式来和arm板连接的

修改时区信息

# vi src/libraries/qtopia/qtimezone.cpp

将 /usr/share/zoneinfo/ 改为/mnt/nfs/qtopia4/qtopiatslibtarget/zoneinfo/ ,保存退出。

# vi src/settings/systemtime/settime.cpp

将 /usr/share/zoneinfo/ 改为/mnt/nfs/qtopia4/qtopiatslibtarget/zoneinfo/ ,保存退出。

裁减Qtopia core的库

# vi qtopiacore/qconfig-qpe.h

首先注释掉关于鼠标光标的宏定义,让程序运行时,触摸屏中央有光标出现:

// Qtopia Core

/*

#ifndef QT_NO_QWS_CURSOR

# define QT_NO_QWS_CURSOR

#endif

*/

/*

#ifndef QT_NO_QWS_MOUSE

# define QT_NO_QWS_MOUSE

#endif

#ifndef QT_NO_QWS_MOUSE_AUTO

# define QT_NO_QWS_MOUSE_AUTO

#endif

*/

其它宏定义根据需要进行注释。

保存后将qconfig-qpe.h拷贝到global目录。

# cp qtopiacore/qconfig-qpe.h qtopiacore/qt/src/corelib/

global/qconfig-qpe.h

注释掉其他文件里的QT_NO_QWS_CURSOR的定义

# vi qtopiacore/qt/src/corelib/global/qfeatures.h

注释掉如下内容:

/*

#if !defined(QT_NO_QWS_CURSOR) && (defined(QT_NO_CURSOR))

#define QT_NO_QWS_CURSOR

#endif

*/

保存退出。

# vi qtopiacore/qt/src/corelib/global/qglobal.h

注释掉以下内容:

//# define QT_NO_QWS_CURSOR

Qtopia4移植过程配置源码包

进入/root/Qtopia4/target目录

#../source/configure -release -image /mnt/nfs/image -prefix
/mnt/nfs/image -xplatform linux-arm-g++ -arch arm -no-qvfb -displaysize
640x480 -no-modem -extra-qtopiacore-config "-release -xplatform
qws/linux-arm-g++ -embedded arm -qconfig qpe -depths 4,8,16,32
-qt-mouse-linuxtp " 2>../confgureERR.txt

主要配置选项解说如下:

-xplatform linux-arm-g++ -arch arm

目标平台为arm-linux,体系结构为arm。

-no-qvfb

目标平台已支持framebuffer,因而不使用虚拟帧缓冲。

-extra-qtopiacore-config

为Qtopia core 配置选项。

-xplatform qws/linux-arm-g++ -embedded arm

目标平台编译配置文件使用qtopiacore/qt/mkspecs/qws/linux-arm-g++目录下的配置文件,嵌入式平台为arm。

-qconfig qpe

使用配置文件qconfig-qpe.h,若使用qconfig-large.h配置文件,则使用-qconfig large选项。

-qt-mouse-linuxtp

触摸屏协议支持linuxtp

2>../confgureERR.txt

最后将配置过程中的错误输出到confgureERR.txt文件中。

# make 2>../makeERR.txt

# make install

在编译安装完成后,在/mnt/nfs/image 中就是Qtopia在arm上运行所需要的文件

建立时区信息

# cd $QTOPIATARG

# mkdir zoneinfo

# cp -a /usr/share/zoneinfo/* /mnt/nfs/image/zoneinfo/

到这一步主机上的工作已经基本完成。

NFS连接主机,进入目标板系统,mount -t nfs 主机地址:/mnt/nfs /mnt/nfs -o nolock

输入目标板环境设置

export PATH=/mnt/nfs/image/bin:$PATH

export LD_LIBRARY_PATH=/mnt/nfs/image/lib:$LD_LIBRARY_PATH

export QWS_MOUSE_PROTO=LinuxTP:/dev/touchscreen/0 待选: /dev/input/mice

export QWS_DISPLAY="LinuxFb:mmWidth35:mmHeight45:0" 此句显示字体和图标。

后执行qpe -qws&

就可以看到目标板屏幕上启动的Qtopia 说明您已经成功了。

注:

a 由于在pc机上安装的时候qtopia的image的存放路径是file:/mnt/nfs/image.

所以在板子上的存放路径也必须跟其一致。否则会出错。如下:

**********************************************************

* ERROR: Expecting this binary to be located in

* /opt/arm-qt/qt-arm-bin/bin/qpe

* but it is being run from

* /Qtopia/bin/qpe

*

* This generally indicates that you have specified the wrong

* value for -prefix when configuring Qtopia. Based on the

* location of this binary, you should be using a prefix of

* /Qtopia

**********************************************************

b 另外会提示如下错误:

Could not read calibration: "/etc/pointercal"

查看的在/etc目录下没有pointercal文件,而自己的qpe怎么也起不来五点校正图片,可以用tslib来校正一下,这边就不说明了。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: