在loongson的1B板上移植MiniGUI-3.0.12流水账
环境:mips Ubuntu-10.4 gcc-3.4.6-2f(mipsel-linux)
首先,在minigui官网下载安装包http://www.minigui.org/zhcn/download/
freetype-2.3.9-fm20100818.tar.gz minigui字体引擎
jpegsrc.v7.tar.gz 显示jpeg的库
libmgplus-1.2.4.tar.gz 增强功能
zlib-1.2.2.tar.gz 数据压缩函数库
libpng-1.2.37.tar.gz
libminigui.gpl-3.0.12.tar.gz
minigui-res-be-3.0.12.tar.gz minigui用到的资源
mg-sample-3.0.12.tar.gz
依赖关系:
libpng (zlib);
libmgplus(libminigui)
mg-samples(libminigui,libmgplus)
在ubuntu中自己任意选定一个目录放置安装包,然后解压
tar xvf ***.tar.gz
编译jpeg
[root@llocalhost] CC=mipsel-linux-gcc \
CPP=mipsel-linux-cpp \
LD=mispel-linux-ld \
AS=mipsel-linux-as \
AR=mipsel-linux-ar \
ANTLIB=mipsel-linux-antlib \
STRIP=mipsel-linux-strip \
./configure --prefix=/usr/local/minigui --host=mipsel-linux --target=mispel-linux
[root@localhost] make
[root@localhost] make install
编译freetype
[root@llocalhost] CC=mipsel-linux-gcc \
CPP=mipsel-linux-cpp \
LD=mispel-linux-ld \
AS=mipsel-linux-as \
AR=mipsel-linux-ar \
ANTLIB=mipsel-linux-antlib \
STRIP=mipsel-linux-strip \
./configure --prefix=/usr/local/minigui --host=mipsel-linux --target=mispel-linux
[root@localhost] make
[root@localhost] make install
编译zlib
[root@llocalhost] CC=mipsel-linux-gcc \
CPP=mipsel-linux-cpp \
LD=mispel-linux-ld \
AS=mipsel-linux-as \
AR=mipsel-linux-ar \
./configure --prefix=/usr/local/minigui --shared
[root@localhost] make
[root@localhost] make install
编译png
[root@llocalhost] cp scripts/makefile.linux Makefile
修改Makefile
AR_RC=ar rc
CC=cc
MKDIR_P=mkdir -p
LN_SF=ln -sf
RANLIB=ranlib
改为
AR_RC=mipsel-linux-ar rc
CC=mipsel-linux-gcc
MKDIR_P=mkdir -p
LN_SF=ln -sf
RANLIB=mipsel-linux-ranlib
prefix=/usr/local
改为
prefix=/usr/local/minigui
修改zlib库路径
# Where the zlib library and include files are located.
#ZLIBLIB=/usr/local/lib
#ZLIBINC=/usr/local/include
ZLIBLIB=$(prefix)/lib
ZLIBINC=$(prefix)/include
[root@localhost] make
[root@localhost] make install
编译minigui-res
[root@llocalhost] CC=mipsel-linux-gcc \
CPP=mipsel-linux-cpp \
LD=mispel-linux-ld \
AS=mipsel-linux-as \
AR=mipsel-linux-ar \
ANTLIB=mipsel-linux-antlib \
STRIP=mipsel-linux-strip \
./configure --prefix=/usr/local/minigui --host=mipsel-linux --target=mispel-linux
[root@localhost] make
[root@localhost] make install
编译libminigui
[root@llocalhost] CC=mipsel-linux-gcc \
CPP=mipsel-linux-cpp \
LD=mispel-linux-ld \
AS=mipsel-linux-as \
AR=mipsel-linux-ar \
CFLAGS=”-I/usr/local/minigui/include -I/opt/gcc-3.4.6-2f/i486-pc-linux-gun/mipsel-linux/include”\
CPPFLAGS=”-g -I/usr/local/minigui/include -I/opt/gcc-3.4.6-2f/i486-pc-linux-gun/mipsel-linux/include”\
CXXFLAGS=”-g -I/usr/local/minigui/include -I/opt/gcc-3.4.6-2f/i486-pc-linux-gun/mipsel-linux/include”\
./configure --prefix=/usr/local/minigui --host=mipsel-linux --target=mispel-linux --with-osname=linux --with-stype=classic --with-targetname=fbcon --enable-autoial --enable-rbf16 --disable-vbfsupport
[root@localhost] make
[root@localhost] make install
遇到错误提示‘asm’时
去掉/src/newgal/pcxvfb/Makefile中的oldincludedir=/usr/local
以及INCLUDES路径中的“-I/usr/local”即可
编译libmgplus
[root@llocalhost] CC=mipsel-linux-gcc \
CPP=mipsel-linux-cpp \
LD=mispel-linux-ld \
AS=mipsel-linux-as \
AR=mipsel-linux-ar \
ANTLIB=mipsel-linux-antlib \
STRIP=mipsel-linux-strip \
./configure --prefix=/usr/local/minigui --host=mipsel-linux --target=mispel-linux
[root@localhost] make
[root@localhost] make install
提示no minigui package时
export PKG_CONFIG_PATH=/usr/local/minigui/lib/pkconfig
编译mg-sample
[root@llocalhost] CC=mipsel-linux-gcc \
CPP=mipsel-linux-cpp \
LD=mispel-linux-ld \
AS=mipsel-linux-as \
AR=mipsel-linux-ar \
CFLAGS=”-I/usr/local/minigui/include -I/opt/gcc-3.4.6-2f/i486-pc-linux-gun/mipsel-linux/include”\
CPPFLAGS=”-g -I/usr/local/minigui/include -I/opt/gcc-3.4.6-2f/i486-pc-linux-gun/mipsel-linux/include”\
CXXFLAGS=”-g -I/usr/local/minigui/include -I/opt/gcc-3.4.6-2f/i486-pc-linux-gun/mipsel-linux/include”\
./configure --prefix=/usr/local/minigui --host=mipsel-linux --target=mispel-linux
[root@localhost] make
出现提示watch.c error:‘usec’undeclared
修改watch.c 中关于usec的定义为“suseconds_t usec”
编译好了就把/usr/local/minigui下的文件拷贝到开发板上的对应目录usr/local/minigui/;
查看自己应用需要的库文件mipsel-linux-readef -d helloworld,把这些库文件拷贝到开发板的libm目录下;
eg:运行helloworld时。要把需要的库文件libdl.so.2/libm.so.6/libc.so.6/libc.so.6/libpthread.so.0等拷贝到开发板的lib目录下;
另外需要注意的是:在minigui/etc下的MiniGUI.cfg必须要与所运行的程序helloworld放到板子上的同一个目录中;
修改MiniGUI.cfg配置:
主要gal_engine=pc_xvfb改为gal_engine=fbcon分辨率根据自己屏幕的分辨率设置(480*272);
ial_engine=pc_xvfb改为ial_engine=dummy;
[fbcon]里面的默认分辨率设置为自己板子的分辨率;
在板子端“./helloworld”即可运行。