成功移植qtopia4.4.3手机版到mini2440上
首先说明:qtopia4是不能在源码目录中编译安装的,可以用configure—help查看。X86版和ARM版能不能使用同一个源码包(不用解压源码包qt-extended-opensource-src-4.4.3.tar.gz分别更名命*-src-x86和*-src-arm,只使用一个*-src即可?)这个没试过,应该是可以的,你们可以试试。我使用的分别解压到不同目录分别更名命*-src和*-src-arm
(1)准备源码:
qt-extended-opensource-src-4.4.3.tar.gz
tslib-1.4.1.tar.bz2
(2)开发环境:
Fedora9—linux-2.6.25
arm-linux-gcc-4.3.2.tgz
(3) 先安装x86的qtopia手机版运行看看效果先:
1.)解压源码qt-extended-opensource-src-4.4.3.tar.gz到qtopia4目录中
2)创建目录build 和target
[root@abilly qtopia4]# ls
build target
qt-extended-4.4.3-src
3)设置环境变量
[root@abilly qtopia4]# export QPEDIR=/home/abilly/qtopia4/build
[root@abilly qtopia4]#
export QTOPIA_DEPOT_PATH =/home/abilly/qtopia4/qt-extended-4.4.3-src
[root@abilly qtopia4]# echo $QPEDIR
/home/abilly/qtopia4/build
[root@abilly qtopia4]# echo $QTOPIA_DEPOT_PATH
/home/abilly/qtopia4/qt-extended-4.4.3-src
4)配置与编译,安装与运行
配置前可以到qt-extended-4.4.3下运行/configure –help看看选项说明
[root@abilly qt-extended-4.4.3]# ./configure --help
。。。。。。。
然后配置如下:进入build目录
[root@abilly build]# ../qt-extended-4.4.3-src/configure -build-qt -image /home/abilly/qtopia4/target -prefix /home/abilly/qtopia4/target
……(约2个半小时后)
Qt Extended has been configured. You can build Qt Extended by running
bin/qbuild.
If you run bin/qbuild image, this will setup a runnable image in
/home/abilly/qtopia4/target.
As configured, Qt Extended MUST be run from /home/abilly/qtopia4/target. If
this is not where you intend to run Qt Extended from you should set the
location by running configure -prefix /opt/Qtopia.
You have new mail in /var/spool/mail/root
配置成功
编译:
[root@abilly build]# bin/qbuild
……(约5个小时后)
Qt Extended has been built.
You must now install Qt Extended by running 'bin/qbuild image'.
This will put the files required to run Qt Extended into the image:
/home/abilly/qtopia4/target
Before you can use the SDK you must finalize it by running 'bin/qbuild sdk'.
This will put the required files into the SDK:
/home/abilly/qtopia4/build/sdk
安装:
[root@abilly build]# bin/qbuild image
。。。。。(约30分钟后)
Qt Extended has been installed.
The files required to run Qt Extended are in the image:
/home/abilly/qtopia4/target
Please note that Qt Extended cannot be moved. It must be run from the image.
编译开发包,怎么使用这个开发自己的应用程序有待研究。。。
[root@abilly build]# bin/qbuild sdk
(10多分钟即可)
Finalizing the SDK
/home/abilly/qtopia4/qt-extended-4.4.3-src/src/build/bin/sdkcache /home/abilly/qtopia4/build/sdk
WARNING: Your perl has a bug with output and UTF-8
WARNING: sdkcache will attempt to work around the bug by changing your
LANG variable from zh_CN.UTF-8 to zh_CN.
The SDK has been finalized.
It can now be deployed to another computer.
Note that you should run configure before building again.
运行:
[root@abilly build]# bin/runqtopia
在运行:结果如图:
(4)编译安装qtopia4到mini2440
1.)解压源码qt-extended-opensource-src-4.4.3.tar.gz到qtopia4_arm目录中
2)创建目录build_arm 和target-arm
[root@abilly qtopia4_arm]# ls
Build_arm target-arm
qt-extended-4.4.3-src-arm
3)设置环境变量
[root@abilly qtopia4_arm]# export QPEDIR=/home/abilly/qtopia4_arm/build_arm
[root@abilly qtopia4_arm]#
export QTOPIA_DEPOT_PATH =/home/abilly/qtopia4_arm/qt-extended-4.4.3-src-arm
[root@abilly qtopia4_arm]# echo $QPEDIR
/home/abilly/qtopia4_arm/build_arm
[root@abilly qtopia4_arm]# echo $QTOPIA_DEPOT_PATH
/home/abilly/qtopia4_arm/qt-extended-4.4.3-src-arm
4)编译安装tslib
5)配置与编译,安装
配置:
进入build_arm目录:
[root@abilly build-arm]#../qt-extended-4.4.3-src-arm/configure -verbose -release -image /home/abilly/qtopia4_arm/target-arm -prefix /home/abilly/qtopia4_arm/target-arm -no-pkg-config -no-dbus -xplatform linux-arm-g++ -arch arm -displaysizes 240x320 -build-qt -qtopia-sqlite -v4l2 -remove-module modem -remove-module bluetooth -remove-module drm -remove-module infrared -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/abilly/mytslib/include -L/home/abilly/mytslib/lib"
。。。。。。。(2个半小时后)
Qt Extended has been configured. You can build Qt Extended by running
bin/qbuild.
If you run bin/qbuild image, this will setup a runnable image in
/home/abilly/qtopia4_arm/target-arm.
As configured, Qt Extended MUST be run from
/home/abilly/qtopia4_arm/target-arm. If this is not where you intend to run Qt
Extended from you should set the location by running configure -prefix
/opt/Qtopia.
编译:
[root@abilly build-arm]# bin/qbuild
(5个小时后:)
。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。
Qt Extended has been built.
You must now install Qt Extended by running 'bin/qbuild image'.
This will put the files required to run Qt Extended into the image:
/home/abilly/qtopia4_arm/target-arm
Before you can use the SDK you must finalize it by running 'bin/qbuild sdk'.
This will put the required files into the SDK:
/home/abilly/qtopia4_arm/build-arm/sdk
安装:
[root@abilly build-arm]# bin/qbuild image
Removing /home/abilly/qtopia4_arm/target-arm
(半个小时后)
。。。。。。。。。。。。。。。。。。。。。。
Qt Extended has been installed.
The files required to run Qt Extended are in the image:
/home/abilly/qtopia4_arm/target-arm
Please note that Qt Extended cannot be moved. It must be run from the image.
[root@abilly build-arm]#
[root@abilly build-arm]# bin/qbuild sdk
Finalizing the SDK
/home/abilly/qtopia4_arm/qt-extended-4.4.3-src-arm/src/build/bin/sdkcache /home/abilly/qtopia4_arm/build-arm/sdk
WARNING: Your perl has a bug with output and UTF-8
WARNING: sdkcache will attempt to work around the bug by changing your
LANG variable from zh_CN.UTF-8 to zh_CN.
The SDK has been finalized.
It can now be deployed to another computer.
Note that you should run configure before building again.
6)移植到mini2440下,NFS挂载
在root_qtopia文件系统的home目录下录建立:
/home/abilly/qtopia4_arm
(这是因为在配置的时候使用了-prefix /home/abilly/qtopia4_arm/target-arm目录必须一致)
拷贝主机的/home/abilly/qtopia4_arm/target-arm到
开发板的root_qtopia下的/home/abilly/qtopia4_arm
设置qtopia4运行的环境变量,脚本/bin/qtopia4内容如下:
#!/bin/sh
export TSLIB_TSDEVICE=/dev/input/event0
export TSLIB_CONFFILE=/usr/local/etc/ts.conf
export TSLIB_PLUGINDIR=/usr/local/lib/ts
export TSLIB_CALIBFILE=/etc/pointercal
export QPEDIR=/home/abilly/qtopia4_arm/target-arm
export PATH=$QPEDIR/bin:$PATH
export LD_LIBRARY_PATH=$QPEDIR/lib:/usr/local/lib:$LD_LIBRARY_PATH
export QWS_SIZE=240x320
export HOME=/home/abilly/qtopia4_arm
export QWS_DISPLAY="LinuxFB:/dev/fb0"
export QWS_DISPLAY="LinuxFB:mmWidth130:mmHeight100:0"
export QWS_KEYBOARD=TTY:/dev/tty1
export QWS_MOUSE_PROTO="TSLIB:/dev/input/event0"
export QT_PLUGIN_PATH=$QPEDIR/plugins/
export QT_QWS_FONTDIR=$QPEDIR/lib/fonts/
修改rcS运行qtopia4的qpe
#/bin/qtopia &
#echo " " > /dev/tty1
#echo "Starting Qtopia, please waiting..." > /dev/tty1
source /bin/qtopia4
if [ -f /etc/pointercal ]; then
$QPEDIR/bin/qpe -qws &
else
/usr/loca/bin/ts_calibrate
$QPEDIR/bin/qpe -qws &
Fi
Nfs 文件系统的挂载略。
启动开发板,结果如图:
对于字体大小,图标大小,应用程序的编译与添加有待研究。
[ 此帖被abilly在2010-06-24 22:43重新编辑 ]