mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
Refactor SRT build, use libsrt.a static library
This commit is contained in:
parent
307a4315f1
commit
e3169a080b
2 changed files with 25 additions and 2 deletions
|
@ -476,6 +476,22 @@ if [ $SRS_FFMPEG_TOOL = YES ]; then
|
||||||
if [ ! -f ${SRS_OBJS}/ffmpeg/bin/ffmpeg ]; then echo "build ffmpeg-4.1 failed."; exit -1; fi
|
if [ ! -f ${SRS_OBJS}/ffmpeg/bin/ffmpeg ]; then echo "build ffmpeg-4.1 failed."; exit -1; fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
#####################################################################################
|
||||||
|
# SRT module, https://github.com/ossrs/srs/issues/1147#issuecomment-577469119
|
||||||
|
#####################################################################################
|
||||||
|
if [[ $SRS_SRT == YES ]]; then
|
||||||
|
if [[ -f /usr/local/lib64/libsrt.a && ! -f ${SRS_OBJS}/srt/lib/libsrt.a ]]; then
|
||||||
|
mkdir -p ${SRS_OBJS}/srt/lib && ln -sf /usr/local/lib64/libsrt.a ${SRS_OBJS}/srt/lib/libsrt.a
|
||||||
|
mkdir -p ${SRS_OBJS}/srt/include && ln -sf /usr/local/include/srt ${SRS_OBJS}/srt/include/
|
||||||
|
fi
|
||||||
|
if [[ -f ${SRS_OBJS}/srt/lib/libsrt.a ]]; then
|
||||||
|
echo "libsrt-1.4.1 is ok.";
|
||||||
|
else
|
||||||
|
echo "no libsrt, please use srs-docker or build from source https://github.com/ossrs/srs/issues/1147#issuecomment-577469119";
|
||||||
|
exit -1;
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
#####################################################################################
|
#####################################################################################
|
||||||
# build research code, librtmp
|
# build research code, librtmp
|
||||||
#####################################################################################
|
#####################################################################################
|
||||||
|
|
11
trunk/configure
vendored
11
trunk/configure
vendored
|
@ -162,12 +162,12 @@ if [ $SRS_GPERF_MD = YES ]; then
|
||||||
fi
|
fi
|
||||||
# srt code path
|
# srt code path
|
||||||
if [[ $SRS_SRT == YES ]]; then
|
if [[ $SRS_SRT == YES ]]; then
|
||||||
LibSRTRoot="${SRS_WORKDIR}/src/srt"
|
LibSRTRoot="${SRS_WORKDIR}/src/srt"; LibSRTfile="${SRS_OBJS_DIR}/srt/lib/libsrt.a"
|
||||||
fi
|
fi
|
||||||
# the link options, always use static link
|
# the link options, always use static link
|
||||||
SrsLinkOptions="-ldl";
|
SrsLinkOptions="-ldl";
|
||||||
if [[ $SRS_SRT == YES ]]; then
|
if [[ $SRS_SRT == YES ]]; then
|
||||||
SrsLinkOptions="${SrsLinkOptions} -pthread -lsrt";
|
SrsLinkOptions="${SrsLinkOptions} -pthread";
|
||||||
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";
|
||||||
|
@ -323,6 +323,9 @@ if [ $SRS_EXPORT_LIBRTMP_PROJECT = NO ]; then
|
||||||
#
|
#
|
||||||
# all depends libraries
|
# all depends libraries
|
||||||
ModuleLibFiles=(${LibSTfile} ${LibSSLfile} ${LibGperfFile})
|
ModuleLibFiles=(${LibSTfile} ${LibSSLfile} ${LibGperfFile})
|
||||||
|
if [[ $SRS_SRT == YES ]]; then
|
||||||
|
ModuleLibFiles+=("${LibSRTfile[*]}")
|
||||||
|
fi
|
||||||
# all depends objects
|
# all depends objects
|
||||||
MODULE_OBJS="${CORE_OBJS[@]} ${KERNEL_OBJS[@]} ${PROTOCOL_OBJS[@]} ${SERVICE_OBJS[@]} ${APP_OBJS[@]} ${SERVER_OBJS[@]}"
|
MODULE_OBJS="${CORE_OBJS[@]} ${KERNEL_OBJS[@]} ${PROTOCOL_OBJS[@]} ${SERVICE_OBJS[@]} ${APP_OBJS[@]} ${SERVER_OBJS[@]}"
|
||||||
ModuleLibIncs=(${LibSTRoot} ${SRS_OBJS_DIR} ${LibGperfRoot} ${LibSSLRoot})
|
ModuleLibIncs=(${LibSTRoot} ${SRS_OBJS_DIR} ${LibGperfRoot} ${LibSSLRoot})
|
||||||
|
@ -336,6 +339,7 @@ if [ $SRS_EXPORT_LIBRTMP_PROJECT = NO ]; then
|
||||||
#
|
#
|
||||||
# For modules, without the app module.
|
# For modules, without the app module.
|
||||||
MODULE_OBJS="${CORE_OBJS[@]} ${KERNEL_OBJS[@]} ${PROTOCOL_OBJS[@]} ${SERVICE_OBJS[@]} ${MAIN_OBJS[@]}"
|
MODULE_OBJS="${CORE_OBJS[@]} ${KERNEL_OBJS[@]} ${PROTOCOL_OBJS[@]} ${SERVICE_OBJS[@]} ${MAIN_OBJS[@]}"
|
||||||
|
ModuleLibFiles=(${LibSTfile} ${LibSSLfile} ${LibGperfFile})
|
||||||
#
|
#
|
||||||
for SRS_MODULE in ${SRS_MODULES[*]}; do
|
for SRS_MODULE in ${SRS_MODULES[*]}; do
|
||||||
. $SRS_MODULE/config
|
. $SRS_MODULE/config
|
||||||
|
@ -360,6 +364,9 @@ if [ $SRS_UTEST = YES ]; then
|
||||||
ModuleLibIncs+=("${LibSRTRoot[*]}")
|
ModuleLibIncs+=("${LibSRTRoot[*]}")
|
||||||
fi
|
fi
|
||||||
ModuleLibFiles=(${LibSTfile} ${LibSSLfile})
|
ModuleLibFiles=(${LibSTfile} ${LibSSLfile})
|
||||||
|
if [[ $SRS_SRT == YES ]]; then
|
||||||
|
ModuleLibFiles+=("${LibSRTfile[*]}")
|
||||||
|
fi
|
||||||
MODULE_DEPENDS=("CORE" "KERNEL" "PROTOCOL" "SERVICE" "APP")
|
MODULE_DEPENDS=("CORE" "KERNEL" "PROTOCOL" "SERVICE" "APP")
|
||||||
if [[ $SRS_SRT == YES ]]; then
|
if [[ $SRS_SRT == YES ]]; then
|
||||||
MODULE_DEPENDS+=("SRT")
|
MODULE_DEPENDS+=("SRT")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue