Chinaunix首页 | 论坛 | 博客
  • 博客访问: 84680
  • 博文数量: 22
  • 博客积分: 2200
  • 博客等级: 大尉
  • 技术积分: 640
  • 用 户 组: 普通用户
  • 注册时间: 2007-09-16 22:20
文章分类
文章存档

2011年(1)

2008年(21)

我的朋友

分类: LINUX

2008-05-18 11:12:43


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
阅读(634) | 评论(0) | 转发(0) |
0

上一篇:LINUX使用技巧

下一篇:待续----------

给主人留下些什么吧!~~