diff --git a/trunk/auto/depends.sh b/trunk/auto/depends.sh index aafd93d92..b9af6007b 100755 --- a/trunk/auto/depends.sh +++ b/trunk/auto/depends.sh @@ -480,13 +480,17 @@ if [[ $SRS_SSL == YES && $SRS_USE_SYS_SSL != YES ]]; then OPENSSL_CONFIG="./Configure linux-armv4" elif [[ ! -f ${SRS_OBJS}/${SRS_PLATFORM}/openssl/lib/libssl.a ]]; then # Try to use exists libraries. - if [[ -f /usr/local/ssl/lib/libssl.a ]]; then + if [[ -f /usr/local/ssl/lib/libssl.a && $SRS_SSL_LOCAL == NO ]]; then (mkdir -p ${SRS_OBJS}/${SRS_PLATFORM}/openssl/lib && cd ${SRS_OBJS}/${SRS_PLATFORM}/openssl/lib && ln -sf /usr/local/ssl/lib/libssl.a && ln -sf /usr/local/ssl/lib/libcrypto.a && mkdir -p /usr/local/ssl/lib/pkgconfig && ln -sf /usr/local/ssl/lib/pkgconfig) (mkdir -p ${SRS_OBJS}/${SRS_PLATFORM}/openssl/include && cd ${SRS_OBJS}/${SRS_PLATFORM}/openssl/include && ln -sf /usr/local/ssl/include/openssl) fi + # Warning if not use the system ssl. + if [[ -f /usr/local/ssl/lib/libssl.a && $SRS_SSL_LOCAL == YES ]]; then + echo "Warning: Local openssl is on, ignore system openssl" + fi fi # For RTC, we should use ASM to improve performance, not a little improving. if [[ $SRS_RTC == NO || $SRS_NASM == NO ]]; then diff --git a/trunk/auto/options.sh b/trunk/auto/options.sh index be4e93fab..5d83ebfaa 100755 --- a/trunk/auto/options.sh +++ b/trunk/auto/options.sh @@ -36,6 +36,7 @@ SRS_STREAM_CASTER=YES SRS_INGEST=YES SRS_SSL=YES SRS_SSL_1_0=NO +SRS_SSL_LOCAL=NO SRS_HTTPS=YES SRS_STAT=YES SRS_TRANSCODE=YES @@ -190,6 +191,8 @@ Toolchain options: @see https://github.com/ossrs/srs/issues/1547#issuec Experts: --sys-ssl=on|off Do not compile ssl, use system ssl(-lssl) if required. Default: $(value2switch $SRS_USE_SYS_SSL) + --ssl-1-0=on|off Whether use openssl-1.0.*. Default: $(value2switch $SRS_SSL_1_0) + --ssl-local=on|off Whether use local openssl, not system even exists. Default: $(value2switch $SRS_SSL_LOCAL) --use-shared-st Use link shared libraries for ST which uses MPL license. Default: $(value2switch $SRS_SHARED_ST) --use-shared-srt Use link shared libraries for SRT which uses MPL license. Default: $(value2switch $SRS_SHARED_SRT) --clean=on|off Whether do 'make clean' when configure. Default: $(value2switch $SRS_CLEAN) @@ -263,6 +266,7 @@ function parse_user_option() { --ssl) if [[ $value == off ]]; then SRS_SSL=NO; else SRS_SSL=YES; fi ;; --https) if [[ $value == off ]]; then SRS_HTTPS=NO; else SRS_HTTPS=YES; fi ;; --ssl-1-0) if [[ $value == off ]]; then SRS_SSL_1_0=NO; else SRS_SSL_1_0=YES; fi ;; + --ssl-local) if [[ $value == off ]]; then SRS_SSL_LOCAL=NO; else SRS_SSL_LOCAL=YES; fi ;; --with-hds) SRS_HDS=YES ;; --without-hds) SRS_HDS=NO ;; @@ -533,6 +537,7 @@ function regenerate_options() { if [ $SRS_SSL = YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --ssl=on"; else SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --ssl=off"; fi if [ $SRS_HTTPS = YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --https=on"; else SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --https=off"; fi if [ $SRS_SSL_1_0 = YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --ssl-1-0=on"; else SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --ssl-1-0=off"; fi + if [ $SRS_SSL_LOCAL = YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --ssl-local=on"; else SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --ssl-local=off"; fi if [ $SRS_USE_SYS_SSL = YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --sys-ssl=on"; else SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --sys-ssl=off"; fi if [ $SRS_TRANSCODE = YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --transcode=on"; else SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --transcode=off"; fi if [ $SRS_INGEST = YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --ingest=on"; else SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --ingest=off"; fi