1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-02-15 04:42:04 +00:00

refine typo

This commit is contained in:
winlin 2016-12-07 12:09:39 +08:00
parent f6c8e02cca
commit 28517849ed
11 changed files with 271 additions and 315 deletions

View file

@ -17,7 +17,7 @@ FILE=${SRS_OBJS}/${SRS_MAKEFILE}
APP_TARGET="${SRS_OBJS_DIR}/${APP_NAME}" APP_TARGET="${SRS_OBJS_DIR}/${APP_NAME}"
echo "generate app ${APP_NAME} depends..."; echo "Generating app ${APP_NAME} depends.";
echo "# build ${APP_TARGET}" >> ${FILE} echo "# build ${APP_TARGET}" >> ${FILE}
# generate the binary depends, for example: # generate the binary depends, for example:
@ -52,7 +52,7 @@ for item in ${MODULE_OBJS[*]}; do
done done
echo "" >> ${FILE} echo "" >> ${FILE}
echo "generate app ${APP_NAME} link..."; echo "Generating app ${APP_NAME} link.";
# genereate the actual link command, for example: # genereate the actual link command, for example:
# $(LINK) -o objs/srs objs/src/core/srs_core.o -ldl # $(LINK) -o objs/srs objs/src/core/srs_core.o -ldl
@ -89,4 +89,4 @@ done
echo -n "${LINK_OPTIONS}" >> ${FILE} echo -n "${LINK_OPTIONS}" >> ${FILE}
echo "" >> ${FILE} echo "" >> ${FILE}
echo -n "generate app ${APP_NAME} ok"; echo '!'; echo -n "Generate app ${APP_NAME} ok"; echo '!';

View file

