构建E680的开发环境

Build native application on E680

Motorola E680/E680i mobile is based on Montavista Hardhat Linux
and Trolltech Qt embedded. All application on E680/E680i are based
on EZX libraries not Qt embedded directly. Motorola doesn't release
the SDK of EZX libraries, So if wanna develop applications for
E680/E680i, We must build a development envorienment from scratch.

With dynamic link technique, Linux can replace the library that the
applications depended if have the same function symbol in ELF format.
Imagine that we write a dynamic library with so name libm, and
keep the sin() function's implementation empty. If a application is
linked to our libm when it is compiled, when it run, library loader
of linux will search library path to load libm. Even this application
is linked to our dirty libm when it is compiled, but when it run with
the correct libm, It will get the correct result. Thus we can build
the dirty libezx libraries with the same function symbols and empty
implementation to build the application, when this application run
on E680/E680i, it will work in the abstract.

Fortunately, Liuto from CCMOVE forum provide a part of EZX SDK for
Motorola A760/A768. I think that Motorola's EZX libraries for
E680/E680i is compatible with A768/A780 in function declaration. So
we can use that header files for A760/A768 and libezx libraries on
E680 system to build the native application for E680/E680i. And
I can run a simple application based with EZX libraries on E680
successfully.

The particular steps are followed:
1. Build the qt-x11-free-2.3.6 to get the moc and uic tools for qt.
2. Build the gcc cross compilers for xscale with VFP patched.
3. Use the qt header files and Other libraries headers in ezx libraries
provided by liuto as our qt header files for cross building.
4. Copy the libezx libraries from E680 system directories
/usr/lib/ezx/lib/libezx* and /usr/lib/libezx* as our qt and EZX
libraries for building.
5. Install tmake tools to product the Makefile for our application.
After install tmake, we must modify the template file to support build
application for E680. I copied the template file from directory
"qws/linux-arm-g++" to "qws/linux-e680-g++" and modifed the tmake.conf
line 54.
"TMAKE_LIBS_QT_THREAD = -lqte-mt-xscale-r -lezxappbase-xscale-r -lezxappsdk-xscale-r -lezxjpeg-xscale-r -lezxtapi-xscale-r -lezxfunlight-xscale-r"
instead of "TMAKE_LIBS_QT_THREAD = -lqte-mt"
This step is only expediently product the correct LDFLAGS to link EZX libraries.

6. Set up the building envorienment. Here is my .bashrc in my home
directory:
PATH=/usr/local/arm/bin:/home/kerberos/e680/gnu_toolchain/qt-x11-2.3.6/bin:$PATH
QTDIR=/home/kerberos/e680/gnu_toolchain/qt-embedded-2.3.6
TMAKEPATH=/home/kerberos/e680/tmake/lib/qws/linux-e680-g++
export PATH QTDIR TMAKEPATH
Finally, we make the envorienment variables effect use command . ~/.bashrc

7. Here is my test program:
test.pro:

TEMPLATE = app
CONFIG += qt thread release warn_off
TARGET = testezx

HEADERS +=

SOURCES += test.cpp
LIBS +=



test.cpp:
[CODE]
#include <ZApplication.h>
#include <ZMainWidget.h>
#include <ZMultiLineEdit.h>
#include <qlineedit.h>
#include <ZScrollView.h>
#include <qframe.h>
#include <ZPushButton.h>
#include <qpushbutton.h>

int main (int argc, char** argv)
{
        QWidget* cst;
        ZScrollView* sv;
        ZMultiLineEdit* ml;

        ZApplication app (argc, argv);
        ZMainWidget* w = new ZMainWidget (true,0);
        sv = new ZScrollView (w, "sv");
        w->setContentWidget (sv);
        sv->show ();

        /*
        QPushButton* bt = new QPushButton ("Hello E680!", sv->viewport());
        sv->addChild (bt, 0, 0, true);
        bt->show ();
        */

        ml = new ZMultiLineEdit (sv->viewport(), true, 6);
        sv->addChild (ml, 0, 0, true);
        ml->show ();

        cst = w->getCSTWidget();

        QPushButton* mybt = new QPushButton ("quit button", cst);
        mybt->show();

        QObject::connect ( mybt, SIGNAL(click()), qApp, SLOT (slotQuickQuit()) );

        app.setMainWidget (w);
        w->showWithInputMethod(IMID_ENGLISH_KB);
#160;       app.showMainWidget (w);
        return app.exec();
}

[/CODE]
8. Build the demo sources use the command: tmake test.pro > Makefile; make
If success, your will get the testezx program.

9. Copy the testezx program to E680 and use the command: . /home/native/.profile
to setup the runtime envorienment for our program. Then run it, a simple
window will apperence on E680 with English soft keyboard and a multiline edit
control.

Good lucky everyone :).


Resources:
1. qt-x11-free-2.3.6.tar.gz
2. EZX.rar
3. tmake-1.8.5
4. xscale-gcc-vfp-3.3.tar.gz
5. E680 :)

I havn't any space to host that files :(, so I can't provide the download link.
 
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值