ºìÁªLinuxÃÅ»§
Linux°ïÖú

QT+QTOPIAÔÚlinuxÉϵÄÒÆÖ²

·¢²¼Ê±¼ä:2007-05-04 11:04:47À´Ô´:ºìÁª×÷Õß:Availslinux
1. ¼ò½é
QTÊÇÄ¿Ç°ÔÚlinuxÉÏʹÓýϹãµÄÒ»¸öͼÐÎϵͳ¡£Óû§¾­³£ÅäºÏKDE×ÀÃæ»·¾³À´Ê¹Óá£ÐèҪעÒâµÄÊÇÎÒÃÇ¿´µ½µÄ²¢²Ù×÷µÄÊÇKDE£¬¶ø²»ÊÇQT¡£QTÖ»ÊÇÒ»Ì׿⺯Êý(Àà¿â)£¬KDE²ÅÊÇ¿ÉÖ´ÐгÌÐò.ͬʱKDEΪÁËÆäËû³ÌÐò·½±ãµÄ¶ÔÆä²Ù×÷£¬Ò²ÌṩһÌ׿⺯Êý(Àà¿â)¡£
ÔÚPC»úÉϵÄQTÊÇ»ùÓÚX11ͼÐÎϵͳµÄ£¬ÔÚǶÈëÉ豸ÖÐÍùÍù²»ÐèÒªÕâôÀÛ׸£¬Ö»ÐèʹÓÃQTE(QT Embedded)¼´¿É°üÀ¨PCƽ̨ÖÐX11ºÍQT¿âµÄ¹¦ÄÜ¡£
ÁíÒ»·½Ãæ,ǶÈëÉ豸ÊÜÐí¶àÌõ¼þµÄÏÞÖÆ£¬×ÀÃæϵͳҲ²»ÄÜÖ±½ÓʹÓÃPC»úÉÏÒÑÓеÄϵͳ¡£QTOPIA¾ÍÊÇÏ൱ÓÚKDEµÄ×ÀÃæϵͳ.¸ù¾Ý¾ßÌåǶÈëÉ豸µÄÐèÒª¿ÉÒÔÅäÖóÉphoneºÍpocket pcÁ½ÖÖ¡£

2. ×¼±¸¹¤×÷
2.1 Ä¿±ê
Ê×ÏÈÒªÃ÷È·½«Òª¸ÉµÄÊÇʲô£¬½«Ôõô×ö¡£
ÎÒÃǵÄÄ¿±êºÜÃ÷È·----¾ÍÊÇÔÚ×Ô¼ºµÄ¿ª·¢°åÉÏʹÓûùÓÚQTEµÄ×ÀÃæϵͳQTOPIA¡£
ÎÒÃǵŤ×÷ÍùÍùÊÇÏÈÔÚPCÍê³ÉÒÔºóÒÆÖ²µ½ARMƽ̨ÉÏ£»ÏȱàÒëºÃQTEµÄ¿â£¬ÔÙ±àÒëQTOPIA¡£ÒòΪÕâ¸öϵͳºÍ¾ßÌåµÄÉ豸Óйأ¨ÀýÈ磺´¥ÃþÆÁ¡¢Ê±ÖÓ¡¢µçÔ´¹ÜÀíÉ豸µÈ£©£¬ËùÒÔ×îºó»¹ÐèÒª×öÉ豸½Ó¿ÚµÄÒÆÖ²¹¤×÷¡£

2.2 Èí¼þ°ü
ϵͳƽ̨£ºRedHat 9£¨ÍêÈ«°²×°£©
qt-embedded-2.3.7.tar.gz £¨qteµÄ¿â£©
qt-x11-2.3.2.tar.gz £¨ÎªÁËÉú³ÉÏàÓ¦µÄqtdesignerºÍqvfb£©
qtopia-free-1.7.0.tar.gz £¨qteµÄ×ÀÃæ»·¾³³ÌÐò£©
tmake-1.11.tar.gz £¨±àÒëʱ»áÓõ½£©
e2fsprogs-1.35.tar.gz £¨Ö»Ê¹ÓÃÆäÖеÄuuidµÄ¿â£©
µ±ÏÂÔØÍêÕâЩ°üÒÔºóÎÒÃÇÏȽ¨Á¢Ò»¸ö¹¤×÷»·¾³¡£¼ÙÉèËùÓÐÈí¼þ°ü¶¼ÏÂÔØÔÚÓû§Ä¿Â¼Ï£¬Í¨³£¶¼ÊÇ/root¡£

