移植平台:
ubuntu:14.04 开发板:s5pv210(A8) Minigui版本:3.0.12
-----------------------------------------------------
以下软件是开发板正常运行的必须安装包,在MiniGui官网可以下载 http://www.minigui.org/zhcn/【已放在嵌入式软件组资料共享文件夹】
-----------------------------------------------------
├── freetype-2.3.9-fm20100818.tar.gz
├── jpegsrc.v7.tar.gz
├── libmgplus-1.2.4.tar.gz
├── libminigui-gpl-3.0.12.tar.gz
├── libpng-1.2.37.tar.gz
├── mg-samples-3.0.12.tar.gz
├── minigui-res-be-3.0.12.tar.gz
└── zlib-1.2.2.tar.gz
依赖关系:
libpng (zlib);
libmgplus(libminigui)
mg-samples(libminigui,libmgplus)
----------------------------------------------------------------------------------------
PS:本教程的安装目录为 /opt/minigui/arm/cross 安装包都放在 /opt/minigui/arm
在安装之前,确保ubuntu安装了gawk、automake、autoconf、m4、g++等
在其他平台移植也适用,把交叉工具链修改对应的就行。
----------------------------------------------------------------------------------------
-----------------------------------------------------
1.编译Freetype库:【指定交叉工具链,指定安装地址】
-----------------------------------------------------
(1)./configure --host=arm-linux --enable-static --prefix=/opt/minigui/arm/cross
(2)make
(3)make install
【若出错,没有internal,在对应报错的路径自行创建 internal文件夹 】
-----------------------------------------------------
2.编译jpeg库:【指定交叉工具链,指定安装地址】
-----------------------------------------------------
(1)CXX=arm-linux-g++ LD=arm-linux-ld AS=arm-linux-as AR=arm-linux-ar ./configure --prefix=/opt/minigui/arm/cross --build=i386-linux --host=arm-linux --target=arm-linux --enable-shared
(2)make
(3)make install
-----------------------------------------------------
3.编译zlib库:【先安装zlib,因为libpng依赖zlib,指定交叉工具链,指定安装地址】
-----------------------------------------------------
(1)CC=arm-linux-gcc CXX=arm-linux-g++ LD=arm-linux-ld AS=arm-linux-as AR=arm-linux-ar ./configure -prefix=/opt/minigui/arm/cross --shared
(2)make
(3)make install
-----------------------------------------------------
4.编译png库:【指定交叉工具链,指定安装地址】
-----------------------------------------------------
(1)export LDFLAGS="-L/opt/minigui/arm/cross/lib"
(2)export CPPFLAGS="-I/opt/minigui/arm/cross/include"
(3)./configure --prefix=/opt/minigui/arm/cross --build=i386-linux --host=arm-linux --target=arm-linux
(4)make
(5)make install
-----------------------------------------------------
5.编译libmgplus-1.2.4库:【指定交叉工具链,指定安装地址】
-----------------------------------------------------
(1)./configure --target=arm-unknown-linux --host=arm-unknown-linux --prefix=/opt/minigui/arm/cross CC=arm-linux-gcc CPP=arm-linux-cpp CXX=arm-linux-g++ LD=arm-linux-ld AR=arm-linux-ar RANLIB=arm-linux-ranlib STRIP=arm-none-linux-gnueabi-strip
(2)make
(3)make install
【若出错:
configure: WARNING: using cross tools not prefixed with host triplet
checking pkg-config is at least version 0.9.0... yes
checking for MINIGUI... configure: error: Package requirements (minigui >= 3.0.10) were not met:
No package 'minigui' found
Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.
Alternatively, you may set the environment variables MINIGUI_CFLAGS
and MINIGUI_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.
【解决办法】
export PKG_CONFIG_PATH=/opt/minigui/arm/cross/lib/pkgconfig/
继续make
make install
】
-----------------------------------------------------
6.编译资源库minigui-res-be-3.0.12:【指定交叉工具链,指定安装地址】
-----------------------------------------------------
(1)CC=arm-linux-gcc CXX=arm-linux-g++ LD=arm-linux-ld AS=arm-linux-as AR=arm-linux-ar ./configure --prefix=/opt/minigui/arm/cross
(2)make
(3)make install
-----------------------------------------------------
7.编译核心库libminigui-gpl-3.0.12:【指定交叉工具链,指定安装地址】
-----------------------------------------------------
(1)CC=arm-linux-gcc CXX=arm-linux-g++ LD=arm-linux-ld AS=arm-linux-as AR=arm-linux-ar CFLAGS="-I/opt/minigui/arm/cross/include -I/usr/local/arm/arm-2009q3/arm-none-linux-gnueabi/include " CPPFLAGS="-g -I/opt/minigui/arm/cross/include -I/usr/local/arm/arm-2009q3/arm-none-linux-gnueabi/include " CXXFLAGS="-g -I/opt/minigui/arm/cross/include -I/usr/local/arm/arm-2009q3/arm-none-linux-gnueabi/include " ./configure --prefix=/opt/minigui/arm/cross --host=arm-linux --target=arm-linux --build=i386-linux --with-osname=linux --with-targetname=fbcon --enable-autoial --disable-vbfsupport --enable-tslibial --disable-screensaver --disable-splash --enable-procs
(2)【
vim src/newgal/pcxvfb/Makefile
修改194行,将/usr/include去掉:
INCLUDES = -I$(abs_top_srcdir)/src/include -I$(abs_top_srcdir)/include \
-I$(abs_top_srcdir)/src/newgal/ -I/usr/include/
否则编译pcxvfb.c将出错
】
(3)make
(4)make install
-----------------------------------------------------
8.编译例程mg-samples-3.0.12:【指定链接动态库】
-----------------------------------------------------
./configure CC=arm-linux-gcc CXX=arm-linux-g++ LD=arm-linux-ld AS=arm-linux-as AR=arm-linux-ar CPPFLAGS=-I/opt/minigui/arm/cross/include prefix=/opt/minigui/arm/cross PKG_CONFIG_PATH=/opt/minigui/arm/cross/lib/pkgconfig
make
make install
线程版编译程序:
(1)arm-linux-gcc -o helloworld helloworld.c -L/opt/minigui/arm/cross/lib -lminigui_ths -ljpeg -lm -lminigui_ths -ldl -lpng -lpng12 -lts -lz -I/opt/minigui/arm/cross/include
进程版,在mg-samples-3.0.12[mginit]文件夹编译得到例程的mginit可执行文件:
(1)arm-linux-gcc mginit.c taskbar.c desktop.c -o mginit -I/opt/minigui/arm/cross/include -L/opt/minigui/arm/cross/lib -lminigui_procs -lpng -ljpeg -lz -lm -lts
(2)arm-linux-gcc -o helloworld helloworld.c -L/opt/minigui/arm/cross/lib -ljpeg -lm -lminigui_procs -ldl -lpng -lpng12 -lts -lz -I/opt/minigui/arm/cross/include
----------------------------------------------交叉编译安装部分完成,下面是移植到开发板----------------------------------------------------------------
-----------------------------------------------------
9.拷贝全部安装文件到开发板 /usr/local【自行设定】
-----------------------------------------------------
(1)cp /opt/minigui/arm/cross/* 全部复制到 /usr/local 下
(2)export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH 【设置minigui的lib的环境变量,让程序正常运行】
-----------------------------------------------------
9.修改MiniGui的配置环境
-----------------------------------------------------
(1)修改开发板上minigui配置文件vi /usr/local/etc/MiniGUI.cfg
把其中的system段修改成如下:
[system]
# GAL engine and default options
gal_engine=fbcon
defaultmode=240x320-32bpp 【32bpp 根据开发板的显示屏的分辨率设定,网上的基本是16bpp。这里卡住了差不多2天】
# IAL engine
ial_engine=tslib //使用触摸功能
mdev=/dev/event0 //这里的event0可能创建在 /dev/input/event0 自行查看
mtype=IMPS2
[fbcon]
defaultmode=240x320-32bpp 【32bpp 必须是32bpp,不然显示不正常,触摸不正常】
-----------------------------------------------------
10.配置tslib库(触摸)
-----------------------------------------------------
(1)移植Tslib到开发板,本教程是放在/usr/local/tslib
(2)配置tslib环境:
export TSLIB_ROOT=/usr/local/tslib
export TSLIB_TSDEVICE=/dev/event0
export TSLIB_CONFFILE=$TSLIB_ROOT/etc/ts.conf
export TSLIB_PLUGINDIR=$TSLIB_ROOT/lib/ts
export TSLIB_CALIBFILE=/etc/pointercal_a70
export TSLIB_CONSOLEDEVICE=none
export TSLIB_FBDEVICE=/dev/fb0
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$TSLIB_ROOT/lib
(3)修改/usr/local/tslib/etc/ts.conf 中的内容应该是:
module_raw input
module pthres pmin=1
module variance delta=30
module dejitter delta=100
module linear
-----------------------------------------------------
11.校准触摸屏
-----------------------------------------------------
(1)运行/usr/local/tslib/bin/ts_calibrate
-----------------------------------------------------
12.最后把之前编译好的helloworld 拷贝到开发板运行
-----------------------------------------------------
(1)最后把helloworld拷贝到开发板中运行。