@ -25,8 +25,8 @@ function require_sudoer()
} }
# TODO: check gcc/g++ # TODO: check gcc/g++
echo "check gcc/g++/gdb/make" echo "Checking gcc/g++/gdb/make."
echo "depends tools are ok" echo "Required tools are ok."
##################################################################################### #####################################################################################
# for Ubuntu, auto install tools by apt-get # for Ubuntu, auto install tools by apt-get
##################################################################################### #####################################################################################
@ -34,7 +34,7 @@ OS_IS_UBUNTU=NO
function Ubuntu_prepare() function Ubuntu_prepare()
{ {
if [ $SRS_CUBIE = YES ]; then if [ $SRS_CUBIE = YES ]; then
echo "for cubieboard, use ubuntu prepare" echo "For cubieboard, please use ubuntu prepare."
else else
uname -v|grep Ubuntu >/dev/null 2>&1 uname -v|grep Ubuntu >/dev/null 2>&1
ret=$?; if [[ 0 -ne $ret ]]; then ret=$?; if [[ 0 -ne $ret ]]; then
@ -49,97 +49,97 @@ function Ubuntu_prepare()
# cross build for arm, install the cross build tool chain. # cross build for arm, install the cross build tool chain.
if [ $SRS_ARM_UBUNTU12 = YES ]; then if [ $SRS_ARM_UBUNTU12 = YES ]; then
$SrsArmCC --help >/dev/null 2>&1; ret=$?; if [[ 0 -ne $ret ]]; 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" 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 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
fi fi
# cross build for mips, user must installed the tool chain. # cross build for mips, user must installed the tool chain.
if [ $SRS_MIPS_UBUNTU12 = YES ]; then if [ $SRS_MIPS_UBUNTU12 = YES ]; then
$SrsArmCC --help >/dev/null 2>&1; ret=$?; if [[ 0 -ne $ret ]]; 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 return 2
fi fi
fi fi
OS_IS_UBUNTU=YES 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 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" 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 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 fi
g++ --help >/dev/null 2>&1; ret=$?; if [[ 0 -ne $ret ]]; then 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++" 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 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 fi
make --help >/dev/null 2>&1; ret=$?; if [[ 0 -ne $ret ]]; then 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" 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 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 fi
patch --help >/dev/null 2>&1; ret=$?; if [[ 0 -ne $ret ]]; then 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" 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 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 fi
unzip --help >/dev/null 2>&1; ret=$?; if [[ 0 -ne $ret ]]; then 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" 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 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 fi
if [ $SRS_NGINX = YES ]; then if [ $SRS_NGINX = YES ]; then
if [[ ! -f /usr/include/pcre.h ]]; 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" 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 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
fi fi
if [ $SRS_FFMPEG_TOOL = YES ]; then if [ $SRS_FFMPEG_TOOL = YES ]; then
autoconf --help >/dev/null 2>&1; ret=$?; if [[ 0 -ne $ret ]]; 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" 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 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 fi
libtool --help >/dev/null 2>&1; ret=$?; if [[ 0 -ne $ret ]]; then 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" 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 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 fi
if [[ ! -f /usr/include/zlib.h ]]; then 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" 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 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
fi fi
echo "Ubuntu install tools success" echo "Tools for Ubuntu are installed."
return 0 return 0
} }
# donot prepare tools, for srs-librtmp depends only gcc and g++. # donot prepare tools, for srs-librtmp depends only gcc and g++.
if [ $SRS_EXPORT_LIBRTMP_PROJECT = NO ]; then 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 fi
##################################################################################### #####################################################################################
# for Centos, auto install tools by yum # for Centos, auto install tools by yum
@ -153,93 +153,93 @@ function Centos_prepare()
# cross build for arm, install the cross build tool chain. # cross build for arm, install the cross build tool chain.
if [ $SRS_CROSS_BUILD = YES ]; then 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 return 1
fi fi
OS_IS_CENTOS=YES 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 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" require_sudoer "sudo yum install -y gcc"
sudo yum install -y gcc; ret=$?; if [[ 0 -ne $ret ]]; then return $ret; fi sudo yum install -y gcc; ret=$?; if [[ 0 -ne $ret ]]; then return $ret; fi
echo "install gcc success" echo "The gcc is installed."
fi fi
g++ --help >/dev/null 2>&1; ret=$?; if [[ 0 -ne $ret ]]; then 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++" require_sudoer "sudo yum install -y gcc-c++"
sudo yum install -y gcc-c++; ret=$?; if [[ 0 -ne $ret ]]; then return $ret; fi 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 fi
make --help >/dev/null 2>&1; ret=$?; if [[ 0 -ne $ret ]]; then 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" require_sudoer "sudo yum install -y make"
sudo yum install -y make; ret=$?; if [[ 0 -ne $ret ]]; then return $ret; fi sudo yum install -y make; ret=$?; if [[ 0 -ne $ret ]]; then return $ret; fi
echo "install make success" echo "The make is installed."
fi fi
patch --help >/dev/null 2>&1; ret=$?; if [[ 0 -ne $ret ]]; then 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" require_sudoer "sudo yum install -y patch"
sudo yum install -y patch; ret=$?; if [[ 0 -ne $ret ]]; then return $ret; fi sudo yum install -y patch; ret=$?; if [[ 0 -ne $ret ]]; then return $ret; fi
echo "install patch success" echo "The patch is installed."
fi fi
unzip --help >/dev/null 2>&1; ret=$?; if [[ 0 -ne $ret ]]; then 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" require_sudoer "sudo yum install -y unzip"
sudo yum install -y unzip; ret=$?; if [[ 0 -ne $ret ]]; then return $ret; fi sudo yum install -y unzip; ret=$?; if [[ 0 -ne $ret ]]; then return $ret; fi
echo "install unzip success" echo "The unzip is installed."
fi fi
if [ $SRS_NGINX = YES ]; then if [ $SRS_NGINX = YES ]; then
if [[ ! -f /usr/include/pcre.h ]]; then if [[ ! -f /usr/include/pcre.h ]]; then
echo "install pcre-devel" echo "Installing pcre-devel."
require_sudoer "sudo yum install -y 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 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
fi fi
if [ $SRS_FFMPEG_TOOL = YES ]; then if [ $SRS_FFMPEG_TOOL = YES ]; then
automake --help >/dev/null 2>&1; ret=$?; if [[ 0 -ne $ret ]]; 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" require_sudoer "sudo yum install -y automake"
sudo yum install -y automake; ret=$?; if [[ 0 -ne $ret ]]; then return $ret; fi sudo yum install -y automake; ret=$?; if [[ 0 -ne $ret ]]; then return $ret; fi
echo "install automake success" echo "The automake is installed."
fi fi
autoconf --help >/dev/null 2>&1; ret=$?; if [[ 0 -ne $ret ]]; then 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" require_sudoer "sudo yum install -y autoconf"
sudo yum install -y autoconf; ret=$?; if [[ 0 -ne $ret ]]; then return $ret; fi sudo yum install -y autoconf; ret=$?; if [[ 0 -ne $ret ]]; then return $ret; fi
echo "install autoconf success" echo "The autoconf is installed."
fi fi
libtool --help >/dev/null 2>&1; ret=$?; if [[ 0 -ne $ret ]]; then 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" require_sudoer "sudo yum install -y libtool"
sudo yum install -y libtool; ret=$?; if [[ 0 -ne $ret ]]; then return $ret; fi sudo yum install -y libtool; ret=$?; if [[ 0 -ne $ret ]]; then return $ret; fi
echo "install libtool success" echo "The libtool is installed."
fi fi
if [[ ! -f /usr/include/zlib.h ]]; then if [[ ! -f /usr/include/zlib.h ]]; then
echo "install zlib-devel" echo "Installing zlib-devel."
require_sudoer "sudo yum install -y 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 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
fi fi
echo "Centos install tools success" echo "Tools for Centos are installed."
return 0 return 0
} }
# donot prepare tools, for srs-librtmp depends only gcc and g++. # donot prepare tools, for srs-librtmp depends only gcc and g++.
if [ $SRS_EXPORT_LIBRTMP_PROJECT = NO ]; then 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 fi
##################################################################################### #####################################################################################
# for Centos, auto install tools by yum # for Centos, auto install tools by yum
@ -250,7 +250,7 @@ function OSX_prepare()
uname -s|grep Darwin >/dev/null 2>&1 uname -s|grep Darwin >/dev/null 2>&1
ret=$?; if [[ 0 -ne $ret ]]; then ret=$?; if [[ 0 -ne $ret ]]; then
if [ $SRS_OSX = YES ]; 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; exit 1;
fi fi
return 0; return 0;
@ -258,110 +258,110 @@ function OSX_prepare()
# cross build for arm, install the cross build tool chain. # cross build for arm, install the cross build tool chain.
if [ $SRS_CROSS_BUILD = YES ]; then 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 return 1
fi fi
OS_IS_OSX=YES OS_IS_OSX=YES
echo "OSX detected, install tools if needed" echo "Installing tools for OSX."
# requires the osx when os # requires the osx when os
if [ $OS_IS_OSX = YES ]; then if [ $OS_IS_OSX = YES ]; then
if [ $SRS_OSX = NO ]; then if [ $SRS_OSX = NO ]; then
echo "OSX detected, must specifies the --osx" echo "Invalid configure options for OSX, please specify --osx."
exit 1 exit 1
fi fi
fi fi
brew --help >/dev/null 2>&1; ret=$?; if [[ 0 -ne $ret ]]; then 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)\"" 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 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 fi
gcc --help >/dev/null 2>&1; ret=$?; if [[ 0 -ne $ret ]]; then gcc --help >/dev/null 2>&1; ret=$?; if [[ 0 -ne $ret ]]; then
echo "install gcc" echo "Installing gcc."
echo "brew install gcc" echo "brew install gcc"
brew install gcc; ret=$?; if [[ 0 -ne $ret ]]; then return $ret; fi brew install gcc; ret=$?; if [[ 0 -ne $ret ]]; then return $ret; fi
echo "install gcc success" echo "The gcc is installed."
fi fi
g++ --help >/dev/null 2>&1; ret=$?; if [[ 0 -ne $ret ]]; then 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++" echo "brew install gcc-c++"
brew install gcc-c++; ret=$?; if [[ 0 -ne $ret ]]; then return $ret; fi 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 fi
make --help >/dev/null 2>&1; ret=$?; if [[ 0 -ne $ret ]]; then make --help >/dev/null 2>&1; ret=$?; if [[ 0 -ne $ret ]]; then
echo "install make" echo "Installing make."
echo "brew install make" echo "brew install make"
brew install make; ret=$?; if [[ 0 -ne $ret ]]; then return $ret; fi brew install make; ret=$?; if [[ 0 -ne $ret ]]; then return $ret; fi
echo "install make success" echo "The make is installed."
fi fi
patch --help >/dev/null 2>&1; ret=$?; if [[ 0 -ne $ret ]]; then patch --help >/dev/null 2>&1; ret=$?; if [[ 0 -ne $ret ]]; then
echo "install patch" echo "Installing patch."
echo "brew install patch" echo "brew install patch"
brew install patch; ret=$?; if [[ 0 -ne $ret ]]; then return $ret; fi brew install patch; ret=$?; if [[ 0 -ne $ret ]]; then return $ret; fi
echo "install patch success" echo "The patch is installed."
fi fi
unzip --help >/dev/null 2>&1; ret=$?; if [[ 0 -ne $ret ]]; then unzip --help >/dev/null 2>&1; ret=$?; if [[ 0 -ne $ret ]]; then
echo "install unzip" echo "Installing unzip."
echo "brew install unzip" echo "brew install unzip"
brew install unzip; ret=$?; if [[ 0 -ne $ret ]]; then return $ret; fi brew install unzip; ret=$?; if [[ 0 -ne $ret ]]; then return $ret; fi
echo "install unzip success" echo "The unzip is installed."
fi fi
if [ $SRS_NGINX = YES ]; then if [ $SRS_NGINX = YES ]; then
if [[ ! -f /usr/local/include/pcre.h ]]; then if [[ ! -f /usr/local/include/pcre.h ]]; then
echo "install pcre" echo "Installing pcre."
echo "brew install pcre" echo "brew install pcre"
brew install pcre; ret=$?; if [[ 0 -ne $ret ]]; then return $ret; fi brew install pcre; ret=$?; if [[ 0 -ne $ret ]]; then return $ret; fi
echo "install pcre success" echo "The pcre is installed."
fi fi
fi fi
if [ $SRS_FFMPEG_TOOL = YES ]; then if [ $SRS_FFMPEG_TOOL = YES ]; then
automake --help >/dev/null 2>&1; ret=$?; if [[ 0 -ne $ret ]]; then automake --help >/dev/null 2>&1; ret=$?; if [[ 0 -ne $ret ]]; then
echo "install automake" echo "Installing automake."
echo "brew install automake" echo "brew install automake"
brew install automake; ret=$?; if [[ 0 -ne $ret ]]; then return $ret; fi brew install automake; ret=$?; if [[ 0 -ne $ret ]]; then return $ret; fi
echo "install automake success" echo "The automake is installed."
fi fi
autoconf --help >/dev/null 2>&1; ret=$?; if [[ 0 -ne $ret ]]; then autoconf --help >/dev/null 2>&1; ret=$?; if [[ 0 -ne $ret ]]; then
echo "install autoconf" echo "Installing autoconf."
echo "brew install autoconf" echo "brew install autoconf"
brew install autoconf; ret=$?; if [[ 0 -ne $ret ]]; then return $ret; fi brew install autoconf; ret=$?; if [[ 0 -ne $ret ]]; then return $ret; fi
echo "install autoconf success" echo "The autoconf is installed."
fi fi
which libtool >/dev/null 2>&1; ret=$?; if [[ 0 -ne $ret ]]; then which libtool >/dev/null 2>&1; ret=$?; if [[ 0 -ne $ret ]]; then
echo "install libtool" echo "Installing libtool."
echo "brew install libtool" echo "brew install libtool"
brew install libtool; ret=$?; if [[ 0 -ne $ret ]]; then return $ret; fi brew install libtool; ret=$?; if [[ 0 -ne $ret ]]; then return $ret; fi
echo "install libtool success" echo "The libtool is installed."
fi fi
brew info zlib >/dev/null 2>&1; ret=$?; if [[ 0 -ne $ret ]]; then brew info zlib >/dev/null 2>&1; ret=$?; if [[ 0 -ne $ret ]]; then
echo "install zlib" echo "Installing zlib."
echo "brew install zlib" echo "brew install zlib"
brew install zlib; ret=$?; if [[ 0 -ne $ret ]]; then return $ret; fi brew install zlib; ret=$?; if [[ 0 -ne $ret ]]; then return $ret; fi
echo "install zlib success" echo "The zlib is installed."
fi fi
fi fi
echo "OSX install tools success" echo "Tools for OSX are installed."
return 0 return 0
} }
# donot prepare tools, for srs-librtmp depends only gcc and g++. # donot prepare tools, for srs-librtmp depends only gcc and g++.
if [ $SRS_EXPORT_LIBRTMP_PROJECT = NO ]; then 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 fi
# the sed command # We must use a bash function instead of variable.
function sed_utility() { function sed_utility() {
if [ $OS_IS_OSX = YES ]; then if [ $OS_IS_OSX = YES ]; then
sed -i '' "$@" sed -i '' "$@"
@ -391,7 +391,7 @@ SED="sed_utility" && echo "SED is $SED"
# others is invalid. # others is invalid.
if [[ $OS_IS_UBUNTU = NO && $OS_IS_CENTOS = NO && $OS_IS_OSX = NO && $SRS_EXPORT_LIBRTMP_PROJECT = NO ]]; then 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 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 exit 1
fi fi
fi fi
@ -411,11 +411,11 @@ if [ $SRS_EXPORT_LIBRTMP_PROJECT = NO ]; then
if [ $SRS_CROSS_BUILD = YES ]; then if [ $SRS_CROSS_BUILD = YES ]; then
# ok, arm specified, if the flag filed does not exists, need to rebuild. # 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 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 else
# TODO: FIXME: patch the bug. # TODO: FIXME: patch the bug.
# patch st for arm, @see: https://github.com/ossrs/srs/wiki/v1_CN_SrsLinuxArm#st-arm-bug-fix # 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} && rm -rf ${SRS_OBJS}/st-1.9 && cd ${SRS_OBJS} &&
unzip -q ../3rdparty/st-1.9.zip && cd st-1.9 && chmod +w * && 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 fi
else else
if [[ ! -f ${SRS_OBJS}/_flag.st.cross.build.tmp && -f ${SRS_OBJS}/st/libst.a ]]; then 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 else
# patch st for arm, @see: https://github.com/ossrs/srs/wiki/v1_CN_SrsLinuxArm#st-arm-bug-fix # 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} && rm -rf ${SRS_OBJS}/st-1.9 && cd ${SRS_OBJS} &&
unzip -q ../3rdparty/st-1.9.zip && cd st-1.9 && chmod +w * && 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
fi fi
# check status # check status
ret=$?; if [[ $ret -ne 0 ]]; then echo "build st-1.9 failed, ret=$ret"; exit $ret; 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 if [ ! -f ${SRS_OBJS}/st/libst.a ]; then echo "Build st-1.9 static lib failed."; exit -1; fi
fi fi
##################################################################################### #####################################################################################
@ -455,7 +455,7 @@ fi
##################################################################################### #####################################################################################
# check the cross build flag file, if flag changed, need to rebuild the st. # check the cross build flag file, if flag changed, need to rebuild the st.
if [ $SRS_HTTP_CORE = YES ]; then 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 fi
##################################################################################### #####################################################################################
@ -464,10 +464,8 @@ fi
function write_nginx_html5() function write_nginx_html5()
{ {
cat<<END > ${html_file} cat<<END > ${html_file}
<video width="640" height="360" <video "autoplay" "controls" "autobuffer" type="application/vnd.apple.mpegurl"
autoplay controls autobuffer src="${hls_stream}">
src="${hls_stream}"
type="application/vnd.apple.mpegurl">
</video> </video>
END END
} }
@ -479,9 +477,9 @@ fi
__SRS_BUILD_NGINX=NO; if [ $SRS_CROSS_BUILD = NO ]; then if [ $SRS_NGINX = YES ]; then __SRS_BUILD_NGINX=YES; fi fi __SRS_BUILD_NGINX=NO; if [ $SRS_CROSS_BUILD = NO ]; then if [ $SRS_NGINX = YES ]; then __SRS_BUILD_NGINX=YES; fi fi
if [ $__SRS_BUILD_NGINX = YES ]; then if [ $__SRS_BUILD_NGINX = YES ]; then
if [[ -f ${SRS_OBJS}/nginx/sbin/nginx ]]; then if [[ -f ${SRS_OBJS}/nginx/sbin/nginx ]]; then
echo "nginx-1.5.7 is ok."; echo "The nginx-1.5.7 is ok.";
else else
echo "build nginx-1.5.7"; echo "Building nginx-1.5.7";
( (
rm -rf ${SRS_OBJS}/nginx-1.5.7 && cd ${SRS_OBJS} && rm -rf ${SRS_OBJS}/nginx-1.5.7 && cd ${SRS_OBJS} &&
unzip -q ../3rdparty/nginx-1.5.7.zip && cd nginx-1.5.7 && unzip -q ../3rdparty/nginx-1.5.7.zip && cd nginx-1.5.7 &&
@ -490,8 +488,8 @@ if [ $__SRS_BUILD_NGINX = YES ]; then
) )
fi fi
# check status # check status
ret=$?; if [[ $ret -ne 0 ]]; then echo "build nginx-1.5.7 failed, ret=$ret"; exit $ret; fi ret=$?; if [[ $ret -ne 0 ]]; then echo "Build nginx-1.5.7 failed, ret=$ret"; exit $ret; fi
if [ ! -f ${SRS_OBJS}/nginx/sbin/nginx ]; then echo "build nginx-1.5.7 failed."; exit -1; fi if [ ! -f ${SRS_OBJS}/nginx/sbin/nginx ]; then echo "Build nginx-1.5.7 failed."; exit -1; fi
# use current user to config nginx, # use current user to config nginx,
# srs will write ts/m3u8 file use current user, # srs will write ts/m3u8 file use current user,
@ -526,7 +524,7 @@ if [ $SRS_EXPORT_LIBRTMP_PROJECT = NO ]; then
ln -sf `pwd`/research/api-server/static-dir/favicon.ico ${SRS_OBJS}/nginx/html/favicon.ico ln -sf `pwd`/research/api-server/static-dir/favicon.ico ${SRS_OBJS}/nginx/html/favicon.ico
# nginx.html to detect whether nginx is alive # nginx.html to detect whether nginx is alive
echo "nginx is ok" > ${SRS_OBJS}/nginx/html/nginx.html echo "Nginx is ok." > ${SRS_OBJS}/nginx/html/nginx.html
fi fi
##################################################################################### #####################################################################################
@ -537,7 +535,7 @@ if [ $SRS_HTTP_CALLBACK = YES ]; then
echo "CherryPy-3.2.4 is ok."; echo "CherryPy-3.2.4 is ok.";
else else
require_sudoer "install CherryPy-3.2.4" require_sudoer "install CherryPy-3.2.4"
echo "install CherryPy-3.2.4"; echo "Installing CherryPy-3.2.4";
( (
sudo rm -rf ${SRS_OBJS}/CherryPy-3.2.4 && cd ${SRS_OBJS} && sudo rm -rf ${SRS_OBJS}/CherryPy-3.2.4 && cd ${SRS_OBJS} &&
unzip -q ../3rdparty/CherryPy-3.2.4.zip && cd CherryPy-3.2.4 && unzip -q ../3rdparty/CherryPy-3.2.4.zip && cd CherryPy-3.2.4 &&
@ -550,7 +548,7 @@ if [ $SRS_HTTP_CALLBACK = YES ]; then
fi fi
if [ $SRS_EXPORT_LIBRTMP_PROJECT = NO ]; then if [ $SRS_EXPORT_LIBRTMP_PROJECT = NO ]; then
echo "link players to cherrypy static-dir" echo "Link players to cherrypy static-dir"
rm -rf research/api-server/static-dir/players && rm -rf research/api-server/static-dir/players &&
ln -sf `pwd`/research/players research/api-server/static-dir/players && ln -sf `pwd`/research/players research/api-server/static-dir/players &&
rm -f research/api-server/static-dir/crossdomain.xml && rm -f research/api-server/static-dir/crossdomain.xml &&
@ -561,7 +559,7 @@ if [ $SRS_EXPORT_LIBRTMP_PROJECT = NO ]; then
rm -rf research/api-server/static-dir/forward && rm -rf research/api-server/static-dir/forward &&
mkdir -p `pwd`/${SRS_OBJS}/nginx/html/forward && mkdir -p `pwd`/${SRS_OBJS}/nginx/html/forward &&
ln -sf `pwd`/${SRS_OBJS}/nginx/html/forward research/api-server/static-dir/forward ln -sf `pwd`/${SRS_OBJS}/nginx/html/forward research/api-server/static-dir/forward
ret=$?; if [[ $ret -ne 0 ]]; then echo "[warn] link players to cherrypy static-dir failed"; fi ret=$?; if [[ $ret -ne 0 ]]; then echo "Warning: Ignore error to link players to cherrypy static-dir."; fi
fi fi
##################################################################################### #####################################################################################
@ -600,15 +598,15 @@ OPENSSL_HOTFIX="-DOPENSSL_NO_HEARTBEATS"
# upgrade can alternatively recompile OpenSSL with -DOPENSSL_NO_HEARTBEATS. # upgrade can alternatively recompile OpenSSL with -DOPENSSL_NO_HEARTBEATS.
if [ $SRS_SSL = YES ]; then if [ $SRS_SSL = YES ]; then
if [ $SRS_USE_SYS_SSL = YES ]; then if [ $SRS_USE_SYS_SSL = YES ]; then
echo "warning: donot compile ssl, use system ssl" echo "Warning: Use system libssl, without compiling openssl."
else else
# check the cross build flag file, if flag changed, need to rebuild the st. # check the cross build flag file, if flag changed, need to rebuild the st.
if [ $SRS_CROSS_BUILD = YES ]; then if [ $SRS_CROSS_BUILD = YES ]; then
# ok, arm specified, if the flag filed does not exists, need to rebuild. # ok, arm specified, if the flag filed does not exists, need to rebuild.
if [[ -f ${SRS_OBJS}/_flag.ssl.cross.build.tmp && -f ${SRS_OBJS}/openssl/lib/libssl.a ]]; then if [[ -f ${SRS_OBJS}/_flag.ssl.cross.build.tmp && -f ${SRS_OBJS}/openssl/lib/libssl.a ]]; then
echo "openssl-1.0.1f for arm is ok."; echo "The openssl-1.0.1f for arm is ok.";
else else
echo "build openssl-1.0.1f for arm"; echo "Building openssl-1.0.1f for ARM.";
( (
rm -rf ${SRS_OBJS}/openssl-1.0.1f && cd ${SRS_OBJS} && rm -rf ${SRS_OBJS}/openssl-1.0.1f && cd ${SRS_OBJS} &&
unzip -q ../3rdparty/openssl-1.0.1f.zip && cd openssl-1.0.1f && unzip -q ../3rdparty/openssl-1.0.1f.zip && cd openssl-1.0.1f &&
@ -623,9 +621,9 @@ if [ $SRS_SSL = YES ]; then
else else
# cross build not specified, if exists flag, need to rebuild for no-arm platform. # cross build not specified, if exists flag, need to rebuild for no-arm platform.
if [[ ! -f ${SRS_OBJS}/_flag.ssl.cross.build.tmp && -f ${SRS_OBJS}/openssl/lib/libssl.a ]]; then if [[ ! -f ${SRS_OBJS}/_flag.ssl.cross.build.tmp && -f ${SRS_OBJS}/openssl/lib/libssl.a ]]; then
echo "openssl-1.0.1f is ok."; echo "Openssl-1.0.1f is ok.";
else else
echo "build openssl-1.0.1f"; echo "Building openssl-1.0.1f.";
( (
rm -rf ${SRS_OBJS}/openssl-1.0.1f && cd ${SRS_OBJS} && rm -rf ${SRS_OBJS}/openssl-1.0.1f && cd ${SRS_OBJS} &&
unzip -q ../3rdparty/openssl-1.0.1f.zip && cd openssl-1.0.1f && unzip -q ../3rdparty/openssl-1.0.1f.zip && cd openssl-1.0.1f &&
@ -637,8 +635,8 @@ if [ $SRS_SSL = YES ]; then
fi fi
fi fi
# check status # check status
ret=$?; if [[ $ret -ne 0 ]]; then echo "build openssl-1.0.1f failed, ret=$ret"; exit $ret; fi ret=$?; if [[ $ret -ne 0 ]]; then echo "Build openssl-1.0.1f failed, ret=$ret"; exit $ret; fi
if [ ! -f ${SRS_OBJS}/openssl/lib/libssl.a ]; then echo "build openssl-1.0.1f failed."; exit -1; fi if [ ! -f ${SRS_OBJS}/openssl/lib/libssl.a ]; then echo "Build openssl-1.0.1f failed."; exit -1; fi
fi fi
fi fi
@ -647,9 +645,9 @@ fi
##################################################################################### #####################################################################################
if [ $SRS_FFMPEG_TOOL = YES ]; then if [ $SRS_FFMPEG_TOOL = YES ]; then
if [[ -f ${SRS_OBJS}/ffmpeg/bin/ffmpeg ]]; then if [[ -f ${SRS_OBJS}/ffmpeg/bin/ffmpeg ]]; then
echo "ffmpeg-2.1 is ok."; echo "The ffmpeg-2.1 is ok.";
else else
echo "build ffmpeg-2.1"; echo "Building ffmpeg-2.1.";
( (
cd ${SRS_OBJS} && pwd_dir=`pwd` && cd ${SRS_OBJS} && pwd_dir=`pwd` &&
rm -rf ffmepg.src && mkdir -p ffmpeg.src && cd ffmpeg.src && rm -rf ffmepg.src && mkdir -p ffmpeg.src && cd ffmpeg.src &&
@ -658,8 +656,8 @@ if [ $SRS_FFMPEG_TOOL = YES ]; then
) )
fi fi
# check status # check status
ret=$?; if [[ $ret -ne 0 ]]; then echo "build ffmpeg-2.1 failed, ret=$ret"; exit $ret; fi ret=$?; if [[ $ret -ne 0 ]]; then echo "Build ffmpeg-2.1 failed, ret=$ret"; exit $ret; fi
if [ ! -f ${SRS_OBJS}/ffmpeg/bin/ffmpeg ]; then echo "build ffmpeg-2.1 failed."; exit -1; fi if [ ! -f ${SRS_OBJS}/ffmpeg/bin/ffmpeg ]; then echo "Build ffmpeg-2.1 failed."; exit -1; fi
fi fi
##################################################################################### #####################################################################################
@ -670,10 +668,10 @@ if [ $SRS_EXPORT_LIBRTMP_PROJECT = NO ]; then
mkdir -p ${SRS_OBJS}/research mkdir -p ${SRS_OBJS}/research
(cd ${SRS_WORKDIR}/research/hls && make ${SRS_JOBS} && mv ts_info ../../${SRS_OBJS_DIR}/research) (cd ${SRS_WORKDIR}/research/hls && make ${SRS_JOBS} && mv ts_info ../../${SRS_OBJS_DIR}/research)
ret=$?; if [[ $ret -ne 0 ]]; then echo "build research/hls failed, ret=$ret"; exit $ret; fi ret=$?; if [[ $ret -ne 0 ]]; then echo "Build research/hls failed, ret=$ret"; exit $ret; fi
(cd research/ffempty && make ${SRS_JOBS} && mv ffempty ../../${SRS_OBJS_DIR}/research) (cd research/ffempty && make ${SRS_JOBS} && mv ffempty ../../${SRS_OBJS_DIR}/research)
ret=$?; if [[ $ret -ne 0 ]]; then echo "build research/ffempty failed, ret=$ret"; exit $ret; fi ret=$?; if [[ $ret -ne 0 ]]; then echo "Build research/ffempty failed, ret=$ret"; exit $ret; fi
fi fi
fi fi
@ -682,7 +680,7 @@ if [ $SRS_LIBRTMP = YES ]; then
# librtmp # librtmp
(cd ${SRS_WORKDIR}/research/librtmp && mkdir -p objs && ln -sf `pwd`/objs ../../${SRS_OBJS_DIR}/research/librtmp) (cd ${SRS_WORKDIR}/research/librtmp && mkdir -p objs && ln -sf `pwd`/objs ../../${SRS_OBJS_DIR}/research/librtmp)
ret=$?; if [[ $ret -ne 0 ]]; then echo "link research/librtmp failed, ret=$ret"; exit $ret; fi ret=$?; if [[ $ret -ne 0 ]]; then echo "Link research/librtmp failed, ret=$ret"; exit $ret; fi
fi fi
##################################################################################### #####################################################################################
@ -690,9 +688,9 @@ fi
##################################################################################### #####################################################################################
if [ $SRS_UTEST = YES ]; then if [ $SRS_UTEST = YES ]; then
if [[ -f ${SRS_OBJS}/gtest/include/gtest/gtest.h ]]; then if [[ -f ${SRS_OBJS}/gtest/include/gtest/gtest.h ]]; then
echo "gtest-1.6.0 is ok."; echo "The gtest-1.6.0 is ok.";
else else
echo "build gtest-1.6.0"; echo "Build gtest-1.6.0";
( (
rm -rf ${SRS_OBJS}/gtest-1.6.0 && cd ${SRS_OBJS} && rm -rf ${SRS_OBJS}/gtest-1.6.0 && cd ${SRS_OBJS} &&
unzip -q ../3rdparty/gtest-1.6.0.zip && unzip -q ../3rdparty/gtest-1.6.0.zip &&
@ -700,8 +698,8 @@ if [ $SRS_UTEST = YES ]; then
) )
fi fi
# check status # check status
ret=$?; if [[ $ret -ne 0 ]]; then echo "build gtest-1.6.0 failed, ret=$ret"; exit $ret; fi ret=$?; if [[ $ret -ne 0 ]]; then echo "Build gtest-1.6.0 failed, ret=$ret"; exit $ret; fi
if [ ! -f ${SRS_OBJS}/gtest/include/gtest/gtest.h ]; then echo "build gtest-1.6.0 failed."; exit -1; fi if [ ! -f ${SRS_OBJS}/gtest/include/gtest/gtest.h ]; then echo "Build gtest-1.6.0 failed."; exit -1; fi
fi fi
##################################################################################### #####################################################################################
@ -709,9 +707,9 @@ fi
##################################################################################### #####################################################################################
if [ $SRS_GPERF = YES ]; then if [ $SRS_GPERF = YES ]; then
if [[ -f ${SRS_OBJS}/gperf/bin/pprof ]]; then if [[ -f ${SRS_OBJS}/gperf/bin/pprof ]]; then
echo "gperftools-2.1 is ok."; echo "The gperftools-2.1 is ok.";
else else
echo "build gperftools-2.1"; echo "Build gperftools-2.1";
( (
rm -rf ${SRS_OBJS}/gperftools-2.1 && cd ${SRS_OBJS} && rm -rf ${SRS_OBJS}/gperftools-2.1 && cd ${SRS_OBJS} &&
unzip -q ../3rdparty/gperftools-2.1.zip && cd gperftools-2.1 && unzip -q ../3rdparty/gperftools-2.1.zip && cd gperftools-2.1 &&
@ -721,8 +719,8 @@ if [ $SRS_GPERF = YES ]; then
) )
fi fi
# check status # check status
ret=$?; if [[ $ret -ne 0 ]]; then echo "build gperftools-2.1 failed, ret=$ret"; exit $ret; fi ret=$?; if [[ $ret -ne 0 ]]; then echo "Build gperftools-2.1 failed, ret=$ret"; exit $ret; fi
if [ ! -f ${SRS_OBJS}/gperf/bin/pprof ]; then echo "build gperftools-2.1 failed."; exit -1; fi if [ ! -f ${SRS_OBJS}/gperf/bin/pprof ]; then echo "Build gperftools-2.1 failed."; exit -1; fi
fi fi
##################################################################################### #####################################################################################

View file

@ -14,7 +14,7 @@ FILE=${SRS_OBJS}/${SRS_MAKEFILE}
LIB_TARGET="${SRS_OBJS_DIR}/${LIB_NAME}" LIB_TARGET="${SRS_OBJS_DIR}/${LIB_NAME}"
LIB_TAGET_STATIC="${LIB_TARGET}.a" LIB_TAGET_STATIC="${LIB_TARGET}.a"
echo "generate lib ${LIB_NAME} depends..." echo "Generating lib ${LIB_NAME} depends."
echo "" >> ${FILE} echo "" >> ${FILE}
echo "# archive library ${LIB_TAGET_STATIC}" >> ${FILE} echo "# archive library ${LIB_TAGET_STATIC}" >> ${FILE}
@ -60,4 +60,4 @@ echo "" >> ${FILE}
echo " @mkdir -p ${SRS_OBJS_DIR}/include" >> ${SRS_WORKDIR}/${SRS_MAKEFILE} echo " @mkdir -p ${SRS_OBJS_DIR}/include" >> ${SRS_WORKDIR}/${SRS_MAKEFILE}
echo " @mkdir -p ${SRS_OBJS_DIR}/lib" >> ${SRS_WORKDIR}/${SRS_MAKEFILE} echo " @mkdir -p ${SRS_OBJS_DIR}/lib" >> ${SRS_WORKDIR}/${SRS_MAKEFILE}
echo -n "generate lib ${LIB_NAME} ok"; echo '!'; echo -n "Generate lib ${LIB_NAME} ok"; echo '!';

View file

@ -17,7 +17,7 @@
FILE=${SRS_OBJS}/${SRS_MAKEFILE} FILE=${SRS_OBJS}/${SRS_MAKEFILE}
echo "#####################################################################################" >> ${FILE} echo "#####################################################################################" >> ${FILE}
echo "# the ${MODULE_ID} module." >> ${FILE} echo "# The module ${MODULE_ID}." >> ${FILE}
echo "#####################################################################################" >> ${FILE} echo "#####################################################################################" >> ${FILE}
echo >> ${FILE} echo >> ${FILE}
@ -88,4 +88,4 @@ echo "" >> ${FILE}
# parent Makefile, to create module output dir before compile it. # parent Makefile, to create module output dir before compile it.
echo " @mkdir -p ${SRS_OBJS_DIR}/${MODULE_DIR}" >> ${SRS_WORKDIR}/${SRS_MAKEFILE} echo " @mkdir -p ${SRS_OBJS_DIR}/${MODULE_DIR}" >> ${SRS_WORKDIR}/${SRS_MAKEFILE}
echo -n "generate module ${MODULE_ID} ok"; echo '!'; echo -n "Generate modules ${MODULE_ID} ok"; echo '!';

View file

@ -892,7 +892,8 @@ SRS_AUTO_CONFIGURE="--prefix=${SRS_PREFIX}"
if [ $SRS_LOG_VERBOSE = YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --log-verbose"; fi if [ $SRS_LOG_VERBOSE = YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --log-verbose"; fi
if [ $SRS_LOG_INFO = YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --log-info"; fi if [ $SRS_LOG_INFO = YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --log-info"; fi
if [ $SRS_LOG_TRACE = YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --log-trace"; fi if [ $SRS_LOG_TRACE = YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --log-trace"; fi
echo "regenerate config: ${SRS_AUTO_CONFIGURE}" echo "User config: $SRS_AUTO_USER_CONFIGURE"
echo "Detail config: ${SRS_AUTO_CONFIGURE}"
} }
regenerate_options regenerate_options

View file

@ -1,28 +1,28 @@
#!/bin/bash #!/bin/bash
# colorful summary # colorful summary
SrsHlsSummaryColor="\${YELLOW}{disabled} "; if [ $SRS_HLS = YES ]; then SrsHlsSummaryColor="\${GREEN}"; fi SrsHlsSummaryColor="\${YELLOW}(Disabled) "; if [ $SRS_HLS = YES ]; then SrsHlsSummaryColor="\${GREEN}"; fi
SrsDvrSummaryColor="\${YELLOW}{disabled} "; if [ $SRS_DVR = YES ]; then SrsDvrSummaryColor="\${GREEN}"; fi SrsDvrSummaryColor="\${YELLOW}(Disabled) "; if [ $SRS_DVR = YES ]; then SrsDvrSummaryColor="\${GREEN}"; fi
SrsNginxSummaryColor="\${GREEN}{disabled} "; if [ $SRS_NGINX = YES ]; then SrsNginxSummaryColor="\${GREEN}"; fi SrsNginxSummaryColor="\${GREEN}(Disabled) "; if [ $SRS_NGINX = YES ]; then SrsNginxSummaryColor="\${GREEN}"; fi
SrsSslSummaryColor="\${YELLOW}{disabled} "; if [ $SRS_SSL = YES ]; then SrsSslSummaryColor="\${GREEN}"; fi SrsSslSummaryColor="\${YELLOW}(Disabled) "; if [ $SRS_SSL = YES ]; then SrsSslSummaryColor="\${GREEN}"; fi
SrsFfmpegSummaryColor="\${YELLOW}{disabled} "; if [ $SRS_FFMPEG_TOOL = YES ]; then SrsFfmpegSummaryColor="\${GREEN}"; fi SrsFfmpegSummaryColor="\${YELLOW}(Disabled) "; if [ $SRS_FFMPEG_TOOL = YES ]; then SrsFfmpegSummaryColor="\${GREEN}"; fi
SrsTranscodeSummaryColor="\${YELLOW}{disabled} "; if [ $SRS_TRANSCODE = YES ]; then SrsTranscodeSummaryColor="\${GREEN}"; fi SrsTranscodeSummaryColor="\${YELLOW}(Disabled) "; if [ $SRS_TRANSCODE = YES ]; then SrsTranscodeSummaryColor="\${GREEN}"; fi
SrsIngestSummaryColor="\${YELLOW}{disabled} "; if [ $SRS_INGEST = YES ]; then SrsIngestSummaryColor="\${GREEN}"; fi SrsIngestSummaryColor="\${YELLOW}(Disabled) "; if [ $SRS_INGEST = YES ]; then SrsIngestSummaryColor="\${GREEN}"; fi
SrsHttpCallbackSummaryColor="\${YELLOW}{disabled} "; if [ $SRS_HTTP_CALLBACK = YES ]; then SrsHttpCallbackSummaryColor="\${GREEN}"; fi SrsHttpCallbackSummaryColor="\${YELLOW}(Disabled) "; if [ $SRS_HTTP_CALLBACK = YES ]; then SrsHttpCallbackSummaryColor="\${GREEN}"; fi
SrsHttpServerSummaryColor="\${YELLOW}{disabled} "; if [ $SRS_HTTP_SERVER = YES ]; then SrsHttpServerSummaryColor="\${GREEN}"; fi SrsHttpServerSummaryColor="\${YELLOW}(Disabled) "; if [ $SRS_HTTP_SERVER = YES ]; then SrsHttpServerSummaryColor="\${GREEN}"; fi
SrsHttpApiSummaryColor="\${YELLOW}{disabled} "; if [ $SRS_HTTP_API = YES ]; then SrsHttpApiSummaryColor="\${GREEN}"; fi SrsHttpApiSummaryColor="\${YELLOW}(Disabled) "; if [ $SRS_HTTP_API = YES ]; then SrsHttpApiSummaryColor="\${GREEN}"; fi
SrsStreamCasterSummaryColor="\${YELLOW}{disabled} "; if [ $SRS_STREAM_CASTER = YES ]; then SrsStreamCasterSummaryColor="\${GREEN}"; fi SrsStreamCasterSummaryColor="\${YELLOW}(Disabled) "; if [ $SRS_STREAM_CASTER = YES ]; then SrsStreamCasterSummaryColor="\${GREEN}"; fi
SrsKafkaSummaryColor="\${YELLOW}{disabled} "; if [ $SRS_KAFKA = YES ]; then SrsKafkaSummaryColor="\${GREEN}"; fi SrsKafkaSummaryColor="\${YELLOW}(Disabled) "; if [ $SRS_KAFKA = YES ]; then SrsKafkaSummaryColor="\${GREEN}"; fi
SrsLibrtmpSummaryColor="\${YELLOW}{disabled} "; if [ $SRS_LIBRTMP = YES ]; then SrsLibrtmpSummaryColor="\${GREEN}"; fi SrsLibrtmpSummaryColor="\${YELLOW}(Disabled) "; if [ $SRS_LIBRTMP = YES ]; then SrsLibrtmpSummaryColor="\${GREEN}"; fi
SrsLibrtmpSSLSummaryColor="\${YELLOW}{disabled} "; if [ $SRS_LIBRTMP = YES ]; then if [ $SRS_SSL = YES ]; then SrsLibrtmpSSLSummaryColor="\${GREEN}"; fi fi SrsLibrtmpSSLSummaryColor="\${YELLOW}(Disabled) "; if [ $SRS_LIBRTMP = YES ]; then if [ $SRS_SSL = YES ]; then SrsLibrtmpSSLSummaryColor="\${GREEN}"; fi fi
SrsResearchSummaryColor="\${GREEN}{disabled} "; if [ $SRS_RESEARCH = YES ]; then SrsResearchSummaryColor="\${GREEN}"; fi SrsResearchSummaryColor="\${GREEN}(Disabled) "; if [ $SRS_RESEARCH = YES ]; then SrsResearchSummaryColor="\${GREEN}"; fi
SrsUtestSummaryColor="\${YELLOW}{disabled} "; if [ $SRS_UTEST = YES ]; then SrsUtestSummaryColor="\${GREEN}"; fi SrsUtestSummaryColor="\${YELLOW}(Disabled) "; if [ $SRS_UTEST = YES ]; then SrsUtestSummaryColor="\${GREEN}"; fi
SrsGperfSummaryColor="\${GREEN}{disabled} "; if [ $SRS_GPERF = YES ]; then SrsGperfSummaryColor="\${GREEN}"; fi SrsGperfSummaryColor="\${GREEN}(Disabled) "; if [ $SRS_GPERF = YES ]; then SrsGperfSummaryColor="\${GREEN}"; fi
SrsGperfMCSummaryColor="\${GREEN}{disabled} "; if [ $SRS_GPERF_MC = YES ]; then SrsGperfMCSummaryColor="\${YELLOW}"; fi SrsGperfMCSummaryColor="\${GREEN}(Disabled) "; if [ $SRS_GPERF_MC = YES ]; then SrsGperfMCSummaryColor="\${YELLOW}"; fi
SrsGperfMDSummaryColor="\${GREEN}{disabled} "; if [ $SRS_GPERF_MD = YES ]; then SrsGperfMDSummaryColor="\${YELLOW}"; fi SrsGperfMDSummaryColor="\${GREEN}(Disabled) "; if [ $SRS_GPERF_MD = YES ]; then SrsGperfMDSummaryColor="\${YELLOW}"; fi
SrsGperfMPSummaryColor="\${GREEN}{disabled} "; if [ $SRS_GPERF_MP = YES ]; then SrsGperfMPSummaryColor="\${YELLOW}"; fi SrsGperfMPSummaryColor="\${GREEN}(Disabled) "; if [ $SRS_GPERF_MP = YES ]; then SrsGperfMPSummaryColor="\${YELLOW}"; fi
SrsGperfCPSummaryColor="\${GREEN}{disabled} "; if [ $SRS_GPERF_CP = YES ]; then SrsGperfCPSummaryColor="\${YELLOW}"; fi SrsGperfCPSummaryColor="\${GREEN}(Disabled) "; if [ $SRS_GPERF_CP = YES ]; then SrsGperfCPSummaryColor="\${YELLOW}"; fi
SrsGprofSummaryColor="\${GREEN}{disabled} "; if [ $SRS_GPROF = YES ]; then SrsGprofSummaryColor="\${YELLOW}"; fi SrsGprofSummaryColor="\${GREEN}(Disabled) "; if [ $SRS_GPROF = YES ]; then SrsGprofSummaryColor="\${YELLOW}"; fi
if [ $SRS_EXPORT_LIBRTMP_PROJECT = NO ]; then if [ $SRS_EXPORT_LIBRTMP_PROJECT = NO ]; then
cat <<END > ${SRS_OBJS}/${SRS_BUILD_SUMMARY} cat <<END > ${SRS_OBJS}/${SRS_BUILD_SUMMARY}
@ -35,81 +35,26 @@ GREEN="\\${GREEN}"
YELLOW="\\${YELLOW}" YELLOW="\\${YELLOW}"
BLACK="\\${BLACK}" BLACK="\\${BLACK}"
echo -e "\${GREEN}build summary:\${BLACK}" echo -e "\${GREEN}The build summary:\${BLACK}"
echo -e " \${BLACK}+------------------------------------------------------------------------------------\${BLACK}" echo -e " \${BLACK}+------------------------------------------------------------------------------------\${BLACK}"
echo -e " |${SrsGperfSummaryColor}gperf @see: https://github.com/ossrs/srs/wiki/v1_CN_GPERF\${BLACK}" echo -e " \${GREEN}For SRS benchmark, recomment the following tools:\${BLACK}"
echo -e " | ${SrsGperfMDSummaryColor}gmd @see: http://blog.csdn.net/win_lin/article/details/50461709\${BLACK}" echo -e " \${GREEN} About gperf, gprof and valgrind, please read http://blog.csdn.net/win_lin/article/details/53503869\${BLACK}"
echo -e " | ${SrsGperfMDSummaryColor}gmd: gperf memory defense, or memory corrupt detect\${BLACK}"
echo -e " | ${SrsGperfMDSummaryColor}env TCMALLOC_PAGE_FENCE=1 ./objs/srs -c conf/console.conf\${BLACK}"
echo -e " | ${SrsGperfMCSummaryColor}gmc @see: http://google-perftools.googlecode.com/svn/trunk/doc/heap_checker.html\${BLACK}"
echo -e " | ${SrsGperfMCSummaryColor}gmc: gperf memory check, or memory leak detect\${BLACK}"
echo -e " | ${SrsGperfMCSummaryColor}env PPROF_PATH=./objs/pprof HEAPCHECK=normal ./objs/srs -c conf/console.conf 2>gmc.log # start gmc\${BLACK}"
echo -e " | ${SrsGperfMCSummaryColor}killall -2 srs # or CTRL+C to stop gmc\${BLACK}"
echo -e " | ${SrsGperfMCSummaryColor}cat gmc.log # to analysis memory leak\${BLACK}"
echo -e " | ${SrsGperfMPSummaryColor}gmp @see: http://google-perftools.googlecode.com/svn/trunk/doc/heapprofile.html\${BLACK}"
echo -e " | ${SrsGperfMPSummaryColor}gmp: gperf memory profile, similar to gcp\${BLACK}"
echo -e " | ${SrsGperfMPSummaryColor}rm -f gperf.srs.gmp*; ./objs/srs -c conf/console.conf # start gmp\${BLACK}"
echo -e " | ${SrsGperfMPSummaryColor}killall -2 srs # or CTRL+C to stop gmp\${BLACK}"
echo -e " | ${SrsGperfMPSummaryColor}./objs/pprof --text objs/srs gperf.srs.gmp* # to analysis memory profile\${BLACK}"
echo -e " | ${SrsGperfCPSummaryColor}gcp @see: http://google-perftools.googlecode.com/svn/trunk/doc/cpuprofile.html\${BLACK}"
echo -e " | ${SrsGperfCPSummaryColor}gcp: gperf cpu profile\${BLACK}"
echo -e " | ${SrsGperfCPSummaryColor}rm -f gperf.srs.gcp*; ./objs/srs -c conf/console.conf # start gcp\${BLACK}"
echo -e " | ${SrsGperfCPSummaryColor}killall -2 srs # or CTRL+C to stop gcp\${BLACK}"
echo -e " | ${SrsGperfCPSummaryColor}./objs/pprof --text objs/srs gperf.srs.gcp* # to analysis cpu profile\${BLACK}"
echo -e " \${BLACK}+------------------------------------------------------------------------------------\${BLACK}" echo -e " \${BLACK}+------------------------------------------------------------------------------------\${BLACK}"
echo -e " |${SrsGprofSummaryColor}gprof @see: https://github.com/ossrs/srs/wiki/v1_CN_GPROF\${BLACK}" echo -e " |\${GREEN}The main server usage: ./objs/srs -c conf/srs.conf, start the srs server\${BLACK}"
echo -e " |${SrsGprofSummaryColor}gprof: GNU profile tool, @see: http://www.cs.utah.edu/dept/old/texinfo/as/gprof.html\${BLACK}" echo -e " | ${SrsHlsSummaryColor}About HLS, please read https://github.com/ossrs/srs/wiki/v2_CN_DeliveryHLS\${BLACK}"
echo -e " | ${SrsGprofSummaryColor}rm -f gmon.out; ./objs/srs -c conf/console.conf # start gprof\${BLACK}" echo -e " | ${SrsDvrSummaryColor}About DVR, please read https://github.com/ossrs/srs/wiki/v2_CN_DVR\${BLACK}"
echo -e " | ${SrsGprofSummaryColor}killall -2 srs # or CTRL+C to stop gprof\${BLACK}" echo -e " | ${SrsNginxSummaryColor}About NGINX, please read https://github.com/ossrs/srs/wiki/v2_CN_DeliveryHLS\${BLACK}"
echo -e " | ${SrsGprofSummaryColor}gprof -b ./objs/srs gmon.out > gprof.srs.log && rm -f gmon.out # gprof report to gprof.srs.log\${BLACK}" echo -e " | ${SrsSslSummaryColor}About SSL, please read https://github.com/ossrs/srs/wiki/v1_CN_RTMPHandshake\${BLACK}"
echo -e " | ${SrsFfmpegSummaryColor}About FFMPEG, please read https://github.com/ossrs/srs/wiki/v1_CN_FFMPEG\${BLACK}"
echo -e " | ${SrsTranscodeSummaryColor}About transcoding, please read https://github.com/ossrs/srs/wiki/v1_CN_FFMPEG\${BLACK}"
echo -e " | ${SrsIngestSummaryColor}About ingester, please read https://github.com/ossrs/srs/wiki/v1_CN_Ingest\${BLACK}"
echo -e " | ${SrsHttpCallbackSummaryColor}About http-callback, please read https://github.com/ossrs/srs/wiki/v2_CN_HTTPCallback\${BLACK}"
echo -e " | ${SrsHttpServerSummaryColor}Aoubt embeded http-server, please read https://github.com/ossrs/srs/wiki/v2_CN_HTTPServer\${BLACK}"
echo -e " | ${SrsHttpApiSummaryColor}About http-api, please read https://github.com/ossrs/srs/wiki/v2_CN_HTTPApi\${BLACK}"
echo -e " | ${SrsStreamCasterSummaryColor}About stream-caster, please read https://github.com/ossrs/srs/wiki/v2_CN_Streamer\${BLACK}"
echo -e " | ${SrsKafkaSummaryColor}About kafka, please read https://github.com/ossrs/srs/wiki/v3_CN_Kafka\${BLACK}"
echo -e " \${BLACK}+------------------------------------------------------------------------------------\${BLACK}" echo -e " \${BLACK}+------------------------------------------------------------------------------------\${BLACK}"
echo -e " |${SrsUtestSummaryColor}utest: ./objs/srs_utest, the utest for srs\${BLACK}" echo -e "\${GREEN}binaries, please read https://github.com/ossrs/srs/wiki/v2_CN_Build\${BLACK}"
echo -e " \${BLACK}+------------------------------------------------------------------------------------\${BLACK}"
echo -e " |${SrsLibrtmpSummaryColor}librtmp @see: https://github.com/ossrs/srs/wiki/v1_CN_SrsLibrtmp\${BLACK}"
echo -e " |${SrsLibrtmpSummaryColor}librtmp: ./objs/include, ./objs/lib, the srs-librtmp library\${BLACK}"
echo -e " | ${SrsLibrtmpSummaryColor}simple handshake: publish/play stream with simple handshake to server\${BLACK}"
echo -e " | ${SrsLibrtmpSSLSummaryColor}complex handshake: it's not required for client, recommend disable it\${BLACK}"
echo -e " | ${SrsLibrtmpSummaryColor}librtmp-sample: ./research/librtmp, the srs-librtmp client sample\${BLACK}"
echo -e " | ${SrsLibrtmpSummaryColor}librtmp-sample: ./research/librtmp/objs/srs_ingest_flv\${BLACK}"
echo -e " | ${SrsLibrtmpSummaryColor}librtmp-sample: ./research/librtmp/objs/srs_ingest_rtmp\${BLACK}"
echo -e " | ${SrsLibrtmpSummaryColor}librtmp-sample: ./research/librtmp/objs/srs_detect_rtmp\${BLACK}"
echo -e " | ${SrsLibrtmpSummaryColor}librtmp-sample: ./research/librtmp/objs/srs_bandwidth_check\${BLACK}"
echo -e " \${BLACK}+------------------------------------------------------------------------------------\${BLACK}"
echo -e " |${SrsResearchSummaryColor}research: ./objs/research, api server, players, ts info, librtmp.\${BLACK}"
echo -e " | ${SrsResearchSummaryColor} @see https://github.com/ossrs/srs/wiki/v2_CN_SrsLibrtmp#srs-librtmp-examples\${BLACK}"
echo -e " \${BLACK}+------------------------------------------------------------------------------------\${BLACK}"
echo -e " |\${GREEN}tools: important tool, others @see https://github.com/ossrs/srs/wiki/v2_CN_SrsLibrtmp#srs-librtmp-examples\${BLACK}"
echo -e " | \${GREEN}./objs/srs_ingest_hls -i http://ossrs.net/live/livestream.m3u8 -y rtmp://127.0.0.1/live/livestream\${BLACK}"
echo -e " \${BLACK}+------------------------------------------------------------------------------------\${BLACK}"
echo -e " |\${GREEN}server: ./objs/srs -c conf/srs.conf, start the srs server\${BLACK}"
echo -e " | ${SrsHlsSummaryColor}hls @see: https://github.com/ossrs/srs/wiki/v2_CN_DeliveryHLS\${BLACK}"
echo -e " | ${SrsHlsSummaryColor}hls: generate m3u8 and ts from rtmp stream\${BLACK}"
echo -e " | ${SrsDvrSummaryColor}dvr @see: https://github.com/ossrs/srs/wiki/v2_CN_DVR\${BLACK}"
echo -e " | ${SrsDvrSummaryColor}dvr: record RTMP stream to flv files.\${BLACK}"
echo -e " | ${SrsNginxSummaryColor}nginx @see: https://github.com/ossrs/srs/wiki/v2_CN_DeliveryHLS\${BLACK}"
echo -e " | ${SrsNginxSummaryColor}nginx: delivery HLS stream by nginx\${BLACK}"
echo -e " | ${SrsNginxSummaryColor}nginx: sudo ./objs/nginx/sbin/nginx\${BLACK}"
echo -e " | ${SrsSslSummaryColor}ssl @see: https://github.com/ossrs/srs/wiki/v1_CN_RTMPHandshake\${BLACK}"
echo -e " | ${SrsSslSummaryColor}ssl: support RTMP complex handshake for client required, for instance, flash\${BLACK}"
echo -e " | ${SrsFfmpegSummaryColor}ffmpeg @see: https://github.com/ossrs/srs/wiki/v1_CN_FFMPEG\${BLACK}"
echo -e " | ${SrsFfmpegSummaryColor}ffmpeg: transcode, mux, ingest tool\${BLACK}"
echo -e " | ${SrsFfmpegSummaryColor}ffmpeg: ./objs/ffmpeg/bin/ffmpeg\${BLACK}"
echo -e " | ${SrsTranscodeSummaryColor}transcode @see: https://github.com/ossrs/srs/wiki/v1_CN_FFMPEG\${BLACK}"
echo -e " | ${SrsTranscodeSummaryColor}transcode: support transcoding RTMP stream\${BLACK}"
echo -e " | ${SrsIngestSummaryColor}ingest @see: https://github.com/ossrs/srs/wiki/v1_CN_Ingest\${BLACK}"
echo -e " | ${SrsIngestSummaryColor}ingest: support ingest file/stream/device then push to SRS by RTMP stream\${BLACK}"
echo -e " | ${SrsHttpCallbackSummaryColor}http-callback @see: https://github.com/ossrs/srs/wiki/v2_CN_HTTPCallback\${BLACK}"
echo -e " | ${SrsHttpCallbackSummaryColor}http-callback: support http callback for authentication and event injection\${BLACK}"
echo -e " | ${SrsHttpServerSummaryColor}http-server @see: https://github.com/ossrs/srs/wiki/v2_CN_HTTPServer\${BLACK}"
echo -e " | ${SrsHttpServerSummaryColor}http-server: support http server to delivery http stream\${BLACK}"
echo -e " | ${SrsHttpApiSummaryColor}http-api @see: https://github.com/ossrs/srs/wiki/v2_CN_HTTPApi\${BLACK}"
echo -e " | ${SrsHttpApiSummaryColor}http-api: support http api to manage server\${BLACK}"
echo -e " | ${SrsStreamCasterSummaryColor}stream-caster @see: https://github.com/ossrs/srs/wiki/v2_CN_Streamer\${BLACK}"
echo -e " | ${SrsStreamCasterSummaryColor}stream-caster: start server to cast stream over other protocols.\${BLACK}"
echo -e " | ${SrsKafkaSummaryColor}kafka @see: https://github.com/ossrs/srs/wiki/v3_CN_Kafka\${BLACK}"
echo -e " | ${SrsKafkaSummaryColor}kafka: start srs kafka producer to report to kafka.\${BLACK}"
echo -e " \${BLACK}+------------------------------------------------------------------------------------\${BLACK}"
echo -e "\${GREEN}binaries @see: https://github.com/ossrs/srs/wiki/v2_CN_Build\${BLACK}"
echo "You can:" echo "You can:"
echo " ./objs/srs -c conf/srs.conf" echo " ./objs/srs -c conf/srs.conf"

View file

@ -187,4 +187,4 @@ END
# parent Makefile, to create module output dir before compile it. # parent Makefile, to create module output dir before compile it.
echo " @mkdir -p ${SRS_OBJS_DIR}/utest" >> ${SRS_WORKDIR}/${SRS_MAKEFILE} echo " @mkdir -p ${SRS_OBJS_DIR}/utest" >> ${SRS_WORKDIR}/${SRS_MAKEFILE}
echo -n "generate utest ok"; echo '!'; echo -n "Generate utest ok"; echo '!';

168
trunk/configure vendored
View file

@ -208,7 +208,7 @@ if [ $SRS_EXPORT_LIBRTMP_PROJECT = NO ]; then
MODULE_ID="MAIN" MODULE_ID="MAIN"
MODULE_DEPENDS=("CORE" "KERNEL" "PROTOCOL" "APP") MODULE_DEPENDS=("CORE" "KERNEL" "PROTOCOL" "APP")
ModuleLibIncs=(${LibSTRoot} ${SRS_OBJS_DIR} ${LibGperfRoot} ${LibSSLRoot}) ModuleLibIncs=(${LibSTRoot} ${SRS_OBJS_DIR} ${LibGperfRoot} ${LibSSLRoot})
MODULE_FILES=("srs_main_server" "srs_main_ingest_hls") MODULE_FILES=("srs_main_server")
DEFINES="" DEFINES=""
# add each modules for main # add each modules for main
for SRS_MODULE in ${SRS_MODULES[*]}; do for SRS_MODULE in ${SRS_MODULES[*]}; do
@ -277,7 +277,7 @@ fi
##################################################################################### #####################################################################################
# makefile # makefile
echo "generate Makefile" echo "Generate Makefile"
# backup old makefile. # backup old makefile.
rm -f ${SRS_WORKDIR}/${SRS_MAKEFILE}.bk && rm -f ${SRS_WORKDIR}/${SRS_MAKEFILE}.bk &&
@ -317,11 +317,10 @@ _default: server srs_ingest_hls librtmp utest __modules $__mdefaults
@bash objs/_srs_build_summary.sh @bash objs/_srs_build_summary.sh
help: help:
@echo "Usage: make <help>|<clean>|<server>|<srs_ingest_hls>|<librtmp>|<utest>|<install>|<install-api>|<uninstall>" @echo "Usage: make <help>|<clean>|<server>|<librtmp>|<utest>|<install>|<install-api>|<uninstall>"
@echo " help display this help menu" @echo " help display this help menu"
@echo " clean cleanup project" @echo " clean cleanup project"
@echo " server build the srs(simple rtmp server) over st(state-threads)" @echo " server build the srs(simple rtmp server) over st(state-threads)"
@echo " srs_ingest_hls build the hls ingest tool of srs."
@echo " librtmp build the client publish/play library, and samples" @echo " librtmp build the client publish/play library, and samples"
@echo " utest build the utest for srs" @echo " utest build the utest for srs"
@echo " install install srs to the prefix path" @echo " install install srs to the prefix path"
@ -353,19 +352,14 @@ echo "" >> ${SRS_WORKDIR}/${SRS_MAKEFILE}
if [ $SRS_EXPORT_LIBRTMP_PROJECT != NO ]; then if [ $SRS_EXPORT_LIBRTMP_PROJECT != NO ]; then
cat << END >> ${SRS_WORKDIR}/${SRS_MAKEFILE} cat << END >> ${SRS_WORKDIR}/${SRS_MAKEFILE}
server: _prepare_dir server: _prepare_dir
@echo "donot build the srs(simple rtmp server) for srs-librtmp" @echo "Ingore srs(simple rtmp server) for srs-librtmp"
srs_ingest_hls: _prepare_dir
@echo "donot build the srs_ingest_hls for srs-librtmp"
END END
else else
cat << END >> ${SRS_WORKDIR}/${SRS_MAKEFILE} cat << END >> ${SRS_WORKDIR}/${SRS_MAKEFILE}
server: _prepare_dir server: _prepare_dir
@echo "build the srs(simple rtmp server) over st(state-threads)" @echo "Build the srs(simple rtmp server) over ST(state-threads)"
\$(MAKE) -f ${SRS_OBJS_DIR}/${SRS_MAKEFILE} srs \$(MAKE) -f ${SRS_OBJS_DIR}/${SRS_MAKEFILE} srs
srs_ingest_hls: _prepare_dir
@echo "build the srs_ingest_hls for srs"
\$(MAKE) -f ${SRS_OBJS_DIR}/${SRS_MAKEFILE} srs_ingest_hls
END END
fi fi
@ -376,13 +370,13 @@ for SRS_MODULE in ${SRS_MODULES[*]}; do
if [ $SRS_EXPORT_LIBRTMP_PROJECT != NO ]; then if [ $SRS_EXPORT_LIBRTMP_PROJECT != NO ]; then
cat << END >> ${SRS_WORKDIR}/${SRS_MAKEFILE} cat << END >> ${SRS_WORKDIR}/${SRS_MAKEFILE}
$SRS_MODULE_NAME: _prepare_dir $SRS_MODULE_NAME: _prepare_dir
@echo "donot build the $SRS_MODULE_NAME for srs-librtmp" @echo "Ingore the $SRS_MODULE_NAME for srs-librtmp"
END END
else else
cat << END >> ${SRS_WORKDIR}/${SRS_MAKEFILE} cat << END >> ${SRS_WORKDIR}/${SRS_MAKEFILE}
$SRS_MODULE_NAME: _prepare_dir $SRS_MODULE_NAME: _prepare_dir
@echo "build the $SRS_MODULE_NAME over SRS" @echo "Build the $SRS_MODULE_NAME over SRS"
\$(MAKE) -f ${SRS_OBJS_DIR}/${SRS_MAKEFILE} $SRS_MODULE_NAME \$(MAKE) -f ${SRS_OBJS_DIR}/${SRS_MAKEFILE} $SRS_MODULE_NAME
END END
@ -393,13 +387,13 @@ done
if [ $SRS_EXPORT_LIBRTMP_PROJECT != NO ]; then if [ $SRS_EXPORT_LIBRTMP_PROJECT != NO ]; then
cat << END >> ${SRS_WORKDIR}/${SRS_MAKEFILE} cat << END >> ${SRS_WORKDIR}/${SRS_MAKEFILE}
uninstall: uninstall:
@echo "disable uninstall for srs-librtmp" @echo "Disable uninstall for srs-librtmp"
install-api: install-api:
@echo "disable install-api for srs-librtmp" @echo "Disable install-api for srs-librtmp"
install: install:
@echo "disable install for srs-librtmp" @echo "Disable install for srs-librtmp"
END END
else else
@ -409,47 +403,47 @@ uninstall:
@rm -rf \$(SRS_PREFIX) @rm -rf \$(SRS_PREFIX)
install-api: install install-api: install
@echo "mkdir \$(__REAL_INSTALL)" @echo "Now mkdir \$(__REAL_INSTALL)"
@mkdir -p \$(__REAL_INSTALL) @mkdir -p \$(__REAL_INSTALL)
@echo "copy binary files" @echo "Now copy binary files"
@mkdir -p \$(__REAL_INSTALL)/research/api-server @mkdir -p \$(__REAL_INSTALL)/research/api-server
@cp research/api-server/server.py \$(__REAL_INSTALL)/research/api-server @cp research/api-server/server.py \$(__REAL_INSTALL)/research/api-server
@mkdir -p \$(__REAL_INSTALL)/objs/ffmpeg/bin @mkdir -p \$(__REAL_INSTALL)/objs/ffmpeg/bin
@cp objs/ffmpeg/bin/ffmpeg \$(__REAL_INSTALL)/objs/ffmpeg/bin @cp objs/ffmpeg/bin/ffmpeg \$(__REAL_INSTALL)/objs/ffmpeg/bin
@echo "copy html files" @echo "Now copy html files"
@mkdir -p \$(__REAL_INSTALL)/research/api-server/static-dir/players @mkdir -p \$(__REAL_INSTALL)/research/api-server/static-dir/players
@cp research/api-server/static-dir/crossdomain.xml \$(__REAL_INSTALL)/research/api-server/static-dir @cp research/api-server/static-dir/crossdomain.xml \$(__REAL_INSTALL)/research/api-server/static-dir
@cp research/api-server/static-dir/index.html \$(__REAL_INSTALL)/research/api-server/static-dir @cp research/api-server/static-dir/index.html \$(__REAL_INSTALL)/research/api-server/static-dir
@cp -r research/api-server/static-dir/players/* \$(__REAL_INSTALL)/research/api-server/static-dir/players @cp -r research/api-server/static-dir/players/* \$(__REAL_INSTALL)/research/api-server/static-dir/players
@echo "copy init.d script files" @echo "Now copy init.d script files"
@mkdir -p \$(__REAL_INSTALL)/etc/init.d @mkdir -p \$(__REAL_INSTALL)/etc/init.d
@cp etc/init.d/srs-api \$(__REAL_INSTALL)/etc/init.d @cp etc/init.d/srs-api \$(__REAL_INSTALL)/etc/init.d
@sed -i "s|^ROOT=.*|ROOT=\"\$(SRS_PREFIX)\"|g" \$(__REAL_INSTALL)/etc/init.d/srs-api @sed -i "s|^ROOT=.*|ROOT=\"\$(SRS_PREFIX)\"|g" \$(__REAL_INSTALL)/etc/init.d/srs-api
@echo "" @echo ""
@echo "api installed, to link and start api:" @echo "The api installed, to link and start api:"
@echo " sudo ln -sf \$(SRS_PREFIX)/etc/init.d/srs-api /etc/init.d/srs-api" @echo " sudo ln -sf \$(SRS_PREFIX)/etc/init.d/srs-api /etc/init.d/srs-api"
@echo " /etc/init.d/srs-api start" @echo " /etc/init.d/srs-api start"
@echo " http://\$(shell bash auto/local_ip.sh):8085" @echo " http://\$(shell bash auto/local_ip.sh):8085"
@echo "@see: https://github.com/ossrs/srs/wiki/v1_CN_LinuxService" @echo "@see: https://github.com/ossrs/srs/wiki/v1_CN_LinuxService"
install: install:
@echo "mkdir \$(__REAL_INSTALL)" @echo "Now mkdir \$(__REAL_INSTALL)"
@mkdir -p \$(__REAL_INSTALL) @mkdir -p \$(__REAL_INSTALL)
@echo "make the http root dir" @echo "Now make the http root dir"
@mkdir -p \$(__REAL_INSTALL)/objs/nginx/html @mkdir -p \$(__REAL_INSTALL)/objs/nginx/html
@cp research/api-server/static-dir/crossdomain.xml \$(__REAL_INSTALL)/objs/nginx/html @cp research/api-server/static-dir/crossdomain.xml \$(__REAL_INSTALL)/objs/nginx/html
@echo "copy binary files" @echo "Now copy binary files"
@mkdir -p \$(__REAL_INSTALL)/objs @mkdir -p \$(__REAL_INSTALL)/objs
@cp objs/srs \$(__REAL_INSTALL)/objs @cp objs/srs \$(__REAL_INSTALL)/objs
@echo "copy srs conf files" @echo "Now copy srs conf files"
@mkdir -p \$(__REAL_INSTALL)/conf @mkdir -p \$(__REAL_INSTALL)/conf
@cp conf/*.conf \$(__REAL_INSTALL)/conf @cp conf/*.conf \$(__REAL_INSTALL)/conf
@echo "copy init.d script files" @echo "Now copy init.d script files"
@mkdir -p \$(__REAL_INSTALL)/etc/init.d @mkdir -p \$(__REAL_INSTALL)/etc/init.d
@cp etc/init.d/srs \$(__REAL_INSTALL)/etc/init.d @cp etc/init.d/srs \$(__REAL_INSTALL)/etc/init.d
@sed -i "s|^ROOT=.*|ROOT=\"\$(SRS_PREFIX)\"|g" \$(__REAL_INSTALL)/etc/init.d/srs @sed -i "s|^ROOT=.*|ROOT=\"\$(SRS_PREFIX)\"|g" \$(__REAL_INSTALL)/etc/init.d/srs
@echo "" @echo ""
@echo "srs installed, to link and start srs:" @echo "SRS is installed, to link and start srs:"
@echo " sudo ln -sf \$(SRS_PREFIX)/etc/init.d/srs /etc/init.d/srs" @echo " sudo ln -sf \$(SRS_PREFIX)/etc/init.d/srs /etc/init.d/srs"
@echo " /etc/init.d/srs start" @echo " /etc/init.d/srs start"
@echo "@see: https://github.com/ossrs/srs/wiki/v1_CN_LinuxService" @echo "@see: https://github.com/ossrs/srs/wiki/v1_CN_LinuxService"
@ -461,16 +455,16 @@ fi
if [ $SRS_LIBRTMP = YES ]; then if [ $SRS_LIBRTMP = YES ]; then
cat << END >> ${SRS_WORKDIR}/${SRS_MAKEFILE} cat << END >> ${SRS_WORKDIR}/${SRS_MAKEFILE}
librtmp: server librtmp: server
@echo "build the client publish/play library." @echo "Building the client publish/play library."
\$(MAKE) -f ${SRS_OBJS_DIR}/${SRS_MAKEFILE} librtmp \$(MAKE) -f ${SRS_OBJS_DIR}/${SRS_MAKEFILE} librtmp
@echo "build the srs-librtmp sample" @echo "Building the srs-librtmp example."
(cd research/librtmp; \$(MAKE) ${SrsLibrtmpSampleEntry}) (cd research/librtmp; \$(MAKE) ${SrsLibrtmpSampleEntry})
END END
else else
cat << END >> ${SRS_WORKDIR}/${SRS_MAKEFILE} cat << END >> ${SRS_WORKDIR}/${SRS_MAKEFILE}
librtmp: server librtmp: server
@echo "srs-librtmp is disabled, ignore." @echo "Ignore srs-librtmp for it's disabled."
END END
fi fi
@ -478,15 +472,15 @@ fi
if [ $SRS_UTEST = YES ]; then if [ $SRS_UTEST = YES ]; then
cat << END >> ${SRS_WORKDIR}/${SRS_MAKEFILE} cat << END >> ${SRS_WORKDIR}/${SRS_MAKEFILE}
utest: server utest: server
@echo "build the utest for srs" @echo "Building the utest for srs"
${SrsUtestMakeEntry} ${SrsUtestMakeEntry}
@echo "utest for srs build success" @echo "The utest is built ok."
END END
else else
cat << END >> ${SRS_WORKDIR}/${SRS_MAKEFILE} cat << END >> ${SRS_WORKDIR}/${SRS_MAKEFILE}
utest: server utest: server
@echo "utest is disabled, ignore" @echo "Ignore utest for it's disabled."
END END
fi fi
@ -501,7 +495,7 @@ END
cat ${SRS_WORKDIR}/${SRS_MAKEFILE}.bk >> ${SRS_WORKDIR}/${SRS_MAKEFILE} && cat ${SRS_WORKDIR}/${SRS_MAKEFILE}.bk >> ${SRS_WORKDIR}/${SRS_MAKEFILE} &&
rm -f ${SRS_WORKDIR}/${SRS_MAKEFILE}.bk rm -f ${SRS_WORKDIR}/${SRS_MAKEFILE}.bk
echo 'configure ok! ' echo 'Configure ok! '
##################################################################################### #####################################################################################
# when configure success, prepare build # when configure success, prepare build
@ -517,132 +511,132 @@ fi
# summary # summary
if [ $SRS_EXPORT_LIBRTMP_PROJECT = NO ]; then if [ $SRS_EXPORT_LIBRTMP_PROJECT = NO ]; then
echo "" echo ""
echo "configure summary:" echo "Configure summary:"
echo " ${SRS_AUTO_USER_CONFIGURE}" echo " ${SRS_AUTO_USER_CONFIGURE}"
echo " ${SRS_AUTO_CONFIGURE}" echo " ${SRS_AUTO_CONFIGURE}"
if [ $SRS_HLS = YES ]; then if [ $SRS_HLS = YES ]; then
echo -e "${GREEN}HLS is enabled${BLACK}" echo -e "${GREEN}HLS is enabled.${BLACK}"
else else
echo -e "${YELLOW}warning: without HLS support${BLACK}" echo -e "${YELLOW}Warning: HLS is disabled.${BLACK}"
fi fi
if [ $SRS_STREAM_CASTER = YES ]; then if [ $SRS_STREAM_CASTER = YES ]; then
echo -e "${YELLOW}Experiment: StreamCaster is enabled${BLACK}" echo -e "${YELLOW}Experiment: StreamCaster is enabled.${BLACK}"
else else
echo -e "${GREEN}note: without StreamCaster support${BLACK}" echo -e "${GREEN}Note: StreamCaster is disabled.${BLACK}"
fi fi
if [ $SRS_KAFKA = YES ]; then if [ $SRS_KAFKA = YES ]; then
echo -e "${GREEN}Kafka is enabled${BLACK}" echo -e "${GREEN}Kafka is enabled.${BLACK}"
else else
echo -e "${YELLOW}warning: without Kafka support${BLACK}" echo -e "${YELLOW}Warning: Kafka is disabled.${BLACK}"
fi fi
if [ $SRS_HDS = YES ]; then if [ $SRS_HDS = YES ]; then
echo -e "${YELLOW}Experiment: HDS is enabled${BLACK}" echo -e "${YELLOW}Experiment: HDS is enabled.${BLACK}"
else else
echo -e "${GREEN}warning: without HDS support${BLACK}" echo -e "${GREEN}Warning: HDS is disabled.${BLACK}"
fi fi
if [ $SRS_NGINX = YES ]; then if [ $SRS_NGINX = YES ]; then
echo -e "${GREEN}Nginx http server is enabled${BLACK}" echo -e "${GREEN}Nginx is enabled.${BLACK}"
else else
echo -e "${GREEN}note: Nginx http server is disabled${BLACK}" echo -e "${GREEN}Note: Nginx is disabled.${BLACK}"
fi fi
if [ $SRS_DVR = YES ]; then if [ $SRS_DVR = YES ]; then
echo -e "${GREEN}DVR is enabled${BLACK}" echo -e "${GREEN}DVR is enabled.${BLACK}"
else else
echo -e "${YELLOW}warning: without DVR support${BLACK}" echo -e "${YELLOW}Warning: DVR is disabled.${BLACK}"
fi fi
if [ $SRS_SSL = YES ]; then if [ $SRS_SSL = YES ]; then
echo -e "${GREEN}rtmp complex handshake is enabled${BLACK}" echo -e "${GREEN}RTMP complex handshake is enabled${BLACK}"
else else
echo -e "${YELLOW}warning: without rtmp complex handshake support, donot support h264/aac to adobe flash player${BLACK}" echo -e "${YELLOW}Warning: RTMP complex handshake is disabled, flash cann't play h264/aac.${BLACK}"
fi fi
if [ $SRS_FFMPEG_TOOL = YES ]; then if [ $SRS_FFMPEG_TOOL = YES ]; then
echo -e "${GREEN}transcode/mux/ingest tool FFMPEG is enabled${BLACK}" echo -e "${GREEN}The FFMPEG tool is enabled.${BLACK}"
else else
echo -e "${YELLOW}warning: without transcode/mux/ingest tool FFMPEG support${BLACK}" echo -e "${YELLOW}Warning: The FFMPEG tool is disabled, please use other tools for transcode/mux/ingest.${BLACK}"
fi fi
if [ $SRS_TRANSCODE = YES ]; then if [ $SRS_TRANSCODE = YES ]; then
echo -e "${GREEN}transcoding RTMP stream is enabled${BLACK}" echo -e "${GREEN}The transcoding is enabled${BLACK}"
else else
echo -e "${YELLOW}warning: without transcoding RTMP stream support${BLACK}" echo -e "${YELLOW}Warning: The transcoding is disabled.${BLACK}"
fi fi
if [ $SRS_INGEST = YES ]; then if [ $SRS_INGEST = YES ]; then
echo -e "${GREEN}ingest file/stream/device is enabled${BLACK}" echo -e "${GREEN}The ingesting is enabled.${BLACK}"
else else
echo -e "${YELLOW}warning: without ingest file/stream/device support${BLACK}" echo -e "${YELLOW}Warning: The ingesting is disabled.${BLACK}"
fi fi
if [ $SRS_HTTP_CALLBACK = YES ]; then if [ $SRS_HTTP_CALLBACK = YES ]; then
echo -e "${GREEN}http hooks callback over CherryPy is enabled${BLACK}" echo -e "${GREEN}The http-callback is enabled${BLACK}"
else else
echo -e "${YELLOW}warning: without http hooks callback over CherryPy support${BLACK}" echo -e "${YELLOW}Warning: The http-callback is disabled.${BLACK}"
fi fi
if [ $SRS_HTTP_SERVER = YES ]; then if [ $SRS_HTTP_SERVER = YES ]; then
echo -e "${GREEN}http server to delivery http stream is enabled${BLACK}" echo -e "${GREEN}Embeded HTTP server for HTTP-FLV/HLS is enabled.${BLACK}"
else else
echo -e "${YELLOW}warning: without http server to delivery http stream support${BLACK}" echo -e "${YELLOW}Warning: Embeded HTTP server is disabled, HTTP-FLV is disabled, please use nginx to delivery HLS.${BLACK}"
fi fi
if [ $SRS_HTTP_API = YES ]; then if [ $SRS_HTTP_API = YES ]; then
echo -e "${GREEN}http api to manage server is enabled${BLACK}" echo -e "${GREEN}The HTTP API is enabled${BLACK}"
else else
echo -e "${YELLOW}warning: without http api to manage server support${BLACK}" echo -e "${YELLOW}Warning: The HTTP API is disabled.${BLACK}"
fi fi
if [ $SRS_LIBRTMP = YES ]; then if [ $SRS_LIBRTMP = YES ]; then
echo -e "${GREEN}srs-librtmp for client is enabled${BLACK}" echo -e "${GREEN}The client-side srs-librtmp is enabled.${BLACK}"
else else
echo -e "${YELLOW}note: srs-librtmp for client is disabled${BLACK}" echo -e "${YELLOW}Note: The client-side srs-librtmp is disabled.${BLACK}"
fi fi
if [ $SRS_RESEARCH = YES ]; then if [ $SRS_RESEARCH = YES ]; then
echo -e "${GREEN}research tools are builded${BLACK}" echo -e "${GREEN}The research tools are enabled.${BLACK}"
else else
echo -e "${GREEN}note: research tools are not builded${BLACK}" echo -e "${GREEN}Note: The research tools are disabled.${BLACK}"
fi fi
if [ $SRS_UTEST = YES ]; then if [ $SRS_UTEST = YES ]; then
echo -e "${GREEN}utest for srs are builded${BLACK}" echo -e "${GREEN}The utests are enabled.${BLACK}"
else else
echo -e "${YELLOW}note: utest for srs are not builded${BLACK}" echo -e "${YELLOW}Note: The utests are disabled.${BLACK}"
fi fi
if [ $SRS_GPERF = YES ]; then if [ $SRS_GPERF = YES ]; then
echo -e "${GREEN}gperf(tcmalloc) for srs are builded${BLACK}" echo -e "${GREEN}The gperf(tcmalloc) is enabled.${BLACK}"
else else
echo -e "${GREEN}note: gperf(tcmalloc) for srs are not builded${BLACK}" echo -e "${GREEN}Note: The gperf(tcmalloc) is disabled.${BLACK}"
fi fi
if [ $SRS_GPERF_MC = YES ]; then if [ $SRS_GPERF_MC = YES ]; then
echo -e "${YELLOW}gmc(gperf memory check) for srs are builded -- Performance may suffer${BLACK}" echo -e "${YELLOW}The gmc(gperf memory check) is enabled, performance may suffer.${BLACK}"
else else
echo -e "${GREEN}note: gmc(gperf memory check) for srs are not builded${BLACK}" echo -e "${GREEN}Note: The gmc(gperf memory check) is disabled.${BLACK}"
fi fi
if [ $SRS_GPERF_MD = YES ]; then if [ $SRS_GPERF_MD = YES ]; then
echo -e "${YELLOW}gmd(gperf memory defense) for srs are builded -- Performance may suffer${BLACK}" echo -e "${YELLOW}The gmd(gperf memory defense) is enabled, performance may suffer.${BLACK}"
else else
echo -e "${GREEN}note: gmd(gperf memory defense) for srs are not builded${BLACK}" echo -e "${GREEN}Note: The gmd(gperf memory defense) is disabled.${BLACK}"
fi fi
if [ $SRS_GPERF_MP = YES ]; then if [ $SRS_GPERF_MP = YES ]; then
echo -e "${YELLOW}gmp(gperf memory profile) for srs are builded -- Performance may suffer${BLACK}" echo -e "${YELLOW}The gmp(gperf memory profile) is enabled, performance may suffer.${BLACK}"
else else
echo -e "${GREEN}note: gmp(gperf memory profile) for srs are not builded${BLACK}" echo -e "${GREEN}Note: The gmp(gperf memory profile) is disabled.${BLACK}"
fi fi
if [ $SRS_GPERF_CP = YES ]; then if [ $SRS_GPERF_CP = YES ]; then
echo -e "${YELLOW}gcp(gperf cpu profile) for srs are builded -- Performance may suffer${BLACK}" echo -e "${YELLOW}The gcp(gperf cpu profile) is enabled, performance may suffer.${BLACK}"
else else
echo -e "${GREEN}note: gcp(gperf cpu profile) for srs are not builded${BLACK}" echo -e "${GREEN}Note: The gcp(gperf cpu profile) is disabled.${BLACK}"
fi fi
if [ $SRS_GPROF = YES ]; then if [ $SRS_GPROF = YES ]; then
echo -e "${YELLOW}gprof(GNU profile tool) for srs are builded -- Performance may suffer${BLACK}" echo -e "${YELLOW}The gprof(GNU profile tool) is enabled, performance may suffer.${BLACK}"
else else
echo -e "${GREEN}note: gprof(GNU profile tool) for srs are not builded${BLACK}" echo -e "${GREEN}Note: The gprof(GNU profile tool) is disabled.${BLACK}"
fi fi
if [ $SRS_ARM_UBUNTU12 = YES ]; then if [ $SRS_ARM_UBUNTU12 = YES ]; then
echo -e "${GREEN}arm-ubuntu12(armhf, v7cpu) for srs are builded${BLACK}" echo -e "${GREEN}The cross-build arm-ubuntu12(armhf, v7cpu) is enabled.${BLACK}"
else else
echo -e "${GREEN}note: arm-ubuntu12(armhf, v7cpu) for srs are not builded${BLACK}" echo -e "${GREEN}Note: The cross-build arm-ubuntu12(armhf, v7cpu)is disabled.${BLACK}"
fi fi
if [ $SRS_MIPS_UBUNTU12 = YES ]; then if [ $SRS_MIPS_UBUNTU12 = YES ]; then
echo -e "${GREEN}mips-ubuntu12 for srs are builded${BLACK}" echo -e "${GREEN}The mips-ubuntu12 is enabled.${BLACK}"
else else
echo -e "${GREEN}note: mips-ubuntu12 for srs are not builded${BLACK}" echo -e "${GREEN}Note: The mips-ubuntu12 is disabled.${BLACK}"
fi fi
# add each modules for application # add each modules for application
for SRS_MODULE in ${SRS_MODULES[*]}; do for SRS_MODULE in ${SRS_MODULES[*]}; do
echo -e "${GREEN}module: $SRS_MODULE${BLACK}" echo -e "${GREEN}Enable module: $SRS_MODULE${BLACK}"
done done
fi fi
@ -652,7 +646,7 @@ fi
if [ $SRS_EXPORT_LIBRTMP_PROJECT = NO ]; then if [ $SRS_EXPORT_LIBRTMP_PROJECT = NO ]; then
ip=`ifconfig|grep "inet addr"| grep -v "127.0.0.1"|awk '{print $2}'|awk -F ':' 'NR==1 {print $2}'` ip=`ifconfig|grep "inet addr"| grep -v "127.0.0.1"|awk '{print $2}'|awk -F ':' 'NR==1 {print $2}'`
echo "" echo ""
echo "to run 3rdparty application:" echo "You can run 3rdparty applications:"
if [ $SRS_NGINX = YES ]; then if [ $SRS_NGINX = YES ]; then
echo "\" sudo ./objs/nginx/sbin/nginx \" to start the nginx http server for hls" echo "\" sudo ./objs/nginx/sbin/nginx \" to start the nginx http server for hls"
fi fi
@ -663,14 +657,14 @@ if [ $SRS_EXPORT_LIBRTMP_PROJECT = NO ]; then
echo -e "\" python ./research/api-server/server.py 8085 \" to start the api-server" echo -e "\" python ./research/api-server/server.py 8085 \" to start the api-server"
fi fi
echo "" echo ""
echo "to build:" echo "You can build SRS:"
echo "\" make \" to build the srs(simple rtmp server)." echo "\" make \" to build the srs(simple rtmp server)."
echo "\" make help \" to get the usage of make" echo "\" make help \" to get the usage of make"
else else
# for srs-librtmp single file, # for srs-librtmp single file,
# package the whole project to srs_librtmp.h and srs_librtmp.cpp # package the whole project to srs_librtmp.h and srs_librtmp.cpp
if [ $SRS_EXPORT_LIBRTMP_SINGLE != NO ]; then if [ $SRS_EXPORT_LIBRTMP_SINGLE != NO ]; then
echo "package the whole project to srs_librtmp.h and srs_librtmp.cpp" echo "Packaging the whole project to srs_librtmp.h and srs_librtmp.cpp"
. $SRS_EXPORT_LIBRTMP_SINGLE/auto/generate-srs-librtmp-single.sh . $SRS_EXPORT_LIBRTMP_SINGLE/auto/generate-srs-librtmp-single.sh
echo -e "${GREEN}Please use the srs-librtmp files: ${BLACK}" echo -e "${GREEN}Please use the srs-librtmp files: ${BLACK}"
echo -e "${GREEN} $SRS_EXPORT_LIBRTMP_PROJECT/srs_librtmp.h ${BLACK}" echo -e "${GREEN} $SRS_EXPORT_LIBRTMP_PROJECT/srs_librtmp.h ${BLACK}"

View file

@ -361,6 +361,8 @@
3C663F0B1AB0155100286D8B /* srs_play.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = srs_play.c; path = ../../../research/librtmp/srs_play.c; sourceTree = "<group>"; }; 3C663F0B1AB0155100286D8B /* srs_play.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = srs_play.c; path = ../../../research/librtmp/srs_play.c; sourceTree = "<group>"; };
3C663F0C1AB0155100286D8B /* srs_publish.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = srs_publish.c; path = ../../../research/librtmp/srs_publish.c; sourceTree = "<group>"; }; 3C663F0C1AB0155100286D8B /* srs_publish.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = srs_publish.c; path = ../../../research/librtmp/srs_publish.c; sourceTree = "<group>"; };
3C663F0D1AB0155100286D8B /* srs_rtmp_dump.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = srs_rtmp_dump.c; path = ../../../research/librtmp/srs_rtmp_dump.c; sourceTree = "<group>"; }; 3C663F0D1AB0155100286D8B /* srs_rtmp_dump.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = srs_rtmp_dump.c; path = ../../../research/librtmp/srs_rtmp_dump.c; sourceTree = "<group>"; };
3C6673CF1DF7B93200A6DF57 /* readme.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = readme.txt; path = ../../../modules/readme.txt; sourceTree = "<group>"; };
3C6673D11DF7B95E00A6DF57 /* config */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = config; path = "../../../modules/hls-ingester/config"; sourceTree = "<group>"; };
3C689F911AB6AAAC00C9CEEE /* common.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = common.h; path = "../../objs/st-1.9/common.h"; sourceTree = "<group>"; }; 3C689F911AB6AAAC00C9CEEE /* common.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = common.h; path = "../../objs/st-1.9/common.h"; sourceTree = "<group>"; };
3C689F921AB6AAAC00C9CEEE /* event.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = event.c; path = "../../objs/st-1.9/event.c"; sourceTree = "<group>"; }; 3C689F921AB6AAAC00C9CEEE /* event.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = event.c; path = "../../objs/st-1.9/event.c"; sourceTree = "<group>"; };
3C689F931AB6AAAC00C9CEEE /* io.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = io.c; path = "../../objs/st-1.9/io.c"; sourceTree = "<group>"; }; 3C689F931AB6AAAC00C9CEEE /* io.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = io.c; path = "../../objs/st-1.9/io.c"; sourceTree = "<group>"; };
@ -811,6 +813,14 @@
path = srs_xcode; path = srs_xcode;
sourceTree = "<group>"; sourceTree = "<group>";
}; };
3C6673D01DF7B95000A6DF57 /* hls-ingester */ = {
isa = PBXGroup;
children = (
3C6673D11DF7B95E00A6DF57 /* config */,
);
name = "hls-ingester";
sourceTree = "<group>";
};
3C689F901AB6AA9100C9CEEE /* st-1.9 */ = { 3C689F901AB6AA9100C9CEEE /* st-1.9 */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
@ -831,7 +841,8 @@
3C96ADC41B00A71000885304 /* modules */ = { 3C96ADC41B00A71000885304 /* modules */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
3C24ECCA1C3A42D800460622 /* readme.txt */, 3C6673D01DF7B95000A6DF57 /* hls-ingester */,
3C6673CF1DF7B93200A6DF57 /* readme.txt */,
); );
name = modules; name = modules;
sourceTree = "<group>"; sourceTree = "<group>";

View file

@ -0,0 +1,7 @@
# The module to ingest hls to replace ffmpeg with better behavior.
SRS_MODULE_NAME=("hls-ingester")
SRS_MODULE_MAIN=("srs_main_ingest_hls")
SRS_MODULE_APP=()
SRS_MODULE_DEFINES=""
SRS_MODULE_MAKEFILE=""

View file

@ -31,7 +31,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// current release version // current release version
#define VERSION_MAJOR 3 #define VERSION_MAJOR 3
#define VERSION_MINOR 0 #define VERSION_MINOR 0
#define VERSION_REVISION 221 #define VERSION_REVISION 7
// generated by configure, only macros. // generated by configure, only macros.
#include <srs_auto_headers.hpp> #include <srs_auto_headers.hpp>