2.3 »·¾³µÄ½¨Á¢
# cd ~
# mkdir x86-qtopia

# tar zxvf qt-x11-2.3.2.tar.gz
# mv qt-2.3.2 qt-x11

# cd x86-qtopia
# tar zxvf ../tmake-1.11.tar.gz
# tar zxvf ../qt-embedded-2.3.7.tar.gz
# tar zxvf ../qtopia-free-1.7.0.tar.gz
# tar zxvf ../e2fsprogs-1.35.tar.gz
# mv tmake-1.11 tmake
# mv qt-2.3.7/ qt
# mv qtopia-free-1.7.0 qtopia
# mv e2fsprogs-1.35 e2fsprogs

# cp x86-qtopia arm-qtopia -rf
¼Çס£¬Óû§Ä¿Â¼ÏµÄx86-qtopiaĿ¼ÊÇPC»úÉϱàÒëµÄ¹¤×÷»·¾³£¬arm-qtopiaÊÇarmƽ̨µÄ½»²æ±àÒ빤×÷»·¾³£¬qt-x11ÊÇÁ½Õß¹«Óõġ£

½ÓÏÂÀ´»¹±ØÐë±àÒëqt-x11£¬Ö÷ÒªÊÇΪÁ˱àÒëÉú³ÉÆäÖеÄqtdesignerºÍqvfb¡£qvfb³ÌÐòÔÚϵͳÖв¢Î´°²×°£¬ÐèÒªÎÒÃÇ×Ô¼º±àÒë¡£qtdesignerÊǺÍqt¿âµÄ°æ±¾ÊÇÏà¹ØµÄ£¬µ±ÎÒÃÇʹÓÃPC»úÉϺÍQTE°æ±¾²»·ûµÄqtdesignerʱ£¬¿ÉÄÜÔÚPC»úÉϵÄqt-x11ÄÜʹÓõĿؼþÔÚQTEÉϲ¢Î´ÊµÏÖ£¬µ¼ÖÂÓ¦ÓóÌÐò±àÒë²»³É¹¦¡£ËùÒÔ£¬ÎÒÃÇʹÓÃ2.3°æ±¾µÄQTEʱ£¬±ØÐëʹÓÃÏàͬ°æ±¾µÄqt-x11±àÒëÉú³ÉµÄqtdesignerºÍqvfb¡£
# cd ~/qt-x11
# export QTDIR=$PWD
# echo yes | ./configure -static -no-xft -no-opengl -no-sm
# make -C src/moc
# cp src/moc/moc bin
# make -C src
# make -C tools/designer
# make -C tools/qvfb
# cp tools/qvfb/qvfb bin
# strip bin/uic bin/moc bin/designer bin/qvfb
# cp qt-x11/bin/* qt/bin -f
# cp qt-x11/bin/* qt/bin -f


3. PCƽ̨±àÒë
±àÒë֮ǰ×öÒ»ÏÂ×¼±¸¹¤×÷£º´ò¿ªÒ»¸ö¿ØÖÆ̨֮ºóÉèÖû·¾³±äÁ¿¡£
# cd ~/x86-qtopia
# export QTDIR=$PWD/qt
# export QPEDIR=$PWD/qtopia
# export TMAKEDIR=$PWD/tmake
# export TMAKEPATH=$TMAKEDIR/lib/qws/linux-generic-g++
# export PATH=$QTDIR/bin:$QPEDIR/bin:$TMAKEDIR/bin:$PATH

3.1 ±àÒëQTE
# cd $QTDIR
# cp $QPEDIR/src/qt/qconfig-qpe.h src/tools/ -f
# (echo yes ; echo no) | ./configure -platform linux-generic-g++ -qconfig qpe -depths 16,24,32
# make -C src clean
# make -C src
¿´Ò»ÏÂ$QTDIRĿ¼ÏÂÊÇ·ñÒѾ­ÓÐÁËqtµÄ¿âÁË£¿

3.2 ±àÒëQTOPIA
# cd $QPEDIR/src
# ./configure
# make clean
# make

