编译基于DirectFB的Phoneme(Advance)
编译基于DirectFB的Phoneme(Advance)
转载时请注明出处和作者联系方式
作者联系方式:李先静 <xianjimli at hotmail dot com>
Phoneme其实就是J2ME,SUN公司虽然把JAVA的实现开源了,但仍然保留JAVA这个名字,所以出于法律上的考虑,开源的J2ME实现改名为phoneme。phoneme有两个版本,一个对硬件要求较低,功能也较弱,适用于一般的feature phone,取名为phoneME Feature。 另一个对硬件要求较高,功能更强大,适用于一般的smart phone,取名为phoneME Advanced。
考虑到我们的硬件配置,我决定玩玩phoneME Advanced。从https://phoneme.dev. java.net下载了phoneme_advanced-mr2-dev-src-b21-04_may_2007.zip。浏览了一下源代码,发现里面有基于DirectFB的实现,真是太好了。试了一下,编译也比较简单:
-
编译安装DirectFB,为了测试方便,我们使用基于SDL的DirectFB而不是fbdev。
tar zxf DirectFB-1.0.0.tar.gz
cd DirectFB-1.0.0
./configure –enable-sdl
make;make install
-
安装JDK(使用GCC编译用点问题)。
./j2sdk-1_4_2_15-linux-i586.bin
mv j2sdk1.4.2_15 /usr/share
-
解包。
unzip phoneme_advanced-mr2-dev-src-b21-04_may_2007.zip
cd phoneme_advanced_mr2
-
修改directfbapp_export.c,支持SDL显示。
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
- 编译之前先设置一些环境变量,为了方便把它放到env.sh文件里。
#!/bin/bash
export PREFIX=/usr/local
export JDK_DIR=/usr/share/j2sdk1.4.2_15
if [ "$1" = "" ]
then
echo "Usage: . env.sh ARCH(i386|arm)"
return;
fi
export ARCH="$1"
export CPU=$ARCH
if [ "$ARCH" = "arm" ]
then
export CPU_ALIAS="arm"
else
export CPU_ALIAS="x86"
fi
export DIRECTFB_INSTALL_DIR=$PREFIX
export PCSL_PLATFORM=linux_"$ARCH"_gcc
export PATH=$JDK_DIR/bin:$PATH
export JDK_HOME=$JDK_DIR
export MEHOME=$PWD
export PCSL_OUTPUT_DIR=$MEHOME/pcsl/output
export CDC_DIR=$MEHOME/cdc
export CDC_DIST_DIR=$CDC_DIR/build/linux-$CPU_ALIAS-generic/
export TOOLS_DIR=$MEHOME/tools
export CLDC_DIST_DIR=$CDC_DIST_DIR
运行该脚本: . evn.sh i386
-
编译,为了方便我们把做放一个脚本文件build.sh中。
#!/bin/bash
cd $MEHOME/pcsl
make clean
make NETWORK_MODULE=bsd/generic
cd $MEHOME
cd $CDC_DIST_DIR
make clean
make USE_MIDP=true CVM_DEBUG=true USE_DIRECTFB=true USE_QT_FB=false
cd $MEHOME
运行该脚本:./build.sh
(如果编译时有问题,可能需要安装xorg-x11-deprecated 软件包)
-
安装,为了方便我们把做放一个脚本文件install.sh中。
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
编译ARM版的过程类似,只是要修改几个Makefile,让它可以找到交叉编译的工具链就可以了。
不过基于DirectFB的实现,还很不完善,键值映射,笔点支持,中文显示和输入法等要自己去实现或者修改。但由于工作上的变动,暂时没有时间去玩这个,以后再补充吧。
~~end~~