下载qt-extended-opensource-src-4.4.3.tar.gz并解压到/home/work/desktop下
并在该目录下创建目录build
#cd /home/work/desktop
#tar -zxvf qt-extended-opensource-src-4.4.3.tar.gz
#mkdir build
#cd build
设置环境变量:
#export QPEDIR=/home/work/desktop/bulid
#export QTOPIA_DEPOT_PATH=/home/work/desktop/qt-extended-4.4.3
修改源码包:
裁减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
保存退出。
修改时区信息
# vi src/libraries/qtopia/qtimezone.cpp
将其中的/usr/share/zoneinfo 改为/home/work/desktop/zoneinfo,保存退出。
*********************************************本机编译qt-extended*********************************
#cd desktop
解压qt-extended-opensource-src-4.4.3.tar.gz源码
#mkdir build
#../configure -qbuild-qt -image /home/work/desktop/target -prefix /home/work/desktop/target
#bin/build
#bin/build image //安装到了target目录下
编译安装完运行
#bin/runqtopia
*************************************************************************************************
*****************************************经典编译****************************************
#$QTOPIA_DEPOT_PATH/configure -release -image /home/work/desktop/target -prefix /home/work/desktop/target -xplatform linux-arm-g++ -arch arm -displaysizes 640x480 -build-qt -extra-qt-embedded-config "-xplatform qws/linux-arm-g++ -embedded arm -qconfig qpe -shared -little-endian -webkit -qt-kbd-usb -qt-libpng -qt-libjpeg -qt-gif -depths 4,8,16,32 -qt-mouse-tslib -I/home/work/mytslib/include -L/home/work/mytslib/lib" 2>../qtopiaconfigureERR.txt
-remove-module modem -remove-module bluetooth -remove-module drm -remove-module infrared
添加上这几个参数试试
-verbose 添加出错信息 对定位错误有点用
#bin/qbuild 2>../makeQt-extendedERR.txt
#bin/qbuild image
配置选项:
-xplatform linux-arm-g++ -arch arm //目标平台为arm-linux,体系结构为arm。
-extra-qt-embedded-config //为qt-extended 配置选项。(-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-tslib
-I/home/work/mytslib/include -L/home/work/mytslib/lib
支持tslib,并在后面添加上刚才编译的tslib的头文件和库。
2>../qtopiaconfigureERR.txt//最后将配置过程中的错误输出到qtopiaconfigureERR.txt中
*****************************************************************************************
******************************device编译*************************************************
#cd desktop
解压qt-extended-opensource-src-4.4.3.tar.gz源码
#mkdir build
************* 配置修改qt-extended-4.4.3/devices的目录;
按照n810的配置创建自己所需要的环境目录,主要修改的地方、文件:
1、修改mkspecs/qws/linux-nokia-g++/qmake.conf文件
a、用自己的交叉编译工具替换arm-linux-*
b、将自己编译的tslib的目录指定到QMAKE_LIVBS和QMAKE_INCLUDES参数中
2、修改configure.common
configure.common 文件 Read for both desktop and device builds (before the other file).
按照自己的需要来裁剪参数模块
3、修改configure:
configure配置的是qtopia-core的参数(Read for device builds.)
a、-xplatform linux-nokia-g++
b、在该文档的最后添加自己所需要的参数,如-extra-qt-embedded-config "-webkit -qt-kbd-usb -qt-libpng -qt-libjpeg -qt-gif"
4、修改configure-qvfb
configure-qvfb文件 read for desktop build
按照自己的需要裁剪
5、修改environment
This script (if it exists) is sourced before re-running configure and before Makefile calls Makefile.target
* a、修改主要的参数;TOOLCHAIN=* 指定自己的交叉编译工具
b、PKG_CONFIG_PREFIX和PKG_CONFIG_PATH做适当的调整
*********************
#cd build
#../configure -device n810 2>../configureERR.txt
#bin/qbuild
#bin/qbuild image
*************************************************************************************************