diff --git a/trunk/auto/apps.sh b/trunk/auto/apps.sh index 6b9fbf88f..59fc92672 100755 --- a/trunk/auto/apps.sh +++ b/trunk/auto/apps.sh @@ -17,7 +17,7 @@ FILE=${SRS_OBJS}/${SRS_MAKEFILE} APP_TARGET="${SRS_OBJS_DIR}/${APP_NAME}" -echo "generate app ${APP_NAME} depends..."; +echo "Generating app ${APP_NAME} depends."; echo "# build ${APP_TARGET}" >> ${FILE} # generate the binary depends, for example: @@ -52,7 +52,7 @@ for item in ${MODULE_OBJS[*]}; do done echo "" >> ${FILE} -echo "generate app ${APP_NAME} link..."; +echo "Generating app ${APP_NAME} link."; # genereate the actual link command, for example: # $(LINK) -o objs/srs objs/src/core/srs_core.o -ldl @@ -89,4 +89,4 @@ done echo -n "${LINK_OPTIONS}" >> ${FILE} echo "" >> ${FILE} -echo -n "generate app ${APP_NAME} ok"; echo '!'; +echo -n "Generate app ${APP_NAME} ok"; echo '!'; diff --git a/trunk/auto/depends.sh b/trunk/auto/depends.sh index 58b9286a4..2af8df503 100755 --- a/trunk/auto/depends.sh +++ b/trunk/auto/depends.sh @@ -25,8 +25,8 @@ function require_sudoer() } # TODO: check gcc/g++ -echo "check gcc/g++/gdb/make" -echo "depends tools are ok" +echo "Checking gcc/g++/gdb/make." +echo "Required tools are ok." ##################################################################################### # for Ubuntu, auto install tools by apt-get ##################################################################################### @@ -34,7 +34,7 @@ OS_IS_UBUNTU=NO function Ubuntu_prepare() { if [ $SRS_CUBIE = YES ]; then - echo "for cubieboard, use ubuntu prepare" + echo "For cubieboard, please use ubuntu prepare." else uname -v|grep Ubuntu >/dev/null 2>&1 ret=$?; if [[ 0 -ne $ret ]]; then @@ -49,97 +49,97 @@ function Ubuntu_prepare() # cross build for arm, install the cross build tool chain. if [ $SRS_ARM_UBUNTU12 = YES ]; then $SrsArmCC --help >/dev/null 2>&1; ret=$?; if [[ 0 -ne $ret ]]; then - echo "install gcc-arm-linux-gnueabi g++-arm-linux-gnueabi" + echo "Installing gcc-arm-linux-gnueabi g++-arm-linux-gnueabi." require_sudoer "sudo apt-get install -y --force-yes gcc-arm-linux-gnueabi g++-arm-linux-gnueabi" sudo apt-get install -y --force-yes gcc-arm-linux-gnueabi g++-arm-linux-gnueabi; ret=$?; if [[ 0 -ne $ret ]]; then return $ret; fi - echo "install gcc-arm-linux-gnueabi g++-arm-linux-gnueabi success" + echo "The gcc-arm-linux-gnueabi g++-arm-linux-gnueabi are installed." fi fi # cross build for mips, user must installed the tool chain. if [ $SRS_MIPS_UBUNTU12 = YES ]; then $SrsArmCC --help >/dev/null 2>&1; ret=$?; if [[ 0 -ne $ret ]]; then - echo "user must install the tool chain: $SrsArmCC" + echo "You must install the tool chain: $SrsArmCC" return 2 fi fi OS_IS_UBUNTU=YES - echo "Ubuntu detected, install tools if needed" + echo "Installing tools for Ubuntu." gcc --help >/dev/null 2>&1; ret=$?; if [[ 0 -ne $ret ]]; then - echo "install gcc" + echo "Installing gcc." require_sudoer "sudo apt-get install -y --force-yes gcc" sudo apt-get install -y --force-yes gcc; ret=$?; if [[ 0 -ne $ret ]]; then return $ret; fi - echo "install gcc success" + echo "The gcc is installed." fi g++ --help >/dev/null 2>&1; ret=$?; if [[ 0 -ne $ret ]]; then - echo "install g++" + echo "Installing g++." require_sudoer "sudo apt-get install -y --force-yes g++" sudo apt-get install -y --force-yes g++; ret=$?; if [[ 0 -ne $ret ]]; then return $ret; fi - echo "install g++ success" + echo "The g++ is installed." fi make --help >/dev/null 2>&1; ret=$?; if [[ 0 -ne $ret ]]; then - echo "install make" + echo "Installing make." require_sudoer "sudo apt-get install -y --force-yes make" sudo apt-get install -y --force-yes make; ret=$?; if [[ 0 -ne $ret ]]; then return $ret; fi - echo "install make success" + echo "The make is installed." fi patch --help >/dev/null 2>&1; ret=$?; if [[ 0 -ne $ret ]]; then - echo "install patch" + echo "Installing patch." require_sudoer "sudo apt-get install -y --force-yes patch" sudo apt-get install -y --force-yes patch; ret=$?; if [[ 0 -ne $ret ]]; then return $ret; fi - echo "install patch success" + echo "The patch is installed." fi unzip --help >/dev/null 2>&1; ret=$?; if [[ 0 -ne $ret ]]; then - echo "install unzip" + echo "Installing unzip." require_sudoer "sudo apt-get install -y --force-yes unzip" sudo apt-get install -y --force-yes unzip; ret=$?; if [[ 0 -ne $ret ]]; then return $ret; fi - echo "install unzip success" + echo "The unzip is installed." fi if [ $SRS_NGINX = YES ]; then if [[ ! -f /usr/include/pcre.h ]]; then - echo "install libpcre3-dev" + echo "Installing libpcre3-dev." require_sudoer "sudo apt-get install -y --force-yes libpcre3-dev" sudo apt-get install -y --force-yes libpcre3-dev; ret=$?; if [[ 0 -ne $ret ]]; then return $ret; fi - echo "install libpcre3-dev success" + echo "The libpcre3-dev is installed." fi fi if [ $SRS_FFMPEG_TOOL = YES ]; then autoconf --help >/dev/null 2>&1; ret=$?; if [[ 0 -ne $ret ]]; then - echo "install autoconf" + echo "Installing autoconf." require_sudoer "sudo apt-get install -y --force-yes autoconf" sudo apt-get install -y --force-yes autoconf; ret=$?; if [[ 0 -ne $ret ]]; then return $ret; fi - echo "install autoconf success" + echo "The autoconf is installed." fi libtool --help >/dev/null 2>&1; ret=$?; if [[ 0 -ne $ret ]]; then - echo "install libtool" + echo "Installing libtool." require_sudoer "sudo apt-get install -y --force-yes libtool" sudo apt-get install -y --force-yes libtool; ret=$?; if [[ 0 -ne $ret ]]; then return $ret; fi - echo "install libtool success" + echo "The libtool is installed." fi if [[ ! -f /usr/include/zlib.h ]]; then - echo "install zlib1g-dev" + echo "Installing zlib1g-dev." require_sudoer "sudo apt-get install -y --force-yes zlib1g-dev" sudo apt-get install -y --force-yes zlib1g-dev; ret=$?; if [[ 0 -ne $ret ]]; then return $ret; fi - echo "install zlib1g-dev success" + echo "The zlib1g-dev is installed." fi fi - echo "Ubuntu install tools success" + echo "Tools for Ubuntu are installed." return 0 } # donot prepare tools, for srs-librtmp depends only gcc and g++. if [ $SRS_EXPORT_LIBRTMP_PROJECT = NO ]; then - Ubuntu_prepare; ret=$?; if [[ 0 -ne $ret ]]; then echo "Ubuntu prepare failed, ret=$ret"; exit $ret; fi + Ubuntu_prepare; ret=$?; if [[ 0 -ne $ret ]]; then echo "Install tools for ubuntu failed, ret=$ret"; exit $ret; fi fi ##################################################################################### # for Centos, auto install tools by yum @@ -153,93 +153,93 @@ function Centos_prepare() # cross build for arm, install the cross build tool chain. if [ $SRS_CROSS_BUILD = YES ]; then - echo "embeded(arm/mips) is invalid for CentOS" + echo "CentOS doesn't support crossbuild for arm/mips, please use Ubuntu instead." return 1 fi OS_IS_CENTOS=YES - echo "Centos detected, install tools if needed" + echo "Installing tools for Centos." gcc --help >/dev/null 2>&1; ret=$?; if [[ 0 -ne $ret ]]; then - echo "install gcc" + echo "Installing gcc." require_sudoer "sudo yum install -y gcc" sudo yum install -y gcc; ret=$?; if [[ 0 -ne $ret ]]; then return $ret; fi - echo "install gcc success" + echo "The gcc is installed." fi g++ --help >/dev/null 2>&1; ret=$?; if [[ 0 -ne $ret ]]; then - echo "install gcc-c++" + echo "Installing gcc-c++." require_sudoer "sudo yum install -y gcc-c++" sudo yum install -y gcc-c++; ret=$?; if [[ 0 -ne $ret ]]; then return $ret; fi - echo "install gcc-c++ success" + echo "The gcc-c++ is installed." fi make --help >/dev/null 2>&1; ret=$?; if [[ 0 -ne $ret ]]; then - echo "install make" + echo "Installing make." require_sudoer "sudo yum install -y make" sudo yum install -y make; ret=$?; if [[ 0 -ne $ret ]]; then return $ret; fi - echo "install make success" + echo "The make is installed." fi patch --help >/dev/null 2>&1; ret=$?; if [[ 0 -ne $ret ]]; then - echo "install patch" + echo "Installing patch." require_sudoer "sudo yum install -y patch" sudo yum install -y patch; ret=$?; if [[ 0 -ne $ret ]]; then return $ret; fi - echo "install patch success" + echo "The patch is installed." fi unzip --help >/dev/null 2>&1; ret=$?; if [[ 0 -ne $ret ]]; then - echo "install unzip" + echo "Installing unzip." require_sudoer "sudo yum install -y unzip" sudo yum install -y unzip; ret=$?; if [[ 0 -ne $ret ]]; then return $ret; fi - echo "install unzip success" + echo "The unzip is installed." fi if [ $SRS_NGINX = YES ]; then if [[ ! -f /usr/include/pcre.h ]]; then - echo "install pcre-devel" + echo "Installing pcre-devel." require_sudoer "sudo yum install -y pcre-devel" sudo yum install -y pcre-devel; ret=$?; if [[ 0 -ne $ret ]]; then return $ret; fi - echo "install pcre-devel success" + echo "The pcre-devel is installed." fi fi if [ $SRS_FFMPEG_TOOL = YES ]; then automake --help >/dev/null 2>&1; ret=$?; if [[ 0 -ne $ret ]]; then - echo "install automake" + echo "Installing automake." require_sudoer "sudo yum install -y automake" sudo yum install -y automake; ret=$?; if [[ 0 -ne $ret ]]; then return $ret; fi - echo "install automake success" + echo "The automake is installed." fi autoconf --help >/dev/null 2>&1; ret=$?; if [[ 0 -ne $ret ]]; then - echo "install autoconf" + echo "Installing autoconf." require_sudoer "sudo yum install -y autoconf" sudo yum install -y autoconf; ret=$?; if [[ 0 -ne $ret ]]; then return $ret; fi - echo "install autoconf success" + echo "The autoconf is installed." fi libtool --help >/dev/null 2>&1; ret=$?; if [[ 0 -ne $ret ]]; then - echo "install libtool" + echo "Installing libtool." require_sudoer "sudo yum install -y libtool" sudo yum install -y libtool; ret=$?; if [[ 0 -ne $ret ]]; then return $ret; fi - echo "install libtool success" + echo "The libtool is installed." fi if [[ ! -f /usr/include/zlib.h ]]; then - echo "install zlib-devel" + echo "Installing zlib-devel." require_sudoer "sudo yum install -y zlib-devel" sudo yum install -y zlib-devel; ret=$?; if [[ 0 -ne $ret ]]; then return $ret; fi - echo "install zlib-devel success" + echo "The zlib-devel is installed." fi fi - echo "Centos install tools success" + echo "Tools for Centos are installed." return 0 } # donot prepare tools, for srs-librtmp depends only gcc and g++. if [ $SRS_EXPORT_LIBRTMP_PROJECT = NO ]; then - Centos_prepare; ret=$?; if [[ 0 -ne $ret ]]; then echo "CentOS prepare failed, ret=$ret"; exit $ret; fi + Centos_prepare; ret=$?; if [[ 0 -ne $ret ]]; then echo "Install tools for CentOS failed, ret=$ret"; exit $ret; fi fi ##################################################################################### # for Centos, auto install tools by yum @@ -250,7 +250,7 @@ function OSX_prepare() uname -s|grep Darwin >/dev/null 2>&1 ret=$?; if [[ 0 -ne $ret ]]; then if [ $SRS_OSX = YES ]; then - echo "OSX check failed, actual is `uname -s`" + echo "Current OS `uname -s` is not OSX, please check your configure options." exit 1; fi return 0; @@ -258,110 +258,110 @@ function OSX_prepare() # cross build for arm, install the cross build tool chain. if [ $SRS_CROSS_BUILD = YES ]; then - echo "embeded(arm/mips) is invalid for OSX" + echo "OSX doesn't support crossbuild for arm/mips, please use Ubuntu instead." return 1 fi OS_IS_OSX=YES - echo "OSX detected, install tools if needed" + echo "Installing tools for OSX." # requires the osx when os if [ $OS_IS_OSX = YES ]; then if [ $SRS_OSX = NO ]; then - echo "OSX detected, must specifies the --osx" + echo "Invalid configure options for OSX, please specify --osx." exit 1 fi fi brew --help >/dev/null 2>&1; ret=$?; if [[ 0 -ne $ret ]]; then - echo "install brew" + echo "Installing brew." echo "ruby -e \"$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)\"" ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"; ret=$?; if [[ 0 -ne $ret ]]; then return $ret; fi - echo "install brew success" + echo "The brew is installed." fi gcc --help >/dev/null 2>&1; ret=$?; if [[ 0 -ne $ret ]]; then - echo "install gcc" + echo "Installing gcc." echo "brew install gcc" brew install gcc; ret=$?; if [[ 0 -ne $ret ]]; then return $ret; fi - echo "install gcc success" + echo "The gcc is installed." fi g++ --help >/dev/null 2>&1; ret=$?; if [[ 0 -ne $ret ]]; then - echo "install gcc-c++" + echo "Installing gcc-c++." echo "brew install gcc-c++" brew install gcc-c++; ret=$?; if [[ 0 -ne $ret ]]; then return $ret; fi - echo "install gcc-c++ success" + echo "The gcc-c++ is installed." fi make --help >/dev/null 2>&1; ret=$?; if [[ 0 -ne $ret ]]; then - echo "install make" + echo "Installing make." echo "brew install make" brew install make; ret=$?; if [[ 0 -ne $ret ]]; then return $ret; fi - echo "install make success" + echo "The make is installed." fi patch --help >/dev/null 2>&1; ret=$?; if [[ 0 -ne $ret ]]; then - echo "install patch" + echo "Installing patch." echo "brew install patch" brew install patch; ret=$?; if [[ 0 -ne $ret ]]; then return $ret; fi - echo "install patch success" + echo "The patch is installed." fi unzip --help >/dev/null 2>&1; ret=$?; if [[ 0 -ne $ret ]]; then - echo "install unzip" + echo "Installing unzip." echo "brew install unzip" brew install unzip; ret=$?; if [[ 0 -ne $ret ]]; then return $ret; fi - echo "install unzip success" + echo "The unzip is installed." fi if [ $SRS_NGINX = YES ]; then if [[ ! -f /usr/local/include/pcre.h ]]; then - echo "install pcre" + echo "Installing pcre." echo "brew install pcre" brew install pcre; ret=$?; if [[ 0 -ne $ret ]]; then return $ret; fi - echo "install pcre success" + echo "The pcre is installed." fi fi if [ $SRS_FFMPEG_TOOL = YES ]; then automake --help >/dev/null 2>&1; ret=$?; if [[ 0 -ne $ret ]]; then - echo "install automake" + echo "Installing automake." echo "brew install automake" brew install automake; ret=$?; if [[ 0 -ne $ret ]]; then return $ret; fi - echo "install automake success" + echo "The automake is installed." fi autoconf --help >/dev/null 2>&1; ret=$?; if [[ 0 -ne $ret ]]; then - echo "install autoconf" + echo "Installing autoconf." echo "brew install autoconf" brew install autoconf; ret=$?; if [[ 0 -ne $ret ]]; then return $ret; fi - echo "install autoconf success" + echo "The autoconf is installed." fi which libtool >/dev/null 2>&1; ret=$?; if [[ 0 -ne $ret ]]; then - echo "install libtool" + echo "Installing libtool." echo "brew install libtool" brew install libtool; ret=$?; if [[ 0 -ne $ret ]]; then return $ret; fi - echo "install libtool success" + echo "The libtool is installed." fi brew info zlib >/dev/null 2>&1; ret=$?; if [[ 0 -ne $ret ]]; then - echo "install zlib" + echo "Installing zlib." echo "brew install zlib" brew install zlib; ret=$?; if [[ 0 -ne $ret ]]; then return $ret; fi - echo "install zlib success" + echo "The zlib is installed." fi fi - echo "OSX install tools success" + echo "Tools for OSX are installed." return 0 } # donot prepare tools, for srs-librtmp depends only gcc and g++. if [ $SRS_EXPORT_LIBRTMP_PROJECT = NO ]; then - OSX_prepare; ret=$?; if [[ 0 -ne $ret ]]; then echo "OSX prepare failed, ret=$ret"; exit $ret; fi + OSX_prepare; ret=$?; if [[ 0 -ne $ret ]]; then echo "Install tools for OSX failed, ret=$ret"; exit $ret; fi fi -# the sed command +# We must use a bash function instead of variable. function sed_utility() { if [ $OS_IS_OSX = YES ]; then sed -i '' "$@" @@ -391,7 +391,7 @@ SED="sed_utility" && echo "SED is $SED" # others is invalid. if [[ $OS_IS_UBUNTU = NO && $OS_IS_CENTOS = NO && $OS_IS_OSX = NO && $SRS_EXPORT_LIBRTMP_PROJECT = NO ]]; then if [[ $SRS_PI = NO && $SRS_CUBIE = NO && $SRS_CROSS_BUILD = NO ]]; then - echo "what a fuck, os not supported." + echo "What a fuck, your OS `uname -s` is not supported." exit 1 fi fi @@ -411,11 +411,11 @@ if [ $SRS_EXPORT_LIBRTMP_PROJECT = NO ]; then if [ $SRS_CROSS_BUILD = YES ]; then # ok, arm specified, if the flag filed does not exists, need to rebuild. if [[ -f ${SRS_OBJS}/_flag.st.cross.build.tmp && -f ${SRS_OBJS}/st/libst.a ]]; then - echo "st-1.9t for arm is ok."; + echo "The st-1.9t for arm is ok."; else # TODO: FIXME: patch the bug. # patch st for arm, @see: https://github.com/ossrs/srs/wiki/v1_CN_SrsLinuxArm#st-arm-bug-fix - echo "build st-1.9t for arm"; + echo "Building st-1.9t for arm."; ( rm -rf ${SRS_OBJS}/st-1.9 && cd ${SRS_OBJS} && unzip -q ../3rdparty/st-1.9.zip && cd st-1.9 && chmod +w * && @@ -429,10 +429,10 @@ if [ $SRS_EXPORT_LIBRTMP_PROJECT = NO ]; then fi else if [[ ! -f ${SRS_OBJS}/_flag.st.cross.build.tmp && -f ${SRS_OBJS}/st/libst.a ]]; then - echo "st-1.9t is ok."; + echo "The st-1.9t is ok."; else # patch st for arm, @see: https://github.com/ossrs/srs/wiki/v1_CN_SrsLinuxArm#st-arm-bug-fix - echo "build st-1.9t"; + echo "Building st-1.9t."; ( rm -rf ${SRS_OBJS}/st-1.9 && cd ${SRS_OBJS} && unzip -q ../3rdparty/st-1.9.zip && cd st-1.9 && chmod +w * && @@ -446,8 +446,8 @@ if [ $SRS_EXPORT_LIBRTMP_PROJECT = NO ]; then fi fi # check status - ret=$?; if [[ $ret -ne 0 ]]; then echo "build st-1.9 failed, ret=$ret"; exit $ret; fi - if [ ! -f ${SRS_OBJS}/st/libst.a ]; then echo "build st-1.9 static lib failed."; exit -1; fi + ret=$?; if [[ $ret -ne 0 ]]; then echo "Build st-1.9 failed, ret=$ret"; exit $ret; fi + if [ ! -f ${SRS_OBJS}/st/libst.a ]; then echo "Build st-1.9 static lib failed."; exit -1; fi fi ##################################################################################### @@ -455,7 +455,7 @@ fi ##################################################################################### # check the cross build flag file, if flag changed, need to rebuild the st. if [ $SRS_HTTP_CORE = YES ]; then - echo "http-parser is copied into srs_http_stack.*pp" + echo "The http-parser is copied into srs_http_stack.*pp" fi ##################################################################################### @@ -464,10 +464,8 @@ fi function write_nginx_html5() { cat< ${html_file} -