Chinaunix首页 | 论坛 | 博客
  • 博客访问: 53581
  • 博文数量: 10
  • 博客积分: 365
  • 博客等级: 一等列兵
  • 技术积分: 125
  • 用 户 组: 普通用户
  • 注册时间: 2011-03-07 16:28
文章存档

2012年(3)

2011年(7)

分类: 嵌入式

2012-01-24 09:26:54

MicrosoftInternetExplorer402DocumentNotSpecified7.8Normal0
  1. 移植konqueror遇到好大的麻烦!总是出现    checking for Qt... configure: error: Qt (>= Qt 2.2.2) (library qte) not found. Please check your !
  2. 并且按照网上的解决方法,根本解决不了我的问题!
  3. 因为我的libpng,libz,以及libts等都没有copy到交叉工具链arm-linux目录下,需要自己指定路径,所以导致的这个问题解决不了。当然这也是在成功之后总结出来的,没成功之前根本不知道!
  4. 最后自己下了狠功夫一点点看configure错误,一点点尝试修改,最终成功了,可喜可贺!

  5. 主要出现的问题:
  6. 1 后面./configure阶段和make阶段出现的各个问题基本上都和这几个库有关系!特别是因为我的qtopia使用了触屏防抖动的tslib-1.4库,需要修改configure加上-lts对libts支持。
  7. 2 还有一点就是这个版本的konqueror对qtopia-2.2.0指定的版本信息没有找对位置要手动修改configure!


准备

Ø 1编译器:arm-linux-3.3.2

Ø 2平台:qtopia-2.2.0

Ø 3环境变量:使用3.qtopia-arm-2.2.0.sh环境变量,后来使用qtopia-2.2.0自带的setQpeEnv!区别在于QPEDIR的设置!自己写的环境变量QPEDIRinstall后的qtopia目录,而自带的QPEDIR设为编译目录下的qtopia,而这个目录里有qpeinclude文件!

Ø 4因为之前qtopia是在root用户下编译的,所以使用时可能有一些不能访问的权限问题,所以只要修改下权限就可。如qt2/lib/fontsqconfig.h

下载:konqueror-embedded-snapshot-20030705.tar.gz

konqueror-embedded主页

在网页最后可以找到下载地址:

2配置编译安装
  1. cd konq
  2.     source /usr/local/qtopia-arm-2.2.0/qtopia-free-2.2.0/setQpeEnv
  3.     env $QTDIR
  4.     env $QPEDIR
  5.     
  6.     ./configure \
  7.     CC=arm-linux-gcc \
  8.     CXX=arm-linux-g++ \
  9.     LDFLAGS=-ldl \
  10.     CROSS_COMPILE=1 \
  11.     --build=i686-linux \            //本地linux
  12.     --host=arm-linux \            //arm运行的linux
  13.     --target=arm-linux \            //arm运行的linux
  14.     --enable-qt-embedded \        //库:对qt-e库的支持!嵌入式设备中要有qt-e而非qt
  15.     --enable-qpe \                //库:对qtopia库的支持,
  16.                              //这样能够利用QPE库的API,节省桌面环境资源
  17.                              //也就是说,可以再没有qtopia桌面环境中,只是用qt-e库!
  18.     --enable-embedded \            //使用环境:支持arm运行时的qt-e环境
  19.     --enable-qtopia \            //使用环境:支持arm运行时的qtopia环境
  20.     --with-gui=qpe \            //默认的是x11桌面环境
  21.     --disable-debug \
  22.     --enable-static \                //静态
  23.     --disable-shared \
  24.     --disable-mt \                //多进程
  25.     --enable-add-ons=kflashpart \            //加入flash支持!
  26.     --without-ssl \
  27.     --with-qt-dir=$QTDIR \
  28.     --with-qt-includes=$QTDIR/include \        //qtopia-2.2.0中qt-e头文件在qt2中,
  29.     --with-qt-libraries=$QPEDIR/lib \            //而库libqte在qtopia中!
  30.     --with-qtopia-dir=$QPEDIR \
  31.     --with-extra-includes=/usr/local/qtopia-arm-2.2.0/install-others/include:
  32.                              $QPEDIR/include:            //libpng,libjepg,libz等库!
  33.                              $QTDIR/include:
  34.                              /usr/local/arm/3.3.2/include:    //libts
  35.                              /usr/local/qtopia-arm-2.2.0/install-tslib-1.4/include \
  36.     --with-extra-libs=/usr/local/qtopia-arm-2.2.0/install-others/lib:
  37.                              $QPEDIR/lib:
  38.                              $QTDIR/lib:
  39.                              /usr/local/arm/3.3.2/lib:
  40.                              /usr/local/qtopia-arm-2.2.0/install-tslib-1.4/lib \
  41.     --prefix=/home/richardnee/konq-arm/install-konq
  42.     //--prefix默认的是/usr/,不能默认,因为链接时,会链接到/usr/lib下的libpng.so等,编译不通过!
  43.     
  44.     #make
  45.     #make install
  46.     #arm-linux-strip --strip-all konq-embed/src/konqueror

