Andrew Huang <bluedrum@163.com> 转载请注明作者及联络方式

  这个已经接近最新版,更大是QT 4.7.3 离线版要1G,因此选择这个版本进行移植,用来测试.一下I80的屏.

  一.准备工作

   1. zip版本(不推荐下载)
    下载 http://get.qt.nokia.com/qt/source/qt-everywhere-opensource-src-4.7.2.zip
    解压 unzip qt-everywhere-opensource-src-4.7.2.zip
    改名  mv qt-everywhere-opensource-src-4.7.2/ qt-4.7.2

    第一次运configure 会提示./configure: /bin/sh^M: bad interpreter: 
    这里因为 configure中使用了windows的回车符.如果在LINUX下运行需要将其转换一下
    dos2unix configure  
    解决上述问题,但是其它的文件仍有回车问题

 2.tar.gz版本
    下载 http://get.qt.nokia.com/qt/source/qt-everywhere-opensource-src-4.7.2.tar.gz
    解压: tar xvf qt-everywhere-opensource-src-4.7.2.tar.gz
    改名: mv qt-everywhere-opensource-src-4.7.2 qt-4.7.2

   3.显示与嵌入式LINUX相关的configure 选项
     ./configure -embedded -h

  二.移植

   2.1 生成Makefile

  1. echo o | ./configure -prefix $PWD/../output/arm-linux/qt -opensource -confirm-license -release -shared -embedded arm -xplatform qws/linux-arm-g++ -depths 16,18,24 -fast -optimized-qmake -pch -qt-sql-sqlite -qt-libjpeg -qt-zlib -qt-libpng -qt-freetype -little-endian -host-little-endian -no-qt3support -no-libtiff -no-libmng -no-opengl -no-mmx -no-sse -no-sse2 -no-3dnow -no-openssl -no-webkit -no-qvfb -no-phonon -no-nis -no-opengl -no-cups -no-glib -no-xcursor -no-xfixes -no-xrandr -no-xrender -no-separate-debug-info -nomake examples -nomake tools -nomake docs -qt-mouse-tslib -qt-kbd-linuxinput -qt-gfx-linuxfb -I$PWD/../output/arm-linux/include -L$PWD/../output/arm-linux/lib  -lasound
注意这里的-lasound 是 链接alsa是必须,否则编译多媒体会报错.
 生成成功后
   
  1. Qt is now configured for building. Just run 'gmake'.
  2. Once everything is built, you must run 'gmake install'.
  3. Qt will be installed into /opt/qt-4.7.2
  4. To reconfigure, run 'gmake confclean' and 'configure'.
2.2 编译 
   系统已经自带了qmake或make
    我是 make 
    安装 make install

三.测试
   在qt的安装目录下,有一个demos目录下,各个程序都会被编译成功.
   在运行qt之间,必须写一个运行脚本,配置一些必须脚本.
   主要是二大块,一个是tslib的配置参数,另一个是QT本身的配置参数,这是我成功运行的版本。

我测试是demos/mainwindow下的测试程序

  1. export PRJ_HOME=/mnt/nfs/workspace/output/arm-linux
  2. export QTDIR=$PRJ_HOME/qt
  3. export TSLIB_TSDEVICE=/dev/input/event0
  4. export TSLIB_CALIBFILE=/etc/pointercal
  5. export TSLIB_CONFFILE=${PRJ_HOME}/etc/ts.conf
  6. echo TSLIB_CONFFILE=$TSLIB_CONFFILE
  7. #export TSLIB_CONFFILE=/etc/ts.conf
  8. export TSLIB_PLUGINDIR=${PRJ_HOME}/lib/ts
  9. export TSLIB_FBDEVICE=/dev/fb0
  10. export QWS_MOUSE_PROTO=Tslib:/dev/input/event0
  11. export QWS_SIZE=480X272
  12. #export QWS_DISPLAY=LinuxFb:mmWidth=272:mmHeight=480:0
  13. export QWS_DISPLAY=LinuxFb:/dev/fb0
  14. export QT_PLUGIN_PATH=$QT_DIR/plugins
  15. export QT_QWS_FONTDIR=$QTDIR/lib/fonts
  16. export LD_LIBRARY_PATH=$PRJ_HOME/lib:$QTDIR/lib

  17. ./mainwindow -qws            #最终测试程序
    
其中QWS_DISPLAY设置 屏幕旋转:
  
export QWS_DISPLAY=Transformed:Rot90    //旋转90 可以旋转0、90、180、270
想让qt支持旋转,在编译嵌入式qt的时候要加上-qt-gfx-transformed选项


最终是在4.3"下的s3c6410 测试成功,
   20587912_131373973073hP.jpg