From df20fe6c9da7a424314932a620495afffebf3cb1 Mon Sep 17 00:00:00 2001 From: winlin Date: Wed, 16 Jun 2021 08:43:33 +0800 Subject: [PATCH] Fix build fail --- trunk/auto/options.sh | 42 +++++++++++++++++----------- trunk/src/app/srs_app_listener.cpp | 1 + trunk/src/app/srs_app_rtc_conn.cpp | 3 ++ trunk/src/app/srs_app_rtc_server.cpp | 1 + trunk/src/app/srs_app_server.cpp | 1 + 5 files changed, 32 insertions(+), 16 deletions(-) diff --git a/trunk/auto/options.sh b/trunk/auto/options.sh index 574730a0c..06ec13d1b 100755 --- a/trunk/auto/options.sh +++ b/trunk/auto/options.sh @@ -350,6 +350,7 @@ function parse_user_option_to_value_and_option() { esac } +# For variable values, might be three values: YES, RESERVED, NO(by default). function value2switch() { if [[ $1 == YES ]]; then echo on; @@ -358,6 +359,7 @@ function value2switch() { fi } +# For user options, only off or on(by default). function switch2value() { if [[ $1 == off ]]; then echo NO; @@ -378,12 +380,7 @@ do parse_user_option done -if [ $help = yes ]; then - show_help - exit 0 -fi - -function apply_detail_options() { +function apply_auto_options() { # set default preset if not specifies if [[ $SRS_X86_X64 == NO && $SRS_OSX == NO && $SRS_CROSS_BUILD == NO ]]; then SRS_X86_X64=YES; opt="--x86-x64 $opt"; @@ -410,6 +407,28 @@ function apply_detail_options() { if [ $SRS_TRANSCODE = YES ]; then SRS_FFMPEG_STUB=YES; fi if [ $SRS_INGEST = YES ]; then SRS_FFMPEG_STUB=YES; fi + if [[ $SRS_SRTP_ASM == YES && $SRS_RTC == NO ]]; then + echo "Disable SRTP-ASM, because RTC is disabled." + SRS_SRTP_ASM=NO + fi + + if [[ $SRS_SRTP_ASM == YES && $SRS_NASM == NO ]]; then + echo "Disable SRTP-ASM, because NASM is disabled." + SRS_SRTP_ASM=NO + fi +} + +if [ $help = yes ]; then + apply_auto_options + show_help + exit 0 +fi + +##################################################################################### +# apply options +##################################################################################### + +function apply_detail_options() { # Always enable HTTP utilies. if [ $SRS_HTTP_CORE = NO ]; then SRS_HTTP_CORE=YES; echo -e "${YELLOW}[WARN] Always enable HTTP utilies.${BLACK}"; fi if [ $SRS_STREAM_CASTER = NO ]; then SRS_STREAM_CASTER=YES; echo -e "${YELLOW}[WARN] Always enable StreamCaster.${BLACK}"; fi @@ -429,17 +448,8 @@ function apply_detail_options() { else export SRS_JOBS="--jobs=${SRS_JOBS}" fi - - if [[ $SRS_SRTP_ASM == YES && $SRS_RTC == NO ]]; then - echo "Disable SRTP-ASM, because RTC is disabled." - SRS_SRTP_ASM=NO - fi - - if [[ $SRS_SRTP_ASM == YES && $SRS_NASM == NO ]]; then - echo "Disable SRTP-ASM, because NASM is disabled." - SRS_SRTP_ASM=NO - fi } +apply_auto_options apply_detail_options function regenerate_options() { diff --git a/trunk/src/app/srs_app_listener.cpp b/trunk/src/app/srs_app_listener.cpp index 053b4d487..cab8730a8 100755 --- a/trunk/src/app/srs_app_listener.cpp +++ b/trunk/src/app/srs_app_listener.cpp @@ -25,6 +25,7 @@ using namespace std; #include #include #include +#include #include diff --git a/trunk/src/app/srs_app_rtc_conn.cpp b/trunk/src/app/srs_app_rtc_conn.cpp index f3081c7a0..0d1ef72f7 100644 --- a/trunk/src/app/srs_app_rtc_conn.cpp +++ b/trunk/src/app/srs_app_rtc_conn.cpp @@ -16,6 +16,7 @@ using namespace std; #include #include +#include #include #include @@ -41,6 +42,8 @@ using namespace std; #include #include #include +#include +#include #include diff --git a/trunk/src/app/srs_app_rtc_server.cpp b/trunk/src/app/srs_app_rtc_server.cpp index 56f64203c..8e4cd336f 100644 --- a/trunk/src/app/srs_app_rtc_server.cpp +++ b/trunk/src/app/srs_app_rtc_server.cpp @@ -27,6 +27,7 @@ using namespace std; #include #include #include +#include extern SrsPps* _srs_pps_rpkts; SrsPps* _srs_pps_rstuns = NULL; diff --git a/trunk/src/app/srs_app_server.cpp b/trunk/src/app/srs_app_server.cpp index 554a61219..344804cc8 100644 --- a/trunk/src/app/srs_app_server.cpp +++ b/trunk/src/app/srs_app_server.cpp @@ -35,6 +35,7 @@ using namespace std; #include #include #include +#include std::string srs_listener_type2string(SrsListenerType type) {