嵌入式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前的#去掉。

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