MiniGUI核心库自动编译脚本

2013-01-17 由 创建在标签 开发

前一段时间整理了一下MiniGUI的编译,写了一个自动编译的脚本,把所有的环境变量都添加在脚本中,免去配置的痛苦,只需要更改相应的环境变量配置即可。

脚本如下:

#!/bin/sh
# Author : sgbihu.com
# Create date: 2013-01-17
# Function: compile the minigui lib
#
#

CURPATH=$PWD
# The complie path
MINIGUIROOTDIR=/home/linux/minigui

# Compile env
export CC=arm-linux-gcc
export CXX=arm-linux-g++
export LD=arm-linux-ld
export AS=arm-linux-as
export AR=arm-linux-ar
export CFLAGS="-I/usr/local/minigui/include"
export CPPFLAGS="-g -I/usr/local/minigui/include"
export CXXFLAGS="-g -I/usr/local/minigui/include"
export LIBS="-L/usr/local/minigui/lib"
export STRIP=arm-linux-strip

# The path you want to install
INSTALLPATH="/usr/local/minigui"
# The crosstool's include, Now only used by miniGUI Core lib.
CROSSCOMPILEINCLUDE="/opt/crosstool/arm-linux/gcc-3.4.4-glibc-2.3.5/arm-linux/arm-linux/include"
# The Compile devices
HOST=arm-linux
BUILD=i386-linux
TARGET=arm-linux

cd $MINIGUIROOTDIR

# Zlib
cd ./zlib-1.2.6
./configure --prefix=$INSTALLPATH --shared
make
make install
#PNG
cd ../libpng-1.5.8
./configure --prefix=$INSTALLPATH --includedir=$INSTALLPATH/include --build=$BUILD --host=$HOST --target=$TARGET

make
make install

#JEPG
cd ../jpeg-8c

./configure --prefix=$INSTALLPATH --build=$BUILD --host=$HOST --target=$TARGET --enable-shared
make
make install

# FREE TYPE
cd ../freetype-1.3.1

export ac_cv_sizeof_int=4
export ac_cv_sizeof_long=4
./configure --prefix=$INSTALLPATH --build=$BUILD --host=$HOST --target=$TARGET --enable-static

unset ac_cv_sizeof_int
unset ac_cv_sizeof_long
make
make install

# MiniGUI resource
cd ../minigui-res-be-3.0.12
./configure --prefix=$INSTALLPATH
make
make install

# MiniGUI Core Lib
cd ../libminigui-gpl-3.0.12
./configure --prefix=$INSTALLPATH --build=$BUILD --host=$HOST --target=$TARGET --with-osname=linux --with-style=classic \
            --with-targetname=fbcon --enable-autoial --enable-rbf16 --disable-vbfsupport --oldincludedir=$CROSSCOMPILEINCLUDE

make
make install

# Strip
$STRIP $INSTALLPATH/lib/*

在执行脚本中还是会遇到错误,需要改几个Makefile的生成模板。Makefile.in和Makefile.am。同时需要注释掉一些测试程序的编译。注意点如下:

freetype库:在Makefile.in中去掉“all:”后的变量“tttest”,注释掉“install:”下的第二行: $(FTTESTDIR); $(MAKE) –f$(MAKEFILE) install。

minigui核心库:所有目录下的Makefile.in和Makefile.am都有一个/usr/include的绝对路径,将这个路径替换成$(oldincludedir),执行这个脚本即可编译minigui的核心库。

最后编译一个例子程序,然后在你的开发板上运行吧!

标签:, ,

无评论

发表评论