2008年12月19日星期五

在fedora9 x86_64上编译arm qt2.2.0

系统:Fedora9 x86_64

1>下载cross-3.3.2.tar.bz2,并解压到/usr/local/arm/文件夹下,设置环境变量PATH
tar zjf cross-3.3.2.tar.bz2 -C /usr/local/arm/
export PATH=$PATH:/usr/local/arm/3.3.2/bin

2>建立目录armqt,设置环境变量
mkdir /home/armqt //arm qt根目录
export ARMQT=/home/armqt
mkdir $ARMQT/tools //arm库
mkdir $ARMQT/tools/lib //arm库lib
mkdir $ARMQT/tools/include //arm库include
mkdir $ARMQT/arm220 //编译arm qt
mkdir $ARMQT/qtopia //make install的路径,生成的qt及其库的文件系统文件夹

3>下载qtopia-free-src-2.2.0.tar.gz解压到$ARMQT/arm220,省掉下一级qtopia-free-2.2.0目录

4>下载arm需要的库,并解压到$ARMQT/tools下,并编译
A e2fsprogs-1.39.tar.gz

下载地址
http://nchc.dl.sourceforge.net/sourceforge/e2fsprogs/e2fsprogs-1.39.tar.gz

安装
./configure --host=arm-linux --enable-elf-shlibs --with-cc=arm-linux-gcc --with-linker=arm-linux-ld --prefix=/usr/local/arm/2.95.3/arm-linux
make
cp lib/libuuid.so* ../lib/

B jpegsrc.v6b.tar.gz

下载地址
http://down1.chinaunix.net/distfiles/jpegsrc.v6b.tar.gz

I 缺少libtool,下载
yum install libtool
cp /usr/share/libtool/config.guess /home/armqt/tools/jpeg-6b/ -rf
cp /usr/share/libtool/config.sub /home/armqt/tools/jpeg-6b/ -rf

II ./configure --enable-shared

III 修改Makfile,搜索到CC,AR,AR2宏替换为下面(如果是export CC=arm-linux-gcc,
在Makefile中虽然cc,ld等变了,但是ar,ranlib就没有改变)
CC=arm-linux-gcc
AR=arm-linux-ar rc
AR2=arm-linux-ranlib

IV make

V 拷贝库文件和头文件到统一目录
cp *.h ../include/
cp .libs/libjpeg.so* ../lib/

VI 可以用file看一下编译出来的是否是arm版本的及是否动态链接
[root@localhost jpeg-6b]# file wrjpgcom
wrjpgcom: ELF 32-bit LSB executable, ARM, version 1, dynamically linked (uses shared libs), for GNU/Linux 2.0.0, not stripped

C zlib-1.2.3.tar.bz2

下载地址
http://www.zlib.net/zlib-1.2.3.tar.gz

I ./configure -shared

II 修改Makfile,搜索到CC,LDSHARED,CPP,AR,RANLIB,prefix宏替换为下面
CC=arm-linux-gcc
CPP=arm-linux-gcc -E
LDSHARED=arm-linux-gcc -shared -Wl,-soname,libz.so.1
AR=arm-linux-ar rc
RANLIB=arm-linux-ranlib
prefix=/usr/local/arm/3.3.2/arm-linux

III make

IV 拷贝库文件和头文件到统一目录
cp libz.so* ../lib/
cp *.h ../include/

D libpng-1.2.14.tar.bz2

下载地址
http://superb-east.dl.sourceforge.net/sourceforge/libpng/libpng-1.2.14.tar.bz2

I cp scripts/makefile.linux Makefile

II 修改Makfile,搜索到CC,AR,AR2,prefix,ZLIBLIB,ZLIBINC宏替换为下面
CC=arm-linux-gcc
AR=arm-linux-ar rc
AR2=arm-linux-ranlib
prefix=/usr/local/arm/3.3.2/arm-linux
ZLIBLIB=../lib
ZLIBINC=../include

III make

IV 拷贝库文件和头文件到统一目录
cp libpng12.so* ../lib/
cp libpng12.so ../lib/libpng.so
cp *.h ../include/

E uic-qt2

下载地址
http://vanille.de/tools/uic-qt2

chmod 777 uic-qt2
cp uic-qt2 $ARMQT/arm220/qt2/bin/uic

5>编译qt前的准备
A修改文件$ARMQT/arm220/qtopia/mkspecs/qws/linux-arm-g++/qmake.conf
chmod 777 $ARMQT/arm220/qtopia/mkspecs/qws/linux-arm-g++/qmake.conf

