diff --git a/trunk/auto/depends.sh b/trunk/auto/depends.sh index 052a35743..7bb51c329 100755 --- a/trunk/auto/depends.sh +++ b/trunk/auto/depends.sh @@ -469,43 +469,47 @@ fi # Affected users should upgrade to OpenSSL 1.0.1g. Users unable to immediately # upgrade can alternatively recompile OpenSSL with -DOPENSSL_NO_HEARTBEATS. if [ $SRS_SSL = YES ]; then - # check the arm flag file, if flag changed, need to rebuild the st. - if [ $SRS_ARM_UBUNTU12 = YES ]; then - # ok, arm specified, if the flag filed does not exists, need to rebuild. - if [[ -f ${SRS_OBJS}/_flag.ssl.arm.tmp && -f ${SRS_OBJS}/openssl/lib/libssl.a ]]; then - echo "openssl-1.0.1f for arm is ok."; - else - echo "build openssl-1.0.1f for arm"; - ( - rm -rf ${SRS_OBJS}/openssl-1.0.1f && cd ${SRS_OBJS} && - unzip -q ../3rdparty/openssl-1.0.1f.zip && cd openssl-1.0.1f && - ./Configure --prefix=`pwd`/_release -no-shared no-asm linux-armv4 -DOPENSSL_NO_HEARTBEATS && - make CC=${SrsArmCC} GCC=${SrsArmGCC} AR="${SrsArmAR} r" \ - LD=${SrsArmLD} LINK=${SrsArmGCC} RANDLIB=${SrsArmRANDLIB} && - make install && - cd .. && rm -rf openssl && ln -sf openssl-1.0.1f/_release openssl && - cd .. && touch ${SRS_OBJS}/_flag.ssl.arm.tmp - ) - fi + if [ $SRS_USE_SYS_SSL = YES ]; then + echo "warning: donot compile ssl, use system ssl" else - # arm not specified, if exists flag, need to rebuild for no-arm platform. - if [[ ! -f ${SRS_OBJS}/_flag.ssl.arm.tmp && -f ${SRS_OBJS}/openssl/lib/libssl.a ]]; then - echo "openssl-1.0.1f is ok."; + # check the arm flag file, if flag changed, need to rebuild the st. + if [ $SRS_ARM_UBUNTU12 = YES ]; then + # ok, arm specified, if the flag filed does not exists, need to rebuild. + if [[ -f ${SRS_OBJS}/_flag.ssl.arm.tmp && -f ${SRS_OBJS}/openssl/lib/libssl.a ]]; then + echo "openssl-1.0.1f for arm is ok."; + else + echo "build openssl-1.0.1f for arm"; + ( + rm -rf ${SRS_OBJS}/openssl-1.0.1f && cd ${SRS_OBJS} && + unzip -q ../3rdparty/openssl-1.0.1f.zip && cd openssl-1.0.1f && + ./Configure --prefix=`pwd`/_release -no-shared no-asm linux-armv4 -DOPENSSL_NO_HEARTBEATS && + make CC=${SrsArmCC} GCC=${SrsArmGCC} AR="${SrsArmAR} r" \ + LD=${SrsArmLD} LINK=${SrsArmGCC} RANDLIB=${SrsArmRANDLIB} && + make install && + cd .. && rm -rf openssl && ln -sf openssl-1.0.1f/_release openssl && + cd .. && touch ${SRS_OBJS}/_flag.ssl.arm.tmp + ) + fi else - echo "build openssl-1.0.1f"; - ( - rm -rf ${SRS_OBJS}/openssl-1.0.1f && cd ${SRS_OBJS} && - unzip -q ../3rdparty/openssl-1.0.1f.zip && cd openssl-1.0.1f && - ./config --prefix=`pwd`/_release -no-shared -DOPENSSL_NO_HEARTBEATS && - make && make install && - cd .. && rm -rf openssl && ln -sf openssl-1.0.1f/_release openssl && - cd .. && rm -f ${SRS_OBJS}/_flag.ssl.arm.tmp - ) + # arm not specified, if exists flag, need to rebuild for no-arm platform. + if [[ ! -f ${SRS_OBJS}/_flag.ssl.arm.tmp && -f ${SRS_OBJS}/openssl/lib/libssl.a ]]; then + echo "openssl-1.0.1f is ok."; + else + echo "build openssl-1.0.1f"; + ( + rm -rf ${SRS_OBJS}/openssl-1.0.1f && cd ${SRS_OBJS} && + unzip -q ../3rdparty/openssl-1.0.1f.zip && cd openssl-1.0.1f && + ./config --prefix=`pwd`/_release -no-shared -DOPENSSL_NO_HEARTBEATS && + make && make install && + cd .. && rm -rf openssl && ln -sf openssl-1.0.1f/_release openssl && + cd .. && rm -f ${SRS_OBJS}/_flag.ssl.arm.tmp + ) + fi fi + # check status + ret=$?; if [[ $ret -ne 0 ]]; then echo "build openssl-1.0.1f failed, ret=$ret"; exit $ret; fi + if [ ! -f ${SRS_OBJS}/openssl/lib/libssl.a ]; then echo "build openssl-1.0.1f failed."; exit -1; fi fi - # check status - ret=$?; if [[ $ret -ne 0 ]]; then echo "build openssl-1.0.1f failed, ret=$ret"; exit $ret; fi - if [ ! -f ${SRS_OBJS}/openssl/lib/libssl.a ]; then echo "build openssl-1.0.1f failed."; exit -1; fi fi if [ $SRS_SSL = YES ]; then diff --git a/trunk/auto/options.sh b/trunk/auto/options.sh index c27a2acec..49847e05d 100755 --- a/trunk/auto/options.sh +++ b/trunk/auto/options.sh @@ -47,6 +47,10 @@ SRS_PREFIX=/usr/local/srs SRS_JOBS=1 SRS_STATIC=RESERVED # +# experts +# donot compile ssl, use system ssl(-lssl) if required. +SRS_USE_SYS_SSL=NO +# # presets # for x86/x64 pc/servers SRS_X86_X64=NO @@ -143,6 +147,9 @@ Conflicts: 4. --arm vs --with-ffmpeg/bwtc/gperf/gmc/gmp/gprof: the complex tools not available for arm. +Experts: + --use-sys-ssl donot compile ssl, use system ssl(-lssl) if required. + Workflow: 1. apply "Presets". if not specified, use default preset. 2. apply "Options". user specified option will override the preset. @@ -210,6 +217,8 @@ function parse_user_option() { --fast) SRS_FAST=YES ;; --pure-rtmp) SRS_PURE_RTMP=YES ;; --rtmp-hls) SRS_RTMP_HLS=YES ;; + + --use-sys-ssl) SRS_USE_SYS_SSL=YES ;; *) echo "$0: error: invalid option \"$option\"" diff --git a/trunk/configure b/trunk/configure index 99b3b5324..a78462fe1 100755 --- a/trunk/configure +++ b/trunk/configure @@ -396,12 +396,14 @@ LibHttpParserRoot=""; LibHttpParserfile="" if [ $SRS_HTTP_PARSER = YES ]; then LibHttpParserRoot="${SRS_OBJS}/hp"; LibHttpParserfile="${LibHttpParserRoot}/libhttp_parser.a"; fi # openssl-1.0.1f, for the RTMP complex handshake. LibSSLRoot="";LibSSLfile="" -if [ $SRS_SSL = YES ]; then LibSSLRoot="${SRS_OBJS}/openssl/include"; LibSSLfile="${SRS_OBJS}/openssl/lib/libssl.a ${SRS_OBJS}/openssl/lib/libcrypto.a"; fi +if [ $SRS_SSL = YES ]; then if [ $SRS_USE_SYS_SSL = NO ]; then LibSSLRoot="${SRS_OBJS}/openssl/include"; LibSSLfile="${SRS_OBJS}/openssl/lib/libssl.a ${SRS_OBJS}/openssl/lib/libcrypto.a"; fi fi # gperftools-2.1, for mem check and mem/cpu profile LibGperfRoot=""; LibGperfFile="" if [ $SRS_GPERF = YES ]; then LibGperfRoot="${SRS_OBJS}/gperf/include"; LibGperfFile="${SRS_OBJS}/gperf/lib/libtcmalloc_and_profiler.a"; fi # the link options, always use static link -SrsLinkOptions=""; if [ $SRS_STATIC = YES ]; then SrsLinkOptions="-static"; else SrsLinkOptions="-ldl"; fi +SrsLinkOptions=""; +if [ $SRS_SSL = YES ]; then if [ $SRS_USE_SYS_SSL = YES ]; then SrsLinkOptions="-lssl"; fi fi +if [ $SRS_STATIC = YES ]; then SrsLinkOptions="${SrsLinkOptions} -static"; else SrsLinkOptions="${SrsLinkOptions} -ldl"; fi ##################################################################################### # Modules, compile each module, then link to binary diff --git a/trunk/src/core/srs_core.hpp b/trunk/src/core/srs_core.hpp index 1c014b31f..c0c4891a4 100644 --- a/trunk/src/core/srs_core.hpp +++ b/trunk/src/core/srs_core.hpp @@ -31,7 +31,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // current release version #define VERSION_MAJOR "0" #define VERSION_MINOR "9" -#define VERSION_REVISION "66" +#define VERSION_REVISION "67" #define RTMP_SIG_SRS_VERSION VERSION_MAJOR"."VERSION_MINOR"."VERSION_REVISION // server info. #define RTMP_SIG_SRS_KEY "srs"