FC4默认安装的GCC4.0不可以用,而是要安装GCC3.2即这两个包:compat-gcc-32(CD3)&compat-gcc-32-c (CD4)
编译过程中不能用fc4自带的gcc4.0.0编译要用gcc3.2.3来编译,所以要将配置文件中的g 全部替换为g 32,gcc全部替换为gcc32,主要替换的有这几个地方
class=codetop>CODE:class=codemain>$QTEDIR/configs/linux-generic-g -share $QTEDIR/configs/linux-generic-g -share-debug $TMAKEDIR/lib/qws/linux-generic-g /tmake.conf $QPEDIR/mkspecs/qws/linux-generic-g /qmake.conf |
环境变量
class=codetop>CODE:class=codemain>TMAKEDIR=/home/arm/tmake-1.13 QT2DIR=/home/arm/qt-x11-2.3.2 QTEDIR=/home/arm/qt-embedded-2.3.10 QPEDIR=/home/arm/qtopia-2.1.1 QT3DIR=/usr/lib/qt-3.3 QTDIR=$QTEDIR DQTDIR=$QT3DIR TMAKEPATH=$TMAKEDIR/lib/qws/linux-generic-g QMAKESPEC=linux-g PATH=$QT2DIR/bin:$QTEDIR/bin:$QPEDIR/bin:$DQTDIR/bin:$QT3DIR/bin:$QTDIR/bin:$TMAKEDIR/bin:$PATH LD_LIBRARY_PATH=$QT2DIR/lib:$QTEDIR/lib:$QPEDIR/lib:$DQTDIR/lib:$QT3DIR/lib:$QTDIR/lib:$LD_LIBRARY_PATH exportTROLLTECHDIRTMAKEDIEQT2DIRQTEDIRQPEDIRQT3DIRQTDIRDQTDIRTMAKEPATHQMAKESPECPATHLD_LIBRARY_PATH |
还有可能以上目录中的linux-x86-g 里的配置文件替换编译参数就可以了
在编译qvfb的时候有可能遇到ld找不到库的问题
改前LIBS=$(SUBLIBS)-L$(QTDIR)/lib-L/usr/X11R6/lib-lqt-lXext-lX11-lm
改后LIBS=$(SUBLIBS)-L$(QTDIR)/lib-L/usr/X11R6/lib-L$(QTEDIR)/lib-lqt-lXext-lX11-lm-lqte
只要添加$QTEDIR/lib库就可以了在后面参数中添加-lqte就可以了,这样编译文件没问题
按这样的步骤执行可能不能生成framebuffer后我改用静态连接的办法实现了该功能
1.编译qt-2.3.2
class=codetop>CODE:class=codemain>cd$QT2DIR exportTMAKEPATH=$TMAKEDIR/lib/linux-g exportQTDIR=$QT2DIR exportPATH=$QTDIR/bin:$PATH exportLD_LIBRARY_PATH=$QTDIR/lib:$LD_LIBRARY_PATH ./configure-static-no-xft-no-opengl-no-sm make mkdir$QTEDIR/bin cpbin/uic$QTEDIR/bin/ |
2.编译qvfb
class=codetop>CODE:class=codemain>exportTMAKEPATH=$TMAKEDIR/lib/linux-g exportQTDIR=$QT2DIR exportPATH=$QTDIR/bin:$PATH exportLD_LIBRARY_PATH=$QTDIR/lib:$LD_LIBRARY_PATH cd$QTEDIR/tools/qvfb tmake-oMakefileqvfb.pro make mvqvfb$QTEDIR/bin/ |
3.编译qt/embedded
class=codetop>CODE:class=codemain>cd$QTEDIR cp$QPEDIR/src/qt/qconfig-qpe.h$QTEDIR/src/tools exportTMAKEPATH=$TMAKEDIR/lib/qws/linux-x86-g exportQTDIR=$QTEDIR exportPATH=$QTDIR/bin:$PATH exportLD_LIBRARY_PATH=$QTDIR/lib:$LD_LIBRARY_PATH ./configure-debug-qconfigqpe-qvfb-depths4,8,16,32-keypad-mode-system-jpeg-gif makesub-src |
4.编译qtopia
class=codetop>CODE:class=codemain>cd$QPEDIR exportQTDIR=$QTEDIR exportPATH=$QTDIR/bin:$PATH exportLD_LIBRARY_PATH=$QTDIR/lib:$LD_LIBRARY_PATH ./configure-debug-editionphone-qtopiadesktop-displaysize176x208 make |
编译qtopia的过程与第一种方法完全一样,这里最重要的就是环境的设置问题了,很多情况下就是因为环境设置不正确的问题而导致编译出错或者是编译成功而运行的时候出错,这些问题都要仔细研究一下她的内部结构才可以解决,不要只是找到网上的一些资料然后就完全按
她的去做,这样成功的可能性不会很大,这些东西还是要靠自己一步步去摸索.
由于qtopia没有提供启动脚本所以用下面的启动脚本来启动qtopia界面
class=codetop>CODE:class=codemain>#!/bin/sh
TMAKEDIR=/home/arm/tmake-1.13 QT2DIR=/home/arm/qt-x11-2.3.2 QTEDIR=/home/arm/qt-embedded-2.3.10 QPEDIR=/home/arm/qtopia-2.1.1 QT3DIR=/usr/lib/qt-3.3 QTDIR=$QTEDIR DQTDIR=$QT3DIR TMAKEPATH=$TMAKEDIR/lib/qws/linux-generic-g QMAKESPEC=linux-g PATH=$QT2DIR/bin:$QTEDIR/bin:$QPEDIR/bin:$DQTDIR/bin:$QT3DIR/bin:$QTDIR/bin:$TMAKEDIR/bin:$PATH LD_LIBRARY_PATH=$QT2DIR/lib:$QTEDIR/lib:$QPEDIR/lib:$DQTDIR/lib:$QT3DIR/lib:$QTDIR/lib:$LD_LIBRARY_PATH exportTROLLTECHDIRTMAKEDIEQT2DIRQTEDIRQPEDIRQT3DIRQTDIRDQTDIRTMAKEPATHQMAKESPECPATHLD_LIBRARY_PATH
findproc(){ /bin/ps-e|/bin/sed-n-e''/\<''$1''\>/s/^*\([0-9][0-9]*\).*/\1/p'' } killproc(){ pid=`findproc$1` ["$pid"!=""]&&kill$pid } killallquicklauncher killallqpe killallqvfb [-x/sbin/fuser]&&(/sbin/fuser-kntcp4242||/sbin/fuser-kntcp4243) [-x/bin/fuser]&&(/bin/fuser-kntcp4242||/bin/fuser-kntcp4243) echo"Stoppingcommonsounddeamons..." artsd_pid=`findprocartsd` ["$artsd_pid"!=""]&&kill$artsd_pid esd_pid=`findprocesd` ["$esd_pid"!=""]&&kill$esd_pid echo"Startingqvfb..." qvfb-width160-height280& sleep3s echo"StartingQtopia2.1.1..." HOME=/home/arm/qtopia-2.1.1/image/opt/Qtopia/demohomeqpe echo"Restartingkilledsounddeamons..." ["$artsd_pid"!=""]&&artsd& ["$esd_pid"!=""]&&esd& |
其中pcdev是我开始安装时的环境设置脚本
#!/bin/bash
设置TMAKEDIR、QT2DIR、QTEDIR、QPEDIR、QT3DIR、TMAKEPATH、QMAKESPEC、PATH和LD_LIBRARY_PATH这几个变量就可以了。
下载本文示例代码
阅读(242) | 评论(0) | 转发(0) |