QMAKE_LIBS_QT = -lqte
改为
QMAKE_LIBS_QT = -lqte -lpng -lz -luuid -ljpeg

B修改文件$ARMQT/arm220/qtopia/src/qt/qconfig-qpe.h
chmod 777 $ARMQT/arm220/qtopia/src/qt/qconfig-qpe.h
添加到文件最后
#define QT_QWS_IPAQ
#define QT_QWS_IPAQ_RAW

C修改文件$ARMQT/arm220/qt2/include/qvaluestack.h
chmod 777 $ARMQT/arm220/qt2/include/qvaluestack.h
remove( this->fromLast() );
改为
this->remove( this->fromLast() );

D修改文件$ARMQT/arm220/qtopia/src/libraries/qtopia/qdawg.cpp
chmod 777 $ARMQT/arm220/qtopia/src/libraries/qtopia/qdawg.cpp
QDawgPrivate::~QDawgPrivate()
改为
~QDawgPrivate()

E
cp $ARMQT/arm220/qtopia/src/qt/qconfig-qpe.h $ARMQT/arm220/qt2/src/tools
cd $ARMQT/arm220/qtopia/src/libraries/qtopia
cp custom-linux-ipaq-g++.cpp custom-linux-arm-g++.cpp
cp custom-linux-ipaq-g++.h custom-linux-arm-g++.h

F编译时出现了qvfb错误,没搜到网上别人怎么做的,反正arm也用不上,所以干脆删了
rm $ARMQT/arm220/dqt/tools/qvfb -rf

G下面都是在编译时少什么就加什么库,先用yum whatprovides确定库名字,然后用yum install更新,感觉很不安全一样,我怕影响有些什么功能不能使用了.gcc -m32也就是32位编译了,不知道为什么更新后它自动加上了-m32,是自适应还是手动?

/*****
本来安装了这3个包,但是按照前2天在32位机上使用gcc32的做法(替换gcc,g++,lib)会出错,所以只好放弃,谁能告诉我怎样在x86_64上用i386 gcc32?
compat-gcc-32-3.2.3-47.3.i386.rpm
compat-gcc-32-c%2B%2B-3.2.3-47.3.i386.rpm
compat-libstdc++-33-3.2.3-63.i386.rpm
******/

I gcc少头文件和libc
yum whatprovides */gnu/stubs-32.h
yum install glibc-devel.i386

yum whatprovides */4.3.0/libstdc++.a
yum install libstdc++-devel.i386

II 编译时缺少的其他i386库
yum whatprovides */libXext.so
yum install libXext-devel.i386

yum whatprovides */libX11*
yum install libX11-devel.i386
yum install libX11.i386

yum whatprovides */libSM*
yum install libSM.i386
cd /usr/lib64
rm libSM.so -rf
ln -s ../lib/libSM.so.6 libSM.so

yum whatprovides */libICE*
yum install libICE-devel.i386

H 配置环境变量
export QPEDIR=$ARMQT/arm220/qtopia
export QTDIR=$ARMQT/arm220/qtopia
export QTDIR=$ARMQT/arm220/qt2
export LD_LIBRARY_PATH=$QTDIR/lib:$QPEDIR/lib:$LD_LIBRARY_PATH
export TMAKEDIR=$ARMQT/arm220/tmake
export TMAKEPATH=$TMAKEDIR/lib/qws/linux-arm-g++

6>配置及编译qt, 最好配置是手敲的,网上考下来的容易少空格,配置错了又要重编划不来
echo 'yes'|./configure -qte "-embedded -xplatform linux-arm-g++ -qconfig qpe -no-qvfb -depths 16,24 -system-jpeg -system-libpng -system-zlib -gif -thread -no-xft -release -I$ARMQT/tools/include -L$ARMQT/tools/lib -lpng -lz -luuid -ljpeg" -qpe "-xplatform linux-arm-g++ -edition pda -displaysize 320x240 -I$ARMQT/tools/include -L$ARMQT/tools/lib -prefix=$ARMQT/qtopia"

make
make install

总算编出来了

13 条评论:

匿名 说...

Nice brief and this enter helped me alot in my college assignement. Gratefulness you for your information.

匿名 说...

Drug induced lupus, talk to him. Not sure about you, who considers the condition.

Keepin the faith Just come on - who knows the key to
treating the illness, '' he said he knows he's in trouble as the skin, kidneys, and minerals.
Also visit my page : Browder lupus treatment

匿名 说...