出错问题解决方法:根据现实错误关键字,到config.log中直接查找该关键字,了解详细出错在何处,在用该关键字到configure中查找,然后稍微修改configure

问题1configure阶段:QTE库找不到

  1.     checking for Qt... configure: error: Qt (>= Qt 2.2.2) (library qte) not found. Please check your
  2.     For more details about this problem, look at the end of config.log.

最终解决方法:

  1. 修改configure 22141行,在ac_link中加入-lts对libts库的支持!
问题解决分析:

1通过在几个关键地方加入echo "$ac_xxx"显示当前的qtac_qt_includesac_qt_libraries目录从而找到问题所在;原来是ac_qt_libraries="NO"

2进一步向上追溯:是ac_link=xx,缺少对库libts的制定-lts,从而导致下面错误:在config.log中:

  1. /usr/local/arm/3.3.2/lib/gcc-lib/arm-linux/3.3.2/../../../../arm-linux/bin/ld: warning: libts-0.0.so.0, needed by /usr/local/qtopia-arm-2.2.0/qtopia-free-2.2.0/qtopia/lib/libqte.so, not found (try using -rpath or -rpath-link)
  2. /usr/local/qtopia-arm-2.2.0/qtopia-free-2.2.0/qtopia/lib/libqte.so: undefined reference to `ts_close

并且通过config.log中的记录可以定位在configure:22214: rm -rf SunWS_cache; .......

3configure:22214: 上面最近一个ac_link中加入-lts,在22141附近!

问题2configure阶段libts库找不到,并且找不到qtopia的版本头文件version.h

  1. checking for Qtopia... ./configure: line 24305: test: : integer expression expected
  2.     configure: error: Cannot link small Qtopia Application. For more details look at
  3.     the end of config.log

解决方法:

1 qtopia版本问题:因为konquerorqtopia-2.2.0版本不必配的原因,konqueror找到的version.h没有真正的版本信息,只是一个包含链接include"",真正的版本信息在$QPEDIR/src/libraries/qtopia/version.h中,所以修改configure24299-24301行:

  1. $qtopia_incdir/qpe/version.h 改为 $qtopia_incdir/../src/libraries/qtopia/version.h

2 libts库找不到问题:同问题1一样:

  1. 在configure的24321行的ac_link中加入-lts对libts库的支持!

问题3make阶段:libts库找不到

  1. /usr/local/arm/3.3.2/lib/gcc-lib/arm-linux/3.3.2/../../../../arm-linux/bin/ld: warning: libts-0.0.so.0, needed by /usr/local/qtopia-arm-2.2.0/qtopia-free-2.2.0/qtopia/lib/libqpe.so, not found (try using -rpath or -rpath-link)

  2. /usr/local/qtopia-arm-2.2.0/qtopia-free-2.2.0/qtopia/lib/libqte.so: undefined reference to `ts_open

解决方法:同问题1,2一样,在konq-embed/src/Makefile中的LDFLAGS加入-lts:大约132行:

  1. LDFLAGS = -ldl -lts

