嵌入式Linux自學階段性總結(3)

d. 現在就可以配置./configure參數,生成我們平臺需要的Makefile.一點需要說明,必須在源代碼目錄運行解壓路徑下的configure.如下所示,我的解壓路徑是和目標路徑並列,所以才../qtopia-opensource-4.3.2/configure,不然死活都過不了。我分本編譯兩個版本的qtopia,一個是用於主機上qvfb(也就是x11上模擬framebuffer的一個程序)運行,用於開發調式的版本。另一個版本纔是真正要下載到開發板上實際運行的版本。前者不要交叉編譯,後者需要。我的shell如下(其中包括了1>步驟,同時也沒有修改時區路徑):

 

export PATH=$PATH:/usr/local/arm/3.4.1/bin

#mkdir /opt/qtopia

cd /opt

cp -r /mnt/qtopia_tslib_root/tslib1.4-install/ .

cd /opt/qtopia

#tar zxf /home/leo/download/qtopia-opensource-src-4.3.2.tar.gz

 

# Edit qtopia source for both host and target

cd qtopia-opensource-4.3.2/src/libraries/qtopiabase

cp custom-linux-generic-g++.h custom-linux-arm-g++.h

cp custom-linux-generic-g++.cpp custom-linux-arm-g++.cpp

 

cd /opt/qtopia

mkdir build_native-4.3.2

mkdir build_device-4.3.2

 

# build qtopia for host, set sdk=/opt/qtopia/sdk/4.3.2/x86, prefix=image=/opt/qtopia/sdk/4.3.2/x86/image

cd build_native-4.3.2

 

echo "yes" |../qtopia-opensource-4.3.2/configure -silent -release -image /opt/qtopia/sdk/4.3.2/x86/image -prefix /opt/qtopia/sdk/4.3.2/x86/image -sdk /opt/qtopia/sdk/4.3.2/x86 -qvfb -displaysize 800x480 -edition phone -no-modem -no-sxe -verbose -clean -extra-qt-config "-qt-zlib -qt-gif -qt-libpng -qt-libmng -qt-libjpeg" -extra-qtopiacore-config "-release -no-opengl -qconfig qpe -qt-sql-sqlite -depths 4,8,16,32 -qt-kbd-usb -no-kbd-tty -no-mouse-linuxtp -qt-mouse-qvfb"

make

make install

 

cd ..

 

# build qtopia for device(QQ2440), set sdk=/opt/qtopia/sdk/4.3.2/qq2440, prefix=image=/opt/qtopia/target, tslibdir=/opt/tslib1.4-install/

cd build_device-4.3.2

echo "yes" |../qtopia-opensource-4.3.2/configure -silent -release -image /opt/qtopia/target -prefix /opt/qtopia/target -sdk /opt/qtopia/sdk/4.3.2/qq2440 -xplatform linux-arm-g++ -arch arm -qvfb -displaysize 800x480 -edition phone -no-modem -no-sxe -verbose -clean -extra-qt-config "-qt-zlib -qt-gif -qt-libpng -qt-libmng -qt-libjpeg" -extra-qtopiacore-config "-release -xplatform qws/linux-arm-g++ -embedded arm -no-opengl -qconfig qpe -qt-sql-sqlite -depths 4,8,16,32 -qt-kbd-usb -no-kbd-tty -no-mouse-linuxtp -qt-mouse-tslib -I /opt/tslib1.4-install/include -L /opt/tslib1.4-install/lib"

make

make install

 

交叉編譯的目標版本配置說明:

主要配置選項解說如下:

-xplatform linux-arm-g++ -arch arm

目標平臺爲arm-linux,體系結構爲arm

-qvfb

qtopia支持qvfb,如果目標平臺已支持framebuffer,-no-qvfb.

-extra-qt-config

qt配置選項。

-extra-qtopiacore-config

Qtopia core 配置選項。

-xplatform qws/linux-arm-g++ -embedded arm

目標平臺編譯配置文件使用qtopiacore/qt/mkspecs/qws/linux-arm-g++目錄下的配置文件,嵌入式平臺爲arm

-qconfig qpe

使用配置文件qconfig-qpe.h,若使用qconfig-large.h配置文件,則使用-qconfig large選項。

-no-opengl 不實用openGL es圖形庫,否則還要下載安裝openGL es標準的實現庫纔可以編譯過去。

-qt-sql-sqlite

數據庫支持Sqlite

-qt-kbd-usb

鍵盤支持usb協議。

-no-mouse-linuxtp -qt-mouse-tslib

-I/opt/tslib1.4-install/include -L/opt/tslib1.4-install/lib

觸摸屏協議不支持linuxtp,支持tslib,並在後面添加上剛纔編譯的tslib的頭文件和庫。

參數:2>../qtopiaconfgureERR.txt

 

最後將配置過程中的錯誤輸出到qtopiaconfgureERR.txt文件中。

必要的時候也可以加上:-silence 不在中端上顯示進度信息,加快編譯速度。

 

最後,把主機的/usr/share/zoneinfo/內容考到剛纔設置的目標系統時區信息目錄裏。修改配置文件tslib1.4-install/etc/ts.conf,將module_raw h3600前的#去掉。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章