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

solve merge problem

This commit is contained in:
runner365 2020-01-25 16:24:04 +08:00
commit 8d277c6e8b
39 changed files with 411 additions and 434 deletions

View file

@ -40,9 +40,6 @@ function srs_undefine_macro()
}
# export the preset.
if [ $SRS_OSX = YES ]; then
srs_define_macro "SRS_OSX" $SRS_AUTO_HEADERS_H
fi
if [ $SRS_X86_X64 = YES ]; then
srs_define_macro "SRS_X86_X64" $SRS_AUTO_HEADERS_H
fi
@ -141,6 +138,11 @@ if [ $SRS_LOG_TRACE = YES ]; then
else
srs_undefine_macro "SRS_AUTO_TRACE" $SRS_AUTO_HEADERS_H
fi
if [ $SRS_CROSS_BUILD = YES ]; then
srs_define_macro "SRS_AUTO_CROSSBUILD" $SRS_AUTO_HEADERS_H
else
srs_undefine_macro "SRS_AUTO_CROSSBUILD" $SRS_AUTO_HEADERS_H
fi
# prefix
echo "" >> $SRS_AUTO_HEADERS_H

View file

@ -96,7 +96,7 @@ function Ubuntu_prepare()
if [[ $SRS_VALGRIND == YES ]]; then
if [[ ! -f /usr/include/valgrind/valgrind.h ]]; then
echo "Installing valgrind-dev."
require_sudoer "sudo apt-get install -y --force-yes valgrind-dev"
require_sudoer "sudo apt-get install -y --force-yes valgrind-dbg"
sudo apt-get install -y --force-yes valgrind-dev; ret=$?; if [[ 0 -ne $ret ]]; then return $ret; fi
echo "The valgrind-dev is installed."
fi
@ -185,101 +185,11 @@ fi
#####################################################################################
# for Centos, auto install tools by yum
#####################################################################################
OS_IS_OSX=NO
function OSX_prepare()
{
uname -s|grep Darwin >/dev/null 2>&1
ret=$?; if [[ 0 -ne $ret ]]; then
if [ $SRS_OSX = YES ]; then
echo "Current OS `uname -s` is not OSX, please check your configure options."
exit 1;
fi
return 0;
fi
OS_IS_OSX=YES
echo "Installing tools for OSX."
# requires the osx when os
if [ $OS_IS_OSX = YES ]; then
if [ $SRS_OSX = NO ]; then
echo "Invalid configure options for OSX, please specify --osx."
exit 1
fi
fi
brew --help >/dev/null 2>&1; ret=$?; if [[ 0 -ne $ret ]]; then
echo "Installing brew."
echo "ruby -e \"$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)\""
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"; ret=$?; if [[ 0 -ne $ret ]]; then return $ret; fi
echo "The brew is installed."
fi
gcc --help >/dev/null 2>&1; ret=$?; if [[ 0 -ne $ret ]]; then
echo "Installing gcc."
echo "brew install gcc"
brew install gcc; ret=$?; if [[ 0 -ne $ret ]]; then return $ret; fi
echo "The gcc is installed."
fi
g++ --help >/dev/null 2>&1; ret=$?; if [[ 0 -ne $ret ]]; then
echo "Installing gcc-c++."
echo "brew install gcc-c++"
brew install gcc-c++; ret=$?; if [[ 0 -ne $ret ]]; then return $ret; fi
echo "The gcc-c++ is installed."
fi
make --help >/dev/null 2>&1; ret=$?; if [[ 0 -ne $ret ]]; then
echo "Installing make."
echo "brew install make"
brew install make; ret=$?; if [[ 0 -ne $ret ]]; then return $ret; fi
echo "The make is installed."
fi
patch --help >/dev/null 2>&1; ret=$?; if [[ 0 -ne $ret ]]; then
echo "Installing patch."
echo "brew install patch"
brew install patch; ret=$?; if [[ 0 -ne $ret ]]; then return $ret; fi
echo "The patch is installed."
fi
unzip --help >/dev/null 2>&1; ret=$?; if [[ 0 -ne $ret ]]; then
echo "Installing unzip."
echo "brew install unzip"
brew install unzip; ret=$?; if [[ 0 -ne $ret ]]; then return $ret; fi
echo "The unzip is installed."
fi
if [[ $SRS_VALGRIND == YES ]]; then
valgrind --help >/dev/null 2>&1; ret=$?; if [[ 0 -ne $ret ]]; then
echo "Installing valgrind."
echo "brew install valgrind"
brew install valgrind; ret=$?; if [[ 0 -ne $ret ]]; then return $ret; fi
echo "The valgrind is installed."
fi
fi
echo "Tools for OSX are installed."
return 0
}
# donot prepare tools, for srs-librtmp depends only gcc and g++.
if [ $SRS_EXPORT_LIBRTMP_PROJECT = NO ]; then
OSX_prepare; ret=$?; if [[ 0 -ne $ret ]]; then echo "Install tools for OSX failed, ret=$ret"; exit $ret; fi
fi
# We must use a bash function instead of variable.
function sed_utility() {
if [ $OS_IS_OSX = YES ]; then
sed -i '' "$@"
else
sed -i "$@"
fi
sed -i "$@"
ret=$?; if [[ $ret -ne 0 ]]; then
if [ $OS_IS_OSX = YES ]; then
echo "sed -i '' \"$@\""
else
echo "sed -i \"$@\""
fi
echo "sed -i \"$@\""
return $ret
fi
}
@ -294,7 +204,7 @@ SED="sed_utility" && echo "SED is $SED"
# directly build on arm/mips, for example, pi or cubie,
# export srs-librtmp
# 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 && $SRS_EXPORT_LIBRTMP_PROJECT = NO ]]; then
if [[ $SRS_PI = NO && $SRS_CUBIE = NO && $SRS_CROSS_BUILD = NO ]]; then
echo "Your OS `uname -s` is not supported."
exit 1
@ -307,16 +217,12 @@ fi
if [ $SRS_EXPORT_LIBRTMP_PROJECT = NO ]; then
# check the cross build flag file, if flag changed, need to rebuild the st.
_ST_MAKE=linux-debug && _ST_EXTRA_CFLAGS="-DMD_HAVE_EPOLL"
# for osx, use darwin for st, donot use epoll.
if [ $OS_IS_OSX = YES ]; then
_ST_MAKE=darwin-debug && _ST_EXTRA_CFLAGS="-DMD_HAVE_KQUEUE -I/usr/local/include"
fi
if [[ $SRS_VALGRIND == YES ]]; then
_ST_EXTRA_CFLAGS="$_ST_EXTRA_CFLAGS -DMD_VALGRIND"
fi
# Pass the global extra flags.
if [[ $SRS_EXTRA_CFLAGS != '' ]]; then
_ST_EXTRA_CFLAGS="$_ST_EXTRA_CFLAGS $SRS_EXTRA_CFLAGS"
if [[ $SRS_EXTRA_FLAGS != '' ]]; then
_ST_EXTRA_CFLAGS="$_ST_EXTRA_CFLAGS $SRS_EXTRA_FLAGS"
fi
# Patched ST from https://github.com/ossrs/state-threads/tree/srs
if [[ -f ${SRS_OBJS}/st/libst.a ]]; then
@ -326,7 +232,8 @@ if [ $SRS_EXPORT_LIBRTMP_PROJECT = NO ]; then
(
rm -rf ${SRS_OBJS}/st-srs && cd ${SRS_OBJS} &&
ln -sf ../3rdparty/st-srs && cd st-srs &&
make clean && make ${_ST_MAKE} EXTRA_CFLAGS="${_ST_EXTRA_CFLAGS}" &&
make clean && make ${_ST_MAKE} EXTRA_CFLAGS="${_ST_EXTRA_CFLAGS}" \
CC=${SRS_TOOL_CC} AR=${SRS_TOOL_AR} LD=${SRS_TOOL_LD} RANDLIB=${SRS_TOOL_RANDLIB} &&
cd .. && rm -f st && ln -sf st-srs/obj st
)
fi
@ -413,53 +320,55 @@ if [ $SRS_EXPORT_LIBRTMP_PROJECT = NO ]; then
fi
#####################################################################################
# openssl, for rtmp complex handshake
# openssl, for rtmp complex handshake and HLS encryption.
#####################################################################################
# extra configure options
CONFIGURE_TOOL="./config"
if [ $SRS_OSX = YES ]; then
CONFIGURE_TOOL="./Configure darwin64-`uname -m`-cc"
if [[ $SRS_SSL == YES && $SRS_USE_SYS_SSL == YES ]]; then
echo "Warning: Use system libssl, without compiling openssl."
fi
OPENSSL_HOTFIX="-DOPENSSL_NO_HEARTBEATS"
# @see http://www.openssl.org/news/secadv/20140407.txt
# Affected users should upgrade to OpenSSL 1.1.0e. Users unable to immediately
# upgrade can alternatively recompile OpenSSL with -DOPENSSL_NO_HEARTBEATS.
if [ $SRS_SSL = YES ]; then
if [[ -f /usr/local/lib64/libssl.a && ! -f ${SRS_OBJS}/openssl/lib/libssl.a ]]; then
(mkdir -p ${SRS_OBJS}/openssl/lib && cd ${SRS_OBJS}/openssl/lib &&
ln -sf /usr/local/lib64/libssl.a && ln -sf /usr/local/lib64/libcrypto.a)
(mkdir -p ${SRS_OBJS}/openssl/include && cd ${SRS_OBJS}/openssl/include &&
ln -sf /usr/local/include/openssl)
fi
if [ $SRS_USE_SYS_SSL = YES ]; then
echo "Warning: Use system libssl, without compiling openssl."
if [[ $SRS_SSL == YES && $SRS_USE_SYS_SSL != YES ]]; then
OPENSSL_HOTFIX="-DOPENSSL_NO_HEARTBEATS"
OPENSSL_CONFIG="./config"
# https://stackoverflow.com/questions/15539062/cross-compiling-of-openssl-for-linux-arm-v5te-linux-gnueabi-toolchain
if [[ $SRS_CROSS_BUILD == YES ]]; then
OPENSSL_CONFIG="./Configure linux-armv4"
else
# cross build not specified, if exists flag, need to rebuild for no-arm platform.
if [[ -f ${SRS_OBJS}/openssl/lib/libssl.a ]]; then
echo "Openssl-1.1.0e is ok.";
else
echo "Building openssl-1.1.0e.";
(
rm -rf ${SRS_OBJS}/openssl-1.1.0e && cd ${SRS_OBJS} &&
unzip -q ../3rdparty/openssl-1.1.0e.zip && cd openssl-1.1.0e &&
$CONFIGURE_TOOL --prefix=`pwd`/_release -no-shared no-threads $OPENSSL_HOTFIX &&
make && make install_sw &&
cd .. && rm -rf openssl && ln -sf openssl-1.1.0e/_release openssl
)
# If not crossbuild, try to use exists libraries.
if [[ -f /usr/local/lib64/libssl.a && ! -f ${SRS_OBJS}/openssl/lib/libssl.a ]]; then
(mkdir -p ${SRS_OBJS}/openssl/lib && cd ${SRS_OBJS}/openssl/lib &&
ln -sf /usr/local/lib64/libssl.a && ln -sf /usr/local/lib64/libcrypto.a)
(mkdir -p ${SRS_OBJS}/openssl/include && cd ${SRS_OBJS}/openssl/include &&
ln -sf /usr/local/include/openssl)
fi
# check status
ret=$?; if [[ $ret -ne 0 ]]; then echo "Build openssl-1.1.0e failed, ret=$ret"; exit $ret; fi
if [ ! -f ${SRS_OBJS}/openssl/lib/libssl.a ]; then echo "Build openssl-1.1.0e failed."; exit -1; fi
fi
# cross build not specified, if exists flag, need to rebuild for no-arm platform.
if [[ -f ${SRS_OBJS}/openssl/lib/libssl.a ]]; then
echo "Openssl-1.1.0e is ok.";
else
echo "Building openssl-1.1.0e.";
(
rm -rf ${SRS_OBJS}/openssl-1.1.0e && cd ${SRS_OBJS} &&
unzip -q ../3rdparty/openssl-1.1.0e.zip && cd openssl-1.1.0e &&
${OPENSSL_CONFIG} --prefix=`pwd`/_release -no-shared -no-threads -no-asm $OPENSSL_HOTFIX &&
make CC=${SRS_TOOL_CC} AR="${SRS_TOOL_AR} -rs" LD=${SRS_TOOL_LD} RANDLIB=${SRS_TOOL_RANDLIB} && make install_sw &&
cd .. && rm -rf openssl && ln -sf openssl-1.1.0e/_release openssl
)
fi
# check status
ret=$?; if [[ $ret -ne 0 ]]; then echo "Build openssl-1.1.0e failed, ret=$ret"; exit $ret; fi
if [ ! -f ${SRS_OBJS}/openssl/lib/libssl.a ]; then echo "Build openssl-1.1.0e failed."; exit -1; fi
fi
#####################################################################################
# live transcoding, ffmpeg-4.1, x264-core157, lame-3.99.5, libaacplus-2.0.2.
#####################################################################################
# Always link the ffmpeg tools if exists.
if [[ -f /usr/local/bin/ffmpeg && ! -f ${SRS_OBJS}/ffmpeg/bin/ffmpeg ]]; then
mkdir -p ${SRS_OBJS}/ffmpeg/bin && ln -sf /usr/local/bin/ffmpeg ${SRS_OBJS}/ffmpeg/bin/ffmpeg
fi
if [ $SRS_FFMPEG_TOOL = YES ]; then
if [[ -f /usr/local/bin/ffmpeg && ! -f ${SRS_OBJS}/ffmpeg/bin/ffmpeg ]]; then
mkdir -p ${SRS_OBJS}/ffmpeg/bin && ln -sf /usr/local/bin/ffmpeg ${SRS_OBJS}/ffmpeg/bin/ffmpeg
fi
if [[ -f ${SRS_OBJS}/ffmpeg/bin/ffmpeg ]]; then
echo "ffmpeg-4.1 is ok.";
else
@ -545,4 +454,3 @@ fi
# generated the test script
#####################################################################################
rm -rf ${SRS_OBJS}/srs.test && ln -sf `pwd`/scripts/srs.test objs/srs.test

