diff --git a/trunk/auto/options.sh b/trunk/auto/options.sh index f9e8dfaa0..8bf8106f7 100755 --- a/trunk/auto/options.sh +++ b/trunk/auto/options.sh @@ -382,12 +382,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"; @@ -414,6 +409,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 @@ -433,17 +450,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() {