From 20896325eaaff4f25987a679202f8a7717c7e59c Mon Sep 17 00:00:00 2001 From: winlin Date: Tue, 21 Apr 2020 14:02:26 +0800 Subject: [PATCH] Update script --- trunk/auto/depends.sh | 13 ++++++++----- trunk/auto/options.sh | 12 ++++++------ 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/trunk/auto/depends.sh b/trunk/auto/depends.sh index 557de4bb3..62b0ad3fa 100755 --- a/trunk/auto/depends.sh +++ b/trunk/auto/depends.sh @@ -103,7 +103,10 @@ function Ubuntu_prepare() fi pkg-config --version >/dev/null 2>&1; ret=$?; if [[ 0 -ne $ret ]]; then - echo "Please install pkg-config"; exit -1; + echo "Installing pkg-config." + require_sudoer "sudo apt-get install -y --force-yes pkg-config" + sudo apt-get install -y --force-yes pkg-config; ret=$?; if [[ 0 -ne $ret ]]; then return $ret; fi + echo "The pkg-config is installed." fi echo "Tools for Ubuntu are installed." @@ -540,10 +543,10 @@ fi if [ $SRS_EXPORT_LIBRTMP_PROJECT = NO ]; then # For openssl-1.1.*, we should disable SRTP ASM, because SRTP only works with openssl-1.0.* if [[ $SRS_SRTP_ASM == YES ]]; then - echo "#include " > ${SRS_OBJS}/_tmp_srtp_asm_detect.c - echo "#if OPENSSL_VERSION_NUMBER >= 0x10100000L // v1.1.x" >> ${SRS_OBJS}/_tmp_srtp_asm_detect.c - echo "#error \"SRTP only works with openssl-1.0.*\"" >> ${SRS_OBJS}/_tmp_srtp_asm_detect.c - echo "#endif" >> ${SRS_OBJS}/_tmp_srtp_asm_detect.c + echo " #include " > ${SRS_OBJS}/_tmp_srtp_asm_detect.c + echo " #if OPENSSL_VERSION_NUMBER >= 0x10100000L // v1.1.x " >> ${SRS_OBJS}/_tmp_srtp_asm_detect.c + echo " #error \"SRTP only works with openssl-1.0.*\" " >> ${SRS_OBJS}/_tmp_srtp_asm_detect.c + echo " #endif " >> ${SRS_OBJS}/_tmp_srtp_asm_detect.c ${SRS_TOOL_CC} -c ${SRS_OBJS}/_tmp_srtp_asm_detect.c -I${SRS_OBJS}/openssl/include -o /dev/null >/dev/null 2>&1 if [[ $? -ne 0 ]]; then SRS_SRTP_ASM=NO && echo "Warning: Disable SRTP ASM optimization, please update docker"; diff --git a/trunk/auto/options.sh b/trunk/auto/options.sh index f2b0cb7e6..2a3b2480b 100755 --- a/trunk/auto/options.sh +++ b/trunk/auto/options.sh @@ -570,12 +570,12 @@ function apply_user_detail_options() { # Detect whether has sendmmsg. # @see http://man7.org/linux/man-pages/man2/sendmmsg.2.html mkdir -p ${SRS_OBJS} && - echo "#include " > ${SRS_OBJS}/_tmp_sendmmsg_detect.c - echo "int main(int argc, char** argv) {" >> ${SRS_OBJS}/_tmp_sendmmsg_detect.c - echo " struct mmsghdr hdr;" >> ${SRS_OBJS}/_tmp_sendmmsg_detect.c - echo " hdr.msg_len = 0;" >> ${SRS_OBJS}/_tmp_sendmmsg_detect.c - echo " return 0;" >> ${SRS_OBJS}/_tmp_sendmmsg_detect.c - echo "}" >> ${SRS_OBJS}/_tmp_sendmmsg_detect.c + echo " #include " > ${SRS_OBJS}/_tmp_sendmmsg_detect.c + echo " int main(int argc, char** argv) { " >> ${SRS_OBJS}/_tmp_sendmmsg_detect.c + echo " struct mmsghdr hdr; " >> ${SRS_OBJS}/_tmp_sendmmsg_detect.c + echo " hdr.msg_len = 0; " >> ${SRS_OBJS}/_tmp_sendmmsg_detect.c + echo " return 0; " >> ${SRS_OBJS}/_tmp_sendmmsg_detect.c + echo " } " >> ${SRS_OBJS}/_tmp_sendmmsg_detect.c ${SRS_TOOL_CC} -c ${SRS_OBJS}/_tmp_sendmmsg_detect.c -D_GNU_SOURCE -o /dev/null >/dev/null 2>&1 ret=$?; rm -f ${SRS_OBJS}/_tmp_sendmmsg_detect.c; if [[ $ret -ne 0 ]]; then