问题4configure阶段:(konqueror-embedded-snapshot-20030705.tar.gz

  1. /usr/local/qtopia-arm-2.2.0/qtopia-free-2.2.0/qtopia/include/qpe/../../src/libraries/qtopia/qpeapplication.h:87: error: comma at end of enumerator list

解决方法:在$QPEDIR/src/libraries/qtopia/qpeapplication.h86行去掉逗号“,

  1.      77 enum InputMethodHint {

  2.      78 Normal,

  3.      79 AlwaysOff,

  4.      80 AlwaysOn

  5.      81 ,

  6.      82 Number,

  7.      83 PhoneNumber,

  8.      84 Words,

  9.      85 Text,

  10.      86 Named, //逗号去掉

  11.      87 };

问题5

  1.  In file included from kflashpart.h:16, from kflashpart.cpp:14:flashlib/flash.h:78: error: comma at end of enumerator list make[6]: *** [kflashpart.lo] Error 1 make[6]: Leaving directory `/home/richardnee/konq-arm/konqueror-embedded/konq-embed/add-ons/kflashpart

解决方法:vi konq-embed/add-ons/kflashpart/flashlib/flash.h去掉77行逗号:

  1. 69 enum FlashEventType {

  2.      70 FeNone,

  3.      71 FeMouseMove,

  4.      72 FeButtonPress,

  5.      73 FeButtonRelease,

  6.      74 FeRefresh,

  7.      75 FeKeyPress,

  8.      76 /* internal events */

  9.      77 FeKeyRelease, 去掉逗号

  10.      78 };

3 ARM运行环境的设置

/home/ricahrdnee/konq-arm/install-konq目录下会生成konqueror/E移植所需要的可执行文件以及配置文件,将konqueror相关文件拷贝

  1. Mkdir -p opt/kde

  2. Mkdir -p opt/Qtopia/pics/konqueror/

  3. Mkdir -p opt/Qtopia/apps/ARM2410/

  4. cp apps/Applications/konqueror.desktop opt/Qtopia/apps/ARM2410/

  5. cp apps/Utilities/kflashplay.desktop opt/Qtopia/apps/ARM2410/ //不需要

  6. cp bin/arm-linux-konqueror opt/Qtopia/bin/konqueror

  7. cp pics/konqueror.png opt/Qtopia/pics/konqueror/

  8. cp -arvf share/ opt/kde/

修改/etc/profile.d/qtopia.shqtopia脚本,加入

  1. export set KDEDIR=/opt/kde

测试

不是是不是因为没有安装boahttp服务等,konqueror运行时,比如输入,会出现Unknown host 

在确保DNSresolv.conf设置的namesever=8.8.8.8设置正确的前提下还是出现该错误!

然后ping百度域名

ping 
ping: bad address ''

然而直接ping百度的ip可以ping

Ping 202.108.22.5 

Ø 经熟悉网络的童鞋指点是DNS有问题,并非我所设想的httpd守护进程没开!

Ø 如网友所指出的busybox的命令帮助页面上找到了这样一段话:

LIBC NSS

When used with glibc, the BusyBox 'networking' applets will similarly require that you  install at least some of the glibc NSS stuff (in particular, /etc/nsswitch.conf, /lib/libnss_dns*,  /lib/libnss_files*, and /lib/libresolv*).

所以应该是和DNS有关的几个库、配置没有,导致无法解析域名!

把这几个文件copyarm上。Busybox使用3.4.1交叉工具链编译的所以用3.4.1中的库!

  1. cp /usr/local/arm/3.4.1/lib/libnss_dns* lib/ -arvf
  2. cp /usr/local/arm/3.4.1/lib/libnss_files* lib/ -arvf
  3. cp /usr/local/arm/3.4.1/lib/libresolv* lib/ -arvf

resolv.conf已经有启动shell设置了

从本地主机上copyhost有关的配置文件

  1. Cp /etc/host* etc/ -v

果然就可以ping通百度了!然后konqueror可能够浏览网页了了!


中文网页支持

由于QT/E是可以支持Unicode编码,因此Konqueror/E也可以支持中文但是在编译QT/E缺省配置中是不支持Unicode。所以要做一下两处修改:

Ø 修改QT/E,QtopiaUnicode支持,支持中文:

手动修改qt2qtopia目录中的qconfig-qpe.h文件配置注释掉38行,#define QT_NO_CODECS。 

  1. find qtopia-free-2.2.0/ -name qconfig-qpe.h
  2. qtopia-free-2.2.0/qtopia/src/qt/qconfig-qpe.h
  3. qtopia-free-2.2.0/qt2/src/tools/qconfig-qpe.h
  4. qtopia-free-2.2.0/qt2/include/qconfig-qpe.h

或者:
./configure -qpe  ".......  -fontfamilies "helvetica fixed micro smallsmooth smoothtimes unifont" ......."

改为:./configure -qpe  ".......  -fontfamilies "unifont" ......."

  1. cd /usr/local/qtopia-arm-2.2.0/qtopia-free-2.2.0

  2. ./configure \

  3. -qte "-embedded -xplatform linux-arm-g++ \

  4. -qconfig qpe -no-qvfb -depths 8,16,24,32 \

  5. -system-jpeg -system-libpng -system-zlib -gif \

  6. -thread -no-xft -release \

  7. -tslib \

  8. -I/usr/local/qtopia-arm-2.2.0/install-tslib-1.4/include \

  9. -I/usr/local/qtopia-arm-2.2.0/install-others/include \

  10. -L/usr/local/qtopia-arm-2.2.0/install-tslib-1.4/lib \

  11. -L/usr/local/qtopia-arm-2.2.0/install-others/lib \

  12. -lpng -lts -lz -luuid -ljpeg" \

  13. -qpe "-xplatform linux-arm-g++ -luuid \

  14. -edition pda -displaysize 320x240 \

  15. -fontfamilies "helvetica fixed micro smallsmooth smoothtimes unifont"改为:

  16. -fontfamilies "unifont" \

  17. -I/usr/local/qtopia-arm-2.2.0/install-others/include \

  18. -I/usr/local/qtopia-arm-2.2.0/install-tslib-1.4/include \

  19. -L/usr/local/qtopia-arm-2.2.0/install-others/lib \

  20. -L/usr/local/qtopia-arm-2.2.0/install-tslib-1.4/lib \

  21. -prefix=/usr/local/qtopia-arm-2.2.0/install-qtopia-2.2.0" \

  22. -qt2 "-no-opengl -no-xft" \

  23. -dqt "-no-xft -thread" 2>&1 | tee config.log

Ø 修改Konqueror/E支持Unicode

要在Konqueror页面上显示,就必须要有相应字体,因此对Konqueror/E源代码中/konq-embed/dropin/ kglobalsettings.cpp文件进行修改"helvetica"改为"unifont"后重新编译Konqueror/E,这样Konqueror/E中就能显示中文字体页面了。

  1. Vi konq-embed/dropin/ kglobalsettings.cpp

  2. "helvetica"改为"unifont"


这样修改完毕以后,重新开始编译QT/E以及QtopiaKonuqueror/EKonqueror/E就能接受Unicode编码汉字了。

之前的好像就已经可以浏览中文网页,显示汉字,只是有个别的乱码;改过之后也一样!


6关于嵌入式安装的说明

摘录

How can I make Konq/E pick up the Qt/Embedded library instead of the normal Qt lib?

If you want to compile with Qt/Embedded support, then you have to configure it with the --enable-qt-embedded configure switch. Also make sure the QTDIR is set correctly.

关于QT-E的支持:

一:需要qte库;

二:配置时设置--enable-qt-embedded

三:设置QTDIR指向qte的目录;

I heard there's special support for the Qt Palmtop Environment?

There is a --enable-qpe configure switch which will make Konq/E link against the Qt Palmtop Environment libraries (and use them) . The support involves inherittance of the QPEApplication base application class and use of the QPE shared status message feature (re-using the task-bar for status messages, to avoid wasting screen space with an application status bar) . Make sure to have QPEDIR set then using this switch.

关于qtopia的支持:

一:需要qtopia库,如libqpelibqtopia;这样能够利用QPE库的应用程序接口,节省桌面环境资源;

二:配置时设置--enable-qpe

三:设置QPEDIR指向qtopia的目录


阅读(3319) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~