qtopia 4.2.3 移植 交叉编译记录&总结

文章来源:http://blog.chinaunix.net/u/28781/article_65529.html

一.硬件平台
1.主机: PC机,1G Memory 3G Cpu。
2.目标机: jk2410 arm9。

二.软件平台
1.Ubuntu 7.04 (主机操作系统,VMware)
2.gcc3.3.6(主机编译器)
3.eldk4.1(交叉编译器)
4.qtopia-opensource-4.2.3.tar.gz(包含Qt,Qtopia core)

三.移植过程
1.拷贝编译目标需要的文件"configure : -xplatform linux-arm-g++"
export QTOPIA_DEPOT_PATH=/home/leibian/qtopia_arm/qtopia-opensource-4.2.3/
cd src/libraries/qtopiabase/
cp custom-linux-cassiopeia-g++.h custom-linux-arm-g++.h
cp custom-linux-cassiopeia-g++.cpp custom-linux-arm-g++.cpp

2.修改
cd $QTOPIA_DEPOT_PATH
a)支持触摸屏
vi qtopiacore/qconfig-qpe.h
#define QT_QWS_IPAQ
#define QT_QWS_IPAQ_RAW
b) 修改时区信息, 否则qtipia运行时候会到“/usr/share/zoneinfo/”读取
vi src/libraries/qtopia/qtimezone.cpp
将114行的 /usr/share/zoneinfo/ 改为/qtopia-mount-folder-on-board/etc/zoneinfo ,保存退出。
vi src/settings/systemtime/settime.cpp
将318行的 /usr/share/zoneinfo/ 改为/qtopia-mount-folder-on-board/etc/zoneinfo ,保存退出。

3.configure
mkdir /home/leibian/qtopia_arm/build_4.2
export QPEDIR=/home/leibian/qtopia_arm/build_4.2
cd $QPEDIR
echo "yes" | ../qtopia-opensource-4.2.3/configure -edition phone -xplatform linux-arm-g++ -arch arm -no-qvfb -release -displaysize 240x320 -no-modem -quicklaunch -defaultbuttons phone -image /home/leibian/qtopia_arm/nfs/ -prefix /home/leibian/qtopia_arm/nfs/ -no-bluetooth -no-drm -no-drm -no-infrared   -extra-qt-config "-qt-zlib -qt-gif -qt-libpng -qt-libmng -qt-libjpeg" -extra-qtopiacore-config '-depths 16 -qt-mouse-linuxtp -no-mouse-pc -no-mouse-bus -no-mouse-yopy -no-mouse-vr41xx  -no-mouse-tslib -no-mouse-qvfb' > log_cfg 2>&1

4.make
make > log 2>&1

5.install
make install IMAGE=/home/leibian/qtopia_arm/nfs/
拷贝zoneinfo
mkdir /home/leibian/qtopia_arm/nfs/etc
cp -avf $QTOPIA_DEPOT_PATH/etc/zoneinfo /home/leibian/qtopia_arm/nfs/etc

6.run(using nfs)
export PATH=/qtopia-mount-folder-on-board/bin:$PATH
export LD_LIBRARY_PATH=/qtopia-mount-folder-on-board/lib:$LD_LIBRARY_PATH
export QWS_MOUSE_PROTO=LinuxTP:/dev/touchscreen/0
export QWS_DISPLAY="LinuxFb:mmWidth35:mmHeight45:0"

qpe&
等待出现画面之后,校正触摸屏
qcop service send Launcher "execute(QString)" "calibrate"

四.常见问题
a)V4L2_PIX_FMT_SBGGR8:
vi arm-linux/include/linux/videodev2.h
在 #define V4L2_PIX_FMT_HI240   v4l2_fourcc('H','I','2','4') /*  8  8-bit color   */ 之后添加
/* see http://www.siliconimaging.com/RGB%20Bayer.htm */
#define V4L2_PIX_FMT_SBGGR8  v4l2_fourcc('B','A','8','1') /*  8  BGBG.. GRGR.. */
vi arm-linux/sys_include/linux/videodev2.h
edit it same as arm-linux/include/linux/videodev2.h

b)PAGE_SIZE and PAGE_MASK
vi arm-linux/sys-include/asm/page.h
把语句
#ifdef __KERNEL__
移动到定义
15 /* PAGE_SHIFT determines the page size */
16 #define PAGE_SHIFT      12
17 #define PAGE_SIZE       (1UL << PAGE_SHIFT)
18 #define PAGE_MASK       (~(PAGE_SIZE-1))
后面
vi arm-linux/include/asm/page.h
edit it same as above

c)触摸屏不工作
检查
export QWS_MOUSE_PROTO=LinuxTP:/dev/touchscreen/0

d)显示字体和图标小
检查
export QWS_DISPLAY="LinuxFb:mmWidth35:mmHeight45:0"

e)nfs mout failed
mount -t nfs xx xx -o nolock

f)nfs timeout
mout -t nfs xx xx -o nolock,rsize=1024,wsize=1024,timeo=15 

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

setenv bootargs console=ttySAC0,115200 root=/dev/nfs nfsroot=192.168.18.10:/nfsroot ip=192.168.18.110:::255.255.255.0::eth0

你可能感兴趣的:(qtopia 4.2.3 移植 交叉编译记录&总结)