环境:VMware+Fedora14
嵌入式平台:S3C6410
交叉编译工具链:arm-linux-gcc 4.5.1
源码包:arm-qt-extended-4.4.3-20101105.tgz tslib-1.4.tar.gz
一、 搭建TI的编译环境主要是arm-linux-gcc和gcc的安装
二、交叉编译安装 tslib-1.4将下载的tslib-1.4.tar.gz放到pc目录/usr/local/myfile/arm下
#tar zxvf tslib-1.4.tar.gz
#cd tslib
#./autogen.sh
#./configure --prefix=/usr/local/tslib --host=arm-linux ac_cv_func_malloc_0_nonnull=yes
其中ac_cv_func_malloc_0_nonnull=yes 是为解决如下编译错误设置的
ts_test.o: In function `main': ts_test.c:(.text+0x1d8): undefined reference to `rpl_malloc' fbutils.o: In function `open_framebuffer': fbutils.c:(.text+0xa20): undefined reference to `rpl_malloc' collect2: ld returned 1 exit status |
#make
#make install
将/usr/local/tslib整个目录复制到arm板系统文件/opt目录下
三、 编译及运行Qt-extended-4.4.3把arm-qt-extended-4.4.3-20101105.tgz安装包放到/usr/local/myfile/arm目录下
#tar zxvf arm-qt-extended-4.4.3-20101105.tgz
#cd arm-qt-extended-4.4.3
#tar xvzf qt-extended-opensource-src-4.4.3.tar.gz
#mkdir builddir
#QTOPIA_PREFIX_DIR=/opt/Qtopia4.4.3
#export QTOPIA_DEPOT_PATH=$PWD/qt-extended-4.4.3
#export QPEDIR=$PWD/builddir
#export PATH=/opt/FriendlyARM/mini6410/linux/arm-gcc-4.4.1/bin/:$PATH
#export LC_CTYPE="en_US"
#export LANG="en_US"
#export LANGUAGE="en_US"
#cd $QPEDIR
# echo yes | $QTOPIA_DEPOT_PATH/configure \
-ui-type mobile \
-xplatform linux-arm-g++ \
-arch arm \
-release \
-clean \
-prefix ${QTOPIA_PREFIX_DIR} \
-sound-system oss \
-build-qt \
-no-sxe \
-no-ssl \
-no-v4l2 \
-no-vpn \
-no-phonon \
-no-libamr \
-dynamic-rotation \
-mediaengines cruxus \
-remove-mediaengine gstreamer,helix \
-pictureflow \
-remove-module bluetooth,drm \
-no-dbus \
-no-dbusipc \
-add-displaysize 240x320 \
-extra-qt-embedded-config "-embedded arm -xplatform qws/linux-arm-g++ -no-cups -nomake examples -nomake demos -qt-libjpeg -qt-libmng -qt-libpng -no-dbus -depths 16,32 -qt-gfx-linuxfb -qt-gfx-transformed -no-gfx-qvfb -no-gfx-vnc -no-gfx-multiscreen -qt-kbd-tty -no-kbd-usb -no-kbd-sl5000 -no-kbd-yopy -no-kbd-vr41xx -no-kbd-qvfb -qt-mouse-tslib -no-webkit -no-openssl -no-phonon -no-phonon-backend -no-nas-sound -no-exceptions -svg" \
-extra-qt-config "-no-webkit" \
2>&1 | tee ../qtopiaconfig.log
#bin/qbuild 2>&1 | tee ../qtopiamake.log
#bin/qbuild image
出现Qt Extended has been installed.则编译安装成功。编译生成的文件在builddir/image目录下。其实我们完全可以写一个shell文件进行整体编译
2、将builddir/image下所有文件复制到你的嵌入式文件系统的/opt/Qtopia4.4.3/目录下。修改etc/profile文件:
if [ -e /etc/friendlyarm-ts-input.conf ] ; then
. /etc/friendlyarm-ts-input.conf
fi
true ${TSLIB_TSDEVICE:=/dev/touchscreen}
TSLIB_CONFFILE=/etc/ts.conf
export TSLIB_TSDEVICE
export TSLIB_CONFFILE
export TSLIB_PLUGINDIR=/opt/tslib/lib/ts
export TSLIB_CALIBFILE=/etc/pointercal
export QTDIR=/opt/Qtopia4.4.3
export QPEDIR=/opt/Qtopia4.4.3
export PATH=$QTDIR/bin:$PATH
export LD_LIBRARY_PATH=$QTDIR/lib:/usr/local/lib:$LD_LIBRARY_PATH
export CAMERA_DEVICE=/dev/video2
export QWS_KEYBOARD=TTY:/dev/tty1
export KDEDIR=/opt/kde
嵌入式arm上的环境搭建好后,可以运行一些例子进行测试
也可以在pc机的linux下运用交叉编译环境编译一个小程序,然后在移到arm开发板上,如果程序能够运行,所以交叉编译器和arm上Qt环境已经成功。
将pc机linux下到/root/.bash-profile文件下更改环境变量PATH
PATH=$PATH:$HOME/bin:/usr/local/myfile/arm/arm-qt-extended-4.4.3/builddir/qtopiacore/target/bin
#source /root/.bash-profile
qmake就可以作为全局量进行交叉编译,这样方便得多