1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

arm support ssl/hls, change to 0.9.17

This commit is contained in:
winlin 2014-03-16 20:16:42 +08:00
parent 75340e3ac0
commit a9da5903f6
4 changed files with 274 additions and 129 deletions

View file

@ -1,7 +1,8 @@
#!/bin/bash #!/bin/bash
# variables: # variables, parent script must set it:
# SRS_JOBS: the build jobs, parent script must set it. # SRS_JOBS: the build jobs.
# SrsArmMakeOptions: the arm make options for ubuntu12(armhf, v7cpu)
##################################################################################### #####################################################################################
##################################################################################### #####################################################################################
@ -33,7 +34,7 @@ function Ubuntu_prepare()
{ {
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
return; return 0;
fi fi
echo "Ubuntu detected, install tools if needed" echo "Ubuntu detected, install tools if needed"
@ -41,69 +42,80 @@ function Ubuntu_prepare()
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 "install 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 sudo apt-get install -y --force-yes gcc; ret=$?; if [[ 0 -ne $ret ]]; then return $ret; fi
echo "install gcc success" echo "install gcc success"
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 "install 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++ sudo apt-get install -y --force-yes g++; ret=$?; if [[ 0 -ne $ret ]]; then return $ret; fi
echo "install g++ success" echo "install g++ success"
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 "install 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 sudo apt-get install -y --force-yes make; ret=$?; if [[ 0 -ne $ret ]]; then return $ret; fi
echo "install make success" echo "install make success"
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 "install 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 sudo apt-get install -y --force-yes autoconf; ret=$?; if [[ 0 -ne $ret ]]; then return $ret; fi
echo "install autoconf success" echo "install autoconf success"
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 "install 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 sudo apt-get install -y --force-yes libtool; ret=$?; if [[ 0 -ne $ret ]]; then return $ret; fi
echo "install libtool success" echo "install libtool success"
fi fi
if [[ ! -f /usr/include/pcre.h ]]; then if [[ ! -f /usr/include/pcre.h ]]; then
echo "install libpcre3-dev" echo "install 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 sudo apt-get install -y --force-yes libpcre3-dev; ret=$?; if [[ 0 -ne $ret ]]; then return $ret; fi
echo "install libpcre3-dev success" echo "install libpcre3-dev success"
fi fi
if [[ ! -f /usr/include/zlib.h ]]; then if [[ ! -f /usr/include/zlib.h ]]; then
echo "install zlib1g-dev" echo "install 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 sudo apt-get install -y --force-yes zlib1g-dev; ret=$?; if [[ 0 -ne $ret ]]; then return $ret; fi
echo "install zlib1g-dev success" echo "install zlib1g-dev success"
fi fi
if [[ ! -d /usr/include/freetype2 ]]; then if [[ ! -d /usr/include/freetype2 ]]; then
echo "install libfreetype6-dev" echo "install libfreetype6-dev"
require_sudoer "sudo apt-get install -y --force-yes libfreetype6-dev" require_sudoer "sudo apt-get install -y --force-yes libfreetype6-dev"
sudo apt-get install -y --force-yes libfreetype6-dev sudo apt-get install -y --force-yes libfreetype6-dev; ret=$?; if [[ 0 -ne $ret ]]; then return $ret; fi
echo "install libfreetype6-dev success" echo "install libfreetype6-dev success"
fi fi
# for arm, install the cross build tool chain.
if [ $SRS_ARM_UBUNTU12 = YES ]; then
arm-linux-gnueabi-gcc --help >/dev/null 2>&1; ret=$?; if [[ 0 -ne $ret ]]; then
echo "install 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"
fi
fi
echo "Ubuntu install tools success" echo "Ubuntu install tools success"
return 0
} }
Ubuntu_prepare Ubuntu_prepare; ret=$?; if [[ 0 -ne $ret ]]; then echo "Ubuntu perfapre failed, ret=$ret"; exit $ret; fi
##################################################################################### #####################################################################################
# for Centos, auto install tools by yum # for Centos, auto install tools by yum
##################################################################################### #####################################################################################
function Centos_prepare() function Centos_prepare()
{ {
if [[ ! -f /etc/redhat-release ]]; then if [[ ! -f /etc/redhat-release ]]; then
return; return 0;
fi fi
echo "Centos detected, install tools if needed" echo "Centos detected, install tools if needed"
@ -111,74 +123,100 @@ function Centos_prepare()
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 "install gcc"
require_sudoer "sudo yum install -y gcc" require_sudoer "sudo yum install -y gcc"
sudo yum install -y gcc sudo yum install -y gcc; ret=$?; if [[ 0 -ne $ret ]]; then return $ret; fi
echo "install gcc success" echo "install gcc success"
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 "install gcc-c++"
require_sudoer "sudo yum install -y gcc-c++" require_sudoer "sudo yum install -y gcc-c++"
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 "install gcc-c++ success"
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 "install make"
require_sudoer "sudo yum install -y make" require_sudoer "sudo yum install -y make"
sudo yum install -y make sudo yum install -y make; ret=$?; if [[ 0 -ne $ret ]]; then return $ret; fi
echo "install make success" echo "install make success"
fi fi
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 "install automake"
require_sudoer "sudo yum install -y automake" require_sudoer "sudo yum install -y automake"
sudo yum install -y automake sudo yum install -y automake; ret=$?; if [[ 0 -ne $ret ]]; then return $ret; fi
echo "install automake success" echo "install automake success"
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 "install autoconf"
require_sudoer "sudo yum install -y autoconf" require_sudoer "sudo yum install -y autoconf"
sudo yum install -y autoconf sudo yum install -y autoconf; ret=$?; if [[ 0 -ne $ret ]]; then return $ret; fi
echo "install autoconf success" echo "install autoconf success"
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 "install libtool"
require_sudoer "sudo yum install -y libtool" require_sudoer "sudo yum install -y libtool"
sudo yum install -y libtool sudo yum install -y libtool; ret=$?; if [[ 0 -ne $ret ]]; then return $ret; fi
echo "install libtool success" echo "install libtool success"
fi fi
if [[ ! -f /usr/include/pcre.h ]]; then if [[ ! -f /usr/include/pcre.h ]]; then
echo "install pcre-devel" echo "install pcre-devel"
require_sudoer "sudo yum install -y pcre-devel" require_sudoer "sudo yum install -y pcre-devel"
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 "install pcre-devel success"
fi fi
if [[ ! -f /usr/include/zlib.h ]]; then if [[ ! -f /usr/include/zlib.h ]]; then
echo "install zlib-devel" echo "install zlib-devel"
require_sudoer "sudo yum install -y zlib-devel" require_sudoer "sudo yum install -y zlib-devel"
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 "install zlib-devel success"
fi fi
if [[ ! -d /usr/include/freetype2 ]]; then if [[ ! -d /usr/include/freetype2 ]]; then
echo "install freetype-devel" echo "install freetype-devel"
require_sudoer "sudo yum install -y freetype-devel" require_sudoer "sudo yum install -y freetype-devel"
sudo yum install -y freetype-devel sudo yum install -y freetype-devel; ret=$?; if [[ 0 -ne $ret ]]; then return $ret; fi
echo "install freetype-devel success" echo "install freetype-devel success"
fi fi
# for arm, install the cross build tool chain.
if [ $SRS_ARM_UBUNTU12 = YES ]; then
echo "arm-ubuntu12 is invalid for CentOS"
return 1
fi
echo "Centos install tools success" echo "Centos install tools success"
return 0
} }
Centos_prepare Centos_prepare; ret=$?; if [[ 0 -ne $ret ]]; then "CentOS perfapre failed, ret=$ret"; exit $ret; fi
##################################################################################### #####################################################################################
# st-1.9 # st-1.9
##################################################################################### #####################################################################################
if [[ -f ${SRS_OBJS}/st-1.9/obj/libst.a && -f ${SRS_OBJS}/st-1.9/obj/libst.so ]]; then # check the arm flag file, if flag changed, need to rebuild the st.
if [ $SRS_ARM_UBUNTU12 = YES ]; then
# ok, arm specified, if the flag filed does not exists, need to rebuild.
if [[ -f ${SRS_OBJS}/_flag.st.arm.tmp && -f ${SRS_OBJS}/st-1.9/obj/libst.a && -f ${SRS_OBJS}/st-1.9/obj/libst.so ]]; then
echo "st-1.9t for arm is ok.";
else
# TODO: FIXME: patch the bug.
# patch st for arm, @see: https://github.com/winlinvip/simple-rtmp-server/wiki/SrsLinuxArm#st-arm-bug-fix
echo "build 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 &&
make CC=${SrsArmCC} AR=${SrsArmAR} LD=${SrsArmLD} RANDLIB=${SrsArmRANDLIB} linux-debug &&
cd .. && rm -f st && ln -sf st-1.9/obj st &&
cd .. && touch ${SRS_OBJS}/_flag.st.arm.tmp
)
fi
else
# arm not specified, if exists flag, need to rebuild for no-arm platform.
if [[ ! -f ${SRS_OBJS}/_flag.st.arm.tmp && -f ${SRS_OBJS}/_flag.st.arm.tmp && -f ${SRS_OBJS}/st-1.9/obj/libst.a && -f ${SRS_OBJS}/st-1.9/obj/libst.so ]]; then
echo "st-1.9t is ok."; echo "st-1.9t is ok.";
else else
echo "build st-1.9t"; echo "build st-1.9t";
@ -186,9 +224,11 @@ else
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 && unzip -q ../3rdparty/st-1.9.zip && cd st-1.9 &&
make linux-debug && make linux-debug &&
cd .. && rm -f st && ln -sf st-1.9/obj st cd .. && rm -f st && ln -sf st-1.9/obj st &&
cd .. && rm -f ${SRS_OBJS}/_flag.st.arm.tmp
) )
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-1.9/obj/libst.a ]; then echo "build st-1.9 failed."; exit -1; fi if [ ! -f ${SRS_OBJS}/st-1.9/obj/libst.a ]; then echo "build st-1.9 failed."; exit -1; fi
@ -230,6 +270,7 @@ function write_nginx_html5()
</video> </video>
END END
} }
if [ $SRS_ARM_UBUNTU12 = NO ]; then
if [ $SRS_HLS = YES ]; then if [ $SRS_HLS = 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 "nginx-1.5.7 is ok.";
@ -273,6 +314,7 @@ if [ $SRS_HLS = YES ]; then
# 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
fi
if [ $SRS_HLS = YES ]; then if [ $SRS_HLS = YES ]; then
echo "#define SRS_HLS" >> $SRS_AUTO_HEADERS_H echo "#define SRS_HLS" >> $SRS_AUTO_HEADERS_H
@ -320,6 +362,7 @@ ln -sf `pwd`/${SRS_OBJS}/nginx/html/forward research/api-server/static-dir/forwa
# only when the nginx is ok, # only when the nginx is ok,
# if api-server not enalbed, use nginx as demo. # if api-server not enalbed, use nginx as demo.
if [ $SRS_ARM_UBUNTU12 = NO ]; then
if [ $SRS_HLS = YES ]; then if [ $SRS_HLS = YES ]; then
if [ $SRS_HTTP_CALLBACK = YES ]; then if [ $SRS_HTTP_CALLBACK = YES ]; then
# override the default index. # override the default index.
@ -344,12 +387,31 @@ if [ $SRS_HLS = YES ]; then
END END
fi fi
fi fi
fi
##################################################################################### #####################################################################################
# openssl, for rtmp complex handshake # openssl, for rtmp complex handshake
##################################################################################### #####################################################################################
if [ $SRS_SSL = YES ]; then if [ $SRS_SSL = YES ]; then
if [[ -f ${SRS_OBJS}/openssl/lib/libssl.a ]]; then # check the arm flag file, if flag changed, need to rebuild the st.
if [ $SRS_ARM_UBUNTU12 = YES ]; then
# ok, arm specified, if the flag filed does not exists, need to rebuild.
if [[ -f ${SRS_OBJS}/_flag.ssl.arm.tmp && -f ${SRS_OBJS}/openssl/lib/libssl.a ]]; then
echo "openssl-1.0.1f for arm is ok.";
else
echo "build openssl-1.0.1f for arm";
(
rm -rf ${SRS_OBJS}/openssl-1.0.1f && cd ${SRS_OBJS} &&
unzip -q ../3rdparty/openssl-1.0.1f.zip && cd openssl-1.0.1f &&
./Configure --prefix=`pwd`/_release -no-shared no-asm linux-armv4 &&
make CC=${SrsArmCC} GCC=${SrsArmGCC} AR="${SrsArmAR} r" KD=${SrsArmLD} LINK=${SrsArmLINK} RANDLIB=${SrsArmRANDLIB} && make install &&
cd .. && ln -sf openssl-1.0.1f/_release openssl &&
cd .. && touch ${SRS_OBJS}/_flag.ssl.arm.tmp
)
fi
else
# arm not specified, if exists flag, need to rebuild for no-arm platform.
if [[ ! -f ${SRS_OBJS}/_flag.ssl.arm.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 "build openssl-1.0.1f";
@ -358,9 +420,11 @@ if [ $SRS_SSL = YES ]; then
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 &&
./config --prefix=`pwd`/_release -no-shared && ./config --prefix=`pwd`/_release -no-shared &&
make && make install && make && make install &&
cd .. && ln -sf openssl-1.0.1f/_release openssl cd .. && ln -sf openssl-1.0.1f/_release openssl &&
cd .. && rm -f ${SRS_OBJS}/_flag.ssl.arm.tmp
) )
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
@ -471,3 +535,12 @@ if [ $SRS_GPERF_CP = YES ]; then
else else
echo "#undef SRS_GPERF_CP" >> $SRS_AUTO_HEADERS_H echo "#undef SRS_GPERF_CP" >> $SRS_AUTO_HEADERS_H
fi fi
#####################################################################################
# for arm.
#####################################################################################
if [ $SRS_ARM_UBUNTU12 = YES ]; then
echo "#define SRS_ARM_UBUNTU12" >> $SRS_AUTO_HEADERS_H
else
echo "#undef SRS_ARM_UBUNTU12" >> $SRS_AUTO_HEADERS_H
fi

View file

@ -24,24 +24,10 @@ SRS_GPERF_MC=RESERVED # gperf memory check
SRS_GPERF_MP=RESERVED # gperf memory profile SRS_GPERF_MP=RESERVED # gperf memory profile
SRS_GPERF_CP=RESERVED # gperf cpu profile SRS_GPERF_CP=RESERVED # gperf cpu profile
SRS_GPROF=RESERVED # gprof SRS_GPROF=RESERVED # gprof
SRS_ARM_UBUNTU12=RESERVED # armhf(v7cpu) built on ubuntu12
# arguments # arguments
SRS_JOBS=1 SRS_JOBS=1
# TODO: remove the default to yes.
SRS_HLS=YES
SRS_SSL=YES
SRS_FFMPEG=YES
SRS_HTTP_CALLBACK=YES
SRS_LIBRTMP=YES
SRS_BWTC=NO
SRS_RESEARCH=NO
SRS_UTEST=YES
SRS_GPERF=NO
SRS_GPERF_MC=NO
SRS_GPERF_MP=NO
SRS_GPERF_CP=NO
SRS_GPROF=NO
##################################################################################### #####################################################################################
# parse options # parse options
##################################################################################### #####################################################################################
@ -75,6 +61,7 @@ do
--with-gmp) SRS_GPERF_MP=YES ;; --with-gmp) SRS_GPERF_MP=YES ;;
--with-gcp) SRS_GPERF_CP=YES ;; --with-gcp) SRS_GPERF_CP=YES ;;
--with-gprof) SRS_GPROF=YES ;; --with-gprof) SRS_GPROF=YES ;;
--with-arm-ubuntu12) SRS_ARM_UBUNTU12=YES ;;
--without-ssl) SRS_SSL=NO ;; --without-ssl) SRS_SSL=NO ;;
--without-hls) SRS_HLS=NO ;; --without-hls) SRS_HLS=NO ;;
@ -89,6 +76,7 @@ do
--without-gmp) SRS_GPERF_MP=NO ;; --without-gmp) SRS_GPERF_MP=NO ;;
--without-gcp) SRS_GPERF_CP=NO ;; --without-gcp) SRS_GPERF_CP=NO ;;
--without-gprof) SRS_GPROF=NO ;; --without-gprof) SRS_GPROF=NO ;;
--without-arm-ubuntu12) SRS_ARM_UBUNTU12=NO ;;
--jobs) SRS_JOBS=${value} ;; --jobs) SRS_JOBS=${value} ;;
@ -99,6 +87,42 @@ do
esac esac
done done
#####################################################################################
# apply the default value when user donot specified.
#####################################################################################
# if arm specified, set some default to disabled.
if [ $SRS_ARM_UBUNTU12 = YES ]; then
if [ $SRS_HLS = RESERVED ]; then SRS_HLS=NO; fi
if [ $SRS_SSL = RESERVED ]; then SRS_SSL=NO; fi
if [ $SRS_FFMPEG = RESERVED ]; then SRS_FFMPEG=NO; fi
if [ $SRS_HTTP_CALLBACK = RESERVED ]; then SRS_HTTP_CALLBACK=NO; fi
if [ $SRS_LIBRTMP = RESERVED ]; then SRS_LIBRTMP=NO; fi
if [ $SRS_BWTC = RESERVED ]; then SRS_BWTC=NO; fi
if [ $SRS_RESEARCH = RESERVED ]; then SRS_RESEARCH=NO; fi
if [ $SRS_UTEST = RESERVED ]; then SRS_UTEST=NO; fi
if [ $SRS_GPERF = RESERVED ]; then SRS_GPERF=NO; fi
if [ $SRS_GPERF_MC = RESERVED ]; then SRS_GPERF_MC=NO; fi
if [ $SRS_GPERF_MP = RESERVED ]; then SRS_GPERF_MP=NO; fi
if [ $SRS_GPERF_CP = RESERVED ]; then SRS_GPERF_CP=NO; fi
if [ $SRS_GPROF = RESERVED ]; then SRS_GPROF=NO; fi
if [ $SRS_ARM_UBUNTU12 = RESERVED ]; then SRS_ARM_UBUNTU12=NO; fi
else
if [ $SRS_HLS = RESERVED ]; then SRS_HLS=YES; fi
if [ $SRS_SSL = RESERVED ]; then SRS_SSL=YES; fi
if [ $SRS_FFMPEG = RESERVED ]; then SRS_FFMPEG=YES; fi
if [ $SRS_HTTP_CALLBACK = RESERVED ]; then SRS_HTTP_CALLBACK=YES; fi
if [ $SRS_LIBRTMP = RESERVED ]; then SRS_LIBRTMP=YES; fi
if [ $SRS_BWTC = RESERVED ]; then SRS_BWTC=NO; fi
if [ $SRS_RESEARCH = RESERVED ]; then SRS_RESEARCH=NO; fi
if [ $SRS_UTEST = RESERVED ]; then SRS_UTEST=YES; fi
if [ $SRS_GPERF = RESERVED ]; then SRS_GPERF=NO; fi
if [ $SRS_GPERF_MC = RESERVED ]; then SRS_GPERF_MC=NO; fi
if [ $SRS_GPERF_MP = RESERVED ]; then SRS_GPERF_MP=NO; fi
if [ $SRS_GPERF_CP = RESERVED ]; then SRS_GPERF_CP=NO; fi
if [ $SRS_GPROF = RESERVED ]; then SRS_GPROF=NO; fi
if [ $SRS_ARM_UBUNTU12 = RESERVED ]; then SRS_ARM_UBUNTU12=NO; fi
fi
# parse the jobs for make # parse the jobs for make
if [[ "" -eq SRS_JOBS ]]; then if [[ "" -eq SRS_JOBS ]]; then
export SRS_JOBS="--jobs" export SRS_JOBS="--jobs"
@ -132,6 +156,7 @@ if [ $help = yes ]; then
--with-gmp build memory profile for srs with gperf tools. --with-gmp build memory profile for srs with gperf tools.
--with-gcp build cpu profile for srs with gperf tools. --with-gcp build cpu profile for srs with gperf tools.
--with-gprof build srs with gprof(GNU profile tool). --with-gprof build srs with gprof(GNU profile tool).
--with-arm-ubuntu12 build srs on ubuntu12 for armhf(v7cpu).
--without-ssl disable rtmp complex handshake. --without-ssl disable rtmp complex handshake.
--without-hls disable hls, rtmp streaming only. --without-hls disable hls, rtmp streaming only.
@ -146,6 +171,7 @@ if [ $help = yes ]; then
--without-gmp do not build memory profile for srs with gperf tools. --without-gmp do not build memory profile for srs with gperf tools.
--without-gcp do not build cpu profile for srs with gperf tools. --without-gcp do not build cpu profile for srs with gperf tools.
--without-gprof do not build srs with gprof(GNU profile tool). --without-gprof do not build srs with gprof(GNU profile tool).
--without-arm-ubuntu12 do not build srs on ubuntu12 for armhf(v7cpu).
--jobs[=N] Allow N jobs at once; infinite jobs with no arg. --jobs[=N] Allow N jobs at once; infinite jobs with no arg.
used for make in the configure, for example, to make ffmpeg. used for make in the configure, for example, to make ffmpeg.
@ -181,6 +207,21 @@ if [ $__gperf_slow = YES ]; then if [ $SRS_GPROF = YES ]; then
echo "gmc/gmp/gcp not compatible with gprof, see: ./configure --help"; __check_ok=NO; echo "gmc/gmp/gcp not compatible with gprof, see: ./configure --help"; __check_ok=NO;
fi fi fi fi
# check arm, if arm enabled, only allow st/ssl/librtmp,
# user should disable all other features
if [ $SRS_ARM_UBUNTU12 = YES ]; then
if [ $SRS_FFMPEG = YES ]; then echo "ffmpeg for arm is not available, see: ./configure --help"; __check_ok=NO; fi
if [ $SRS_HTTP_CALLBACK = YES ]; then echo "http-callback for arm is not available, see: ./configure --help"; __check_ok=NO; fi
if [ $SRS_BWTC = YES ]; then echo "bwtc for arm is not available, see: ./configure --help"; __check_ok=NO; fi
if [ $SRS_RESEARCH = YES ]; then echo "research for arm is not available, see: ./configure --help"; __check_ok=NO; fi
if [ $SRS_UTEST = YES ]; then echo "utest for arm is not available, see: ./configure --help"; __check_ok=NO; fi
if [ $SRS_GPERF = YES ]; then echo "gperf for arm is not available, see: ./configure --help"; __check_ok=NO; fi
if [ $SRS_GPERF_MC = YES ]; then echo "gmc for arm is not available, see: ./configure --help"; __check_ok=NO; fi
if [ $SRS_GPERF_MP = YES ]; then echo "gmp for arm is not available, see: ./configure --help"; __check_ok=NO; fi
if [ $SRS_GPERF_CP = YES ]; then echo "gcp for arm is not available, see: ./configure --help"; __check_ok=NO; fi
if [ $SRS_GPROF = YES ]; then echo "gprof for arm is not available, see: ./configure --help"; __check_ok=NO; fi
fi
# check variable neccessary # check variable neccessary
if [ $SRS_HLS = RESERVED ]; then echo "you must specifies the hls, see: ./configure --help"; __check_ok=NO; fi if [ $SRS_HLS = RESERVED ]; then echo "you must specifies the hls, see: ./configure --help"; __check_ok=NO; fi
if [ $SRS_SSL = RESERVED ]; then echo "you must specifies the ssl, see: ./configure --help"; __check_ok=NO; fi if [ $SRS_SSL = RESERVED ]; then echo "you must specifies the ssl, see: ./configure --help"; __check_ok=NO; fi
@ -195,6 +236,7 @@ if [ $SRS_GPERF_MC = RESERVED ]; then echo "you must specifies the gperf-mc, see
if [ $SRS_GPERF_MP = RESERVED ]; then echo "you must specifies the gperf-mp, see: ./configure --help"; __check_ok=NO; fi if [ $SRS_GPERF_MP = RESERVED ]; then echo "you must specifies the gperf-mp, see: ./configure --help"; __check_ok=NO; fi
if [ $SRS_GPERF_CP = RESERVED ]; then echo "you must specifies the gperf-cp, see: ./configure --help"; __check_ok=NO; fi if [ $SRS_GPERF_CP = RESERVED ]; then echo "you must specifies the gperf-cp, see: ./configure --help"; __check_ok=NO; fi
if [ $SRS_GPROF = RESERVED ]; then echo "you must specifies the gprof, see: ./configure --help"; __check_ok=NO; fi if [ $SRS_GPROF = RESERVED ]; then echo "you must specifies the gprof, see: ./configure --help"; __check_ok=NO; fi
if [ $SRS_ARM_UBUNTU12 = RESERVED ]; then echo "you must specifies the arm-ubuntu12, see: ./configure --help"; __check_ok=NO; fi
if [ $__check_ok = NO ]; then if [ $__check_ok = NO ]; then
exit 1; exit 1;
fi fi
@ -214,5 +256,6 @@ if [ $SRS_GPERF_MC = YES ]; then SRS_CONFIGURE="${SRS_CONFIGURE} --with-gmc"; el
if [ $SRS_GPERF_MP = YES ]; then SRS_CONFIGURE="${SRS_CONFIGURE} --with-gmp"; else SRS_CONFIGURE="${SRS_CONFIGURE} --without-gmp"; fi if [ $SRS_GPERF_MP = YES ]; then SRS_CONFIGURE="${SRS_CONFIGURE} --with-gmp"; else SRS_CONFIGURE="${SRS_CONFIGURE} --without-gmp"; fi
if [ $SRS_GPERF_CP = YES ]; then SRS_CONFIGURE="${SRS_CONFIGURE} --with-gcp"; else SRS_CONFIGURE="${SRS_CONFIGURE} --without-gcp"; fi if [ $SRS_GPERF_CP = YES ]; then SRS_CONFIGURE="${SRS_CONFIGURE} --with-gcp"; else SRS_CONFIGURE="${SRS_CONFIGURE} --without-gcp"; fi
if [ $SRS_GPROF = YES ]; then SRS_CONFIGURE="${SRS_CONFIGURE} --with-gprof"; else SRS_CONFIGURE="${SRS_CONFIGURE} --without-gprof"; fi if [ $SRS_GPROF = YES ]; then SRS_CONFIGURE="${SRS_CONFIGURE} --with-gprof"; else SRS_CONFIGURE="${SRS_CONFIGURE} --without-gprof"; fi
if [ $SRS_ARM_UBUNTU12 = YES ]; then SRS_CONFIGURE="${SRS_CONFIGURE} --with-arm-ubuntu12"; else SRS_CONFIGURE="${SRS_CONFIGURE} --without-arm-ubuntu12"; fi
SRS_CONFIGURE="${SRS_CONFIGURE} ${SRS_JOBS}" SRS_CONFIGURE="${SRS_CONFIGURE} ${SRS_JOBS}"
echo "regenerate config: ${SRS_CONFIGURE}" echo "regenerate config: ${SRS_CONFIGURE}"

