1. 安裝交叉編譯器,。利用友善之臂自帶的交叉編譯器。
將arm-linux-gcc-4.3.2.tgz 放在 /root下,,執(zhí)行如下操作
#cd /root
#tar xvzf arm-linux-gcc-4.3.2.tgz –C /
#gedit
/root/.bashrc
在bashrc最后一行添加 export PATH=$PATH:/usr/local/arm/4.3.2/bin
#source /root/.bashrc
#arm-linux-gcc -v
查看交叉編譯器版本為4.3.2
2. 編輯tslib對觸摸屏的支持
將tslib1.4.tar.gz 放在/root 下,,解壓并編譯:
# cd /root
# tar zxvf tslib1.4.tar.gz
# cd tslib
# ./autogen.sh
#
./configure --prefix=/usr/local/tslib/ --host=arm-linux
ac_cv_func_malloc_0_nonnull=yes
# make
# make install
3.
配置QtE4.7.0
將qt-everywhere-opensource-src-4.7.0.tar.gz壓縮包放在/opt下,解壓:
#cd /opt
#tar zxvf qt-everywhere-opensource-src-4.7.0.tar.gz
#mv qt-everywhere-opensource-src-4.7.0 qt-4.7.0-arm
#cd qt-4.7.0-arm
3.1制作一個配置腳本
#gedit autoconfig.sh
編輯文件如下:
#!/bin/bash
./configure \
-prefix
/usr/local/Trolltech/QtEmbedded-4.7.0-arm \
-opensource \
-confirm-license \
-release -shared \
-embedded arm \
-xplatform
qws/linux-arm-g++ \
-depths 16,18,24 \
-fast \
-optimized-qmake \
-pch \
-qt-sql-sqlite \
-qt-libjpeg \
-qt-zlib \
-qt-libpng
\
-qt-freetype \
-little-endian -host-little-endian \
-no-qt3support
\
-no-libtiff -no-libmng \
-no-opengl \
-no-mmx -no-sse -no-sse2 \
-no-3dnow \
-no-openssl \
-no-webkit \
-no-qvfb \
-no-phonon
\
-no-nis \
-no-opengl \
-no-cups \
-no-glib \
-no-xcursor
-no-xfixes -no-xrandr -no-xrender \
-no-separate-debug-info \
-nomake
examples -nomake tools -nomake docs \
-qt-mouse-tslib
-I/usr/local/tslib/include \
-L/usr/local/tslib/lib
exit
3.2生成Makefile文件并編譯安裝
#chmod 755 autoconfig.sh
#./autoconfig.sh
#gmake
#gmake
install
3.3 移植到mini2440
安裝完成后
將/usr/local/Trolltech/QtEmbedded-4.7.0-arm/lib/fonts中的字體全部刪除 將
wenquanyi_120_50.qpf字體復(fù)制到fonts下:
#rm –rf /usr/local/Trolltech/QtEmbedded-4.7.0-arm/lib/fonts/*
#cp wenquanyi_120_50.qpf
/usr/local/Trolltech/QtEmbedded-4.7.0-arm/lib/fonts/
3.4 制作開發(fā)板文件系統(tǒng)
將root_qtopia-20100108.tar.gz 和
mkyaffs2image.tgz放在/root下,。刪除qtopia圖形界面系統(tǒng),,刪除root文件夾下占存儲較大的文件,。復(fù)制/usr/local/Trolltech/QtEmbedded-4.7.0-arm/lib
文件夾到 /root/root_qtopia/ usr/local/Trolltech/QtEmbedded-4.7.0-arm,, 復(fù)制
/usr/local/tslib下所有內(nèi)容到 /root/root_qtopia/usr/local/,修改觸摸屏配置文件 ts.conf,
修改環(huán)境變量,,修改自啟動文件 /root/root_qtopia/etc/init.d/rcS,。最后將mkyaffs2image 工具生成文件系統(tǒng)鏡像。
#cd /root
#tar zxvf root_qtopia-20100108.tar.gz
#tar zxvf
mkyaffs2image.tgz
#cd root_qtopia
#rm –rf opt/Qtopia
#rm –rf
root/Documents/*
#mkdir -p usr/local/Trolltech/QtEmbedded-4.7.0-arm
#cp –r
/usr/local/Trolltech/QtEmbedded-4.7.0-arm/lib
usr/local/Trolltech/QtEmbedded-4.7.0-arm
#cp –r /usr/local/tslib/*
usr/local/
#gedit usr/local/etc/ts.conf
#gedit etc/profile
#gedit
etc/init.d/rcS
#cd /root
#mkyaffs2image root_qtopia
root_qt-4.7.0.img
usr/local/etc/ts.conf: 取消注釋 module_raw input
etc/profile:在最后添加
export QTDIR=/usr/local/Trolltech/QtEmbedded-4.7.0-arm
export
T_ROOT=/usr/local
export PATH=$QTDIR/bin:$PATH
export
TSLIB_CONSOLEDEVICE=none
export TSLIB_FBDEVICE=/dev/fb0
export
TSLIB_TSDEVICE=/dev/input/event0
export TSLIB_PLUGINDIR=$T_ROOT/lib/ts
export TSLIB_CONFFILE=$T_ROOT/etc/ts.conf
export
TSLIB_CALIBFILE=/etc/pointercal
export
QWS_MOUSE_PROTO=Tslib:/dev/input/event0
export
LD_LIBRARY_PATH=$T_ROOT/lib:$QTDIR/lib
etc/init.d/rcS:
刪除:
/bin/qtopia &
echo " " > /dev/tty1
echo "Starting Qtopia, please waiting..." > /dev/tty1
添加:
source /etc/profile
echo " " > /dev/tty1
echo "Starting touch calibrate " > /dev/tty1
echo " " > /dev/tty1
sleep 1
/usr/local/bin/ts_calibrate &
3.5 下載內(nèi)核,,文件系統(tǒng)到mini2440
linux-2.6.32.img
root_qt-4.7.0.img
至此Qt4.7.0移植完成..