1 Star 0 Fork 1

lineCode / libpdk

forked from libpdk / libpdk 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
install 1.67 KB
一键复制 编辑 原始数据 按行查看 历史
zzu_softboy 提交于 2017-11-09 21:34 . add install shell script
#!/bin/bash
function _cleanup()
{
unset -f _usage _cleanup ; return 0
}
## Clear out nested functions on exit
trap _cleanup INT EXIT RETURN
###### some declarations ######
forceBuild=no
function _usage() {
###### U S A G E : Help and ERROR ######
echo $@
echo "Usage:"
echo "./install [-f]"
}
[ $# = 0 ] && _usage " >>>>>>>> no options given "
##################################################################
####### "getopts" with: short options AND long options #######
####### AND short/long arguments #######
while getopts ':f-' OPTION ; do
case "$OPTION" in
f ) forceBuild=yes ;;
- ) [ $OPTIND -ge 1 ] && optind=$(expr $OPTIND - 1 ) || optind=$OPTIND
eval OPTION="\$$optind"
OPTARG=$(echo $OPTION | cut -d'=' -f2)
OPTION=$(echo $OPTION | cut -d'=' -f1)
case $OPTION in
--force ) forceBuild=yes ;;
* ) _usage " Long: >>>>>>>> invalid options (long) ";exit 1;;
esac
OPTIND=1
shift
;;
? ) _usage "Short: >>>>>>>> invalid options (short) ";exit 1;;
esac
done
echo -e "Welcome to use libpdk project"
if [ ! -d "build" ]
then
echo -e "create the build directory"
mkdir build
cd build
else
cd build
if [ "$forceBuild" == "yes" ]
then
echo -e "clean the build directory"
rm -Rf *
fi
fi
echo -e "init the submodules of libpdk project"
git submodule init
echo -e "build configure libpdk"
cmake ../
if [ $? ]
then
echo "something is wrong, maybe the build system can't find php-config"
echo "you can try ./install --php-config-path=path"
fi
C/C++
1
https://gitee.com/lineco/libpdk.git
git@gitee.com:lineco/libpdk.git
lineco
libpdk
libpdk
master

搜索帮助

53164aa7 5694891 3bd8fe86 5694891