diff --git a/.circleci/config.yml b/.circleci/config.yml index 3438cfba3..59be9a326 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -6,15 +6,23 @@ jobs: steps: - checkout - run: | - echo "Build and run SRS baseline" && + echo "Build SRS baseline" && cd trunk && ./configure && make + build-c7-nortc: + docker: + - image: ossrs/srs:dev + steps: + - checkout + - run: | + echo "Build SRS without RTC" && + cd trunk && ./configure --rtc=off && make build-c7-noasm: docker: - image: ossrs/srs:dev steps: - checkout - run: | - echo "Build and run SRS without NASM or SRTP-NASM" && + echo "Build SRS without NASM or SRTP-NASM" && cd trunk && ./configure --nasm=off --srtp-nasm=off && make build-c7-gb28181: docker: @@ -22,7 +30,7 @@ jobs: steps: - checkout - run: | - echo "Build and run SRS with GB28181" && + echo "Build SRS with GB28181" && cd trunk && ./configure --gb28181=on && make build-c7-srt: docker: @@ -30,7 +38,7 @@ jobs: steps: - checkout - run: | - echo "Build and run SRS with SRT" && + echo "Build SRS with SRT" && cd trunk && ./configure --srt=on && make build-c8-baseline: docker: @@ -38,7 +46,7 @@ jobs: steps: - checkout - run: | - echo "Build and run SRS for CentOS8" && + echo "Build SRS for CentOS8" && cd trunk && ./configure && make build-c8-srt: docker: @@ -46,7 +54,7 @@ jobs: steps: - checkout - run: | - echo "Build and run SRS with SRT for CentOS8" && + echo "Build SRS with SRT for CentOS8" && cd trunk && ./configure --srt=on && make build-u16-baseline: docker: @@ -54,7 +62,7 @@ jobs: steps: - checkout - run: | - echo "Build and run SRS for Ubuntu16" && + echo "Build SRS for Ubuntu16" && cd trunk && ./configure && make build-u16-srt: docker: @@ -62,7 +70,7 @@ jobs: steps: - checkout - run: | - echo "Build and run SRS with SRT for Ubuntu16" && + echo "Build SRS with SRT for Ubuntu16" && cd trunk && ./configure --srt=on && make build-u18-baseline: docker: @@ -70,7 +78,7 @@ jobs: steps: - checkout - run: | - echo "Build and run SRS for Ubuntu18" && + echo "Build SRS for Ubuntu18" && cd trunk && ./configure && make build-u18-srt: docker: @@ -78,7 +86,7 @@ jobs: steps: - checkout - run: | - echo "Build and run SRS with SRT for Ubuntu18" && + echo "Build SRS with SRT for Ubuntu18" && cd trunk && ./configure --srt=on && make build-u20-baseline: docker: @@ -86,7 +94,7 @@ jobs: steps: - checkout - run: | - echo "Build and run SRS for Ubuntu20" && + echo "Build SRS for Ubuntu20" && cd trunk && ./configure && make build-u20-srt: docker: @@ -94,7 +102,7 @@ jobs: steps: - checkout - run: | - echo "Build and run SRS with SRT for Ubuntu20" && + echo "Build SRS with SRT for Ubuntu20" && cd trunk && ./configure --srt=on && make run-utest: docker: @@ -121,7 +129,7 @@ jobs: steps: - checkout - run: | - echo "Build and run SRS C++98(ANSI), no FFmpeg-fit" && + echo "Build SRS C++98(ANSI), no FFmpeg-fit" && cd trunk && ./configure --cxx11=off --cxx14=off --ffmpeg-fit=off && make workflows: version: 2 @@ -130,6 +138,7 @@ workflows: - build-c7-baseline - run-utest - run-regression-test + - build-c7-nortc - build-c7-noasm - build-c7-gb28181 - build-c7-srt diff --git a/trunk/auto/auto_headers.sh b/trunk/auto/auto_headers.sh index 1704b182e..a0bf149b2 100755 --- a/trunk/auto/auto_headers.sh +++ b/trunk/auto/auto_headers.sh @@ -40,15 +40,6 @@ function srs_undefine_macro() } # export the preset. -if [ $SRS_X86_X64 = YES ]; then - srs_define_macro "SRS_X86_X64" $SRS_AUTO_HEADERS_H -fi -if [ $SRS_PI = YES ]; then - srs_define_macro "SRS_PI" $SRS_AUTO_HEADERS_H -fi -if [ $SRS_CUBIE = YES ]; then - srs_define_macro "SRS_CUBIE" $SRS_AUTO_HEADERS_H -fi echo "#undef SRS_EXPORT_LIBRTMP" >> $SRS_AUTO_HEADERS_H echo "" >> $SRS_AUTO_HEADERS_H diff --git a/trunk/auto/options.sh b/trunk/auto/options.sh index 1c32a9062..ff9f72e97 100755 --- a/trunk/auto/options.sh +++ b/trunk/auto/options.sh @@ -17,7 +17,7 @@ help=no # feature options SRS_HDS=NO SRS_SRT=NO -SRS_RTC=YES +SRS_RTC=RESERVED SRS_GB28181=NO SRS_CXX11=NO SRS_CXX14=NO @@ -139,7 +139,7 @@ function show_help() { Presets: --x86-64, --x86-x64 For x86/x64 cpu, common pc and servers. Default: $(value2switch $SRS_X86_X64) - --arm Enable crossbuild for ARM, should also set bellow toolchain options. Default: $(value2switch $SRS_CROSS_BUILD) + --arm Enable cross-build for ARM, please set bellow Toolchain also. Default: $(value2switch $SRS_CROSS_BUILD) --osx Enable build for OSX/Darwin AppleOS. Default: $(value2switch $SRS_OSX) Features: @@ -179,11 +179,11 @@ Performance: @see https://blog.csdn.net/win_lin/article/details/5 Toolchain options: @see https://github.com/ossrs/srs/issues/1547#issuecomment-576078411 --static=on|off Whether add '-static' to link options. Default: $(value2switch $SRS_STATIC) - --cc= Use c compiler CC. Default: $SRS_TOOL_CC - --cxx= Use c++ compiler CXX. Default: $SRS_TOOL_CXX - --ar= Use archive tool AR. Default: $SRS_TOOL_CXX - --ld= Use linker tool LD. Default: $SRS_TOOL_CXX - --randlib= Use randlib tool RANDLIB. Default: $SRS_TOOL_CXX + --cc= Toolchain: Use c compiler CC. Default: $SRS_TOOL_CC + --cxx= Toolchain: Use c++ compiler CXX. Default: $SRS_TOOL_CXX + --ar= Toolchain: Use archive tool AR. Default: $SRS_TOOL_CXX + --ld= Toolchain: Use linker tool LD. Default: $SRS_TOOL_CXX + --randlib= Toolchain: Use randlib tool RANDLIB. Default: $SRS_TOOL_CXX --extra-flags= Set EFLAGS as CFLAGS and CXXFLAGS. Also passed to ST as EXTRA_CFLAGS. Experts: @@ -357,9 +357,17 @@ function parse_user_option() { --debug) if [[ $value == off ]]; then SRS_DEBUG=NO; else SRS_DEBUG=YES; fi ;; --debug-stats) if [[ $value == off ]]; then SRS_DEBUG_STATS=NO; else SRS_DEBUG_STATS=YES; fi ;; - # Deprecated, might be removed in future. + # Alias for --arm, cross build. --arm) SRS_CROSS_BUILD=YES ;; --mips) SRS_CROSS_BUILD=YES ;; + --with-arm-ubuntu12) SRS_CROSS_BUILD=YES ;; + --without-arm-ubuntu12) SRS_CROSS_BUILD=NO ;; + --arm-ubuntu12) if [[ $value == off ]]; then SRS_CROSS_BUILD=NO; else SRS_CROSS_BUILD=YES; fi ;; + --with-mips-ubuntu12) SRS_CROSS_BUILD=YES ;; + --without-mips-ubuntu12) SRS_CROSS_BUILD=NO ;; + --mips-ubuntu12) if [[ $value == off ]]; then SRS_CROSS_BUILD=NO; else SRS_CROSS_BUILD=YES; fi ;; + + # Deprecated, might be removed in future. --pi) SRS_PI=YES ;; --cubie) SRS_CUBIE=YES ;; --dev) SRS_DEV=YES ;; @@ -380,12 +388,6 @@ function parse_user_option() { --with-librtmp) SRS_LIBRTMP=YES ;; --without-librtmp) SRS_LIBRTMP=NO ;; --librtmp) if [[ $value == off ]]; then SRS_LIBRTMP=NO; else SRS_LIBRTMP=YES; fi ;; - --with-arm-ubuntu12) SRS_CROSS_BUILD=YES ;; - --without-arm-ubuntu12) SRS_CROSS_BUILD=NO ;; - --arm-ubuntu12) if [[ $value == off ]]; then SRS_CROSS_BUILD=NO; else SRS_CROSS_BUILD=YES; fi ;; - --with-mips-ubuntu12) SRS_CROSS_BUILD=YES ;; - --without-mips-ubuntu12) SRS_CROSS_BUILD=NO ;; - --mips-ubuntu12) if [[ $value == off ]]; then SRS_CROSS_BUILD=NO; else SRS_CROSS_BUILD=YES; fi ;; *) echo "$0: error: invalid option \"$option\"" @@ -447,6 +449,11 @@ function apply_detail_options() { SRS_X86_X64=YES; opt="--x86-x64 $opt"; fi + # Setup the default values if not set. + if [[ $SRS_RTC == RESERVED ]]; then + SRS_RTC=YES; if [[ $SRS_CROSS_BUILD == YES ]]; then SRS_RTC=NO; fi + fi + # The SRT code in SRS requires c++11, although we build libsrt without c++11. # TODO: FIXME: Remove c++11 code in SRT of SRS. if [[ $SRS_SRT == YES ]]; then @@ -581,12 +588,11 @@ regenerate_options ##################################################################################### function check_option_conflicts() { if [[ $SRS_TOOL_CC == '' || $SRS_TOOL_CXX == '' || $SRS_TOOL_AR == '' || $SRS_TOOL_LD == '' || $SRS_TOOL_RANDLIB == '' ]]; then - echo "No crossbuild tools, cc: $SRS_TOOL_CC, cxx: $SRS_TOOL_CXX, ar: $SRS_TOOL_AR, ld: $SRS_TOOL_LD, randlib: $SRS_TOOL_RANDLIB"; exit -1 + echo "Error: No build toolchain, cc: $SRS_TOOL_CC, cxx: $SRS_TOOL_CXX, ar: $SRS_TOOL_AR, ld: $SRS_TOOL_LD, randlib: $SRS_TOOL_RANDLIB"; exit -1 fi if [[ $SRS_CROSS_BUILD == YES && ($SRS_TOOL_CC == 'gcc' || $SRS_TOOL_CXX == 'g++' || $SRS_TOOL_AR == 'ar') ]]; then - echo "Warning: For crossbuild, must not use default toolchain, cc: $SRS_TOOL_CC, cxx: $SRS_TOOL_CXX, ar: $SRS_TOOL_AR" - SRS_CROSS_BUILD=NO + echo "Error: For cross build, should setup the toolchain(./configure -h|grep -i toolchain), cc: $SRS_TOOL_CC, cxx: $SRS_TOOL_CXX, ar: $SRS_TOOL_AR"; exit 1 fi if [[ $SRS_NGINX == YES ]]; then