41
trunk/configure vendored
View file

@ -37,6 +37,15 @@ echo "#define SRS_CONFIGURE \"${SRS_CONFIGURE}\"" > $SRS_AUTO_HEADERS_H
echo "#define SRS_BUILD_DATE \"`date \"+%Y-%m-%d %H:%M:%S\"`\"" >> $SRS_AUTO_HEADERS_H echo "#define SRS_BUILD_DATE \"`date \"+%Y-%m-%d %H:%M:%S\"`\"" >> $SRS_AUTO_HEADERS_H
echo "#define SRS_BUILD_TS \"`date +%s`\"" >> $SRS_AUTO_HEADERS_H echo "#define SRS_BUILD_TS \"`date +%s`\"" >> $SRS_AUTO_HEADERS_H
# the arm-ubuntu12 options for make for depends
SrsArmCC="arm-linux-gnueabi-gcc"
SrsArmGCC="arm-linux-gnueabi-gcc"
SrsArmCXX="arm-linux-gnueabi-g++"
SrsArmLINK="arm-linux-gnueabi-g++"
SrsArmAR="arm-linux-gnueabi-ar"
SrsArmLD="arm-linux-gnueabi-ld"
SrsArmRANDLIB="arm-linux-gnueabi-ranlib"
# apply user options. # apply user options.
. auto/depends.sh . auto/depends.sh
@ -247,12 +256,25 @@ SrsGperf=""; SrsGperfLink=""; if [ $SRS_GPERF = YES ]; then SrsGperfLink=" -lpth
# the cxx flag generated. # the cxx flag generated.
CXXFLAGS="${CppStd}${WarnLevel}${GDBDebug}${LibraryCompile}${SrsGprof}" CXXFLAGS="${CppStd}${WarnLevel}${GDBDebug}${LibraryCompile}${SrsGprof}"
if [ $SRS_GPERF = YES ]; then CXXFLAGS="${CXXFLAGS} -fno-builtin-malloc -fno-builtin-calloc -fno-builtin-realloc -fno-builtin-free"; fi if [ $SRS_GPERF = YES ]; then CXXFLAGS="${CXXFLAGS} -fno-builtin-malloc -fno-builtin-calloc -fno-builtin-realloc -fno-builtin-free"; fi
# arm or i386/x86_64
if [ $SRS_ARM_UBUNTU12 = YES ]; then
cat << END > ${SRS_OBJS}/${SRS_MAKEFILE} cat << END > ${SRS_OBJS}/${SRS_MAKEFILE}
CC ?= gcc CC = ${SrsArmCC}
GCC ?= gcc GCC = ${SrsArmGCC}
CXX ?= g++ CXX = ${SrsArmCXX}
AR ?= ar AR = ${SrsArmAR}
LINK ?= g++ LINK = ${SrsArmLINK}
END
else
cat << END > ${SRS_OBJS}/${SRS_MAKEFILE}
CC = gcc
GCC = gcc
CXX = g++
AR = ar
LINK = g++
END
fi
cat << END >> ${SRS_OBJS}/${SRS_MAKEFILE}
CXXFLAGS = ${CXXFLAGS} CXXFLAGS = ${CXXFLAGS}
.PHONY: default srs bandwidth librtmp .PHONY: default srs bandwidth librtmp
@ -277,6 +299,8 @@ if [ $SRS_SSL = YES ]; then LibSSLRoot="${SRS_OBJS}/openssl/include"; LibSSLfile
# gperftools-2.1, for mem check and mem/cpu profile # gperftools-2.1, for mem check and mem/cpu profile
LibGperfRoot=""; LibGperfFile="" LibGperfRoot=""; LibGperfFile=""
if [ $SRS_GPERF = YES ]; then LibGperfRoot="${SRS_OBJS}/gperf/include"; LibGperfFile="${SRS_OBJS}/gperf/lib/libtcmalloc_and_profiler.a"; fi if [ $SRS_GPERF = YES ]; then LibGperfRoot="${SRS_OBJS}/gperf/include"; LibGperfFile="${SRS_OBJS}/gperf/lib/libtcmalloc_and_profiler.a"; fi
# the link options, if arm, use static link
SrsLinkOptions="-ldl"; if [ $SRS_ARM_UBUNTU12 = YES ]; then SrsLinkOptions="-ldl -static"; fi
##################################################################################### #####################################################################################
# Modules, compile each module, then link to binary # Modules, compile each module, then link to binary
@ -344,7 +368,7 @@ MAIN_ENTRANCES=("srs_main_server" "srs_main_bandcheck")
ModuleLibFiles=(${LibSTfile} ${LibHttpParserfile} ${LibSSLfile} ${LibGperfFile}) ModuleLibFiles=(${LibSTfile} ${LibHttpParserfile} ${LibSSLfile} ${LibGperfFile})
# all depends objects # all depends objects
MODULE_OBJS="${CORE_OBJS[@]} ${KERNEL_OBJS[@]} ${RTMP_OBJS[@]} ${APP_OBJS[@]} ${MAIN_OBJS[@]}" MODULE_OBJS="${CORE_OBJS[@]} ${KERNEL_OBJS[@]} ${RTMP_OBJS[@]} ${APP_OBJS[@]} ${MAIN_OBJS[@]}"
LINK_OPTIONS="-ldl${SrsGprofLink}${SrsGperfLink}" LINK_OPTIONS="${SrsLinkOptions}${SrsGprofLink}${SrsGperfLink}"
# #
# srs: # srs:
# srs(simple rtmp server) over st(state-threads) # srs(simple rtmp server) over st(state-threads)
@ -447,6 +471,11 @@ if [ $SRS_GPROF = YES ]; then
else else
echo -e "${GREEN}note: gprof(GNU profile tool) for srs are not builded${BLACK}" echo -e "${GREEN}note: gprof(GNU profile tool) for srs are not builded${BLACK}"
fi fi
if [ $SRS_ARM_UBUNTU12 = YES ]; then
echo -e "${GREEN}arm-ubuntu12(armhf, v7cpu) for srs are builded${BLACK}"
else
echo -e "${GREEN}note: arm-ubuntu12(armhf, v7cpu) for srs are not builded${BLACK}"
fi
##################################################################################### #####################################################################################
# next step # next step

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 "0" #define VERSION_MAJOR "0"
#define VERSION_MINOR "9" #define VERSION_MINOR "9"
#define VERSION_REVISION "16" #define VERSION_REVISION "17"
#define RTMP_SIG_SRS_VERSION VERSION_MAJOR"."VERSION_MINOR"."VERSION_REVISION #define RTMP_SIG_SRS_VERSION VERSION_MAJOR"."VERSION_MINOR"."VERSION_REVISION
// server info. // server info.
#define RTMP_SIG_SRS_KEY "srs" #define RTMP_SIG_SRS_KEY "srs"