|
|
@ -136,20 +136,24 @@ END
|
|
|
|
# st(state-threads) the basic network library for SRS.
|
|
|
|
# st(state-threads) the basic network library for SRS.
|
|
|
|
LibSTRoot="${SRS_OBJS_DIR}/st"; LibSTfile="${LibSTRoot}/libst.a"
|
|
|
|
LibSTRoot="${SRS_OBJS_DIR}/st"; LibSTfile="${LibSTRoot}/libst.a"
|
|
|
|
if [[ $SRS_SHARED_ST == YES ]]; then LibSTfile="-lst"; fi
|
|
|
|
if [[ $SRS_SHARED_ST == YES ]]; then LibSTfile="-lst"; fi
|
|
|
|
|
|
|
|
|
|
|
|
# srtp
|
|
|
|
# srtp
|
|
|
|
if [[ $SRS_RTC == YES ]]; then
|
|
|
|
if [[ $SRS_RTC == YES ]]; then
|
|
|
|
LibSrtpRoot="${SRS_OBJS_DIR}/srtp2/include"; LibSrtpFile="${SRS_OBJS_DIR}/srtp2/lib/libsrtp2.a"
|
|
|
|
LibSrtpRoot="${SRS_OBJS_DIR}/srtp2/include"; LibSrtpFile="${SRS_OBJS_DIR}/srtp2/lib/libsrtp2.a"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
# FFMPEG for WebRTC transcoding, such as aac to opus.
|
|
|
|
# FFMPEG for WebRTC transcoding, such as aac to opus.
|
|
|
|
if [[ $SRS_RTC == YES ]]; then
|
|
|
|
if [[ $SRS_FFMPEG_FIT == YES ]]; then
|
|
|
|
LibFfmpegRoot="${SRS_OBJS_DIR}/ffmpeg/include"; LibFfmpegFile="${SRS_OBJS_DIR}/ffmpeg/lib/libavcodec.a ${SRS_OBJS_DIR}/ffmpeg/lib/libswresample.a ${SRS_OBJS_DIR}/ffmpeg/lib/libavutil.a"
|
|
|
|
LibFfmpegRoot="${SRS_OBJS_DIR}/ffmpeg/include"; LibFfmpegFile="${SRS_OBJS_DIR}/ffmpeg/lib/libavcodec.a ${SRS_OBJS_DIR}/ffmpeg/lib/libswresample.a ${SRS_OBJS_DIR}/ffmpeg/lib/libavutil.a"
|
|
|
|
LibFfmpegRoot="${LibFfmpegRoot} ${SRS_OBJS_DIR}/opus/include"; LibFfmpegFile="${LibFfmpegFile} ${SRS_OBJS_DIR}/opus/lib/libopus.a"
|
|
|
|
LibFfmpegRoot="${LibFfmpegRoot} ${SRS_OBJS_DIR}/opus/include"; LibFfmpegFile="${LibFfmpegFile} ${SRS_OBJS_DIR}/opus/lib/libopus.a"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
# openssl-1.1.0e, for the RTMP complex handshake.
|
|
|
|
# openssl-1.1.0e, for the RTMP complex handshake.
|
|
|
|
LibSSLRoot="";LibSSLfile=""
|
|
|
|
LibSSLRoot="";LibSSLfile=""
|
|
|
|
if [[ $SRS_SSL == YES && $SRS_USE_SYS_SSL == NO ]]; then
|
|
|
|
if [[ $SRS_SSL == YES && $SRS_USE_SYS_SSL == NO ]]; then
|
|
|
|
LibSSLRoot="${SRS_OBJS_DIR}/openssl/include"; LibSSLfile="${SRS_OBJS_DIR}/openssl/lib/libssl.a ${SRS_OBJS_DIR}/openssl/lib/libcrypto.a";
|
|
|
|
LibSSLRoot="${SRS_OBJS_DIR}/openssl/include"; LibSSLfile="${SRS_OBJS_DIR}/openssl/lib/libssl.a ${SRS_OBJS_DIR}/openssl/lib/libcrypto.a";
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
# 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
|
|
|
|
if [ $SRS_GPERF = YES ]; then
|
|
|
@ -158,28 +162,35 @@ fi
|
|
|
|
if [ $SRS_GPERF_MD = YES ]; then
|
|
|
|
if [ $SRS_GPERF_MD = YES ]; then
|
|
|
|
LibGperfFile="${SRS_OBJS_DIR}/gperf/lib/libtcmalloc_debug.a";
|
|
|
|
LibGperfFile="${SRS_OBJS_DIR}/gperf/lib/libtcmalloc_debug.a";
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
# srt code path
|
|
|
|
# srt code path
|
|
|
|
if [[ $SRS_SRT == YES ]]; then
|
|
|
|
if [[ $SRS_SRT == YES ]]; then
|
|
|
|
LibSRTRoot="${SRS_WORKDIR}/src/srt"; LibSRTfile="${SRS_OBJS_DIR}/srt/lib/libsrt.a"
|
|
|
|
LibSRTRoot="${SRS_WORKDIR}/src/srt"; LibSRTfile="${SRS_OBJS_DIR}/srt/lib/libsrt.a"
|
|
|
|
if [[ $SRS_SHARED_SRT == YES ]]; then LibSRTfile="-lsrt"; fi
|
|
|
|
if [[ $SRS_SHARED_SRT == YES ]]; then LibSRTfile="-lsrt"; fi
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
# the link options, always use static link
|
|
|
|
# the link options, always use static link
|
|
|
|
SrsLinkOptions="-ldl";
|
|
|
|
SrsLinkOptions="-ldl";
|
|
|
|
if [[ $SRS_SRT == YES || $SRS_RTC == YES ]]; then
|
|
|
|
if [[ $SRS_SRT == YES || $SRS_RTC == YES ]]; then
|
|
|
|
SrsLinkOptions="${SrsLinkOptions} -lpthread";
|
|
|
|
SrsLinkOptions="${SrsLinkOptions} -lpthread";
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
if [[ $SRS_SSL == YES && $SRS_USE_SYS_SSL == YES ]]; then
|
|
|
|
if [[ $SRS_SSL == YES && $SRS_USE_SYS_SSL == YES ]]; then
|
|
|
|
SrsLinkOptions="${SrsLinkOptions} -lssl -lcrypto";
|
|
|
|
SrsLinkOptions="${SrsLinkOptions} -lssl -lcrypto";
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
# if static specified, add static
|
|
|
|
|
|
|
|
# TODO: FIXME: remove static.
|
|
|
|
# Static link the c++ libraries, for user who build SRS by a new version of gcc,
|
|
|
|
|
|
|
|
# so we need to link the c++ libraries staticly but not all.
|
|
|
|
|
|
|
|
# @see https://stackoverflow.com/a/26107550
|
|
|
|
if [ $SRS_STATIC = YES ]; then
|
|
|
|
if [ $SRS_STATIC = YES ]; then
|
|
|
|
SrsLinkOptions="${SrsLinkOptions} -static";
|
|
|
|
SrsLinkOptions="${SrsLinkOptions} -static-libstdc++";
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
# For coverage.
|
|
|
|
# For coverage.
|
|
|
|
if [[ $SRS_GCOV == YES ]]; then
|
|
|
|
if [[ $SRS_GCOV == YES ]]; then
|
|
|
|
SrsLinkOptions="${SrsLinkOptions} ${SrsGcov}";
|
|
|
|
SrsLinkOptions="${SrsLinkOptions} ${SrsGcov}";
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
# For FFMPEG/RTC.
|
|
|
|
# For FFMPEG/RTC.
|
|
|
|
if [[ $SRS_RTC == YES && $SRS_NASM == NO && $SRS_OSX == NO ]]; then
|
|
|
|
if [[ $SRS_RTC == YES && $SRS_NASM == NO && $SRS_OSX == NO ]]; then
|
|
|
|
SrsLinkOptions="${SrsLinkOptions} -lrt";
|
|
|
|
SrsLinkOptions="${SrsLinkOptions} -lrt";
|
|
|
@ -222,7 +233,10 @@ MODULE_FILES=("srs_protocol_amf0" "srs_protocol_io" "srs_rtmp_stack"
|
|
|
|
"srs_service_rtmp_conn" "srs_service_utility" "srs_service_conn")
|
|
|
|
"srs_service_rtmp_conn" "srs_service_utility" "srs_service_conn")
|
|
|
|
if [[ $SRS_RTC == YES ]]; then
|
|
|
|
if [[ $SRS_RTC == YES ]]; then
|
|
|
|
MODULE_FILES+=("srs_rtc_stun_stack")
|
|
|
|
MODULE_FILES+=("srs_rtc_stun_stack")
|
|
|
|
ModuleLibIncs+=("${LibFfmpegRoot[*]}" ${LibSrtpRoot})
|
|
|
|
ModuleLibIncs+=(${LibSrtpRoot})
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [[ $SRS_FFMPEG_FIT == YES ]]; then
|
|
|
|
|
|
|
|
ModuleLibIncs+=("${LibFfmpegRoot[*]}")
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
PROTOCOL_INCS="src/protocol"; MODULE_DIR=${PROTOCOL_INCS} . auto/modules.sh
|
|
|
|
PROTOCOL_INCS="src/protocol"; MODULE_DIR=${PROTOCOL_INCS} . auto/modules.sh
|
|
|
|
PROTOCOL_OBJS="${MODULE_OBJS[@]}"
|
|
|
|
PROTOCOL_OBJS="${MODULE_OBJS[@]}"
|
|
|
@ -246,7 +260,10 @@ if [ $SRS_GPERF = YES ]; then
|
|
|
|
ModuleLibIncs+=(${LibGperfRoot})
|
|
|
|
ModuleLibIncs+=(${LibGperfRoot})
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
if [[ $SRS_RTC == YES ]]; then
|
|
|
|
if [[ $SRS_RTC == YES ]]; then
|
|
|
|
ModuleLibIncs+=("${LibFfmpegRoot[*]}" ${LibSrtpRoot})
|
|
|
|
ModuleLibIncs+=(${LibSrtpRoot})
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [[ $SRS_FFMPEG_FIT == YES ]]; then
|
|
|
|
|
|
|
|
ModuleLibIncs+=("${LibFfmpegRoot[*]}")
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
MODULE_FILES=("srs_app_server" "srs_app_conn" "srs_app_rtmp_conn" "srs_app_source"
|
|
|
|
MODULE_FILES=("srs_app_server" "srs_app_conn" "srs_app_rtmp_conn" "srs_app_source"
|
|
|
|
"srs_app_refer" "srs_app_hls" "srs_app_forward" "srs_app_encoder" "srs_app_http_stream"
|
|
|
|
"srs_app_refer" "srs_app_hls" "srs_app_forward" "srs_app_encoder" "srs_app_http_stream"
|
|
|
@ -260,9 +277,12 @@ MODULE_FILES=("srs_app_server" "srs_app_conn" "srs_app_rtmp_conn" "srs_app_sourc
|
|
|
|
"srs_app_hourglass" "srs_app_dash" "srs_app_fragment" "srs_app_dvr"
|
|
|
|
"srs_app_hourglass" "srs_app_dash" "srs_app_fragment" "srs_app_dvr"
|
|
|
|
"srs_app_coworkers" "srs_app_hybrid")
|
|
|
|
"srs_app_coworkers" "srs_app_hybrid")
|
|
|
|
if [[ $SRS_RTC == YES ]]; then
|
|
|
|
if [[ $SRS_RTC == YES ]]; then
|
|
|
|
MODULE_FILES+=("srs_app_rtc_conn" "srs_app_rtc_dtls" "srs_app_rtc_codec" "srs_app_rtc_sdp"
|
|
|
|
MODULE_FILES+=("srs_app_rtc_conn" "srs_app_rtc_dtls" "srs_app_rtc_sdp"
|
|
|
|
"srs_app_rtc_queue" "srs_app_rtc_server" "srs_app_rtc_source" "srs_app_rtc_api")
|
|
|
|
"srs_app_rtc_queue" "srs_app_rtc_server" "srs_app_rtc_source" "srs_app_rtc_api")
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [[ $SRS_FFMPEG_FIT == YES ]]; then
|
|
|
|
|
|
|
|
MODULE_FILES+=("srs_app_rtc_codec")
|
|
|
|
|
|
|
|
fi
|
|
|
|
if [[ $SRS_GB28181 == YES ]]; then
|
|
|
|
if [[ $SRS_GB28181 == YES ]]; then
|
|
|
|
MODULE_FILES+=("srs_app_gb28181" "srs_app_gb28181_sip" "srs_app_gb28181_jitbuffer")
|
|
|
|
MODULE_FILES+=("srs_app_gb28181" "srs_app_gb28181_sip" "srs_app_gb28181_jitbuffer")
|
|
|
|
fi
|
|
|
|
fi
|
|
|
@ -284,7 +304,10 @@ if [[ $SRS_SRT == YES ]]; then
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
ModuleLibIncs=(${SRS_OBJS_DIR} ${LibSTRoot} ${LibGperfRoot} ${LibSSLRoot})
|
|
|
|
ModuleLibIncs=(${SRS_OBJS_DIR} ${LibSTRoot} ${LibGperfRoot} ${LibSSLRoot})
|
|
|
|
if [[ $SRS_RTC == YES ]]; then
|
|
|
|
if [[ $SRS_RTC == YES ]]; then
|
|
|
|
ModuleLibIncs+=("${LibFfmpegRoot[*]}" ${LibSrtpRoot})
|
|
|
|
ModuleLibIncs+=(${LibSrtpRoot})
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [[ $SRS_FFMPEG_FIT == YES ]]; then
|
|
|
|
|
|
|
|
ModuleLibIncs+=("${LibFfmpegRoot[*]}")
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
if [[ $SRS_SRT == YES ]]; then
|
|
|
|
if [[ $SRS_SRT == YES ]]; then
|
|
|
|
ModuleLibIncs+=("${LibSRTRoot[*]}")
|
|
|
|
ModuleLibIncs+=("${LibSRTRoot[*]}")
|
|
|
@ -298,7 +321,10 @@ MODULE_ID="MAIN"
|
|
|
|
MODULE_DEPENDS=("CORE" "KERNEL" "PROTOCOL")
|
|
|
|
MODULE_DEPENDS=("CORE" "KERNEL" "PROTOCOL")
|
|
|
|
ModuleLibIncs=(${SRS_OBJS_DIR} ${LibSTRoot} ${LibGperfRoot} ${LibSSLRoot})
|
|
|
|
ModuleLibIncs=(${SRS_OBJS_DIR} ${LibSTRoot} ${LibGperfRoot} ${LibSSLRoot})
|
|
|
|
if [[ $SRS_RTC == YES ]]; then
|
|
|
|
if [[ $SRS_RTC == YES ]]; then
|
|
|
|
ModuleLibIncs+=("${LibFfmpegRoot[*]}" ${LibSrtpRoot})
|
|
|
|
ModuleLibIncs+=(${LibSrtpRoot})
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [[ $SRS_FFMPEG_FIT == YES ]]; then
|
|
|
|
|
|
|
|
ModuleLibIncs+=("${LibFfmpegRoot[*]}")
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
MODULE_FILES=()
|
|
|
|
MODULE_FILES=()
|
|
|
|
DEFINES=""
|
|
|
|
DEFINES=""
|
|
|
@ -325,7 +351,10 @@ done
|
|
|
|
# all depends libraries
|
|
|
|
# all depends libraries
|
|
|
|
ModuleLibFiles=(${LibSTfile} ${LibSSLfile} ${LibGperfFile})
|
|
|
|
ModuleLibFiles=(${LibSTfile} ${LibSSLfile} ${LibGperfFile})
|
|
|
|
if [[ $SRS_RTC == YES ]]; then
|
|
|
|
if [[ $SRS_RTC == YES ]]; then
|
|
|
|
ModuleLibFiles+=("${LibFfmpegFile[*]}" ${LibSrtpFile})
|
|
|
|
ModuleLibFiles+=(${LibSrtpFile})
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [[ $SRS_FFMPEG_FIT == YES ]]; then
|
|
|
|
|
|
|
|
ModuleLibFiles+=("${LibFfmpegFile[*]}")
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
if [[ $SRS_SRT == YES ]]; then
|
|
|
|
if [[ $SRS_SRT == YES ]]; then
|
|
|
|
ModuleLibFiles+=("${LibSRTfile[*]}")
|
|
|
|
ModuleLibFiles+=("${LibSRTfile[*]}")
|
|
|
@ -334,7 +363,10 @@ fi
|
|
|
|
MODULE_OBJS="${CORE_OBJS[@]} ${KERNEL_OBJS[@]} ${PROTOCOL_OBJS[@]} ${APP_OBJS[@]} ${SERVER_OBJS[@]}"
|
|
|
|
MODULE_OBJS="${CORE_OBJS[@]} ${KERNEL_OBJS[@]} ${PROTOCOL_OBJS[@]} ${APP_OBJS[@]} ${SERVER_OBJS[@]}"
|
|
|
|
ModuleLibIncs=(${SRS_OBJS_DIR} ${LibSTRoot} ${LibGperfRoot} ${LibSSLRoot})
|
|
|
|
ModuleLibIncs=(${SRS_OBJS_DIR} ${LibSTRoot} ${LibGperfRoot} ${LibSSLRoot})
|
|
|
|
if [[ $SRS_RTC == YES ]]; then
|
|
|
|
if [[ $SRS_RTC == YES ]]; then
|
|
|
|
ModuleLibIncs+=("${LibFfmpegRoot[*]}" ${LibSrtpRoot})
|
|
|
|
ModuleLibIncs+=(${LibSrtpRoot})
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [[ $SRS_FFMPEG_FIT == YES ]]; then
|
|
|
|
|
|
|
|
ModuleLibIncs+=("${LibFfmpegRoot[*]}")
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
if [[ $SRS_SRT == YES ]]; then
|
|
|
|
if [[ $SRS_SRT == YES ]]; then
|
|
|
|
MODULE_OBJS="${MODULE_OBJS} ${SRT_OBJS[@]}"
|
|
|
|
MODULE_OBJS="${MODULE_OBJS} ${SRT_OBJS[@]}"
|
|
|
@ -348,7 +380,10 @@ BUILD_KEY="srs" APP_MAIN="srs_main_server" APP_NAME="srs" . auto/apps.sh
|
|
|
|
MODULE_OBJS="${CORE_OBJS[@]} ${KERNEL_OBJS[@]} ${PROTOCOL_OBJS[@]} ${MAIN_OBJS[@]}"
|
|
|
|
MODULE_OBJS="${CORE_OBJS[@]} ${KERNEL_OBJS[@]} ${PROTOCOL_OBJS[@]} ${MAIN_OBJS[@]}"
|
|
|
|
ModuleLibFiles=(${LibSTfile} ${LibSSLfile} ${LibGperfFile})
|
|
|
|
ModuleLibFiles=(${LibSTfile} ${LibSSLfile} ${LibGperfFile})
|
|
|
|
if [[ $SRS_RTC == YES ]]; then
|
|
|
|
if [[ $SRS_RTC == YES ]]; then
|
|
|
|
ModuleLibFiles+=("${LibFfmpegFile[*]}" ${LibSrtpFile})
|
|
|
|
ModuleLibFiles+=(${LibSrtpFile})
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [[ $SRS_FFMPEG_FIT == YES ]]; then
|
|
|
|
|
|
|
|
ModuleLibFiles+=("${LibFfmpegFile[*]}")
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
#
|
|
|
|
#
|
|
|
|
for SRS_MODULE in ${SRS_MODULES[*]}; do
|
|
|
|
for SRS_MODULE in ${SRS_MODULES[*]}; do
|
|
|
@ -370,14 +405,20 @@ if [ $SRS_UTEST = YES ]; then
|
|
|
|
"srs_utest_mp4" "srs_utest_service" "srs_utest_app" "srs_utest_rtc")
|
|
|
|
"srs_utest_mp4" "srs_utest_service" "srs_utest_app" "srs_utest_rtc")
|
|
|
|
ModuleLibIncs=(${SRS_OBJS_DIR} ${LibSTRoot} ${LibSSLRoot})
|
|
|
|
ModuleLibIncs=(${SRS_OBJS_DIR} ${LibSTRoot} ${LibSSLRoot})
|
|
|
|
if [[ $SRS_RTC == YES ]]; then
|
|
|
|
if [[ $SRS_RTC == YES ]]; then
|
|
|
|
ModuleLibIncs+=("${LibFfmpegRoot[*]}" ${LibSrtpRoot})
|
|
|
|
ModuleLibIncs+=(${LibSrtpRoot})
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [[ $SRS_FFMPEG_FIT == YES ]]; then
|
|
|
|
|
|
|
|
ModuleLibIncs+=("${LibFfmpegRoot[*]}")
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
if [[ $SRS_SRT == YES ]]; then
|
|
|
|
if [[ $SRS_SRT == YES ]]; then
|
|
|
|
ModuleLibIncs+=("${LibSRTRoot[*]}")
|
|
|
|
ModuleLibIncs+=("${LibSRTRoot[*]}")
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
ModuleLibFiles=(${LibSTfile} ${LibSSLfile})
|
|
|
|
ModuleLibFiles=(${LibSTfile} ${LibSSLfile})
|
|
|
|
if [[ $SRS_RTC == YES ]]; then
|
|
|
|
if [[ $SRS_RTC == YES ]]; then
|
|
|
|
ModuleLibFiles+=("${LibFfmpegFile[*]}" ${LibSrtpFile})
|
|
|
|
ModuleLibFiles+=(${LibSrtpFile})
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [[ $SRS_FFMPEG_FIT == YES ]]; then
|
|
|
|
|
|
|
|
ModuleLibFiles+=("${LibFfmpegFile[*]}")
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
if [[ $SRS_SRT == YES ]]; then
|
|
|
|
if [[ $SRS_SRT == YES ]]; then
|
|
|
|
ModuleLibFiles+=("${LibSRTfile[*]}")
|
|
|
|
ModuleLibFiles+=("${LibSRTfile[*]}")
|
|
|
|