请尊重著作人的劳动果实,引用请说明出处及原创作者
联系方式:aishen944-163.com
谢谢!
对于我这个不满足现状的人来说,如果能够用现有的主流的开源的GUI来做嵌入式开发,真的很有
成就感,想用minigui吧,结果还要买许可证,晕, 这段日子在经历了失败失败再失败的基础上
终于在gtk+在arm平台上的移植迈出了重要一步,现把心得体会及编译过程写出来,这些只是针对我的机器上的编译环境设置的,大家根据自己的情况可以修改:
1, 源码版本,注意最好下载和这些版本号一致的软件,否则不能保证编译能够顺利通过:
a, gtk+基本的依赖包,注意这些包必须首先编译并安装进你的临时安装目录
DirectFB-1.0.0 expat-2.0.0 fontconfig-2.4.2 jpeg-6b freetype-2.3.4
libpng-1.2.16 tiff-3.8.2 zlib-1.2.3
b, gtk+核心包
atk-1.19.3 cairo-1.4.6 glib-2.12.9 gtk+-2.10.13 pango-1.16.4
注意不要使用gtk+-2.10.13之前的版本,那些版本对directfb的支持不是很好
2, 编译环境的设置
export ARM_HOME=/home/qiang/arm_dev
export PATH=$PATH:/opt/crosstool/3.4.5/bin:$ARM_HOME/softs/pkg_tools
export TARGET_PREFIX=$ARM_HOME/arm-linux-prefix
export ARM_CFLAGS="-I$TARGET_PREFIX/usr/include"
export ARM_LDFLAGS="-L$TARGET_PREFIX/lib -L$TARGET_PREFIX/usr/lib"
export C_INCLUDE_PATH=$C_INCLUDE_PATH:$TARGET_PREFIX/usr/include
export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig
export ARM_ROOT=$ARM_HOME/rootfs
export TARGET=arm-linux
3, 现给出自己的编译脚本,可能脚本自己写的太随意了,但思路还算清晰,这些脚本把编译好
的软件打成了许多包:
a, 编译用的脚本模板文件:
# Set the build system vars here
BD_SRC_DIR="${ARM_HOME}/softs/sources/xxx"
BD_PACKAGE_NAME=
BD_ROOT="/tmp/${BD_PACKAGE_NAME}"
BD_PREFIX="/usr"
BD_DEST_DIR="${ARM_HOME}/arm_pkgs"
BD_CONFIG_OPTIONS=
BD_MAKE_OPTIONS=
BD_MAKE_INSTALL_OPTIONS=
BD_MAKE_CLEAN_OPTIONS=
# Set the packages build parted
BD_PACKAGE_DEV_CONTENT=
BD_PACKAGE_DOC_CONTENT=
BD_PACKAGE_LOCALE_CONTENT=
BD_PACKAGE_BIN_CONTENT=
# Set the strip variables
BD_STRIP_OPTIONS="--strip-debug"
BD_STRIP_CONTENT=
function bd_info() {
echo "#####################################################################"
echo "#$1"
echo "#####################################################################"
}
function check_error() {
if [ ! "$?" = "0" ]; then
echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
echo "! Build error at: `date`"
echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
exit 1
fi
}
# Check need vars
if [ -z "${BD_SRC_DIR}" ]; then
echo "Must set the /${BD_SRC_DIR}"
exit 1
elif [ -z "${BD_PACKAGE_NAME}" ]; then
echo "Must set the /${BD_PACKAGE_NAME}"
exit 1
elif [ -z "${BD_DEST_DIR}" ]; then
echo "Must set the /${BD_DEST_DIR}"
exit 1
elif [ -z "${BD_ROOT}" ]; then
echo "Must set the /${BD_ROOT}"
exit 1
elif [ -z "${BD_PACKAGE_DEV_CONTENT}" ] && [ -z "${BD_PACKAGE_DOC_CONTENT}" ] && [ -z "${BD_PACKAGE_BIN_CONTENT}" ]; then
echo "Must set one of the package conent of /${BD_PACKAGE_DEV_CONTENT},/${BD_PACKAGE_DOC_CONTENT}, /${BD_PACKAGE_BIN_CONTENT}"
exit 1
fi
# Begin to configure if configure options length is not zero
cd $BD_SRC_DIR
if [ ! "${BD_CONFIG_OPTIONS}" = "NO-CONFIG" ]; then
bd_info "Begin to configure ..."
./configure --prefix=${BD_PREFIX} ${BD_CONFIG_OPTIONS}
check_error
fi
# Begin to make
if [ ! "${BD_MAKE_OPTIONS}" = "NO-MAKE" ]; then
bd_info "Begin to make ..."
make ${BD_MAKE_OPTIONS}
check_error
fi
# Begin to make install
rm -fr "${BD_ROOT}"
mkdir -p "${BD_ROOT}"
check_error
if [ ! "${BD_MAKE_INSTALL_OPTIONS}" = "NO-INSTALL" ]; then
bd_info "Begin to make install ..."
make $BD_MAKE_INSTALL_OPTIONS install
check_error
fi
# Begin to clean
if [ ! "${BD_MAKE_CLEAN_OPTIONS}" = "NO-CLEAN" ]; then
bd_info "Begin to make clean ..."
make $BD_MAKE_CLEAN_OPTIONS clean
check_error
fi
# Begin to package
bd_info "Begin to make package ..."
if [ ! -d ${BD_DEST_DIR} ]; then
mkdir -p ${BD_DEST_DIR}
check_error
fi
cd $BD_ROOT
# Get package base directory path
pck_path_base="${BD_DEST_DIR}/${BD_PACKAGE_NAME}"
mkdir -p $pck_path_base
check_error
# Strip specialy symbols
if [ ! -z "$BD_STRIP_CONTENT" ]; then
echo "->Stip unneeded symbols..."
arm-linux-strip $BD_STRIP_OPTIONS $BD_STRIP_CONTENT
fi
# Compress and make packages
if [ ! -z "$BD_PACKAGE_DEV_CONTENT" ]; then
echo "->Build the develop package..."
tar -czvf ${pck_path_base}/${BD_PACKAGE_NAME}-dev_chenyq.arm.tgz ${BD_PACKAGE_DEV_CONTENT} -C / > /dev/null
check_error
fi
if [ ! -z "$BD_PACKAGE_DOC_CONTENT" ]; then
echo "->Build the document package..."
tar -czvf ${pck_path_base}/${BD_PACKAGE_NAME}-doc_chenyq.arm.tgz ${BD_PACKAGE_DOC_CONTENT} -C / > /dev/null
check_error
fi
if [ ! -z "$BD_PACKAGE_LOCALE_CONTENT" ]; then
echo "->Build the locales package..."
tar -czvf ${pck_path_base}/${BD_PACKAGE_NAME}-nls_chenyq.arm.tgz ${BD_PACKAGE_LOCALE_CONTENT} -C / > /dev/null
check_error
fi
if [ ! -z "$BD_PACKAGE_BIN_CONTENT" ]; then
echo "->Build the binary package..."
tar -czvf ${pck_path_base}/${BD_PACKAGE_NAME}_chenyq.arm.tgz ${BD_PACKAGE_BIN_CONTENT} -C / > /dev/null
check_error
fi
rm -fr ${BD_ROOT}
check_error
b, 编译zlib用的脚本
export CC="arm-linux-gcc"
export LDSHARED="arm-linux-gcc -shared -Wl,-soname,libz.so.1"
export AR="arm-linux-ar rc"
export RANLIB="arm-linux-ranlib"
export CPP="arm-linux-gcc -E"
# Set the build system vars here
BD_SRC_DIR="${ARM_HOME}/softs/sources/zlib-1.2.3"
BD_PACKAGE_NAME="zlib-1.2.3"
BD_ROOT="/tmp/${BD_PACKAGE_NAME}"
BD_PREFIX="/usr"
BD_DEST_DIR="${ARM_HOME}/arm_pkgs"
BD_CONFIG_OPTIONS="--shared"
BD_MAKE_OPTIONS=
BD_MAKE_INSTALL_OPTIONS="prefix=$BD_ROOT/usr"
BD_MAKE_CLEAN_OPTIONS=
# Set the packages build parted
BD_PACKAGE_DEV_CONTENT="usr/include"
BD_PACKAGE_DOC_CONTENT="usr/share/man"
BD_PACKAGE_BIN_CONTENT="usr/lib"
function bd_info() {
echo "#####################################################################"
echo "#$1"
echo "#####################################################################"
}
function check_error() {
if [ ! "$?" = "0" ]; then
echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
echo "! Build error at: `date`"
echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
exit 1
fi
}
# Check need vars
if [ -z "${BD_SRC_DIR}" ]; then
echo "Must set the /${BD_SRC_DIR}"
exit 1
elif [ -z "${BD_PACKAGE_NAME}" ]; then
echo "Must set the /${BD_PACKAGE_NAME}"
exit 1
elif [ -z "${BD_DEST_DIR}" ]; then
echo "Must set the /${BD_DEST_DIR}"
exit 1
elif [ -z "${BD_ROOT}" ]; then
echo "Must set the /${BD_ROOT}"
exit 1
elif [ -z "${BD_PACKAGE_DEV_CONTENT}" ] && [ -z "${BD_PACKAGE_DOC_CONTENT}" ] && [ -z "${BD_PACKAGE_BIN_CONTENT}" ]; then
echo "Must set one of the package conent of /${BD_PACKAGE_DEV_CONTENT},/${BD_PACKAGE_DOC_CONTENT}, /${BD_PACKAGE_BIN_CONTENT}"
exit 1
fi
# Begin to configure if configure options length is not zero
cd $BD_SRC_DIR
if [ ! "${BD_CONFIG_OPTIONS}" = "NO-CONFIG" ]; then
bd_info "Begin to configure ..."
./configure --prefix=${BD_PREFIX} ${BD_CONFIG_OPTIONS}
check_error
fi
# Begin to make
if [ ! "${BD_MAKE_OPTIONS}" = "NO-MAKE" ]; then
bd_info "Begin to make ..."
make ${BD_MAKE_OPTIONS}
check_error
fi
# Begin to make install
rm -fr "${BD_ROOT}"
mkdir -p "${BD_ROOT}"
check_error
if [ ! "${BD_MAKE_INSTALL_OPTIONS}" = "NO-INSTALL" ]; then
bd_info "Begin to make install ..."
make $BD_MAKE_INSTALL_OPTIONS install
check_error
fi
# Begin to clean
if [ ! "${BD_MAKE_CLEAN_OPTIONS}" = "NO-CLEAN" ]; then
bd_info "Begin to make clean ..."
make $BD_MAKE_CLEAN_OPTIONS clean
check_error
fi
# Begin to package
bd_info "Begin to make package ..."
if [ ! -d ${BD_DEST_DIR} ]; then
mkdir -p ${BD_DEST_DIR}
check_error
fi
cd $BD_ROOT
pck_path_base="${BD_DEST_DIR}/${BD_PACKAGE_NAME}"
mkdir -p $pck_path_base
check_error
if [ ! -z "$BD_PACKAGE_DEV_CONTENT" ]; then
echo "->Build the develop package..."
tar -czvf ${pck_path_base}/${BD_PACKAGE_NAME}-dev_chenyq.arm.tgz ${BD_PACKAGE_DEV_CONTENT} -C / > /dev/null
check_error
fi
if [ ! -z "$BD_PACKAGE_DOC_CONTENT" ]; then
echo "->Build the document package..."
tar -czvf ${pck_path_base}/${BD_PACKAGE_NAME}-doc_chenyq.arm.tgz ${BD_PACKAGE_DOC_CONTENT} -C / > /dev/null
check_error
fi
if [ ! -z "$BD_PACKAGE_BIN_CONTENT" ]; then
echo "->Build the binary package..."
tar -czvf ${pck_path_base}/${BD_PACKAGE_NAME}_chenyq.arm.tgz ${BD_PACKAGE_BIN_CONTENT} -C / > /dev/null
check_error
fi
rm -fr ${BD_ROOT}
check_error
c, 编译jpeg用的脚本
export CC="arm-linux-gcc"
export AR="arm-linux-gcc rc"
export CPP="arm-linux-gcc -E"
export AR2="arm-linux-ranlib"
# Set the build system vars here
BD_SRC_DIR="${ARM_HOME}/softs/sources/jpeg-6b"
BD_PACKAGE_NAME="jpeg-6b"
BD_ROOT="/tmp/${BD_PACKAGE_NAME}"
BD_PREFIX="/usr"
BD_DEST_DIR="${ARM_HOME}/arm_pkgs"
BD_CONFIG_OPTIONS="--build=HOST --target=arm-linux --enable-shared"
BD_MAKE_OPTIONS=
BD_MAKE_INSTALL_OPTIONS="prefix=$BD_ROOT/usr"
BD_MAKE_CLEAN_OPTIONS=
# Set the packages build parted
BD_PACKAGE_DEV_CONTENT="usr/include"
BD_PACKAGE_DOC_CONTENT="usr/man"
BD_PACKAGE_BIN_CONTENT="usr/bin usr/lib"
function bd_info() {
echo "#####################################################################"
echo "#$1"
echo "#####################################################################"
}
function check_error() {
if [ ! "$?" = "0" ]; then
echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
echo "! Build error at: `date`"
echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
exit 1
fi
}
# Check need vars
if [ -z "${BD_SRC_DIR}" ]; then
echo "Must set the /${BD_SRC_DIR}"
exit 1
elif [ -z "${BD_PACKAGE_NAME}" ]; then
echo "Must set the /${BD_PACKAGE_NAME}"
exit 1
elif [ -z "${BD_DEST_DIR}" ]; then
echo "Must set the /${BD_DEST_DIR}"
exit 1
elif [ -z "${BD_ROOT}" ]; then
echo "Must set the /${BD_ROOT}"
exit 1
elif [ -z "${BD_PACKAGE_DEV_CONTENT}" ] && [ -z "${BD_PACKAGE_DOC_CONTENT}" ] && [ -z "${BD_PACKAGE_BIN_CONTENT}" ]; then
echo "Must set one of the package conent of /${BD_PACKAGE_DEV_CONTENT},/${BD_PACKAGE_DOC_CONTENT}, /${BD_PACKAGE_BIN_CONTENT}"
exit 1
fi
# Begin to configure if configure options length is not zero
cd $BD_SRC_DIR
if [ ! "${BD_CONFIG_OPTIONS}" = "NO-CONFIG" ]; then
bd_info "Begin to configure ..."
./configure --prefix=${BD_PREFIX} ${BD_CONFIG_OPTIONS}
check_error
fi
# Begin to make
if [ ! "${BD_MAKE_OPTIONS}" = "NO-MAKE" ]; then
bd_info "Begin to make ..."
make ${BD_MAKE_OPTIONS}
check_error
fi
# Begin to make install
rm -fr "${BD_ROOT}"
mkdir -p "${BD_ROOT}"
check_error
if [ ! "${BD_MAKE_INSTALL_OPTIONS}" = "NO-INSTALL" ]; then
bd_info "Begin to make install ..."
destprefix=${BD_ROOT}/usr
mkdir -p "${destprefix}/include"
mkdir -p "${destprefix}/share"
mkdir -p "${destprefix}/man/man1"
mkdir -p "${destprefix}/bin"
mkdir -p "${destprefix}/lib"
make $BD_MAKE_INSTALL_OPTIONS install
check_error
fi
# Begin to clean
if [ ! "${BD_MAKE_CLEAN_OPTIONS}" = "NO-CLEAN" ]; then
bd_info "Begin to make clean ..."
make $BD_MAKE_CLEAN_OPTIONS clean
check_error
fi
# Begin to package
bd_info "Begin to make package ..."
if [ ! -d ${BD_DEST_DIR} ]; then
mkdir -p ${BD_DEST_DIR}
check_error
fi
cd $BD_ROOT
pck_path_base="${BD_DEST_DIR}/${BD_PACKAGE_NAME}"
mkdir -p $pck_path_base
check_error
if [ ! -z "$BD_PACKAGE_DEV_CONTENT" ]; then
echo "->Build the develop package..."
tar -czvf ${pck_path_base}/${BD_PACKAGE_NAME}-dev_chenyq.arm.tgz ${BD_PACKAGE_DEV_CONTENT} -C / > /dev/null
check_error
fi
if [ ! -z "$BD_PACKAGE_DOC_CONTENT" ]; then
echo "->Build the document package..."
tar -czvf ${pck_path_base}/${BD_PACKAGE_NAME}-doc_chenyq.arm.tgz ${BD_PACKAGE_DOC_CONTENT} -C / > /dev/null
check_error
fi
if [ ! -z "$BD_PACKAGE_BIN_CONTENT" ]; then
echo "->Build the binary package..."
tar -czvf ${pck_path_base}/${BD_PACKAGE_NAME}_chenyq.arm.tgz ${BD_PACKAGE_BIN_CONTENT} -C / > /dev/null
check_error
fi
rm -fr ${BD_ROOT}
check_error
d, 编译png用的脚本
export CFLAGS="$ARM_CFLAGS $CFLAGS"
export LDFLAGS="$ARM_LDFLAGS $LDFLAGS"
export PATH=$TARGET_PREFIX/usr/bin:$PATH
# Set the build system vars here
BD_SRC_DIR="${ARM_HOME}/softs/sources/libpng-1.2.16"
BD_PACKAGE_NAME="libpng-1.2.16"
BD_ROOT="/tmp/${BD_PACKAGE_NAME}"
BD_PREFIX="/usr"
BD_DEST_DIR="${ARM_HOME}/arm_pkgs"
BD_CONFIG_OPTIONS="--enable-shared --host=arm-linux"
BD_MAKE_OPTIONS=
BD_MAKE_INSTALL_OPTIONS="DESTDIR=$BD_ROOT"
BD_MAKE_CLEAN_OPTIONS=
# Set the packages build parted
BD_PACKAGE_DEV_CONTENT="usr/bin usr/lib/pkgconfig usr/include usr/lib/*.la* usr/lib/*.a*"
BD_PACKAGE_DOC_CONTENT="usr/share/man"
BD_PACKAGE_BIN_CONTENT="usr/lib/*.so*"
function bd_info() {
echo "#####################################################################"
echo "#$1"
echo "#####################################################################"
}
function check_error() {
if [ ! "$?" = "0" ]; then
echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
echo "! Build error at: `date`"
echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
exit 1
fi
}
# Check need vars
if [ -z "${BD_SRC_DIR}" ]; then
echo "Must set the /${BD_SRC_DIR}"
exit 1
elif [ -z "${BD_PACKAGE_NAME}" ]; then
echo "Must set the /${BD_PACKAGE_NAME}"
exit 1
elif [ -z "${BD_DEST_DIR}" ]; then
echo "Must set the /${BD_DEST_DIR}"
exit 1
elif [ -z "${BD_ROOT}" ]; then
echo "Must set the /${BD_ROOT}"
exit 1
elif [ -z "${BD_PACKAGE_DEV_CONTENT}" ] && [ -z "${BD_PACKAGE_DOC_CONTENT}" ] && [ -z "${BD_PACKAGE_BIN_CONTENT}" ]; then
echo "Must set one of the package conent of /${BD_PACKAGE_DEV_CONTENT},/${BD_PACKAGE_DOC_CONTENT}, /${BD_PACKAGE_BIN_CONTENT}"
exit 1
fi
# Begin to configure if configure options length is not zero
cd $BD_SRC_DIR
if [ ! "${BD_CONFIG_OPTIONS}" = "NO-CONFIG" ]; then
bd_info "Begin to configure ..."
./configure --prefix=${BD_PREFIX} ${BD_CONFIG_OPTIONS}
check_error
fi
# Begin to make
if [ ! "${BD_MAKE_OPTIONS}" = "NO-MAKE" ]; then
bd_info "Begin to make ..."
make ${BD_MAKE_OPTIONS}
check_error
fi
# Begin to make install
rm -fr "${BD_ROOT}"
mkdir -p "${BD_ROOT}"
check_error
if [ ! "${BD_MAKE_INSTALL_OPTIONS}" = "NO-INSTALL" ]; then
bd_info "Begin to make install ..."
make $BD_MAKE_INSTALL_OPTIONS install
check_error
fi
# Begin to clean
if [ ! "${BD_MAKE_CLEAN_OPTIONS}" = "NO-CLEAN" ]; then
bd_info "Begin to make clean ..."
make $BD_MAKE_CLEAN_OPTIONS clean
check_error
fi
# Begin to package
bd_info "Begin to make package ..."
if [ ! -d ${BD_DEST_DIR} ]; then
mkdir -p ${BD_DEST_DIR}
check_error
fi
cd $BD_ROOT
pck_path_base="${BD_DEST_DIR}/${BD_PACKAGE_NAME}"
mkdir -p $pck_path_base
check_error
if [ ! -z "$BD_PACKAGE_DEV_CONTENT" ]; then
echo "->Build the develop package..."
tar -czvf ${pck_path_base}/${BD_PACKAGE_NAME}-dev_chenyq.arm.tgz ${BD_PACKAGE_DEV_CONTENT} -C / > /dev/null
check_error
fi
if [ ! -z "$BD_PACKAGE_DOC_CONTENT" ]; then
echo "->Build the document package..."
tar -czvf ${pck_path_base}/${BD_PACKAGE_NAME}-doc_chenyq.arm.tgz ${BD_PACKAGE_DOC_CONTENT} -C / > /dev/null
check_error
fi
if [ ! -z "$BD_PACKAGE_BIN_CONTENT" ]; then
echo "->Build the binary package..."
tar -czvf ${pck_path_base}/${BD_PACKAGE_NAME}_chenyq.arm.tgz ${BD_PACKAGE_BIN_CONTENT} -C / > /dev/null
check_error
fi
rm -fr ${BD_ROOT}
check_error
e, 编译expat用的脚本
# Set the build system vars here
BD_SRC_DIR="${ARM_HOME}/softs/sources/expat-2.0.0"
BD_PACKAGE_NAME="expat-2.0.0"
BD_ROOT="/tmp/${BD_PACKAGE_NAME}"
BD_PREFIX="/usr"
BD_DEST_DIR="${ARM_HOME}/arm_pkgs"
BD_CONFIG_OPTIONS="--host=arm-linux"
BD_MAKE_OPTIONS=
BD_MAKE_INSTALL_OPTIONS="DESTDIR=$BD_ROOT"
BD_MAKE_CLEAN_OPTIONS=
# Set the packages build parted
BD_PACKAGE_DEV_CONTENT="usr/include usr/lib/*.la*"
BD_PACKAGE_DOC_CONTENT="usr/man"
BD_PACKAGE_LOCALE_CONTENT=
BD_PACKAGE_BIN_CONTENT="usr/bin usr/lib/*.so*"
function bd_info() {
echo "#####################################################################"
echo "#$1"
echo "#####################################################################"
}
function check_error() {
if [ ! "$?" = "0" ]; then
echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
echo "! Build error at: `date`"
echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
exit 1
fi
}
# Check need vars
if [ -z "${BD_SRC_DIR}" ]; then
echo "Must set the /${BD_SRC_DIR}"
exit 1
elif [ -z "${BD_PACKAGE_NAME}" ]; then
echo "Must set the /${BD_PACKAGE_NAME}"
exit 1
elif [ -z "${BD_DEST_DIR}" ]; then
echo "Must set the /${BD_DEST_DIR}"
exit 1
elif [ -z "${BD_ROOT}" ]; then
echo "Must set the /${BD_ROOT}"
exit 1
elif [ -z "${BD_PACKAGE_DEV_CONTENT}" ] && [ -z "${BD_PACKAGE_DOC_CONTENT}" ] && [ -z "${BD_PACKAGE_BIN_CONTENT}" ]; then
echo "Must set one of the package conent of /${BD_PACKAGE_DEV_CONTENT},/${BD_PACKAGE_DOC_CONTENT}, /${BD_PACKAGE_BIN_CONTENT}"
exit 1
fi
# Begin to configure if configure options length is not zero
cd $BD_SRC_DIR
if [ ! "${BD_CONFIG_OPTIONS}" = "NO-CONFIG" ]; then
bd_info "Begin to configure ..."
./configure --prefix=${BD_PREFIX} ${BD_CONFIG_OPTIONS}
check_error
fi
# Begin to make
if [ ! "${BD_MAKE_OPTIONS}" = "NO-MAKE" ]; then
bd_info "Begin to make ..."
make ${BD_MAKE_OPTIONS}
check_error
fi
# Begin to make install
rm -fr "${BD_ROOT}"
mkdir -p "${BD_ROOT}"
check_error
if [ ! "${BD_MAKE_INSTALL_OPTIONS}" = "NO-INSTALL" ]; then
bd_info "Begin to make install ..."
make $BD_MAKE_INSTALL_OPTIONS install
check_error
fi
# Begin to clean
if [ ! "${BD_MAKE_CLEAN_OPTIONS}" = "NO-CLEAN" ]; then
bd_info "Begin to make clean ..."
make $BD_MAKE_CLEAN_OPTIONS clean
check_error
fi
# Begin to package
bd_info "Begin to make package ..."
if [ ! -d ${BD_DEST_DIR} ]; then
mkdir -p ${BD_DEST_DIR}
check_error
fi
cd $BD_ROOT
pck_path_base="${BD_DEST_DIR}/${BD_PACKAGE_NAME}"
mkdir -p $pck_path_base
check_error
if [ ! -z "$BD_PACKAGE_DEV_CONTENT" ]; then
echo "->Build the develop package..."
tar -czvf ${pck_path_base}/${BD_PACKAGE_NAME}-dev_chenyq.arm.tgz ${BD_PACKAGE_DEV_CONTENT} -C / > /dev/null
check_error
fi
if [ ! -z "$BD_PACKAGE_DOC_CONTENT" ]; then
echo "->Build the document package..."
tar -czvf ${pck_path_base}/${BD_PACKAGE_NAME}-doc_chenyq.arm.tgz ${BD_PACKAGE_DOC_CONTENT} -C / > /dev/null
check_error
fi
if [ ! -z "$BD_PACKAGE_LOCALE_CONTENT" ]; then
echo "->Build the locales package..."
tar -czvf ${pck_path_base}/${BD_PACKAGE_NAME}-nls_chenyq.arm.tgz ${BD_PACKAGE_LOCALE_CONTENT} -C / > /dev/null
check_error
fi
if [ ! -z "$BD_PACKAGE_BIN_CONTENT" ]; then
echo "->Build the binary package..."
tar -czvf ${pck_path_base}/${BD_PACKAGE_NAME}_chenyq.arm.tgz ${BD_PACKAGE_BIN_CONTENT} -C / > /dev/null
check_error
fi
rm -fr ${BD_ROOT}
check_error
f, 编译freetype用的脚本
# Set the build system vars here
BD_SRC_DIR="${ARM_HOME}/softs/sources/freetype-2.3.4"
BD_PACKAGE_NAME="freetype-2.3.4"
BD_ROOT="/tmp/${BD_PACKAGE_NAME}"
BD_PREFIX="/usr"
BD_DEST_DIR="${ARM_HOME}/arm_pkgs"
BD_CONFIG_OPTIONS="--host=arm-linux --target=arm --disable-static --enable-shared"
BD_MAKE_OPTIONS=
BD_MAKE_INSTALL_OPTIONS="DESTDIR=$BD_ROOT"
BD_MAKE_CLEAN_OPTIONS=
# Set the packages build parted
BD_PACKAGE_DEV_CONTENT="usr/share usr/bin usr/include usr/lib/pkgconfig usr/lib/*.la*"
BD_PACKAGE_DOC_CONTENT=
BD_PACKAGE_BIN_CONTENT="usr/lib/*.so*"
function bd_info() {
echo "#####################################################################"
echo "#$1"
echo "#####################################################################"
}
function check_error() {
if [ ! "$?" = "0" ]; then
echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
echo "! Build error at: `date`"
echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
exit 1
fi
}
# Check need vars
if [ -z "${BD_SRC_DIR}" ]; then
echo "Must set the /${BD_SRC_DIR}"
exit 1
elif [ -z "${BD_PACKAGE_NAME}" ]; then
echo "Must set the /${BD_PACKAGE_NAME}"
exit 1
elif [ -z "${BD_DEST_DIR}" ]; then
echo "Must set the /${BD_DEST_DIR}"
exit 1
elif [ -z "${BD_ROOT}" ]; then
echo "Must set the /${BD_ROOT}"
exit 1
elif [ -z "${BD_PACKAGE_DEV_CONTENT}" ] && [ -z "${BD_PACKAGE_DOC_CONTENT}" ] && [ -z "${BD_PACKAGE_BIN_CONTENT}" ]; then
echo "Must set one of the package conent of /${BD_PACKAGE_DEV_CONTENT},/${BD_PACKAGE_DOC_CONTENT}, /${BD_PACKAGE_BIN_CONTENT}"
exit 1
fi
# Begin to configure if configure options length is not zero
cd $BD_SRC_DIR
if [ ! "${BD_CONFIG_OPTIONS}" = "NO-CONFIG" ]; then
bd_info "Begin to configure ..."
./configure --prefix=${BD_PREFIX} ${BD_CONFIG_OPTIONS}
check_error
fi
# Begin to make
if [ ! "${BD_MAKE_OPTIONS}" = "NO-MAKE" ]; then
bd_info "Begin to make ..."
make ${BD_MAKE_OPTIONS}
check_error
fi
# Begin to make install
rm -fr "${BD_ROOT}"
mkdir -p "${BD_ROOT}"
check_error
if [ ! "${BD_MAKE_INSTALL_OPTIONS}" = "NO-INSTALL" ]; then
bd_info "Begin to make install ..."
make $BD_MAKE_INSTALL_OPTIONS install
check_error
fi
# Begin to clean
if [ ! "${BD_MAKE_CLEAN_OPTIONS}" = "NO-CLEAN" ]; then
bd_info "Begin to make clean ..."
make $BD_MAKE_CLEAN_OPTIONS clean
check_error
fi
# Begin to package
bd_info "Begin to make package ..."
if [ ! -d ${BD_DEST_DIR} ]; then
mkdir -p ${BD_DEST_DIR}
check_error
fi
cd $BD_ROOT
pck_path_base="${BD_DEST_DIR}/${BD_PACKAGE_NAME}"
mkdir -p $pck_path_base
check_error
if [ ! -z "$BD_PACKAGE_DEV_CONTENT" ]; then
echo "->Build the develop package..."
tar -czvf ${pck_path_base}/${BD_PACKAGE_NAME}-dev_chenyq.arm.tgz ${BD_PACKAGE_DEV_CONTENT} -C / > /dev/null
check_error
fi
if [ ! -z "$BD_PACKAGE_DOC_CONTENT" ]; then
echo "->Build the document package..."
tar -czvf ${pck_path_base}/${BD_PACKAGE_NAME}-doc_chenyq.arm.tgz ${BD_PACKAGE_DOC_CONTENT} -C / > /dev/null
check_error
fi
if [ ! -z "$BD_PACKAGE_BIN_CONTENT" ]; then
echo "->Build the binary package..."
tar -czvf ${pck_path_base}/${BD_PACKAGE_NAME}_chenyq.arm.tgz ${BD_PACKAGE_BIN_CONTENT} -C / > /dev/null
check_error
fi
rm -fr ${BD_ROOT}
check_error
g, 编译fontconfig用的脚本
export CFLAGS="$ARM_CFLAGS"
export LDFLAGS="$ARM_LDFLAGS -Wl,-rpath-link=$TARGET_PREFIX/usr/lib"
export PATH=$TARGET_PREFIX/usr/bin:$PATH
# Set the build system vars here
BD_SRC_DIR="${ARM_HOME}/softs/sources/fontconfig-2.4.2"
BD_PACKAGE_NAME="fontconfig-2.4.2"
BD_ROOT="/tmp/${BD_PACKAGE_NAME}"
BD_PREFIX="/usr"
BD_DEST_DIR="${ARM_HOME}/arm_pkgs"
BD_CONFIG_OPTIONS="--host=arm-linux --with-arch=arm-linux --sysconfdir=/etc --localstatedir=/var"
BD_MAKE_OPTIONS=""
BD_MAKE_INSTALL_OPTIONS="DESTDIR=$BD_ROOT"
BD_MAKE_CLEAN_OPTIONS=
# Set the packages build parted
BD_PACKAGE_DEV_CONTENT="usr/lib/pkgconfig usr/include usr/lib/*.la* usr/lib/*.a*"
BD_PACKAGE_DOC_CONTENT="usr/share/man usr/share/doc"
BD_PACKAGE_LOCALE_CONTENT=
BD_PACKAGE_BIN_CONTENT="usr/lib/*.so* usr/bin etc var"
function bd_info() {
echo "#####################################################################"
echo "#$1"
echo "#####################################################################"
}
function check_error() {
if [ ! "$?" = "0" ]; then
echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
echo "! Build error at: `date`"
echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
exit 1
fi
}
# Check need vars
if [ -z "${BD_SRC_DIR}" ]; then
echo "Must set the /${BD_SRC_DIR}"
exit 1
elif [ -z "${BD_PACKAGE_NAME}" ]; then
echo "Must set the /${BD_PACKAGE_NAME}"
exit 1
elif [ -z "${BD_DEST_DIR}" ]; then
echo "Must set the /${BD_DEST_DIR}"
exit 1
elif [ -z "${BD_ROOT}" ]; then
echo "Must set the /${BD_ROOT}"
exit 1
elif [ -z "${BD_PACKAGE_DEV_CONTENT}" ] && [ -z "${BD_PACKAGE_DOC_CONTENT}" ] && [ -z "${BD_PACKAGE_BIN_CONTENT}" ]; then
echo "Must set one of the package conent of /${BD_PACKAGE_DEV_CONTENT},/${BD_PACKAGE_DOC_CONTENT}, /${BD_PACKAGE_BIN_CONTENT}"
exit 1
fi
# Begin to configure if configure options length is not zero
cd $BD_SRC_DIR
if [ ! "${BD_CONFIG_OPTIONS}" = "NO-CONFIG" ]; then
bd_info "Begin to configure ..."
./configure --prefix=${BD_PREFIX} ${BD_CONFIG_OPTIONS}
check_error
fi
# Begin to make
if [ ! "${BD_MAKE_OPTIONS}" = "NO-MAKE" ]; then
bd_info "Begin to make ..."
make ${BD_MAKE_OPTIONS}
check_error
fi
# Begin to make install
rm -fr "${BD_ROOT}"
mkdir -p "${BD_ROOT}"
check_error
if [ ! "${BD_MAKE_INSTALL_OPTIONS}" = "NO-INSTALL" ]; then
bd_info "Begin to make install ..."
make $BD_MAKE_INSTALL_OPTIONS install
check_error
fi
# Begin to clean
if [ ! "${BD_MAKE_CLEAN_OPTIONS}" = "NO-CLEAN" ]; then
bd_info "Begin to make clean ..."
make $BD_MAKE_CLEAN_OPTIONS clean
check_error
fi
# Begin to package
bd_info "Begin to make package ..."
if [ ! -d ${BD_DEST_DIR} ]; then
mkdir -p ${BD_DEST_DIR}
check_error
fi
cd $BD_ROOT
pck_path_base="${BD_DEST_DIR}/${BD_PACKAGE_NAME}"
mkdir -p $pck_path_base
check_error
if [ ! -z "$BD_PACKAGE_DEV_CONTENT" ]; then
echo "->Build the develop package..."
tar -czvf ${pck_path_base}/${BD_PACKAGE_NAME}-dev_chenyq.arm.tgz ${BD_PACKAGE_DEV_CONTENT} -C / > /dev/null
check_error
fi
if [ ! -z "$BD_PACKAGE_DOC_CONTENT" ]; then
echo "->Build the document package..."
tar -czvf ${pck_path_base}/${BD_PACKAGE_NAME}-doc_chenyq.arm.tgz ${BD_PACKAGE_DOC_CONTENT} -C / > /dev/null
check_error
fi
if [ ! -z "$BD_PACKAGE_LOCALE_CONTENT" ]; then
echo "->Build the locales package..."
tar -czvf ${pck_path_base}/${BD_PACKAGE_NAME}-nls_chenyq.arm.tgz ${BD_PACKAGE_LOCALE_CONTENT} -C / > /dev/null
check_error
fi
if [ ! -z "$BD_PACKAGE_BIN_CONTENT" ]; then
echo "->Build the binary package..."
tar -czvf ${pck_path_base}/${BD_PACKAGE_NAME}_chenyq.arm.tgz ${BD_PACKAGE_BIN_CONTENT} -C / > /dev/null
check_error
fi
rm -fr ${BD_ROOT}
check_error
h, 编译tiff用的脚本
export CFLAGS="$ARM_CFLAGS $CFLAGS"
export LDFLAGS="$ARM_LDFLAGS $LDFLAGS"
export PATH=$TARGET_PREFIX/usr/bin:$PATH
# Set the build system vars here
BD_SRC_DIR="${ARM_HOME}/softs/sources/tiff-3.8.2"
BD_PACKAGE_NAME="tiff-3.8.2"
BD_ROOT="/tmp/${BD_PACKAGE_NAME}"
BD_PREFIX="/usr"
BD_DEST_DIR="${ARM_HOME}/arm_pkgs"
BD_CONFIG_OPTIONS="--host=arm-linux --without-x"
BD_MAKE_OPTIONS=
BD_MAKE_INSTALL_OPTIONS="DESTDIR=$BD_ROOT"
BD_MAKE_CLEAN_OPTIONS=
# Set the packages build parted
BD_PACKAGE_DEV_CONTENT="usr/lib/*.la usr/lib/*.a usr/include"
BD_PACKAGE_DOC_CONTENT="usr/share/doc usr/man"
BD_PACKAGE_LOCALE_CONTENT=
BD_PACKAGE_BIN_CONTENT="usr/bin usr/lib/*.so*"
# Set the strip variables
BD_STRIP_OPTIONS="--strip-debug"
BD_STRIP_CONTENT="usr/bin usr/lib/*"
function bd_info() {
echo "#####################################################################"
echo "#$1"
echo "#####################################################################"
}
function check_error() {
if [ ! "$?" = "0" ]; then
echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
echo "! Build error at: `date`"
echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
exit 1
fi
}
# Check need vars
if [ -z "${BD_SRC_DIR}" ]; then
echo "Must set the /${BD_SRC_DIR}"
exit 1
elif [ -z "${BD_PACKAGE_NAME}" ]; then
echo "Must set the /${BD_PACKAGE_NAME}"
exit 1
elif [ -z "${BD_DEST_DIR}" ]; then
echo "Must set the /${BD_DEST_DIR}"
exit 1
elif [ -z "${BD_ROOT}" ]; then
echo "Must set the /${BD_ROOT}"
exit 1
elif [ -z "${BD_PACKAGE_DEV_CONTENT}" ] && [ -z "${BD_PACKAGE_DOC_CONTENT}" ] && [ -z "${BD_PACKAGE_BIN_CONTENT}" ]; then
echo "Must set one of the package conent of /${BD_PACKAGE_DEV_CONTENT},/${BD_PACKAGE_DOC_CONTENT}, /${BD_PACKAGE_BIN_CONTENT}"
exit 1
fi
# Begin to configure if configure options length is not zero
cd $BD_SRC_DIR
if [ ! "${BD_CONFIG_OPTIONS}" = "NO-CONFIG" ]; then
bd_info "Begin to configure ..."
./configure --prefix=${BD_PREFIX} ${BD_CONFIG_OPTIONS}
check_error
fi
# Begin to make
if [ ! "${BD_MAKE_OPTIONS}" = "NO-MAKE" ]; then
bd_info "Begin to make ..."
make ${BD_MAKE_OPTIONS}
check_error
fi
# Begin to make install
rm -fr "${BD_ROOT}"
mkdir -p "${BD_ROOT}"
check_error
if [ ! "${BD_MAKE_INSTALL_OPTIONS}" = "NO-INSTALL" ]; then
bd_info "Begin to make install ..."
make $BD_MAKE_INSTALL_OPTIONS install
check_error
fi
# Begin to clean
if [ ! "${BD_MAKE_CLEAN_OPTIONS}" = "NO-CLEAN" ]; then
bd_info "Begin to make clean ..."
make $BD_MAKE_CLEAN_OPTIONS clean
check_error
fi
# Begin to package
bd_info "Begin to make package ..."
if [ ! -d ${BD_DEST_DIR} ]; then
mkdir -p ${BD_DEST_DIR}
check_error
fi
cd $BD_ROOT
# Get package base directory path
pck_path_base="${BD_DEST_DIR}/${BD_PACKAGE_NAME}"
mkdir -p $pck_path_base
check_error
# Strip specialy symbols
if [ ! -z "$BD_STRIP_CONTENT" ]; then
echo "->Stip unneeded symbols..."
arm-linux-strip $BD_STRIP_OPTIONS $BD_STRIP_CONTENT
fi
# Compress and make packages
if [ ! -z "$BD_PACKAGE_DEV_CONTENT" ]; then
echo "->Build the develop package..."
tar -czvf ${pck_path_base}/${BD_PACKAGE_NAME}-dev_chenyq.arm.tgz ${BD_PACKAGE_DEV_CONTENT} -C / > /dev/null
check_error
fi
if [ ! -z "$BD_PACKAGE_DOC_CONTENT" ]; then
echo "->Build the document package..."
tar -czvf ${pck_path_base}/${BD_PACKAGE_NAME}-doc_chenyq.arm.tgz ${BD_PACKAGE_DOC_CONTENT} -C / > /dev/null
check_error
fi
if [ ! -z "$BD_PACKAGE_LOCALE_CONTENT" ]; then
echo "->Build the locales package..."
tar -czvf ${pck_path_base}/${BD_PACKAGE_NAME}-nls_chenyq.arm.tgz ${BD_PACKAGE_LOCALE_CONTENT} -C / > /dev/null
check_error
fi
if [ ! -z "$BD_PACKAGE_BIN_CONTENT" ]; then
echo "->Build the binary package..."
tar -czvf ${pck_path_base}/${BD_PACKAGE_NAME}_chenyq.arm.tgz ${BD_PACKAGE_BIN_CONTENT} -C / > /dev/null
check_error
fi
rm -fr ${BD_ROOT}
check_error
i, 编译directfb用的脚本
export CFLAGS="$ARM_CFLAGS -I$TARGET_PREFIX/usr/include/freetype2 $CFLAGS"
export LDFLAGS="$ARM_LDFLAGS -lz $LDFLAGS"
export PATH=$TARGET_PREFIX/usr/bin:$PATH
# if comple the directfb support linux framebuffer support
# must modify the directfb configure file and modify the
# var "have_linux=no" to "have_linux=yes"
# Set the build system vars here
BD_SRC_DIR="${ARM_HOME}/softs/sources/DirectFB-1.0.0"
BD_PACKAGE_NAME="directFB-1.0.0"
BD_ROOT="/tmp/${BD_PACKAGE_NAME}"
BD_PREFIX="/usr"
BD_DEST_DIR="${ARM_HOME}/arm_pkgs"
BD_CONFIG_OPTIONS="--host=arm-linux --target=arm --disable-osx --disable-debug-support --disable-mmx /
--disable-sse --enable-fbdev --disable-sdl --disable-vnc --disable-sysfs --enable-zlib /
--disable-gif --disable-video4linux --with-gfxdrivers=none"
BD_MAKE_OPTIONS=
BD_MAKE_INSTALL_OPTIONS="DESTDIR=$BD_ROOT"
BD_MAKE_CLEAN_OPTIONS=
# Set the packages build parted
BD_PACKAGE_DEV_CONTENT="usr/include usr/lib/pkgconfig usr/lib/*.la usr/lib/*/*/*.la usr/lib/*/*/*/*.la"
BD_PACKAGE_DOC_CONTENT="usr/share/man"
BD_PACKAGE_BIN_CONTENT="usr/bin usr/lib/*.so* usr/lib/*/*/*.so* usr/lib/*/*/*/*.so* usr/share/directfb-1.0.0"
function bd_info() {
echo "#####################################################################"
echo "#$1"
echo "#####################################################################"
}
function check_error() {
if [ ! "$?" = "0" ]; then
echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
echo "! Build error at: `date`"
echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
exit 1
fi
}
# Check need vars
if [ -z "${BD_SRC_DIR}" ]; then
echo "Must set the /${BD_SRC_DIR}"
exit 1
elif [ -z "${BD_PACKAGE_NAME}" ]; then
echo "Must set the /${BD_PACKAGE_NAME}"
exit 1
elif [ -z "${BD_DEST_DIR}" ]; then
echo "Must set the /${BD_DEST_DIR}"
exit 1
elif [ -z "${BD_ROOT}" ]; then
echo "Must set the /${BD_ROOT}"
exit 1
elif [ -z "${BD_PACKAGE_DEV_CONTENT}" ] && [ -z "${BD_PACKAGE_DOC_CONTENT}" ] && [ -z "${BD_PACKAGE_BIN_CONTENT}" ]; then
echo "Must set one of the package conent of /${BD_PACKAGE_DEV_CONTENT},/${BD_PACKAGE_DOC_CONTENT}, /${BD_PACKAGE_BIN_CONTENT}"
exit 1
fi
# Begin to configure if configure options length is not zero
cd $BD_SRC_DIR
if [ ! "${BD_CONFIG_OPTIONS}" = "NO-CONFIG" ]; then
bd_info "Begin to configure ..."
./configure --prefix=${BD_PREFIX} ${BD_CONFIG_OPTIONS}
check_error
fi
# Begin to make
if [ ! "${BD_MAKE_OPTIONS}" = "NO-MAKE" ]; then
bd_info "Begin to make ..."
make ${BD_MAKE_OPTIONS}
check_error
fi
# Begin to make install
rm -fr "${BD_ROOT}"
mkdir -p "${BD_ROOT}"
check_error
if [ ! "${BD_MAKE_INSTALL_OPTIONS}" = "NO-INSTALL" ]; then
bd_info "Begin to make install ..."
make $BD_MAKE_INSTALL_OPTIONS install
check_error
fi
# Begin to clean
if [ ! "${BD_MAKE_CLEAN_OPTIONS}" = "NO-CLEAN" ]; then
bd_info "Begin to make clean ..."
make $BD_MAKE_CLEAN_OPTIONS clean
check_error
fi
# Begin to package
bd_info "Begin to make package ..."
if [ ! -d ${BD_DEST_DIR} ]; then
mkdir -p ${BD_DEST_DIR}
check_error
fi
cd $BD_ROOT
pck_path_base="${BD_DEST_DIR}/${BD_PACKAGE_NAME}"
mkdir -p $pck_path_base
check_error
if [ ! -z "$BD_PACKAGE_DEV_CONTENT" ]; then
echo "->Build the develop package..."
tar -czvf ${pck_path_base}/${BD_PACKAGE_NAME}-dev_chenyq.arm.tgz ${BD_PACKAGE_DEV_CONTENT} -C / > /dev/null
check_error
fi
if [ ! -z "$BD_PACKAGE_DOC_CONTENT" ]; then
echo "->Build the document package..."
tar -czvf ${pck_path_base}/${BD_PACKAGE_NAME}-doc_chenyq.arm.tgz ${BD_PACKAGE_DOC_CONTENT} -C / > /dev/null
check_error
fi
if [ ! -z "$BD_PACKAGE_BIN_CONTENT" ]; then
echo "->Build the binary package..."
tar -czvf ${pck_path_base}/${BD_PACKAGE_NAME}_chenyq.arm.tgz ${BD_PACKAGE_BIN_CONTENT} -C / > /dev/null
check_error
fi
rm -fr ${BD_ROOT}
check_error
# Unset the env here
# unset CC AR CPP LDSHARED RANLIB
j, 编译atk用到的脚本
export CFLAGS="$ARM_CFLAGS $CFLAGS"
export LDFLAGS="$ARM_LDFLAGS $LDCFLAGS"
export DEP_CFLAGS="-I$TARGET_PREFIX/usr/include/glib-2.0 -I$TARGET_PREFIX/usr/lib/glib-2.0/include"
export DEP_LIBS="-L$TARGET_PREFIX/usr/lib -lglib-2.0 -lgobject-2.0"
# Set the build system vars here
BD_SRC_DIR="${ARM_HOME}/softs/sources/gtkfb/atk-1.19.3"
BD_PACKAGE_NAME="atk-1.19.3"
BD_ROOT="/tmp/${BD_PACKAGE_NAME}"
BD_PREFIX="/usr"
BD_DEST_DIR="${ARM_HOME}/arm_pkgs/gtkfb/"
BD_CONFIG_OPTIONS="--host=arm-linux"
BD_MAKE_OPTIONS=
BD_MAKE_INSTALL_OPTIONS="DESTDIR=$BD_ROOT"
BD_MAKE_CLEAN_OPTIONS=
# Set the packages build parted
BD_PACKAGE_DEV_CONTENT="usr/lib/pkgconfig usr/lib/*.la usr/include"
BD_PACKAGE_DOC_CONTENT="usr/share/gtk-doc"
BD_PACKAGE_LOCALE_CONTENT="usr/share/locale"
BD_PACKAGE_BIN_CONTENT="usr/lib/*.so*"
# Set the strip variables
BD_STRIP_OPTIONS="--strip-debug"
BD_STRIP_CONTENT="usr/lib/*"
function bd_info() {
echo "#####################################################################"
echo "#$1"
echo "#####################################################################"
}
function check_error() {
if [ ! "$?" = "0" ]; then
echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
echo "! Build error at: `date`"
echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
exit 1
fi
}
# Check need vars
if [ -z "${BD_SRC_DIR}" ]; then
echo "Must set the /${BD_SRC_DIR}"
exit 1
elif [ -z "${BD_PACKAGE_NAME}" ]; then
echo "Must set the /${BD_PACKAGE_NAME}"
exit 1
elif [ -z "${BD_DEST_DIR}" ]; then
echo "Must set the /${BD_DEST_DIR}"
exit 1
elif [ -z "${BD_ROOT}" ]; then
echo "Must set the /${BD_ROOT}"
exit 1
elif [ -z "${BD_PACKAGE_DEV_CONTENT}" ] && [ -z "${BD_PACKAGE_DOC_CONTENT}" ] && [ -z "${BD_PACKAGE_BIN_CONTENT}" ]; then
echo "Must set one of the package conent of /${BD_PACKAGE_DEV_CONTENT},/${BD_PACKAGE_DOC_CONTENT}, /${BD_PACKAGE_BIN_CONTENT}"
exit 1
fi
# Begin to configure if configure options length is not zero
cd $BD_SRC_DIR
if [ ! "${BD_CONFIG_OPTIONS}" = "NO-CONFIG" ]; then
bd_info "Begin to configure ..."
./configure --prefix=${BD_PREFIX} ${BD_CONFIG_OPTIONS}
check_error
fi
# Begin to make
if [ ! "${BD_MAKE_OPTIONS}" = "NO-MAKE" ]; then
bd_info "Begin to make ..."
make ${BD_MAKE_OPTIONS}
check_error
fi
# Begin to make install
rm -fr "${BD_ROOT}"
mkdir -p "${BD_ROOT}"
check_error
if [ ! "${BD_MAKE_INSTALL_OPTIONS}" = "NO-INSTALL" ]; then
bd_info "Begin to make install ..."
make $BD_MAKE_INSTALL_OPTIONS install
check_error
fi
# Begin to clean
if [ ! "${BD_MAKE_CLEAN_OPTIONS}" = "NO-CLEAN" ]; then
bd_info "Begin to make clean ..."
make $BD_MAKE_CLEAN_OPTIONS clean
check_error
fi
# Begin to package
bd_info "Begin to make package ..."
if [ ! -d ${BD_DEST_DIR} ]; then
mkdir -p ${BD_DEST_DIR}
check_error
fi
cd $BD_ROOT
pck_path_base="${BD_DEST_DIR}/${BD_PACKAGE_NAME}"
mkdir -p $pck_path_base
check_error
# Strip specialy symbols
if [ ! -z "$BD_STRIP_CONTENT" ]; then
echo "->Stip unneeded symbols..."
arm-linux-strip $BD_STRIP_OPTIONS $BD_STRIP_CONTENT
fi
if [ ! -z "$BD_PACKAGE_DEV_CONTENT" ]; then
echo "->Build the develop package..."
tar -czvf ${pck_path_base}/${BD_PACKAGE_NAME}-dev_chenyq.arm.tgz ${BD_PACKAGE_DEV_CONTENT} -C / > /dev/null
check_error
fi
if [ ! -z "$BD_PACKAGE_DOC_CONTENT" ]; then
echo "->Build the document package..."
tar -czvf ${pck_path_base}/${BD_PACKAGE_NAME}-doc_chenyq.arm.tgz ${BD_PACKAGE_DOC_CONTENT} -C / > /dev/null
check_error
fi
if [ ! -z "$BD_PACKAGE_LOCALE_CONTENT" ]; then
echo "->Build the locales package..."
tar -czvf ${pck_path_base}/${BD_PACKAGE_NAME}-nls_chenyq.arm.tgz ${BD_PACKAGE_LOCALE_CONTENT} -C / > /dev/null
check_error
fi
if [ ! -z "$BD_PACKAGE_BIN_CONTENT" ]; then
echo "->Build the binary package..."
tar -czvf ${pck_path_base}/${BD_PACKAGE_NAME}_chenyq.arm.tgz ${BD_PACKAGE_BIN_CONTENT} -C / > /dev/null
check_error
fi
rm -fr ${BD_ROOT}
check_error
k, 编译glib用到的脚本
# Set the build system vars here
AC_CACHE="arm-linux.cache"
BD_SRC_DIR="${ARM_HOME}/softs/sources/gtkfb/glib-2.12.9"
BD_PACKAGE_NAME="glib-2.12.9"
BD_ROOT="/tmp/${BD_PACKAGE_NAME}"
BD_PREFIX="/usr"
BD_DEST_DIR="${ARM_HOME}/arm_pkgs/gtkfb/"
BD_CONFIG_OPTIONS="--host=arm-linux --cache-file=$AC_CACHE"
BD_MAKE_OPTIONS=
BD_MAKE_INSTALL_OPTIONS="DESTDIR=$BD_ROOT"
BD_MAKE_CLEAN_OPTIONS=
# Set the packages build parted
BD_PACKAGE_DEV_CONTENT="usr/share/aclocal usr/share/glib-2.0 usr/lib/*.la* usr/lib/pkgconfig usr/lib/glib-2.0 /
usr/bin usr/include"
BD_PACKAGE_DOC_CONTENT="usr/share/gtk-doc usr/share/man"
BD_PACKAGE_LOCALE_CONTENT="usr/share/locale"
BD_PACKAGE_BIN_CONTENT="usr/lib/*.so*"
function bd_info() {
echo "#####################################################################"
echo "#$1"
echo "#####################################################################"
}
function check_error() {
if [ ! "$?" = "0" ]; then
echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
echo "! Build error at: `date`"
echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
exit 1
fi
}
# Check need vars
if [ -z "${BD_SRC_DIR}" ]; then
echo "Must set the /${BD_SRC_DIR}"
exit 1
elif [ -z "${BD_PACKAGE_NAME}" ]; then
echo "Must set the /${BD_PACKAGE_NAME}"
exit 1
elif [ -z "${BD_DEST_DIR}" ]; then
echo "Must set the /${BD_DEST_DIR}"
exit 1
elif [ -z "${BD_ROOT}" ]; then
echo "Must set the /${BD_ROOT}"
exit 1
elif [ -z "${BD_PACKAGE_DEV_CONTENT}" ] && [ -z "${BD_PACKAGE_DOC_CONTENT}" ] && [ -z "${BD_PACKAGE_BIN_CONTENT}" ]; then
echo "Must set one of the package conent of /${BD_PACKAGE_DEV_CONTENT},/${BD_PACKAGE_DOC_CONTENT}, /${BD_PACKAGE_BIN_CONTENT}"
exit 1
fi
# Begin to configure if configure options length is not zero
cd $BD_SRC_DIR
if [ ! "${BD_CONFIG_OPTIONS}" = "NO-CONFIG" ]; then
bd_info "Begin to configure ..."
#Fix some cross compile problem
echo ac_cv_type_long_long=yes > $AC_CACHE
echo glib_cv_stack_grows=no >> $AC_CACHE
echo glib_cv_uscore=no >> $AC_CACHE
echo ac_cv_func_posix_getpwuid_r=yes >> $AC_CACHE
./configure --prefix=${BD_PREFIX} ${BD_CONFIG_OPTIONS}
check_error
fi
# Begin to make
if [ ! "${BD_MAKE_OPTIONS}" = "NO-MAKE" ]; then
bd_info "Begin to make ..."
make ${BD_MAKE_OPTIONS}
check_error
fi
# Begin to make install
rm -fr "${BD_ROOT}"
mkdir -p "${BD_ROOT}"
check_error
if [ ! "${BD_MAKE_INSTALL_OPTIONS}" = "NO-INSTALL" ]; then
bd_info "Begin to make install ..."
make $BD_MAKE_INSTALL_OPTIONS install
check_error
fi
# Begin to clean
if [ ! "${BD_MAKE_CLEAN_OPTIONS}" = "NO-CLEAN" ]; then
bd_info "Begin to make clean ..."
make $BD_MAKE_CLEAN_OPTIONS clean
check_error
fi
# Begin to package
bd_info "Begin to make package ..."
if [ ! -d ${BD_DEST_DIR} ]; then
mkdir -p ${BD_DEST_DIR}
check_error
fi
cd $BD_ROOT
pck_path_base="${BD_DEST_DIR}/${BD_PACKAGE_NAME}"
mkdir -p $pck_path_base
check_error
if [ ! -z "$BD_PACKAGE_DEV_CONTENT" ]; then
echo "->Build the develop package..."
tar -czvf ${pck_path_base}/${BD_PACKAGE_NAME}-dev_chenyq.arm.tgz ${BD_PACKAGE_DEV_CONTENT} -C / > /dev/null
check_error
fi
if [ ! -z "$BD_PACKAGE_DOC_CONTENT" ]; then
echo "->Build the document package..."
tar -czvf ${pck_path_base}/${BD_PACKAGE_NAME}-doc_chenyq.arm.tgz ${BD_PACKAGE_DOC_CONTENT} -C / > /dev/null
check_error
fi
if [ ! -z "$BD_PACKAGE_LOCALE_CONTENT" ]; then
echo "->Build the locales package..."
tar -czvf ${pck_path_base}/${BD_PACKAGE_NAME}-nls_chenyq.arm.tgz ${BD_PACKAGE_LOCALE_CONTENT} -C / > /dev/null
check_error
fi
if [ ! -z "$BD_PACKAGE_BIN_CONTENT" ]; then
echo "->Build the binary package..."
tar -czvf ${pck_path_base}/${BD_PACKAGE_NAME}_chenyq.arm.tgz ${BD_PACKAGE_BIN_CONTENT} -C / > /dev/null
check_error
fi
rm -fr ${BD_ROOT}
check_error
l, 编译cairo用到的脚本
export CFLAGS="$ARM_CFLAGS $CFLAGS"
export LDFLAGS="$ARM_LDFLAGS $LDFLAGS"
export PATH=$TARGET_PREFIX/usr/bin:$PATH
export png_CFLAGS="-I$TARGET_PREFIX/usr/include/libpng12"
export png_LIBS="-lpng12"
export directfb_CFLAGS="-D_REENTRANT -I$TARGET_PREFIX/usr/include/directfb"
export directfb_LIBS="-ldirectfb -lz -lfusion -ldirect -lpthread -ldl"
# Set the build system vars here
BD_SRC_DIR="${ARM_HOME}/softs/sources/gtkfb/cairo-1.4.6"
BD_PACKAGE_NAME="cairo-1.4.6"
BD_ROOT="/tmp/${BD_PACKAGE_NAME}"
BD_PREFIX="/usr"
BD_DEST_DIR="${ARM_HOME}/arm_pkgs/gtkfb"
BD_CONFIG_OPTIONS="--host=arm-linux --disable-xlib --disable-xlib-xrender --enable-directfb --without-x /
--enable-pdf --enable-ps --enable-svg"
BD_MAKE_OPTIONS=
BD_MAKE_INSTALL_OPTIONS="DESTDIR=$BD_ROOT"
BD_MAKE_CLEAN_OPTIONS=
# Set the packages build parted
BD_PACKAGE_DEV_CONTENT="usr/lib/*.la usr/lib/*.a* usr/lib/pkgconfig usr/include"
BD_PACKAGE_DOC_CONTENT="usr/share/gtk-doc"
BD_PACKAGE_LOCALE_CONTENT=
BD_PACKAGE_BIN_CONTENT="usr/lib/*.so*"
# Set the strip variables
BD_STRIP_OPTIONS="--strip-debug"
BD_STRIP_CONTENT="usr/lib/*"
function bd_info() {
echo "#####################################################################"
echo "#$1"
echo "#####################################################################"
}
function check_error() {
if [ ! "$?" = "0" ]; then
echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
echo "! Build error at: `date`"
echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
exit 1
fi
}
# Check need vars
if [ -z "${BD_SRC_DIR}" ]; then
echo "Must set the /${BD_SRC_DIR}"
exit 1
elif [ -z "${BD_PACKAGE_NAME}" ]; then
echo "Must set the /${BD_PACKAGE_NAME}"
exit 1
elif [ -z "${BD_DEST_DIR}" ]; then
echo "Must set the /${BD_DEST_DIR}"
exit 1
elif [ -z "${BD_ROOT}" ]; then
echo "Must set the /${BD_ROOT}"
exit 1
elif [ -z "${BD_PACKAGE_DEV_CONTENT}" ] && [ -z "${BD_PACKAGE_DOC_CONTENT}" ] && [ -z "${BD_PACKAGE_BIN_CONTENT}" ]; then
echo "Must set one of the package conent of /${BD_PACKAGE_DEV_CONTENT},/${BD_PACKAGE_DOC_CONTENT}, /${BD_PACKAGE_BIN_CONTENT}"
exit 1
fi
# Begin to configure if configure options length is not zero
cd $BD_SRC_DIR
if [ ! "${BD_CONFIG_OPTIONS}" = "NO-CONFIG" ]; then
bd_info "Begin to configure ..."
./configure --prefix=${BD_PREFIX} ${BD_CONFIG_OPTIONS}
check_error
fi
# Begin to make
if [ ! "${BD_MAKE_OPTIONS}" = "NO-MAKE" ]; then
bd_info "Begin to make ..."
make ${BD_MAKE_OPTIONS}
check_error
fi
# Begin to make install
rm -fr "${BD_ROOT}"
mkdir -p "${BD_ROOT}"
check_error
if [ ! "${BD_MAKE_INSTALL_OPTIONS}" = "NO-INSTALL" ]; then
bd_info "Begin to make install ..."
make $BD_MAKE_INSTALL_OPTIONS install
check_error
fi
# Begin to clean
if [ ! "${BD_MAKE_CLEAN_OPTIONS}" = "NO-CLEAN" ]; then
bd_info "Begin to make clean ..."
make $BD_MAKE_CLEAN_OPTIONS clean
check_error
fi
# Begin to package
bd_info "Begin to make package ..."
if [ ! -d ${BD_DEST_DIR} ]; then
mkdir -p ${BD_DEST_DIR}
check_error
fi
cd $BD_ROOT
# Get package base directory path
pck_path_base="${BD_DEST_DIR}/${BD_PACKAGE_NAME}"
mkdir -p $pck_path_base
check_error
# Strip specialy symbols
if [ ! -z "$BD_STRIP_CONTENT" ]; then
echo "->Stip unneeded symbols..."
arm-linux-strip $BD_STRIP_OPTIONS $BD_STRIP_CONTENT
fi
# Compress and make packages
if [ ! -z "$BD_PACKAGE_DEV_CONTENT" ]; then
echo "->Build the develop package..."
tar -czvf ${pck_path_base}/${BD_PACKAGE_NAME}-dev_chenyq.arm.tgz ${BD_PACKAGE_DEV_CONTENT} -C / > /dev/null
check_error
fi
if [ ! -z "$BD_PACKAGE_DOC_CONTENT" ]; then
echo "->Build the document package..."
tar -czvf ${pck_path_base}/${BD_PACKAGE_NAME}-doc_chenyq.arm.tgz ${BD_PACKAGE_DOC_CONTENT} -C / > /dev/null
check_error
fi
if [ ! -z "$BD_PACKAGE_LOCALE_CONTENT" ]; then
echo "->Build the locales package..."
tar -czvf ${pck_path_base}/${BD_PACKAGE_NAME}-nls_chenyq.arm.tgz ${BD_PACKAGE_LOCALE_CONTENT} -C / > /dev/null
check_error
fi
if [ ! -z "$BD_PACKAGE_BIN_CONTENT" ]; then
echo "->Build the binary package..."
tar -czvf ${pck_path_base}/${BD_PACKAGE_NAME}_chenyq.arm.tgz ${BD_PACKAGE_BIN_CONTENT} -C / > /dev/null
check_error
fi
rm -fr ${BD_ROOT}
check_error
m ,编译pango用到的脚本
export PATH=$TARGET_PREFIX/usr/bin:$PATH
export FONTCONFIG_CFLAGS="-I$TARGET_PREFIX/usr/include/fontconfig"
export FONTCONFIG_LIBS="-lfontconfig"
export CAIRO_CFLAGS="-D_REENTRANT -I$TARGET_PREFIX/usr/include/cairo -I$TARGET_PREFIX/usr/include/directfb -I$TARGET_PREFIX/usr/include/freetype2 -I$TARGET_PREFIX/usr/include/libpng12"
export CAIRO_LIBS="-lcairo"
export GLIB_CFLAGS="-I$TARGET_PREFIX/usr/include/glib-2.0 -I$TARGET_PREFIX/usr/lib/glib-2.0/include"
export GLIB_LIBS="-lglib-2.0 -lgmodule-2.0 -lgobject-2.0"
export CFLAGS="$ARM_CFLAGS $CFLAGS"
export LDFLAGS="$ARM_LDFLAGS -Wl,--rpath-link -Wl,$TARGET_PREFIX/usr/lib/ $LDFLAGS"
# Set the build system vars here
BD_SRC_DIR="${ARM_HOME}/softs/sources/gtkfb/pango-1.16.4"
BD_PACKAGE_NAME="pango-1.16.4"
BD_ROOT="/tmp/${BD_PACKAGE_NAME}"
BD_PREFIX="/usr"
BD_DEST_DIR="${ARM_HOME}/arm_pkgs/gtkfb"
BD_CONFIG_OPTIONS="--host=arm-linux --without-x --sysconfdir=/etc"
BD_MAKE_OPTIONS=
BD_MAKE_INSTALL_OPTIONS="DESTDIR=$BD_ROOT"
BD_MAKE_CLEAN_OPTIONS=
# Set the packages build parted
BD_PACKAGE_DEV_CONTENT="usr/lib/*.la usr/lib/*/*/modules/*.la usr/lib/pkgconfig usr/include"
BD_PACKAGE_DOC_CONTENT="usr/share/gtk-doc usr/man"
BD_PACKAGE_LOCALE_CONTENT=
BD_PACKAGE_BIN_CONTENT="usr/lib/*.so* usr/lib/*/*/modules/*.so* usr/bin"
# Set the strip variables
BD_STRIP_OPTIONS="--strip-debug"
BD_STRIP_CONTENT="usr/lib/*"
function bd_info() {
echo "#####################################################################"
echo "#$1"
echo "#####################################################################"
}
function check_error() {
if [ ! "$?" = "0" ]; then
echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
echo "! Build error at: `date`"
echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
exit 1
fi
}
# Check need vars
if [ -z "${BD_SRC_DIR}" ]; then
echo "Must set the /${BD_SRC_DIR}"
exit 1
elif [ -z "${BD_PACKAGE_NAME}" ]; then
echo "Must set the /${BD_PACKAGE_NAME}"
exit 1
elif [ -z "${BD_DEST_DIR}" ]; then
echo "Must set the /${BD_DEST_DIR}"
exit 1
elif [ -z "${BD_ROOT}" ]; then
echo "Must set the /${BD_ROOT}"
exit 1
elif [ -z "${BD_PACKAGE_DEV_CONTENT}" ] && [ -z "${BD_PACKAGE_DOC_CONTENT}" ] && [ -z "${BD_PACKAGE_BIN_CONTENT}" ]; then
echo "Must set one of the package conent of /${BD_PACKAGE_DEV_CONTENT},/${BD_PACKAGE_DOC_CONTENT}, /${BD_PACKAGE_BIN_CONTENT}"
exit 1
fi
# Begin to configure if configure options length is not zero
cd $BD_SRC_DIR
if [ ! "${BD_CONFIG_OPTIONS}" = "NO-CONFIG" ]; then
bd_info "Begin to configure ..."
./configure --prefix=${BD_PREFIX} ${BD_CONFIG_OPTIONS}
check_error
fi
# Begin to make
if [ ! "${BD_MAKE_OPTIONS}" = "NO-MAKE" ]; then
bd_info "Begin to make ..."
make ${BD_MAKE_OPTIONS}
check_error
fi
# Begin to make install
rm -fr "${BD_ROOT}"
mkdir -p "${BD_ROOT}"
check_error
if [ ! "${BD_MAKE_INSTALL_OPTIONS}" = "NO-INSTALL" ]; then
bd_info "Begin to make install ..."
make $BD_MAKE_INSTALL_OPTIONS install
check_error
fi
# Begin to clean
if [ ! "${BD_MAKE_CLEAN_OPTIONS}" = "NO-CLEAN" ]; then
bd_info "Begin to make clean ..."
make $BD_MAKE_CLEAN_OPTIONS clean
check_error
fi
# Begin to package
bd_info "Begin to make package ..."
if [ ! -d ${BD_DEST_DIR} ]; then
mkdir -p ${BD_DEST_DIR}
check_error
fi
cd $BD_ROOT
# Get package base directory path
pck_path_base="${BD_DEST_DIR}/${BD_PACKAGE_NAME}"
mkdir -p $pck_path_base
check_error
# Strip specialy symbols
if [ ! -z "$BD_STRIP_CONTENT" ]; then
echo "->Stip unneeded symbols..."
arm-linux-strip $BD_STRIP_OPTIONS $BD_STRIP_CONTENT
fi
# Compress and make packages
if [ ! -z "$BD_PACKAGE_DEV_CONTENT" ]; then
echo "->Build the develop package..."
tar -czvf ${pck_path_base}/${BD_PACKAGE_NAME}-dev_chenyq.arm.tgz ${BD_PACKAGE_DEV_CONTENT} -C / > /dev/null
check_error
fi
if [ ! -z "$BD_PACKAGE_DOC_CONTENT" ]; then
echo "->Build the document package..."
tar -czvf ${pck_path_base}/${BD_PACKAGE_NAME}-doc_chenyq.arm.tgz ${BD_PACKAGE_DOC_CONTENT} -C / > /dev/null
check_error
fi
if [ ! -z "$BD_PACKAGE_LOCALE_CONTENT" ]; then
echo "->Build the locales package..."
tar -czvf ${pck_path_base}/${BD_PACKAGE_NAME}-nls_chenyq.arm.tgz ${BD_PACKAGE_LOCALE_CONTENT} -C / > /dev/null
check_error
fi
if [ ! -z "$BD_PACKAGE_BIN_CONTENT" ]; then
echo "->Build the binary package..."
tar -czvf ${pck_path_base}/${BD_PACKAGE_NAME}_chenyq.arm.tgz ${BD_PACKAGE_BIN_CONTENT} -C / > /dev/null
check_error
fi
rm -fr ${BD_ROOT}
check_error
n, 编译gtk用到的脚本
export CFLAGS="$ARM_CFLAGS $CFLAGS"
export LDFLAGS="$ARM_LDFLAGS -Wl,--rpath-link -Wl,$TARGET_PREFIX/usr/lib/ $LDFLAGS"
export PATH="`pwd`/depends_apps:$TARGET_PREFIX/usr/bin:$PATH"
export PKG_CONFIG_PATH=$TARGET_PREFIX/usr/lib/pkgconfig:$PKG_CONFIG_PATH
# Set the build system vars here
AC_CACHE_FILE="arm-linux.cache"
BD_SRC_DIR="${ARM_HOME}/softs/sources/gtkfb/gtk+-2.10.13"
BD_PACKAGE_NAME="gtk+-2.10.13"
BD_ROOT="/tmp/${BD_PACKAGE_NAME}"
BD_PREFIX="/usr"
BD_DEST_DIR="${ARM_HOME}/arm_pkgs/gtkfb"
BD_CONFIG_OPTIONS="--host=arm-linux --with-gdktarget=directfb --without-x --disable-glibtest --cache-file=$AC_CACHE_FILE"
BD_MAKE_OPTIONS=
BD_MAKE_INSTALL_OPTIONS="DESTDIR=$BD_ROOT"
BD_MAKE_CLEAN_OPTIONS=
# Set the packages build parted
BD_PACKAGE_DEV_CONTENT="usr/share/aclocal usr/share/gtk-2.0 usr/lib/*.la usr/lib/*/*/*/*.la usr/lib/pkgconfig usr/include"
BD_PACKAGE_DOC_CONTENT="usr/share/gtk-doc usr/share/man"
BD_PACKAGE_LOCALE_CONTENT="usr/share/locale"
BD_PACKAGE_BIN_CONTENT="usr/share/themes usr/bin usr/lib/*.so* usr/lib/*/*/*/*.so*"
# Set the strip variables
BD_STRIP_OPTIONS="--strip-debug"
BD_STRIP_CONTENT="usr/bin/* usr/lib/* usr/lib/*/*/*/*"
function bd_info() {
echo "#####################################################################"
echo "#$1"
echo "#####################################################################"
}
function check_error() {
if [ ! "$?" = "0" ]; then
echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
echo "! Build error at: `date`"
echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
exit 1
fi
}
# Check need vars
if [ -z "${BD_SRC_DIR}" ]; then
echo "Must set the /${BD_SRC_DIR}"
exit 1
elif [ -z "${BD_PACKAGE_NAME}" ]; then
echo "Must set the /${BD_PACKAGE_NAME}"
exit 1
elif [ -z "${BD_DEST_DIR}" ]; then
echo "Must set the /${BD_DEST_DIR}"
exit 1
elif [ -z "${BD_ROOT}" ]; then
echo "Must set the /${BD_ROOT}"
exit 1
elif [ -z "${BD_PACKAGE_DEV_CONTENT}" ] && [ -z "${BD_PACKAGE_DOC_CONTENT}" ] && [ -z "${BD_PACKAGE_BIN_CONTENT}" ]; then
echo "Must set one of the package conent of /${BD_PACKAGE_DEV_CONTENT},/${BD_PACKAGE_DOC_CONTENT}, /${BD_PACKAGE_BIN_CONTENT}"
exit 1
fi
# Begin to configure if configure options length is not zero
cd $BD_SRC_DIR
if [ ! "${BD_CONFIG_OPTIONS}" = "NO-CONFIG" ]; then
bd_info "Begin to configure ..."
# Fix some problems
echo ac_cv_path_CUPS_CONFIG=no > $AC_CACHE_FILE
./configure --prefix=${BD_PREFIX} ${BD_CONFIG_OPTIONS}
check_error
fi
# Begin to make
if [ ! "${BD_MAKE_OPTIONS}" = "NO-MAKE" ]; then
bd_info "Begin to make ..."
make ${BD_MAKE_OPTIONS}
check_error
fi
# Begin to make install
rm -fr "${BD_ROOT}"
mkdir -p "${BD_ROOT}"
check_error
if [ ! "${BD_MAKE_INSTALL_OPTIONS}" = "NO-INSTALL" ]; then
bd_info "Begin to make install ..."
make $BD_MAKE_INSTALL_OPTIONS install
check_error
fi
# Begin to clean
if [ ! "${BD_MAKE_CLEAN_OPTIONS}" = "NO-CLEAN" ]; then
bd_info "Begin to make clean ..."
make $BD_MAKE_CLEAN_OPTIONS clean
check_error
fi
# Begin to package
bd_info "Begin to make package ..."
if [ ! -d ${BD_DEST_DIR} ]; then
mkdir -p ${BD_DEST_DIR}
check_error
fi
cd $BD_ROOT
# Get package base directory path
pck_path_base="${BD_DEST_DIR}/${BD_PACKAGE_NAME}"
mkdir -p $pck_path_base
check_error
# Strip specialy symbols
if [ ! -z "$BD_STRIP_CONTENT" ]; then
echo "->Stip unneeded symbols..."
arm-linux-strip $BD_STRIP_OPTIONS $BD_STRIP_CONTENT
fi
# Compress and make packages
if [ ! -z "$BD_PACKAGE_DEV_CONTENT" ]; then
echo "->Build the develop package..."
tar -czvf ${pck_path_base}/${BD_PACKAGE_NAME}-dev_chenyq.arm.tgz ${BD_PACKAGE_DEV_CONTENT} -C / > /dev/null
check_error
fi
if [ ! -z "$BD_PACKAGE_DOC_CONTENT" ]; then
echo "->Build the document package..."
tar -czvf ${pck_path_base}/${BD_PACKAGE_NAME}-doc_chenyq.arm.tgz ${BD_PACKAGE_DOC_CONTENT} -C / > /dev/null
check_error
fi
if [ ! -z "$BD_PACKAGE_LOCALE_CONTENT" ]; then
echo "->Build the locales package..."
tar -czvf ${pck_path_base}/${BD_PACKAGE_NAME}-nls_chenyq.arm.tgz ${BD_PACKAGE_LOCALE_CONTENT} -C / > /dev/null
check_error
fi
if [ ! -z "$BD_PACKAGE_BIN_CONTENT" ]; then
echo "->Build the binary package..."
tar -czvf ${pck_path_base}/${BD_PACKAGE_NAME}_chenyq.arm.tgz ${BD_PACKAGE_BIN_CONTENT} -C / > /dev/null
check_error
fi
rm -fr ${BD_ROOT}
check_error
gtk+交叉编译时需要注意的事项, 在进行gtk交叉编译的时候编译时需要用到属主系统上的某些程序用来生成代码或者资源文件,用到的属主系统的程序有:
glib-genmarshal 该程序版本需要和当前交叉编译的glib的版本一致
gtk-update-icon-cache 同上
这两个程序可从属主系统上的glib和gtk包中取得,如果属主系统上的版本太低,可从其他发行版的包中取得,只要你的属主上已经装有了glib和gtk+,那这两个程序无论从哪取得都可以正确运行
随便拷贝一个ttf或者pcf字体到$ARM_ROOT/usr/share/fonts目录下
在开发版上运行pango-querymodules把输出保存为如:
$ARM_ROOT/etc/pango/pango.modules的文件
如果你的开发版上已经有了触摸屏的驱动,如果要使用directfb的linuxinput驱动层:
检查你的开发版上的/dev下有没有input目录如果没有则自己需要建立, 该目录下的
设备文件信息可从你的开发版上的/sys/class/input中获取
如果都设置ok了, 哪现在你的开发版已经可以使用带触摸屏的gtk+了,呵呵!
在交叉编译过程中需要修正*.la的libtool库文件和*.pc文件,下面是修正的脚本:
Fix *.la:
LIBTOOL_FILE_DIR=$TARGET_PREFIX/usr/lib/
for file in `ls $LIBTOOL_FILE_DIR/*.la`
do
# fix libdir variable
libdir=`sed -n "/^libdir=/.*/p" $file`
if [ -z "$libdir" ]; then
echo "Warning, can not find partern in file $file"
else
cp $file "$file"_tmp
sed '/^libdir=/.*/c/libdir="$TARGET_PREFIX/usr/lib"' "$file"_tmp > $file
rm -f "$file"_tmp
fi
# fix dependency lib
new_depend_lib_var=" ";
depend_lib_var=`sed -n "/^dependency_libs=/.*/p" $file`
depend_lib=`echo $depend_lib_var | cut -d= -f2`
depend_lib=`echo $depend_lib | sed "1,$ s/['|/"]//g"`
for dlib in $depend_lib
do
if [ -z `echo $dlib | grep -o '$TARGET_PREFIX'` ] && [ -z `echo $dlib | grep "$TARGET_PREFIX"` ] /
&& [ -z `echo $dlib | grep 'crosstool'` ] && [ ! -z `echo $dlib | grep '/usr/lib'` ]; then
dlib=`echo $dlib | sed '1,$ s///usr//lib/$TARGET_PREFIX//usr//lib/g'`
new_depend_lib_var="$new_depend_lib_var $dlib"
elif [ ! -z $dlib ]; then
new_depend_lib_var="$new_depend_lib_var $dlib"
fi
done
cp $file "$file"_tmp
dep_sed_ptrn="/^dependency_libs=//.*/c//dependency_libs=/"$new_depend_lib_var/""
sed "$dep_sed_ptrn" "$file"_tmp > $file
rm -f "$file"_tmp
done
fix *.pc:
PKG_CONFIG_FILE_DIR=$TARGET_PREFIX/usr/lib/pkgconfig
for file in `ls $PKG_CONFIG_FILE_DIR/*.pc`
do
found=`sed -n "/^prefix=/.*/p" $file`
if [ -z "$found" ]; then
echo "Warning, can not find partern in file $file"
else
cp $file "$file"_tmp
sed "/^prefix=/.*/c/prefix=$TARGET_PREFIX/usr" "$file"_tmp > $file
rm -f "$file"_tmp
fi
done