3.3 ²âÊÔQTOPIA
¼¤¶¯µÄʱ¿ÌÀ´ÁË£¬Èç¹ûÕâ¸ö²½Öè³É¹¦½«Òâζ×Å¿ÉÒÔ×öÓ¦Óÿª·¢ÁË¡£
# cd ~/x86-qtopia
# mkdir dist
# cd dist
# cp -af ../qt/lib/ .
# cp -af ../qtopia/apps .
# cp -af ../qtopia/bin .
# cp -af ../qtopia/plugins .
# cp -af ../qtopia/i18n .
# cp -af ../qtopia/pics .
ÒòΪSecurity.pngÓеã´íÎó£¬ËùÒÔ±ØÐë½øÐÐһϲÙ×÷£º
# cd pics
# pngtopnm Security.png>a.pnm
# pnmtopng a.pnm>Security.png
ÒòΪqpeÔËÐеÄʱºò£¬µ±Ç°Ä¿Â¼±ØÐëÊÇ$QTDIR/bin£¬ËùÒÔ²»ÄÜÔÚ$QTDIRĿ¼ÏÂÖ´ÐÐbin/qpeÀ´ÔËÐС£
# export QTDIR=~/x86-qtopia/qt
# cd $QTDIR/bin
# ./qvfb &
# ./qpe &
¿´µ½qpeÔÚqvfbÖеĽçÃæÁËÂð£¿ÎÒ¿´µ½ÁË¡«£¡


4. Ä¿±êƽ̨½»²æ±àÒë
ÓëPC»úÉϵıàÒëÒ»Ñù£¬´ò¿ªÒ»¸ö¿ØÖÆ̨֮ºóÐèÒªÉèÖû·¾³±äÁ¿¡£
# cd ~/arm-qtopia
# export QTDIR=$PWD/qt
# export QPEDIR=$PWD/qtopia
# export TMAKEDIR=$PWD/tmake
# export TMAKEPATH=$TMAKEDIR/lib/qws/linux-arm-g++
# export PATH=$QTDIR/bin:$QPEDIR/bin:$TMAKEDIR/bin:$PATH
4.1 ½»²æ±àÒëQT

4.2 ½»²æ±àÒëQTOPIA

5. ÒÆÖ²QTÖеÄÏà¹ØÉ豸½Ó¿Ú
5.1 Êó±ê

5.2 ´¥ÃþÆÁ

6. ÒÆÖ²QTOPIAÖеÄÏà¹ØÉ豸½Ó¿Ú
6.1 µçÔ´¹ÜÀíÉ豸

7. ±àдQT³ÌÐò²¢ÒÆÖ²

8. ±àдQTOPIA³ÌÐò²¢ÒÆÖ²
X. tips
@ ÒÆÖ²µÄʱºò±àÒëÆ÷µÄ°æ±¾ºÜÖØÒª.qte-2.3.7ÔÚredhat9µÄ3.2±àÒëÆ÷Ϲ¤×÷ºÜÕý³£,µ«ÔÚFedora4µÄgcc-3.4.2±àÒëÆ÷ϱàÒëÈ´²»³É¹¦.¸ù¾Ý²âÊÔ,PCƽ̨ÉÏʹÓÃgcc-3.2¿ÉÒÔ˳Àû±àÒë,armƽ̨ÉÏʹÓÃgcc-2.95.2¿ÉÒÔ˳Àûͨ¹ý(gnuarmµÄ±àÒëÆ÷ºÃÏñ²»ÐУ¬Óûªºã¹âÅÌÖеÄarmv4l-unkown-linux-gccµÄ¿ÉÒÔ±àÒëͨ¹ý)
@ ±àÒë¹ý³ÌÖлáÌáʾȱÉÙuuidµÄÍ·ÎļþºÍ¿â,ÏÂÔØe2fsprogs-libs-1.38.tar.gz,ÀïÃæÓÐuuidµÄÏà¹Ø´úÂë.
@ ±àÒëµÄʱºòÐèÒªÖ¸¶¨±àÒëÆ÷,ÔÚqtµÄconfigsĿ¼ÏÂÓÐÐí¶àÎļþ,ÐÞ¸Älinux-arm-g++-*ÕâЩÎļþÖеÄÏà¹Ø¶¨Òå.ÀýÈç:ĬÈÏʹÓÃarm-linux-gcc±àÒëÆ÷,¶øÎÒʹÓõÄÊÇGNUARMµÄarm-elf-gcc±àÒëÆ÷,Ìæ»»ÎļþÖÐËùÓÐarm-linux-ǰ׺Ϊarm-elf-¼´¿É.
ÎÄÕÂÆÀÂÛ

¹²ÓÐ 3 ÌõÆÀÂÛ

  1. chen_chq ÓÚ 2010-04-27 23:04:21·¢±í:

    xieÁË

  2. chen_chq ÓÚ 2010-04-27 23:04:16·¢±í:

    xieÁË

  3. 6287175 ÓÚ 2010-02-24 08:22:34·¢±í:

    ѧϰѧϰ