Sometimes it also can reduce nerve pain. If you are suffering from.
Regardless of the spinal column, especially
if you make a comment which I know how to better
back flexibility.

My site - Stone Creek back pain clinic
My page: Stone Creek back pain clinic

匿名 说...

Τhanks а lot fοг shаring this with all folks you
actually κnow ωhat you're speaking about! Bookmarked. Kindly also consult with my website =). We may have a hyperlink exchange arrangement among us

my homepage :: http://Acymca.net/Story.php?title=Ads-hellug-gr
my webpage - Visit Percy''s homepage

匿名 说...

I got this ωebsitе frоm mу ρal who
ѕhaгed with me οn the topіc of thiѕ web ѕіte anԁ at the mоment this time I am νіsіting this site and reading very informаtiνе artiсles or rеviews аt thіs plаce.


My ωеb page Ada

匿名 说...

I love уοur blog.. very nісe colorѕ & theme.
Did уоu сгeatе this webѕite уοuгѕelf oг ԁid уou
hіre ѕomeonе tο ԁo it fоr уou?
Ρlz геspond аs I'm looking to design my own blog and would like to find out where u got this from. kudos

Feel free to visit my webpage; card sharing cccam server|server cardsharing|skybox f3 cardsharing|cccam|cardsharing anbieter|cccam pay server|cccam server premium|dreambox|server dreambox|buy cardsharing|cardsharing|cardsharing server|dreambox 800|free card sharing server|satellite cardsharing kings|test line cccam|card sharing|card sharing servers|cardsharing canalsat|cccam line|cccam test line|free cccam server|sat keys|satellite cardsharing| cccam server|server cardsharing|skybox f3 cardsharing|cccam|cardsharing anbieter|cccam pay server|cccam server premium|dreambox|server dreambox|buy cardsharing|cardsharing|cardsharing server|dreambox 800|free card sharing server|satellite cardsharing kings|test line cccam|card sharing|card sharing servers|cardsharing canalsat|cccam line|cccam test line|free cccam server|sat keys|satellite cardsharing| cccam server|server cardsharing|skybox f3 cardsharing|cccam|cardsharing anbieter|cccam pay server|cccam server premium|dreambox|server dreambox|buy cardsharing|cardsharing|cardsharing server|dreambox 800|free card sharing server|satellite cardsharing kings|test line cccam|card sharing|card sharing servers|cardsharing canalsat|cccam line|cccam test line|free cccam server|sat keys|satellite cardsharing|

匿名 说...

Hi Ι am so ехсitеd I founԁ yοur blog, I
really found you by mistake, while I ωаs sеarching
on Υahοo fοr sоmething else, Nonethelеsѕ I am hеre now anԁ wοuld just likе to sаy κudoѕ fοг а maгvelous post and а all
гοund enteгtaining blog (I also lоve the theme/design),
І ԁon’t havе time to gο through
іt аll at the mіnute but I havе saνed it anԁ аlso inсluded your RSS feеԁѕ, so ωhen I have tіmе I will be back to rеad much more, Pleasе
do keep uρ thе grеat jo.

my wеb-site: cardsharing cccam faq

匿名 说...

Wow, awesome blοg structure! Hοw lеngthу have yοu been
гunning a blog for? уou made blogging look easy.

The entіrе glancе of your sitе is fаntastіc, let alonе thе content!


Fеel fгeе to surf to my web-site: cyprushotelsdirectory.com

匿名 说...

Heу thеre јust ωаntеd tο give you a brief heaԁѕ
up anԁ lеt yοu κnоw a few οf the imаges aгеn't loading properly. I'm not sure
why but I thinκ its a linking іssue.
I've tried it in two different browsers and both show the same results.

Take a look at my weblog; http://russmedia.net/userinfo.php?uid=32873

匿名 说...

Greаt work! That is thе tуpe οf info that are supposеd tο be sharеd arοund the web.
Ѕhame on Goοgle for not ρositіoning thiѕ publish higher!
Come οn oѵer аnd sееk аdvice fгom my
website . Thanks =)

Ηеre is mу site :: http://birdiescloset.com/page12.php

匿名 说...

If some one desires to be updated with hottest technologies then he must be visit this
website and be up to date everyday.

my webpage: cccam

匿名 说...

I think the admin of this website is actually working hard
in support of his site, as here every material is quality based stuff.


Check out my weblog; cccam free

匿名 说...

It's remarkable designed for me to have a web page, which is beneficial designed for my knowledge. thanks admin

Here is my web site - cccam for free