From bd05f69d0b5696c8ed2e0b15ef4261f6f94d546c Mon Sep 17 00:00:00 2001 From: winlin Date: Fri, 3 Apr 2020 13:42:24 +0800 Subject: [PATCH] Refine openssl build script on OSX --- trunk/auto/depends.sh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/trunk/auto/depends.sh b/trunk/auto/depends.sh index 11b5d9ea2..48483d9bf 100755 --- a/trunk/auto/depends.sh +++ b/trunk/auto/depends.sh @@ -471,7 +471,7 @@ fi # Affected users should upgrade to OpenSSL 1.1.0e. Users unable to immediately # upgrade can alternatively recompile OpenSSL with -DOPENSSL_NO_HEARTBEATS. if [[ $SRS_SSL == YES && $SRS_USE_SYS_SSL != YES ]]; then - OPENSSL_OPTIONS="-no-shared -no-threads -no-asm -DOPENSSL_NO_HEARTBEATS" + OPENSSL_OPTIONS="-no-shared -no-threads -DOPENSSL_NO_HEARTBEATS" OPENSSL_CONFIG="./config" # https://stackoverflow.com/questions/15539062/cross-compiling-of-openssl-for-linux-arm-v5te-linux-gnueabi-toolchain if [[ $SRS_CROSS_BUILD == YES ]]; then @@ -485,11 +485,20 @@ if [[ $SRS_SSL == YES && $SRS_USE_SYS_SSL != YES ]]; then ln -sf /usr/local/include/openssl) fi fi + # For RTC, we should use ASM to improve performance, not a little improving. + if [[ $SRS_RTC == NO || $SRS_NASM == NO ]]; then + OPENSSL_OPTIONS="$OPENSSL_OPTIONS -no-asm" + fi # Which lib we use. OPENSSL_LIB="openssl-1.1.0e/_release" if [[ ! -f ${SRS_OBJS}/${SRS_PLATFORM}/${OPENSSL_LIB}/lib/libssl.a ]]; then OPENSSL_LIB="openssl" fi + # Mac OS X can have issues (its often a neglected platform). + # @see https://wiki.openssl.org/index.php/Compilation_and_Installation + if [[ $SRS_OSX == YES ]]; + export KERNEL_BITS=64; + fi # cross build not specified, if exists flag, need to rebuild for no-arm platform. if [[ -f ${SRS_OBJS}/${SRS_PLATFORM}/openssl/lib/libssl.a ]]; then echo "Openssl-1.1.0e is ok.";