歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
您现在的位置: Linux教程網 >> UnixLinux >  >> Linux編程 >> Linux編程

Mini2440移植qt-extended4.4.3

因為項目需求,前段時間在Mini2440上移植了qt-extended4.4.3,現將移植過程簡單的說下,希望對做相關的工作的朋友有幫助。

一、開發環境

  上位機:Fedora9.0

   交叉編譯器版本:arm-linux-gcc4.4.3(友善之臂提供,在此說明下:arm-linux-gcc4.4.3或arm-linux-gcc4.4.2是支持arm9的,建議在arm9上移植不要使用友善之臂提供的arm-linux-gcc4.5(支持的是arm11的));

   網絡文件系統目錄:/opt/root_nfs/root_qtopia(大家根據自己的情況而定)

  開發板LCD版本:w35

  開發板bootloader:u-boot(嵌入式家園提供)

  開發板內核:uImage(嵌入式家園提供)

  根文件系統:root_qtopia(嵌入式家園提供)

 聲明:bootloader、內核和根文件系統大家也可以直接使用友善之臂提供的。


二、交叉編譯tslib1.4

  編譯和運行qt-extended-4.4.3(Qtopia4),需要tslib庫,該庫是觸摸屏校准時需要的庫文件,如對觸摸屏的數據進行過濾、去抖動等,QT的庫會調用tslib的庫文件。

 在此提示大家,安裝Fedora時,最好是完全安裝,不要缺省安裝,因為編譯tslib等時需要第三方庫的支持。

1、解壓tslib1.4.tar.gz

2、進入tslib目錄:

[root@localhost /]# cd tslib/

3、設置環境變量、制定交叉編譯器

#export PATH=/opt/toolchain/4.4.3/bin:$PATH
#export TOOLCHAIN=/opt/toolchain/4.4.3
#export TB_CC_PREFIX=arm-linux-
#export PKG_CONFIG_PREFIX=$TOOLCHAIN/arm-linux

4、運行tslib目錄下的腳本

#./autogen.sh

#echo "ac_cv_func_malloc_0_nonnull=yes">arm-linux.cache

5、配置

#./configure--host=arm-linux
--cache-file=arm-linux.cache
--enable-inputapi=no
PLUGIN_DIR=/usr/local/arm/tslib/plugins
-prefix=/usr/local/arm/tslib/build
-host=arm-linux
--cache-file=arm-linux.cache2>&1 | tee conf_log

這一行:-prefix=/usr/local/arm/tslib/build表示tslib安裝的目錄

最後一行將配置信息寫入conf_log文件,方便大家檢查錯誤

6、編譯

#make2>&1|teemake_log
#makeinstall

7、成功後在/usr/local/arm/tslib出現build目錄,進入相關的etc目錄找到ts.conf濱修改,刪除module_rawinput’前面的#號和空格,

並將build目錄改為tslib(命令:[root@localhost tslib]# mv build tslib),所以現在tslib在pc機下目錄為:/usr/local/arm/tslib/tslib,然後把tslib目錄拷貝至網絡文件系統中:/opt/root_nfs/root_qtopia/usr/local中


三、交叉編譯qt-extended4.4.3

1、新建目錄arm

[root@localhost /]# mkdir arm

2、拷貝qt-extended-opensource-src-4.4.3.tar.gz至arm目錄

3、進入arm目錄

[root@localhost /]# cd arm

為了實現一鍵編譯,在此我編寫一個腳本:build,內容如下:

#!/bin/bash

rm qt-extended-4.4.3 -fr
tar xvzf qt-extended-opensource-src-4.4.3.tar.gz

rm -fr builddir
mkdir builddir

#linux-arm-g++  
export PATH=/opt/toolchain/4.4.3/bin:$PATH
export TOOLCHAIN=/opt/toolchain/4.4.3
export TB_CC_PREFIX=arm-linux-
#export PKG_CONFIG_PREFIX=$TOOLCHAIN/arm-linux
export PKG_CONFIG_PREFIX=$TOOLCHAIN/arm-none-linux-gnueabi


QTOPIA_PREFIX_DIR=/opt/Qtopia4.4.3
export QTOPIA_DEPOT_PATH=$PWD/qt-extended-4.4.3
export QPEDIR=$PWD/builddir
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-zlib
-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-multis
creen -qt-kbd-tty -no-kbd-usb -no-kbd-sl5000 -no-kbd-yopy -no-kbd-vr41xx -no-kbd-qvfb -qt-mouse-tslib -I/usr/local/arm/tslib/tslib/i
nclude  -L/usr/local/arm/tslib/tslib/lib -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 ../qtopia4.4.3makelog                                                                       
bin/qbuild image                                                    

Copyright © Linux教程網 All Rights Reserved