Chinaunix首页 | 论坛 | 博客
  • 博客访问: 525879
  • 博文数量: 150
  • 博客积分: 5000
  • 博客等级: 大校
  • 技术积分: 1705
  • 用 户 组: 普通用户
  • 注册时间: 2008-11-11 23:29
文章分类

全部博文(150)

文章存档

2011年(9)

2010年(25)

2009年(94)

2008年(22)

我的朋友

分类: Java

2009-02-11 01:07:51

 

Introduction

Qt is a cross-platform application development framework. For phoneME Advanced MR2, both PBP and MIDP use Qt as a portability layer for their graphics implementations. PBP uses Qt 3.x for Linux/x86 host-based development and Qt Embedded 2.3.x for device-based development. MIDP uses only Qt Embedded 2.3.x is as a portability layer.

Ubuntu Linux includes the Debian package management system that provides prebuilt packages for a variety of applications, libraries and other system resources. The Ubuntu package repository includes prebuilt packages for Qt 3.x and these make setup for the CDC build system much easier for PBP.

However, MIDP requires Qt Embedded 2.3.x, which is not available in prebuilt package form. This means that to use Qt Embedded 2.3.10 with phoneME Advanced MR2, you will have to download the source code bundle from the Trolltech web site and build it.

Building Qt Embedded

Qt has many build options, not all of which are appropriate for the devices and development style used by phoneME Advanced MR2. These build notes show how to configure the Qt Embedded build system to generate libraries and header files that are appropriate for use with the phoneME Advanced MR2 build system.

There are basically two build files described here:

  • A build script that selects some top-level configuration options and then drives the overall build process,
  • A configuration file that selects a number of compile-time build options.

Note: Qt Embedded 2.3.10 is an older version of the Qt framework that should be built with the gcc/g++ 3.x compilers.

Get the Qt Embedded Source Bundle

The source bundle for Qt Embedded 2.3.10 can be downloaded from the Trolltech ftp site:

% wget ftp://ftp.trolltech.com/qt/source/qt-embedded-2.3.10-free.tar.gz

Then unbundle it into a suitable directory.

Install the qconfig-pmea.h Configuration File

  1. Create a file named qconfig-pmea.h in the src/tools directory in the Qt Embedded source hierarchy:
    #ifndef QT_H
    #endif // QT_H

    #define QT_NO_QWS_CURSOR
    #define QT_NO_QWS_MOUSE_AUTO
    #define QT_NO_CODECS
    #define QT_NO_FREETYPE
    #define QT_NO_BDF
    #define QT_NO_STYLE_POCKETPC
    #define QT_NO_STYLE_AQUA
    #define QT_NO_STYLE_MOTIF
    #define QT_NO_STYLE_PLATINUM
    #define QT_NO_QWS_BEOS_WM_STYLE
    #define QT_NO_QWS_KDE2_WM_STYLE
    #define QT_NO_QWS_KDE_WM_STYLE
    #define QT_NO_QWS_WINDOWS_WM_STYLE
    #define QT_NO_UNICODETABLES
    #define QT_NO_IMAGEIO_MNG
    #define QT_NO_PROPERTIES
    #define QT_NO_COLORNAMES
    #define QT_NO_IMAGEIO_PPM
    #define QT_NO_NETWORKPROTOCOL
    #define QT_NO_PICTURE
    #define QT_NO_PRINTER
    #define QT_NO_QWS_SAVEFONTS
    #define QT_NO_COLORDIALOG
    #define QT_NO_FILEDIALOG
    #define QT_NO_FONTDIALOG
    #define QT_NO_DIAL
    #define QT_NO_DRAGANDDROP
    #define QT_NO_IMAGE_TEXT
    #define QT_NO_INPUTDIALOG
    #define QT_NO_PRINTDIALOG
    #define QT_NO_PROGRESSDIALOG
    #define QT_NO_SEMIMODAL
    #define QT_NO_SIZEGRIP
    #define QT_NO_SPLITTER
    #define QT_NO_WORKSPACE
    #define QT_NO_DOM
    #define QT_NO_EFFECTS
    #define QT_NO_TRANSFORMATIONS
    #define QT_NO_QMEMORYFILE
    #undef QT_USE_MALLOC_FOR_NEW

  2. Make a symbolic link for src/tools/qconfig-pmea.h into the include directory:
    % ln -s src/tools/qconfig-pmea.h include/

Modify and Run the Build Script

The build script below is an example of how to build Qt Embedded that can be modified for your local system.

#!/bin/sh

export QTEDIR=`pwd`/qt-2.3.10
export QTDIR=$QTEDIR

cd $QTEDIR

./configure \
-shared \
-xplatform linux-x86-g++ \
-qconfig pmea \
-qvfb \
-system-jpeg \
-qt-libpng \
-depths 16 \
-keypad-mode \
-debug

make

Relocate the Target Library and Header Files (optional)

The CDC build system can use the target library and header files as they are in the Qt Embedded build hierarchy, or you can relocate just the library and header files to a target directory.

Here's an example of how to do this:

#!/bin/sh

export QTDIR=`pwd`/qt-2.3.10
export TARGETDIR=`pwd`/target

mkdir -p $TARGETDIR/lib
cp -RLf $QTDIR/lib/* $TARGETDIR/lib

mkdir -p $TARGETDIR/include
cp -RLf $QTDIR/include/* $TARGETDIR/include

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