View file

@ -1,12 +1,5 @@
#!/bin/bash
OS_IS_OSX=NO
uname -s|grep Darwin >/dev/null 2>&1
ret=$?; if [[ 0 -eq $ret ]]; then
OS_IS_OSX=YES
fi
echo "Is OSX: ${OS_IS_OSX}"
# when export srs-librtmp single files
# package the whole project to srs_librtmp.h and srs_librtmp.cpp
#

View file

@ -55,8 +55,6 @@ SRS_GCOV=NO
SRS_LOG_VERBOSE=NO
SRS_LOG_INFO=NO
SRS_LOG_TRACE=NO
# The extra c/c++ flags to build SRS. Note that we also pass to ST as EXTRA_CFLAGS.
SRS_EXTRA_CFLAGS=
#
################################################################
# experts
@ -78,7 +76,6 @@ SRS_VALGRIND=NO
SRS_X86_X64=NO
# for osx system
SRS_OSX=NO
SRS_ALLOW_OSX=NO
# dev, open all features for dev, no gperf/prof/arm.
SRS_DEV=NO
# dev, open main server feature for dev, no utest/research/librtmp
@ -99,8 +96,14 @@ SRS_DISABLE_ALL=NO
SRS_ENABLE_ALL=NO
#
#####################################################################################
# We don't support crossbuild for ARM/MIPS, please directly build it on ARM/MIPS server.
# Toolchain crossbuild for ARM or MIPS.
SRS_CROSS_BUILD=NO
SRS_TOOL_CC=gcc
SRS_TOOL_CXX=g++
SRS_TOOL_AR=ar
SRS_TOOL_LD=ld
SRS_TOOL_RANDLIB=randlib
SRS_EXTRA_FLAGS=
#####################################################################################
# menu
@ -157,63 +160,59 @@ Options:
--static Whether add '-static' to link options.
--gcov Whether enable the GCOV compiler options.
--jobs[=N] Allow N jobs at once; infinite jobs with no arg.
used for make in the configure, for example, to make ffmpeg.
--log-verbose whether enable the log verbose level. default: no.
--log-info whether enable the log info level. default: no.
--log-trace whether enable the log trace level. default: yes.
Used for make in the configure, for example, to make ffmpeg.
--log-verbose Whether enable the log verbose level. default: no.
--log-info Whether enable the log info level. default: no.
--log-trace Whether enable the log trace level. default: yes.
Presets:
--x86-x64 [default] for x86/x64 cpu, common pc and servers.
--osx for osx(darwin) system to build SRS.
--pi for raspberry-pi(directly build), open features hls/ssl/static.
--cubie for cubieboard(directly build), open features except ffmpeg/nginx.
--arm alias for --with-arm-ubuntu12, for ubuntu12, arm crossbuild
--mips alias for --with-mips-ubuntu12, for ubuntu12, mips crossbuild
--fast the most fast compile, nothing, only support vp6 RTMP.
--pure-rtmp only support RTMP with ssl.
--disable-all disable all features, only support vp6 RTMP.
--dev for dev, open all features, no nginx/gperf/gprof/arm.
--fast-dev for dev fast compile, the RTMP server, without librtmp/utest/research.
--demo for srs demo, @see: https://github.com/ossrs/srs/wiki/v1_CN_SampleDemo
--full enable all features, no gperf/gprof/arm.
--x86-64 alias for --x86-x64.
Performance: @see https://blog.csdn.net/win_lin/article/details/53503869
--with-valgrind Support valgrind for memory check.
--with-gperf Build SRS with gperf tools(no gmd/gmc/gmp/gcp, with tcmalloc only).
--with-gmc Build memory check for SRS with gperf tools.
--with-gmd Build memory defense(corrupt memory) 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-gprof Build SRS with gprof(GNU profile tool).
Toolchain options:
--extra-flags=<EFLAGS> Set EFLAGS as CFLAGS and CXXFLAGS. Pass to ST as EXTRA_CFLAGS.
--without-valgrind Do not support valgrind for memory check.
--without-gperf Do not build SRS with gperf tools(without tcmalloc and gmd/gmc/gmp/gcp).
--without-gmc Do not build memory check for SRS with gperf tools.
--without-gmd Do not build memory defense 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-gprof Do not build srs with gprof(GNU profile tool).
Toolchain options: @see https://github.com/ossrs/srs/issues/1547#issuecomment-576078411
--arm Enable crossbuild for ARM.
--mips Enable crossbuild for MIPS.
--cc=<CC> Use c compiler CC, default is gcc.
--cxx=<CXX> Use c++ compiler CXX, default is g++.
--ar=<AR> Use archive tool AR, default is ar.
--ld=<LD> Use linker tool LD, default is ld.
--randlib=<RANDLIB> Use randlib tool RANDLIB, default is randlib.
--extra-flags=<EFLAGS> Set EFLAGS as CFLAGS and CXXFLAGS. Also passed to ST as EXTRA_CFLAGS.
Recomment to enable:
--with-http-api enable HTTP API, to communicate with SRS.
--with-http-callback enable HTTP hooks, build cherrypy as demo api server.
--with-http-server enable HTTP server to delivery http stream.
--with-hls enable HLS streaming, mux RTMP to M3U8/TS files.
--with-dvr enable DVR, record RTMP to FLV/MP4 files.
Conflicts:
1. --with-gmc vs --with-gmp:
@see: http://google-perftools.googlecode.com/svn/trunk/doc/heap_checker.html
2. --with-gperf/gmc/gmp vs --with-gprof:
gperftools not compatible with gprof.
The gperftools not compatible with gprof.
3. --arm vs --with-ffmpeg/gperf/gmc/gmp/gprof:
the complex tools not available for arm.
The complex tools not available for arm.
Experts:
--use-sys-ssl donot compile ssl, use system ssl(-lssl) if required.
--memory-watch enable memory watch to detect memory leaking(hurts performance).
--export-librtmp-project=<path> export srs-librtmp to specified project in path.
--export-librtmp-single=<path> export srs-librtmp to a single file(.h+.cpp) in path.
--without-valgrind donot support valgrind for memory check.
--use-sys-ssl Do not compile ssl, use system ssl(-lssl) if required.
--export-librtmp-project=<path> Export srs-librtmp to specified project in path.
--export-librtmp-single=<path> Export srs-librtmp to a single file(.h+.cpp) in path.
Workflow:
1. apply "Presets". if not specified, use default preset.
2. apply "Options". user specified option will override the preset.
3. check conflicts. @see Conflicts section.
4. generate detail features.
1. Apply "Presets". if not specified, use default preset.
2. Apply "Features", "Performance" and others. user specified option will override the preset.
3. Check conflicts, fail if exists conflicts.
4. Generate Makefile.
Remark:
1. both ubuntu12 and ubuntu14 are ok for SRS.
2. the centos5, centos6 and centos7 are ok for SRS.
3. all linux and unix-like os are ok for SRS.
4. windows is absolutely impossible for SRS.
1. For performance improving, read https://blog.csdn.net/win_lin/article/details/53503869
END
}
@ -243,15 +242,10 @@ function parse_user_option() {
--with-gprof) SRS_GPROF=YES ;;
--with-arm-ubuntu12) SRS_CROSS_BUILD=YES ;;
--with-mips-ubuntu12) SRS_CROSS_BUILD=YES ;;
--without-ssl) SRS_SSL=NO ;;
--without-hds) SRS_HDS=NO ;;
--without-nginx) SRS_NGINX=NO ;;
--without-ffmpeg) SRS_FFMPEG_TOOL=NO ;;
--without-transcode) SRS_TRANSCODE=NO ;;
--without-ingest) SRS_INGEST=NO ;;
--without-stat) SRS_STAT=NO ;;
--without-stream-caster) SRS_STREAM_CASTER=NO ;;
--without-librtmp) SRS_LIBRTMP=NO ;;
--without-research) SRS_RESEARCH=NO ;;
--without-utest) SRS_UTEST=NO ;;
@ -266,20 +260,26 @@ function parse_user_option() {
--without-mips-ubuntu12) SRS_CROSS_BUILD=NO ;;
--jobs) SRS_JOBS=${value} ;;
--extra-flags) SRS_EXTRA_CFLAGS=${value} ;;
--prefix) SRS_PREFIX=${value} ;;
--static) SRS_STATIC=YES ;;
--log-verbose) SRS_LOG_VERBOSE=YES ;;
--log-info) SRS_LOG_INFO=YES ;;
--log-trace) SRS_LOG_TRACE=YES ;;
--gcov) SRS_GCOV=YES ;;
--arm) SRS_CROSS_BUILD=YES ;;
--mips) SRS_CROSS_BUILD=YES ;;
--cc) SRS_TOOL_CC=${value} ;;
--cxx) SRS_TOOL_CXX=${value} ;;
--ar) SRS_TOOL_AR=${value} ;;
--ld) SRS_TOOL_LD=${value} ;;
--randlib) SRS_TOOL_RANDLIB=${value} ;;
--extra-flags) SRS_EXTRA_FLAGS=${value} ;;
--x86-x64) SRS_X86_X64=YES ;;
--x86-64) SRS_X86_X64=YES ;;
--osx) SRS_OSX=YES ;;
--allow-osx) SRS_ALLOW_OSX=YES ;;
--arm) SRS_CROSS_BUILD=YES ;;
--mips) SRS_CROSS_BUILD=YES ;;
--allow-osx) SRS_OSX=YES ;;
--pi) SRS_PI=YES ;;
--cubie) SRS_CUBIE=YES ;;
--dev) SRS_DEV=YES ;;
@ -294,6 +294,7 @@ function parse_user_option() {
--memory-watch) SRS_MEM_WATCH=YES ;;
--export-librtmp-project) SRS_EXPORT_LIBRTMP_PROJECT=${value} ;;
--export-librtmp-single) SRS_EXPORT_LIBRTMP_SINGLE=${value} ;;
--with-valgrind) SRS_VALGRIND=YES ;;
--without-valgrind) SRS_VALGRIND=NO ;;
--with-http-callback) SRS_HTTP_CALLBACK=YES ;;
@ -301,11 +302,19 @@ function parse_user_option() {
--with-http-server) SRS_HTTP_SERVER=YES ;;
--with-hls) SRS_HLS=YES ;;
--with-dvr) SRS_DVR=YES ;;
--without-http-callback) SRS_HTTP_CALLBACK=NO ;;
--without-http-api) SRS_HTTP_API=NO ;;
--without-http-server) SRS_HTTP_SERVER=NO ;;
--without-hls) SRS_HLS=NO ;;
--without-dvr) SRS_DVR=NO ;;
--without-stream-caster) ;&
--without-ingest) ;&
--without-ssl) ;&
--without-stat) ;&
--without-transcode) ;&
--without-http-callback) ;&
--without-http-server) ;&
--without-http-api) ;&
--without-hls) ;&
--without-dvr)
echo "ignore option \"$option\""
;;
*)
echo "$0: error: invalid option \"$option\""
@ -318,7 +327,7 @@ function parse_user_option_to_value_and_option() {
case "$option" in
-*=*)
value=`echo "$option" | sed -e 's|[-_a-zA-Z0-9/]*=||'`
option=`echo "$option" | sed -e 's|=[-_a-zA-Z0-9/. ]*||'`
option=`echo "$option" | sed -e 's|=[-_a-zA-Z0-9/. +]*||'`
;;
*) value="" ;;
esac
@ -350,7 +359,7 @@ function apply_user_presets() {
# set default preset if not specifies
if [[ $SRS_PURE_RTMP == NO && $SRS_FAST == NO && $SRS_DISABLE_ALL == NO && $SRS_ENABLE_ALL == NO && \
$SRS_DEV == NO && $SRS_FAST_DEV == NO && $SRS_DEMO == NO && $SRS_PI == NO && $SRS_CUBIE == NO && \
$SRS_X86_X64 == NO && $SRS_OSX == NO \
$SRS_X86_X64 == NO && $SRS_OSX == NO && $SRS_CROSS_BUILD == NO \
]]; then
SRS_X86_X64=YES; opt="--x86-x64 $opt";
fi
@ -400,18 +409,6 @@ function apply_user_presets() {
SRS_STATIC=NO
fi
# for osx(darwin)
if [ $SRS_OSX = YES ]; then
SRS_HDS=YES
SRS_LIBRTMP=YES
SRS_RESEARCH=NO
SRS_UTEST=YES
SRS_STATIC=NO
# valgrind is not supported by macOS sierra, read
# https://stackoverflow.com/questions/40650338/valgrind-on-macos-sierra
SRS_VALGRIND=NO
fi
# if dev specified, open features if possible.
if [ $SRS_DEV = YES ]; then
SRS_HDS=YES
@ -456,6 +453,14 @@ function apply_user_presets() {
SRS_UTEST=NO
SRS_STATIC=NO
fi
# if crossbuild, disable research and librtmp.
if [[ $SRS_CROSS_BUILD == YES ]]; then
SRS_LIBRTMP=NO
SRS_RESEARCH=NO
SRS_UTEST=NO
SRS_STATIC=NO
fi
}
apply_user_presets
@ -553,7 +558,12 @@ SRS_AUTO_CONFIGURE="--prefix=${SRS_PREFIX}"
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_GCOV = YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --gcov"; fi
if [[ $SRS_EXTRA_CFLAGS != '' ]]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --extra-flags=\\\"$SRS_EXTRA_CFLAGS\\\""; fi
if [[ $SRS_EXTRA_FLAGS != '' ]]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --extra-flags=\\\"$SRS_EXTRA_FLAGS\\\""; fi
if [[ $SRS_TOOL_CC != '' ]]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --cc=$SRS_TOOL_CC"; fi
if [[ $SRS_TOOL_CXX != '' ]]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --cxx=$SRS_TOOL_CXX"; fi
if [[ $SRS_TOOL_AR != '' ]]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --ar=$SRS_TOOL_AR"; fi
if [[ $SRS_TOOL_LD != '' ]]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --ld=$SRS_TOOL_LD"; fi
if [[ $SRS_TOOL_RANDLIB != '' ]]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --randlib=$SRS_TOOL_RANDLIB"; fi
echo "User config: $SRS_AUTO_USER_CONFIGURE"
echo "Detail config: ${SRS_AUTO_CONFIGURE}"
}
@ -563,24 +573,24 @@ regenerate_options
# check user options
#####################################################################################
function check_option_conflicts() {
if [ $SRS_CROSS_BUILD = YES ]; then
echo "We don't support crossbuild for ARM/MIPS, please directly build it on ARM/MIPS server."
exit -1
if [[ $SRS_TOOL_CC == '' || $SRS_TOOL_CXX == '' || $SRS_TOOL_AR == '' || $SRS_TOOL_LD == '' || $SRS_TOOL_RANDLIB == '' ]]; then
echo "No crossbuild tools, cc: $SRS_TOOL_CC, cxx: $SRS_TOOL_CXX, ar: $SRS_TOOL_AR, ld: $SRS_TOOL_LD, randlib: $SRS_TOOL_RANDLIB"; exit -1
fi
if [[ $SRS_CROSS_BUILD == YES && ($SRS_TOOL_CC == 'gcc' || $SRS_TOOL_CXX == 'g++' || $SRS_TOOL_AR == 'ar') ]]; then
echo "For crossbuild, must not use default toolchain, cc: $SRS_TOOL_CC, cxx: $SRS_TOOL_CXX, ar: $SRS_TOOL_AR"; exit -1
fi
if [ $SRS_OSX = YES ]; then
echo "We don't support OSX, please use docker https://github.com/ossrs/srs-docker"
exit -1
echo "We don't support OSX, please use docker https://github.com/ossrs/srs-docker"; exit -1
fi
if [[ $SRS_NGINX == YES ]]; then
echo "Don't support building NGINX, please use docker https://github.com/ossrs/srs-docker"
exit -1
echo "Don't support building NGINX, please use docker https://github.com/ossrs/srs-docker"; exit -1
fi
if [[ $SRS_FFMPEG_TOOL == YES ]]; then
echo "Don't support building FFMPEG, please use docker https://github.com/ossrs/srs-docker"
exit -1
echo "Don't support building FFMPEG, please use docker https://github.com/ossrs/srs-docker"; exit -1
fi
# TODO: FIXME: check more os.
@ -626,15 +636,5 @@ function check_option_conflicts() {
if [ $__check_ok = NO ]; then
exit 1;
fi
if [[ $SRS_OSX == YES && $SRS_ALLOW_OSX == NO ]]; then
macOSVersion=`sw_vers -productVersion`
macOSVersionMajor=`echo $macOSVersion|awk -F '.' '{print $1}'`
macOSVersionMinor=`echo $macOSVersion|awk -F '.' '{print $2}'`
if [[ $macOSVersionMajor -ge 10 && $macOSVersionMinor -ge 14 ]]; then
echo "macOS $macOSVersion is not supported, read https://github.com/ossrs/srs/issues/1250"
exit -1
fi
fi
}
check_option_conflicts

View file

@ -43,16 +43,13 @@ echo -e " \${BLACK}+--------------------------------------------------------
echo -e " |\${GREEN}The main server usage: ./objs/srs -c conf/srs.conf, start the srs server\${BLACK}"
echo -e " | ${SrsHlsSummaryColor}About HLS, please read https://github.com/ossrs/srs/wiki/v2_CN_DeliveryHLS\${BLACK}"
echo -e " | ${SrsDvrSummaryColor}About DVR, please read https://github.com/ossrs/srs/wiki/v3_CN_DVR\${BLACK}"
echo -e " | ${SrsNginxSummaryColor}About NGINX, please read https://github.com/ossrs/srs/wiki/v2_CN_DeliveryHLS\${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/v3_CN_FFMPEG\${BLACK}"
echo -e " | ${SrsTranscodeSummaryColor}About transcoding, please read https://github.com/ossrs/srs/wiki/v3_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/v3_CN_HTTPCallback\${BLACK}"
echo -e " | ${SrsHttpServerSummaryColor}Aoubt embeded http-server, please read https://github.com/ossrs/srs/wiki/v2_CN_HTTPServer\${BLACK}"
echo -e " | ${SrsHttpServerSummaryColor}Aoubt 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/v3_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 " | ${SrsValgrindSummaryColor}About VALGRIND, please read https://github.com/ossrs/state-threads/issues/2\${BLACK}"
echo -e " \${BLACK}+------------------------------------------------------------------------------------\${BLACK}"
echo -e "\${GREEN}binaries, please read https://github.com/ossrs/srs/wiki/v2_CN_Build\${BLACK}"

View file

@ -23,12 +23,6 @@ GTEST_DIR=${SRS_TRUNK_PREFIX}/${SRS_OBJS_DIR}/gtest
# the extra defines to compile utest.
EXTRA_DEFINES=""
# for osx to disable the error.
# gtest/include/gtest/internal/gtest-port.h:499:13: fatal error: 'tr1/tuple' file not found
if [ $SRS_OSX = YES ]; then
EXTRA_DEFINES="$EXTRA_DEFINES -DGTEST_HAS_TR1_TUPLE=0"
fi
cat << END > ${FILE}
# user must run make the ${SRS_OBJS_DIR}/utest dir
# at the same dir of Makefile.