winlin

Merge branch 'srs.master'

1 # generate the binary 1 # generate the binary
2 # 2 #
3 # params: 3 # params:
4 -# $SRS_OBJS the objs directory. ie. objs 4 +# $SRS_OBJS the objs directory to store the Makefile. ie. ./objs
  5 +# $SRS_OBJS_DIR the objs directory for Makefile. ie. objs
5 # $SRS_MAKEFILE the makefile name. ie. Makefile 6 # $SRS_MAKEFILE the makefile name. ie. Makefile
6 # 7 #
7 # $MAIN_ENTRANCES array, disable all except the $APP_MAIN itself. ie. ["srs_main_server" "srs_main_bandcheck"] 8 # $MAIN_ENTRANCES array, disable all except the $APP_MAIN itself. ie. ["srs_main_server" "srs_main_bandcheck"]
@@ -14,7 +15,7 @@ @@ -14,7 +15,7 @@
14 15
15 FILE=${SRS_OBJS}/${SRS_MAKEFILE} 16 FILE=${SRS_OBJS}/${SRS_MAKEFILE}
16 17
17 -APP_TARGET="${SRS_OBJS}/${APP_NAME}" 18 +APP_TARGET="${SRS_OBJS_DIR}/${APP_NAME}"
18 19
19 echo "generate app ${APP_NAME} depends..."; 20 echo "generate app ${APP_NAME} depends...";
20 21
@@ -45,7 +46,7 @@ for item in ${MODULE_OBJS[*]}; do @@ -45,7 +46,7 @@ for item in ${MODULE_OBJS[*]}; do
45 continue; 46 continue;
46 fi 47 fi
47 48
48 - OBJ_FILE=${SRS_OBJS}/$item 49 + OBJ_FILE=${SRS_OBJS_DIR}/$item
49 OBJ_FILE="${OBJ_FILE%.*}.o" 50 OBJ_FILE="${OBJ_FILE%.*}.o"
50 echo -n "${OBJ_FILE} " >> ${FILE} 51 echo -n "${OBJ_FILE} " >> ${FILE}
51 done 52 done
@@ -76,7 +77,7 @@ for item in ${MODULE_OBJS[*]}; do @@ -76,7 +77,7 @@ for item in ${MODULE_OBJS[*]}; do
76 continue; 77 continue;
77 fi 78 fi
78 79
79 - OBJ_FILE=${SRS_OBJS}/$item 80 + OBJ_FILE=${SRS_OBJS_DIR}/$item
80 OBJ_FILE="${OBJ_FILE%.*}.o" 81 OBJ_FILE="${OBJ_FILE%.*}.o"
81 echo -n "${OBJ_FILE} " >> ${FILE} 82 echo -n "${OBJ_FILE} " >> ${FILE}
82 done 83 done
@@ -582,21 +582,23 @@ fi @@ -582,21 +582,23 @@ fi
582 ##################################################################################### 582 #####################################################################################
583 # build research code, librtmp 583 # build research code, librtmp
584 ##################################################################################### 584 #####################################################################################
585 -if [ $SRS_RESEARCH = YES ]; then  
586 - mkdir -p ${SRS_OBJS}/research 585 +if [ $SRS_EXPORT_LIBRTMP = NO ]; then
  586 + if [ $SRS_RESEARCH = YES ]; then
  587 + mkdir -p ${SRS_OBJS}/research
587 588
588 - (cd research/hls && make ${SRS_JOBS} && mv ts_info ../../${SRS_OBJS}/research)  
589 - ret=$?; if [[ $ret -ne 0 ]]; then echo "build research/hls failed, ret=$ret"; exit $ret; fi 589 + (cd ${SRS_WORKDIR}/research/hls && make ${SRS_JOBS} && mv ts_info ../../${SRS_OBJS_DIR}/research)
  590 + ret=$?; if [[ $ret -ne 0 ]]; then echo "build research/hls failed, ret=$ret"; exit $ret; fi
590 591
591 - (cd research/ffempty && make ${SRS_JOBS} && mv ffempty ../../${SRS_OBJS}/research)  
592 - ret=$?; if [[ $ret -ne 0 ]]; then echo "build research/ffempty failed, ret=$ret"; exit $ret; fi 592 + (cd research/ffempty && make ${SRS_JOBS} && mv ffempty ../../${SRS_OBJS_DIR}/research)
  593 + ret=$?; if [[ $ret -ne 0 ]]; then echo "build research/ffempty failed, ret=$ret"; exit $ret; fi
  594 + fi
593 fi 595 fi
594 596
595 if [ $SRS_LIBRTMP = YES ]; then 597 if [ $SRS_LIBRTMP = YES ]; then
596 mkdir -p ${SRS_OBJS}/research 598 mkdir -p ${SRS_OBJS}/research
597 599
598 # librtmp 600 # librtmp
599 - (cd research/librtmp && mkdir -p objs && ln -sf `pwd`/objs ../../${SRS_OBJS}/research/librtmp) 601 + (cd ${SRS_WORKDIR}/research/librtmp && mkdir -p objs && ln -sf `pwd`/objs ../../${SRS_OBJS_DIR}/research/librtmp)
600 ret=$?; if [[ $ret -ne 0 ]]; then echo "link research/librtmp failed, ret=$ret"; exit $ret; fi 602 ret=$?; if [[ $ret -ne 0 ]]; then echo "link research/librtmp failed, ret=$ret"; exit $ret; fi
601 fi 603 fi
602 604
1 # generate the library for static link. 1 # generate the library for static link.
2 # 2 #
3 # params: 3 # params:
4 -# $SRS_OBJS the objs directory. ie. objs 4 +# $SRS_OBJS the objs directory to store the Makefile. ie. ./objs
  5 +# $SRS_OBJS_DIR the objs directory for Makefile. ie. objs
5 # $SRS_MAKEFILE the makefile name. ie. Makefile 6 # $SRS_MAKEFILE the makefile name. ie. Makefile
6 # 7 #
7 # $BUILD_KEY a string indicates the build key for Makefile. ie. dump 8 # $BUILD_KEY a string indicates the build key for Makefile. ie. dump
@@ -10,7 +11,7 @@ @@ -10,7 +11,7 @@
10 11
11 FILE=${SRS_OBJS}/${SRS_MAKEFILE} 12 FILE=${SRS_OBJS}/${SRS_MAKEFILE}
12 13
13 -LIB_TARGET="${SRS_OBJS}/${LIB_NAME}" 14 +LIB_TARGET="${SRS_OBJS_DIR}/${LIB_NAME}"
14 LIB_TAGET_STATIC="${LIB_TARGET}.a" 15 LIB_TAGET_STATIC="${LIB_TARGET}.a"
15 16
16 echo "generate lib ${LIB_NAME} depends..." 17 echo "generate lib ${LIB_NAME} depends..."
@@ -29,14 +30,14 @@ for item in ${MODULE_OBJS[*]}; do @@ -29,14 +30,14 @@ for item in ${MODULE_OBJS[*]}; do
29 continue; 30 continue;
30 fi 31 fi
31 32
32 - OBJ_FILE=${SRS_OBJS}/$item 33 + OBJ_FILE=${SRS_OBJS_DIR}/$item
33 OBJ_FILE="${OBJ_FILE%.*}.o" 34 OBJ_FILE="${OBJ_FILE%.*}.o"
34 echo -n "${OBJ_FILE} " >> ${FILE} 35 echo -n "${OBJ_FILE} " >> ${FILE}
35 done 36 done
36 echo "" >> ${FILE} 37 echo "" >> ${FILE}
37 38
38 # build header file 39 # build header file
39 -echo -n " @bash auto/generate_header.sh ${SRS_OBJS}" >> ${FILE} 40 +echo -n " @bash auto/generate_header.sh ${SRS_OBJS_DIR}" >> ${FILE}
40 echo "" >> ${FILE} 41 echo "" >> ${FILE}
41 42
42 # archive librtmp.a 43 # archive librtmp.a
@@ -49,14 +50,14 @@ for item in ${MODULE_OBJS[*]}; do @@ -49,14 +50,14 @@ for item in ${MODULE_OBJS[*]}; do
49 continue; 50 continue;
50 fi 51 fi
51 52
52 - OBJ_FILE=${SRS_OBJS}/$item 53 + OBJ_FILE=${SRS_OBJS_DIR}/$item
53 OBJ_FILE="${OBJ_FILE%.*}.o" 54 OBJ_FILE="${OBJ_FILE%.*}.o"
54 echo -n "${OBJ_FILE} " >> ${FILE} 55 echo -n "${OBJ_FILE} " >> ${FILE}
55 done 56 done
56 echo "" >> ${FILE} 57 echo "" >> ${FILE}
57 58
58 # parent Makefile, to create module output dir before compile it. 59 # parent Makefile, to create module output dir before compile it.
59 -echo " mkdir -p ${SRS_OBJS}/include" >> ${SRS_MAKEFILE}  
60 -echo " mkdir -p ${SRS_OBJS}/lib" >> ${SRS_MAKEFILE} 60 +echo " mkdir -p ${SRS_OBJS_DIR}/include" >> ${SRS_MAKEFILE}
  61 +echo " mkdir -p ${SRS_OBJS_DIR}/lib" >> ${SRS_MAKEFILE}
61 62
62 echo -n "generate lib ${LIB_NAME} ok"; echo '!'; 63 echo -n "generate lib ${LIB_NAME} ok"; echo '!';
1 # generate the module info to Makefile 1 # generate the module info to Makefile
2 # 2 #
3 # params: 3 # params:
4 -# $SRS_OBJS the objs directory. ie. objs 4 +# $SRS_OBJS the objs directory to store the Makefile. ie. ./objs
  5 +# $SRS_OBJS_DIR the objs directory for Makefile. ie. objs
5 # $SRS_MAKEFILE the makefile name. ie. Makefile 6 # $SRS_MAKEFILE the makefile name. ie. Makefile
6 # 7 #
7 # $MODULE_DIR the module dir. ie. src/os/linux 8 # $MODULE_DIR the module dir. ie. src/os/linux
@@ -73,7 +74,7 @@ echo "# OBJ for ${MODULE_ID}, each object file" >> ${FILE} @@ -73,7 +74,7 @@ echo "# OBJ for ${MODULE_ID}, each object file" >> ${FILE}
73 MODULE_OBJS=() 74 MODULE_OBJS=()
74 for item in ${MODULE_FILES[*]}; do 75 for item in ${MODULE_FILES[*]}; do
75 CPP_FILE="${MODULE_DIR}/${item}.cpp" 76 CPP_FILE="${MODULE_DIR}/${item}.cpp"
76 - OBJ_FILE="${SRS_OBJS}/${MODULE_DIR}/${item}.o" 77 + OBJ_FILE="${SRS_OBJS_DIR}/${MODULE_DIR}/${item}.o"
77 MODULE_OBJS="${MODULE_OBJS[@]} ${CPP_FILE}" 78 MODULE_OBJS="${MODULE_OBJS[@]} ${CPP_FILE}"
78 if [ -f ${CPP_FILE} ]; then 79 if [ -f ${CPP_FILE} ]; then
79 echo "${OBJ_FILE}: \$(${DEPS_NAME}) ${CPP_FILE} " >> ${FILE} 80 echo "${OBJ_FILE}: \$(${DEPS_NAME}) ${CPP_FILE} " >> ${FILE}
@@ -84,6 +85,6 @@ done @@ -84,6 +85,6 @@ done
84 echo "" >> ${FILE} 85 echo "" >> ${FILE}
85 86
86 # parent Makefile, to create module output dir before compile it. 87 # parent Makefile, to create module output dir before compile it.
87 -echo " mkdir -p ${SRS_OBJS}/${MODULE_DIR}" >> ${SRS_MAKEFILE} 88 +echo " mkdir -p ${SRS_OBJS_DIR}/${MODULE_DIR}" >> ${SRS_MAKEFILE}
88 89
89 echo -n "generate module ${MODULE_ID} ok"; echo '!'; 90 echo -n "generate module ${MODULE_ID} ok"; echo '!';
@@ -58,6 +58,8 @@ SRS_LOG_TRACE=RESERVED @@ -58,6 +58,8 @@ SRS_LOG_TRACE=RESERVED
58 # experts 58 # experts
59 # donot compile ssl, use system ssl(-lssl) if required. 59 # donot compile ssl, use system ssl(-lssl) if required.
60 SRS_USE_SYS_SSL=NO 60 SRS_USE_SYS_SSL=NO
  61 +# export the srs-librtmp to specified path, NO to disable it.
  62 +SRS_EXPORT_LIBRTMP=NO
61 # 63 #
62 ################################################################ 64 ################################################################
63 # presets 65 # presets
@@ -182,6 +184,7 @@ Conflicts: @@ -182,6 +184,7 @@ Conflicts:
182 184
183 Experts: 185 Experts:
184 --use-sys-ssl donot compile ssl, use system ssl(-lssl) if required. 186 --use-sys-ssl donot compile ssl, use system ssl(-lssl) if required.
  187 + --export-librtmp=<path> export srs-librtmp to specified path.
185 188
186 Workflow: 189 Workflow:
187 1. apply "Presets". if not specified, use default preset. 190 1. apply "Presets". if not specified, use default preset.
@@ -263,6 +266,7 @@ function parse_user_option() { @@ -263,6 +266,7 @@ function parse_user_option() {
263 --full) SRS_ENABLE_ALL=YES ;; 266 --full) SRS_ENABLE_ALL=YES ;;
264 267
265 --use-sys-ssl) SRS_USE_SYS_SSL=YES ;; 268 --use-sys-ssl) SRS_USE_SYS_SSL=YES ;;
  269 + --export-librtmp) SRS_EXPORT_LIBRTMP=${value} ;;
266 270
267 *) 271 *)
268 echo "$0: error: invalid option \"$option\"" 272 echo "$0: error: invalid option \"$option\""
@@ -696,6 +700,31 @@ function apply_user_detail_options() { @@ -696,6 +700,31 @@ function apply_user_detail_options() {
696 else 700 else
697 export SRS_JOBS="--jobs=${SRS_JOBS}" 701 export SRS_JOBS="--jobs=${SRS_JOBS}"
698 fi 702 fi
  703 +
  704 + # disable almost all features for export srs-librtmp.
  705 + if [ $SRS_EXPORT_LIBRTMP != NO ]; then
  706 + SRS_HLS=NO
  707 + SRS_DVR=NO
  708 + SRS_NGINX=NO
  709 + SRS_SSL=NO
  710 + SRS_FFMPEG_TOOL=NO
  711 + SRS_TRANSCODE=NO
  712 + SRS_INGEST=NO
  713 + SRS_STAT=NO
  714 + SRS_HTTP_PARSER=NO
  715 + SRS_HTTP_CALLBACK=NO
  716 + SRS_HTTP_SERVER=NO
  717 + SRS_HTTP_API=NO
  718 + SRS_LIBRTMP=YES
  719 + SRS_RESEARCH=YES
  720 + SRS_UTEST=NO
  721 + SRS_GPERF=NO
  722 + SRS_GPERF_MC=NO
  723 + SRS_GPERF_MP=NO
  724 + SRS_GPERF_CP=NO
  725 + SRS_GPROF=NO
  726 + SRS_STATIC=NO
  727 + fi
699 } 728 }
700 apply_user_detail_options 729 apply_user_detail_options
701 730
  1 +#!/bin/bash
  2 +
  3 +# colorful summary
  4 +SrsHlsSummaryColor="\${YELLOW}{disabled} "; if [ $SRS_HLS = YES ]; then SrsHlsSummaryColor="\${GREEN}"; fi
  5 +SrsDvrSummaryColor="\${YELLOW}{disabled} "; if [ $SRS_DVR = YES ]; then SrsDvrSummaryColor="\${GREEN}"; fi
  6 +SrsNginxSummaryColor="\${GREEN}{disabled} "; if [ $SRS_NGINX = YES ]; then SrsNginxSummaryColor="\${GREEN}"; fi
  7 +SrsSslSummaryColor="\${YELLOW}{disabled} "; if [ $SRS_SSL = YES ]; then SrsSslSummaryColor="\${GREEN}"; fi
  8 +SrsFfmpegSummaryColor="\${YELLOW}{disabled} "; if [ $SRS_FFMPEG_TOOL = YES ]; then SrsFfmpegSummaryColor="\${GREEN}"; fi
  9 +SrsTranscodeSummaryColor="\${YELLOW}{disabled} "; if [ $SRS_TRANSCODE = YES ]; then SrsTranscodeSummaryColor="\${GREEN}"; fi
  10 +SrsIngestSummaryColor="\${YELLOW}{disabled} "; if [ $SRS_INGEST = YES ]; then SrsIngestSummaryColor="\${GREEN}"; fi
  11 +SrsHttpCallbackSummaryColor="\${YELLOW}{disabled} "; if [ $SRS_HTTP_CALLBACK = YES ]; then SrsHttpCallbackSummaryColor="\${GREEN}"; fi
  12 +SrsHttpServerSummaryColor="\${YELLOW}{disabled} "; if [ $SRS_HTTP_SERVER = YES ]; then SrsHttpServerSummaryColor="\${GREEN}"; fi
  13 +SrsHttpApiSummaryColor="\${YELLOW}{disabled} "; if [ $SRS_HTTP_API = YES ]; then SrsHttpApiSummaryColor="\${GREEN}"; fi
  14 +SrsLibrtmpSummaryColor="\${YELLOW}{disabled} "; if [ $SRS_LIBRTMP = YES ]; then SrsLibrtmpSummaryColor="\${GREEN}"; fi
  15 +SrsLibrtmpSSLSummaryColor="\${YELLOW}{disabled} "; if [ $SRS_LIBRTMP = YES ]; then if [ $SRS_SSL = YES ]; then SrsLibrtmpSSLSummaryColor="\${GREEN}"; fi fi
  16 +SrsResearchSummaryColor="\${GREEN}{disabled} "; if [ $SRS_RESEARCH = YES ]; then SrsResearchSummaryColor="\${GREEN}"; fi
  17 +SrsUtestSummaryColor="\${YELLOW}{disabled} "; if [ $SRS_UTEST = YES ]; then SrsUtestSummaryColor="\${GREEN}"; fi
  18 +SrsGperfSummaryColor="\${GREEN}{disabled} "; if [ $SRS_GPERF = YES ]; then SrsGperfSummaryColor="\${GREEN}"; fi
  19 +SrsGperfMCSummaryColor="\${GREEN}{disabled} "; if [ $SRS_GPERF_MC = YES ]; then SrsGperfMCSummaryColor="\${YELLOW}"; fi
  20 +SrsGperfMPSummaryColor="\${GREEN}{disabled} "; if [ $SRS_GPERF_MP = YES ]; then SrsGperfMPSummaryColor="\${YELLOW}"; fi
  21 +SrsGperfCPSummaryColor="\${GREEN}{disabled} "; if [ $SRS_GPERF_CP = YES ]; then SrsGperfCPSummaryColor="\${YELLOW}"; fi
  22 +SrsGprofSummaryColor="\${GREEN}{disabled} "; if [ $SRS_GPROF = YES ]; then SrsGprofSummaryColor="\${YELLOW}"; fi
  23 +cat <<END > ${SRS_OBJS}/${SRS_BUILD_SUMMARY}
  24 +#!/bin/bash
  25 +
  26 +#####################################################################################
  27 +# linux shell color support.
  28 +RED="\\${RED}"
  29 +GREEN="\\${GREEN}"
  30 +YELLOW="\\${YELLOW}"
  31 +BLACK="\\${BLACK}"
  32 +
  33 +echo -e "\${GREEN}build summary:\${BLACK}"
  34 +echo -e " \${BLACK}+------------------------------------------------------------------------------------\${BLACK}"
  35 +echo -e " |${SrsGperfSummaryColor}gperf @see: https://github.com/winlinvip/simple-rtmp-server/wiki/v1_CN_GPERF\${BLACK}"
  36 +echo -e " | ${SrsGperfMCSummaryColor}gmc @see: http://google-perftools.googlecode.com/svn/trunk/doc/heap_checker.html\${BLACK}"
  37 +echo -e " | ${SrsGperfMCSummaryColor}gmc: gperf memory check\${BLACK}"
  38 +echo -e " | ${SrsGperfMCSummaryColor}env PPROF_PATH=./objs/pprof HEAPCHECK=normal ./objs/srs -c conf/console.conf # start gmc\${BLACK}"
  39 +echo -e " | ${SrsGperfMCSummaryColor}killall -2 srs # or CTRL+C to stop gmc\${BLACK}"
  40 +echo -e " | ${SrsGperfMPSummaryColor}gmp @see: http://google-perftools.googlecode.com/svn/trunk/doc/heapprofile.html\${BLACK}"
  41 +echo -e " | ${SrsGperfMPSummaryColor}gmp: gperf memory profile\${BLACK}"
  42 +echo -e " | ${SrsGperfMPSummaryColor}rm -f gperf.srs.gmp*; ./objs/srs -c conf/console.conf # start gmp\${BLACK}"
  43 +echo -e " | ${SrsGperfMPSummaryColor}killall -2 srs # or CTRL+C to stop gmp\${BLACK}"
  44 +echo -e " | ${SrsGperfMPSummaryColor}./objs/pprof --text objs/srs gperf.srs.gmp* # to analysis memory profile\${BLACK}"
  45 +echo -e " | ${SrsGperfCPSummaryColor}gcp @see: http://google-perftools.googlecode.com/svn/trunk/doc/cpuprofile.html\${BLACK}"
  46 +echo -e " | ${SrsGperfCPSummaryColor}gcp: gperf cpu profile\${BLACK}"
  47 +echo -e " | ${SrsGperfCPSummaryColor}rm -f gperf.srs.gcp*; ./objs/srs -c conf/console.conf # start gcp\${BLACK}"
  48 +echo -e " | ${SrsGperfCPSummaryColor}killall -2 srs # or CTRL+C to stop gcp\${BLACK}"
  49 +echo -e " | ${SrsGperfCPSummaryColor}./objs/pprof --text objs/srs gperf.srs.gcp* # to analysis cpu profile\${BLACK}"
  50 +echo -e " \${BLACK}+------------------------------------------------------------------------------------\${BLACK}"
  51 +echo -e " |${SrsGprofSummaryColor}gprof @see: https://github.com/winlinvip/simple-rtmp-server/wiki/v1_CN_GPROF\${BLACK}"
  52 +echo -e " |${SrsGprofSummaryColor}gprof: GNU profile tool, @see: http://www.cs.utah.edu/dept/old/texinfo/as/gprof.html\${BLACK}"
  53 +echo -e " | ${SrsGprofSummaryColor}rm -f gmon.out; ./objs/srs -c conf/console.conf # start gprof\${BLACK}"
  54 +echo -e " | ${SrsGprofSummaryColor}killall -2 srs # or CTRL+C to stop gprof\${BLACK}"
  55 +echo -e " | ${SrsGprofSummaryColor}gprof -b ./objs/srs gmon.out > gprof.srs.log && rm -f gmon.out # gprof report to gprof.srs.log\${BLACK}"
  56 +echo -e " \${BLACK}+------------------------------------------------------------------------------------\${BLACK}"
  57 +echo -e " |${SrsResearchSummaryColor}research: ./objs/research, api server, players, ts info, librtmp.\${BLACK}"
  58 +echo -e " \${BLACK}+------------------------------------------------------------------------------------\${BLACK}"
  59 +echo -e " |${SrsUtestSummaryColor}utest: ./objs/srs_utest, the utest for srs\${BLACK}"
  60 +echo -e " \${BLACK}+------------------------------------------------------------------------------------\${BLACK}"
  61 +echo -e " |${SrsLibrtmpSummaryColor}librtmp @see: https://github.com/winlinvip/simple-rtmp-server/wiki/v1_CN_SrsLibrtmp\${BLACK}"
  62 +echo -e " |${SrsLibrtmpSummaryColor}librtmp: ./objs/include, ./objs/lib, the srs-librtmp library\${BLACK}"
  63 +echo -e " | ${SrsLibrtmpSummaryColor}simple handshake: publish/play stream with simple handshake to server\${BLACK}"
  64 +echo -e " | ${SrsLibrtmpSSLSummaryColor}complex handshake: it's not required for client, recommend disable it\${BLACK}"
  65 +echo -e " | ${SrsLibrtmpSummaryColor}librtmp-sample: ./research/librtmp, the srs-librtmp client sample\${BLACK}"
  66 +echo -e " | ${SrsLibrtmpSummaryColor}librtmp-sample: ./research/librtmp/objs/srs_ingest_flv\${BLACK}"
  67 +echo -e " | ${SrsLibrtmpSummaryColor}librtmp-sample: ./research/librtmp/objs/srs_ingest_rtmp\${BLACK}"
  68 +echo -e " | ${SrsLibrtmpSummaryColor}librtmp-sample: ./research/librtmp/objs/srs_detect_rtmp\${BLACK}"
  69 +echo -e " | ${SrsLibrtmpSummaryColor}librtmp-sample: ./research/librtmp/objs/srs_bandwidth_check\${BLACK}"
  70 +echo -e " \${BLACK}+------------------------------------------------------------------------------------\${BLACK}"
  71 +echo -e " |\${GREEN}server: ./objs/srs -c conf/srs.conf, start the srs server\${BLACK}"
  72 +echo -e " | ${SrsHlsSummaryColor}hls @see: https://github.com/winlinvip/simple-rtmp-server/wiki/v1_CN_DeliveryHLS\${BLACK}"
  73 +echo -e " | ${SrsHlsSummaryColor}hls: generate m3u8 and ts from rtmp stream\${BLACK}"
  74 +echo -e " | ${SrsDvrSummaryColor}dvr @see: https://github.com/winlinvip/simple-rtmp-server/wiki/v1_CN_DVR\${BLACK}"
  75 +echo -e " | ${SrsDvrSummaryColor}dvr: record RTMP stream to flv files.\${BLACK}"
  76 +echo -e " | ${SrsNginxSummaryColor}nginx @see: https://github.com/winlinvip/simple-rtmp-server/wiki/v1_CN_DeliveryHLS\${BLACK}"
  77 +echo -e " | ${SrsNginxSummaryColor}nginx: delivery HLS stream by nginx\${BLACK}"
  78 +echo -e " | ${SrsNginxSummaryColor}nginx: sudo ./objs/nginx/sbin/nginx\${BLACK}"
  79 +echo -e " | ${SrsSslSummaryColor}ssl @see: https://github.com/winlinvip/simple-rtmp-server/wiki/v1_CN_RTMPHandshake\${BLACK}"
  80 +echo -e " | ${SrsSslSummaryColor}ssl: support RTMP complex handshake for client required, for instance, flash\${BLACK}"
  81 +echo -e " | ${SrsFfmpegSummaryColor}ffmpeg @see: https://github.com/winlinvip/simple-rtmp-server/wiki/v1_CN_FFMPEG\${BLACK}"
  82 +echo -e " | ${SrsFfmpegSummaryColor}ffmpeg: transcode, mux, ingest tool\${BLACK}"
  83 +echo -e " | ${SrsFfmpegSummaryColor}ffmpeg: ./objs/ffmpeg/bin/ffmpeg\${BLACK}"
  84 +echo -e " | ${SrsTranscodeSummaryColor}transcode @see: https://github.com/winlinvip/simple-rtmp-server/wiki/v1_CN_FFMPEG\${BLACK}"
  85 +echo -e " | ${SrsTranscodeSummaryColor}transcode: support transcoding RTMP stream\${BLACK}"
  86 +echo -e " | ${SrsIngestSummaryColor}ingest @see: https://github.com/winlinvip/simple-rtmp-server/wiki/v1_CN_Ingest\${BLACK}"
  87 +echo -e " | ${SrsIngestSummaryColor}ingest: support ingest file/stream/device then push to SRS by RTMP stream\${BLACK}"
  88 +echo -e " | ${SrsHttpCallbackSummaryColor}http-callback @see: https://github.com/winlinvip/simple-rtmp-server/wiki/v1_CN_HTTPCallback\${BLACK}"
  89 +echo -e " | ${SrsHttpCallbackSummaryColor}http-callback: support http callback for authentication and event injection\${BLACK}"
  90 +echo -e " | ${SrsHttpServerSummaryColor}http-server @see: https://github.com/winlinvip/simple-rtmp-server/wiki/v1_CN_HTTPServer\${BLACK}"
  91 +echo -e " | ${SrsHttpServerSummaryColor}http-server: support http server to delivery http stream\${BLACK}"
  92 +echo -e " | ${SrsHttpApiSummaryColor}http-api @see: https://github.com/winlinvip/simple-rtmp-server/wiki/v1_CN_HTTPApi\${BLACK}"
  93 +echo -e " | ${SrsHttpApiSummaryColor}http-api: support http api to manage server\${BLACK}"
  94 +echo -e " \${BLACK}+------------------------------------------------------------------------------------\${BLACK}"
  95 +echo -e "\${GREEN}binaries @see: https://github.com/winlinvip/simple-rtmp-server/wiki/v1_CN_Build\${BLACK}"
  96 +
  97 +echo "you can:"
  98 +echo " ./objs/srs -c conf/srs.conf"
  99 +echo " to start the srs server, with config conf/srs.conf."
  100 +END
1 # generate utest Makefile 1 # generate utest Makefile
2 # 2 #
3 # params: 3 # params:
4 -# $SRS_OBJS the objs directory. ie. objs 4 +# $SRS_OBJS the objs directory to store the Makefile. ie. ./objs
  5 +# $SRS_OBJS_DIR the objs directory for Makefile. ie. objs
5 # $SRS_MAKEFILE the makefile name. ie. Makefile 6 # $SRS_MAKEFILE the makefile name. ie. Makefile
6 # 7 #
7 # $APP_NAME the app name to output. ie. srs_utest 8 # $APP_NAME the app name to output. ie. srs_utest
@@ -17,10 +18,10 @@ mkdir -p ${SRS_OBJS}/utest @@ -17,10 +18,10 @@ mkdir -p ${SRS_OBJS}/utest
17 # trunk of srs, which contains the src dir, relative to objs/utest, it's trunk 18 # trunk of srs, which contains the src dir, relative to objs/utest, it's trunk
18 SRS_TRUNK_PREFIX=../.. 19 SRS_TRUNK_PREFIX=../..
19 # gest dir, relative to objs/utest, it's trunk/objs/gtest 20 # gest dir, relative to objs/utest, it's trunk/objs/gtest
20 -GTEST_DIR=${SRS_TRUNK_PREFIX}/${SRS_OBJS}/gtest 21 +GTEST_DIR=${SRS_TRUNK_PREFIX}/${SRS_OBJS_DIR}/gtest
21 22
22 cat << END > ${FILE} 23 cat << END > ${FILE}
23 -# user must run make the ${SRS_OBJS}/utest dir 24 +# user must run make the ${SRS_OBJS_DIR}/utest dir
24 # at the same dir of Makefile. 25 # at the same dir of Makefile.
25 26
26 # A sample Makefile for building Google Test and using it in user 27 # A sample Makefile for building Google Test and using it in user
@@ -52,7 +53,7 @@ CXXFLAGS += -g -Wall -Wextra -O0 @@ -52,7 +53,7 @@ CXXFLAGS += -g -Wall -Wextra -O0
52 53
53 # All tests produced by this Makefile. Remember to add new tests you 54 # All tests produced by this Makefile. Remember to add new tests you
54 # created to the list. 55 # created to the list.
55 -TESTS = ${SRS_TRUNK_PREFIX}/${SRS_OBJS}/${APP_NAME} 56 +TESTS = ${SRS_TRUNK_PREFIX}/${SRS_OBJS_DIR}/${APP_NAME}
56 57
57 # All Google Test headers. Usually you shouldn't change this 58 # All Google Test headers. Usually you shouldn't change this
58 # definition. 59 # definition.
@@ -129,7 +130,7 @@ echo "# Depends, the depends objects" >> ${FILE} @@ -129,7 +130,7 @@ echo "# Depends, the depends objects" >> ${FILE}
129 echo -n "SRS_UTEST_DEPS = " >> ${FILE} 130 echo -n "SRS_UTEST_DEPS = " >> ${FILE}
130 for item in ${MODULE_OBJS[*]}; do 131 for item in ${MODULE_OBJS[*]}; do
131 FILE_NAME=${item%.*} 132 FILE_NAME=${item%.*}
132 - echo -n "${SRS_TRUNK_PREFIX}/${SRS_OBJS}/${FILE_NAME}.o " >> ${FILE} 133 + echo -n "${SRS_TRUNK_PREFIX}/${SRS_OBJS_DIR}/${FILE_NAME}.o " >> ${FILE}
133 done 134 done
134 echo "" >> ${FILE}; echo "" >> ${FILE} 135 echo "" >> ${FILE}; echo "" >> ${FILE}
135 # 136 #
@@ -169,12 +170,12 @@ echo "" >> ${FILE}; echo "" >> ${FILE} @@ -169,12 +170,12 @@ echo "" >> ${FILE}; echo "" >> ${FILE}
169 # 170 #
170 echo "# generate the utest binary" >> ${FILE} 171 echo "# generate the utest binary" >> ${FILE}
171 cat << END >> ${FILE} 172 cat << END >> ${FILE}
172 -${SRS_TRUNK_PREFIX}/${SRS_OBJS}/${APP_NAME} : \$(SRS_UTEST_DEPS) ${MODULE_OBJS} gtest_main.a 173 +${SRS_TRUNK_PREFIX}/${SRS_OBJS_DIR}/${APP_NAME} : \$(SRS_UTEST_DEPS) ${MODULE_OBJS} gtest_main.a
173 \$(CXX) -o \$@ \$(CPPFLAGS) \$(CXXFLAGS) \$^ \$(DEPS_LIBRARIES_FILES) ${LINK_OPTIONS} 174 \$(CXX) -o \$@ \$(CPPFLAGS) \$(CXXFLAGS) \$^ \$(DEPS_LIBRARIES_FILES) ${LINK_OPTIONS}
174 END 175 END
175 176
176 ##################################################################################### 177 #####################################################################################
177 # parent Makefile, to create module output dir before compile it. 178 # parent Makefile, to create module output dir before compile it.
178 -echo " mkdir -p ${SRS_OBJS}/utest" >> ${SRS_MAKEFILE} 179 +echo " mkdir -p ${SRS_OBJS_DIR}/utest" >> ${SRS_MAKEFILE}
179 180
180 echo -n "generate utest ok"; echo '!'; 181 echo -n "generate utest ok"; echo '!';
@@ -4,7 +4,9 @@ @@ -4,7 +4,9 @@
4 # the main output dir, all configure and make output are in this dir. 4 # the main output dir, all configure and make output are in this dir.
5 ##################################################################################### 5 #####################################################################################
6 # create the main objs 6 # create the main objs
7 -SRS_OBJS="objs" 7 +SRS_WORKDIR="."
  8 +SRS_OBJS_DIR="objs"
  9 +SRS_OBJS="${SRS_WORKDIR}/${SRS_OBJS_DIR}"
8 mkdir -p ${SRS_OBJS} 10 mkdir -p ${SRS_OBJS}
9 11
10 ##################################################################################### 12 #####################################################################################
@@ -19,14 +21,35 @@ BLACK="\\e[0m" @@ -19,14 +21,35 @@ BLACK="\\e[0m"
19 # srs features: SRS_SSL/SRS_HLS/SRS_NGINX/SRS_FFMPEG_TOOL/SRS_HTTP_CALLBACK/...... 21 # srs features: SRS_SSL/SRS_HLS/SRS_NGINX/SRS_FFMPEG_TOOL/SRS_HTTP_CALLBACK/......
20 # build options: SRS_JOBS 22 # build options: SRS_JOBS
21 ##################################################################################### 23 #####################################################################################
22 -SRS_AUTO_HEADERS_H="${SRS_OBJS}/srs_auto_headers.hpp"  
23 # parse options, exit with error when parse options invalid. 24 # parse options, exit with error when parse options invalid.
24 . auto/options.sh 25 . auto/options.sh
25 26
26 -# clean the exists 27 +# for export srs-librtmp, change target to it.
  28 +if [ $SRS_EXPORT_LIBRTMP != NO ]; then
  29 + if [[ -d ${SRS_EXPORT_LIBRTMP} ]]; then
  30 + echo -e "${RED}srs-librtmp target dir exists: ${SRS_EXPORT_LIBRTMP}. ${BLACK}"
  31 + exit 1
  32 + fi
  33 + # create target
  34 + SRS_WORKDIR=${SRS_EXPORT_LIBRTMP} && SRS_OBJS=${SRS_WORKDIR}/${SRS_OBJS_DIR} && mkdir -p ${SRS_OBJS} &&
  35 + # copy src to target
  36 + _CPT=${SRS_EXPORT_LIBRTMP}/3rdparty && mkdir -p ${_CPT} && cp 3rdparty/st-1.9.zip ${_CPT} &&
  37 + _CPT=${SRS_EXPORT_LIBRTMP}/3rdparty/patches && mkdir -p ${_CPT} && cp 3rdparty/patches/1.st.arm.patch ${_CPT} &&
  38 + _CPT=${SRS_EXPORT_LIBRTMP}/research/librtmp && mkdir -p ${_CPT} && cp research/librtmp/*.c ${_CPT} && cp research/librtmp/Makefile ${_CPT} &&
  39 + _CPT=${SRS_EXPORT_LIBRTMP}/src/core && mkdir -p ${_CPT} && cp src/core/* ${_CPT}
  40 + # check ret
  41 + ret=$?; if [[ $ret -ne 0 ]]; then echo "export src failed, ret=$ret"; exit $ret; fi
  42 +fi
  43 +
  44 +# the auto generated variables.
  45 +SRS_AUTO_HEADERS_H="${SRS_OBJS}/srs_auto_headers.hpp"
  46 +
  47 +# clean the exists, when not export srs-librtmp.
27 # do this only when the options is ok. 48 # do this only when the options is ok.
28 -if [[ -f Makefile ]]; then  
29 - make clean 49 +if [ $SRS_EXPORT_LIBRTMP = NO ]; then
  50 + if [[ -f Makefile ]]; then
  51 + make clean
  52 + fi
30 fi 53 fi
31 54
32 # write user options to headers 55 # write user options to headers
@@ -99,112 +122,16 @@ SrsLibrtmpSampleEntry="nossl" @@ -99,112 +122,16 @@ SrsLibrtmpSampleEntry="nossl"
99 if [ $SRS_SSL = YES ]; then SrsLibrtmpSampleEntry="ssl";fi 122 if [ $SRS_SSL = YES ]; then SrsLibrtmpSampleEntry="ssl";fi
100 # utest make entry, (cd utest; make) 123 # utest make entry, (cd utest; make)
101 SrsUtestMakeEntry="@echo -e \"ignore utest for it's disabled\"" 124 SrsUtestMakeEntry="@echo -e \"ignore utest for it's disabled\""
102 -if [ $SRS_UTEST = YES ]; then SrsUtestMakeEntry="(cd ${SRS_OBJS}/utest; \$(MAKE))"; fi 125 +if [ $SRS_UTEST = YES ]; then SrsUtestMakeEntry="(cd ${SRS_OBJS_DIR}/utest; \$(MAKE))"; fi
103 126
104 ##################################################################################### 127 #####################################################################################
105 -# colorful summary  
106 -SrsHlsSummaryColor="\${YELLOW}{disabled} "; if [ $SRS_HLS = YES ]; then SrsHlsSummaryColor="\${GREEN}"; fi  
107 -SrsDvrSummaryColor="\${YELLOW}{disabled} "; if [ $SRS_DVR = YES ]; then SrsDvrSummaryColor="\${GREEN}"; fi  
108 -SrsNginxSummaryColor="\${GREEN}{disabled} "; if [ $SRS_NGINX = YES ]; then SrsNginxSummaryColor="\${GREEN}"; fi  
109 -SrsSslSummaryColor="\${YELLOW}{disabled} "; if [ $SRS_SSL = YES ]; then SrsSslSummaryColor="\${GREEN}"; fi  
110 -SrsFfmpegSummaryColor="\${YELLOW}{disabled} "; if [ $SRS_FFMPEG_TOOL = YES ]; then SrsFfmpegSummaryColor="\${GREEN}"; fi  
111 -SrsTranscodeSummaryColor="\${YELLOW}{disabled} "; if [ $SRS_TRANSCODE = YES ]; then SrsTranscodeSummaryColor="\${GREEN}"; fi  
112 -SrsIngestSummaryColor="\${YELLOW}{disabled} "; if [ $SRS_INGEST = YES ]; then SrsIngestSummaryColor="\${GREEN}"; fi  
113 -SrsHttpCallbackSummaryColor="\${YELLOW}{disabled} "; if [ $SRS_HTTP_CALLBACK = YES ]; then SrsHttpCallbackSummaryColor="\${GREEN}"; fi  
114 -SrsHttpServerSummaryColor="\${YELLOW}{disabled} "; if [ $SRS_HTTP_SERVER = YES ]; then SrsHttpServerSummaryColor="\${GREEN}"; fi  
115 -SrsHttpApiSummaryColor="\${YELLOW}{disabled} "; if [ $SRS_HTTP_API = YES ]; then SrsHttpApiSummaryColor="\${GREEN}"; fi  
116 -SrsLibrtmpSummaryColor="\${YELLOW}{disabled} "; if [ $SRS_LIBRTMP = YES ]; then SrsLibrtmpSummaryColor="\${GREEN}"; fi  
117 -SrsLibrtmpSSLSummaryColor="\${YELLOW}{disabled} "; if [ $SRS_LIBRTMP = YES ]; then if [ $SRS_SSL = YES ]; then SrsLibrtmpSSLSummaryColor="\${GREEN}"; fi fi  
118 -SrsResearchSummaryColor="\${GREEN}{disabled} "; if [ $SRS_RESEARCH = YES ]; then SrsResearchSummaryColor="\${GREEN}"; fi  
119 -SrsUtestSummaryColor="\${YELLOW}{disabled} "; if [ $SRS_UTEST = YES ]; then SrsUtestSummaryColor="\${GREEN}"; fi  
120 -SrsGperfSummaryColor="\${GREEN}{disabled} "; if [ $SRS_GPERF = YES ]; then SrsGperfSummaryColor="\${GREEN}"; fi  
121 -SrsGperfMCSummaryColor="\${GREEN}{disabled} "; if [ $SRS_GPERF_MC = YES ]; then SrsGperfMCSummaryColor="\${YELLOW}"; fi  
122 -SrsGperfMPSummaryColor="\${GREEN}{disabled} "; if [ $SRS_GPERF_MP = YES ]; then SrsGperfMPSummaryColor="\${YELLOW}"; fi  
123 -SrsGperfCPSummaryColor="\${GREEN}{disabled} "; if [ $SRS_GPERF_CP = YES ]; then SrsGperfCPSummaryColor="\${YELLOW}"; fi  
124 -SrsGprofSummaryColor="\${GREEN}{disabled} "; if [ $SRS_GPROF = YES ]; then SrsGprofSummaryColor="\${YELLOW}"; fi  
125 -cat <<END > ${SRS_OBJS}/${SRS_BUILD_SUMMARY}  
126 -#!/bin/bash  
127 -  
128 -#####################################################################################  
129 -# linux shell color support.  
130 -RED="\\${RED}"  
131 -GREEN="\\${GREEN}"  
132 -YELLOW="\\${YELLOW}"  
133 -BLACK="\\${BLACK}"  
134 -  
135 -echo -e "\${GREEN}build summary:\${BLACK}"  
136 -echo -e " \${BLACK}+------------------------------------------------------------------------------------\${BLACK}"  
137 -echo -e " |${SrsGperfSummaryColor}gperf @see: https://github.com/winlinvip/simple-rtmp-server/wiki/v1_CN_GPERF\${BLACK}"  
138 -echo -e " | ${SrsGperfMCSummaryColor}gmc @see: http://google-perftools.googlecode.com/svn/trunk/doc/heap_checker.html\${BLACK}"  
139 -echo -e " | ${SrsGperfMCSummaryColor}gmc: gperf memory check\${BLACK}"  
140 -echo -e " | ${SrsGperfMCSummaryColor}env PPROF_PATH=./objs/pprof HEAPCHECK=normal ./objs/srs -c conf/console.conf # start gmc\${BLACK}"  
141 -echo -e " | ${SrsGperfMCSummaryColor}killall -2 srs # or CTRL+C to stop gmc\${BLACK}"  
142 -echo -e " | ${SrsGperfMPSummaryColor}gmp @see: http://google-perftools.googlecode.com/svn/trunk/doc/heapprofile.html\${BLACK}"  
143 -echo -e " | ${SrsGperfMPSummaryColor}gmp: gperf memory profile\${BLACK}"  
144 -echo -e " | ${SrsGperfMPSummaryColor}rm -f gperf.srs.gmp*; ./objs/srs -c conf/console.conf # start gmp\${BLACK}"  
145 -echo -e " | ${SrsGperfMPSummaryColor}killall -2 srs # or CTRL+C to stop gmp\${BLACK}"  
146 -echo -e " | ${SrsGperfMPSummaryColor}./objs/pprof --text objs/srs gperf.srs.gmp* # to analysis memory profile\${BLACK}"  
147 -echo -e " | ${SrsGperfCPSummaryColor}gcp @see: http://google-perftools.googlecode.com/svn/trunk/doc/cpuprofile.html\${BLACK}"  
148 -echo -e " | ${SrsGperfCPSummaryColor}gcp: gperf cpu profile\${BLACK}"  
149 -echo -e " | ${SrsGperfCPSummaryColor}rm -f gperf.srs.gcp*; ./objs/srs -c conf/console.conf # start gcp\${BLACK}"  
150 -echo -e " | ${SrsGperfCPSummaryColor}killall -2 srs # or CTRL+C to stop gcp\${BLACK}"  
151 -echo -e " | ${SrsGperfCPSummaryColor}./objs/pprof --text objs/srs gperf.srs.gcp* # to analysis cpu profile\${BLACK}"  
152 -echo -e " \${BLACK}+------------------------------------------------------------------------------------\${BLACK}"  
153 -echo -e " |${SrsGprofSummaryColor}gprof @see: https://github.com/winlinvip/simple-rtmp-server/wiki/v1_CN_GPROF\${BLACK}"  
154 -echo -e " |${SrsGprofSummaryColor}gprof: GNU profile tool, @see: http://www.cs.utah.edu/dept/old/texinfo/as/gprof.html\${BLACK}"  
155 -echo -e " | ${SrsGprofSummaryColor}rm -f gmon.out; ./objs/srs -c conf/console.conf # start gprof\${BLACK}"  
156 -echo -e " | ${SrsGprofSummaryColor}killall -2 srs # or CTRL+C to stop gprof\${BLACK}"  
157 -echo -e " | ${SrsGprofSummaryColor}gprof -b ./objs/srs gmon.out > gprof.srs.log && rm -f gmon.out # gprof report to gprof.srs.log\${BLACK}"  
158 -echo -e " \${BLACK}+------------------------------------------------------------------------------------\${BLACK}"  
159 -echo -e " |${SrsResearchSummaryColor}research: ./objs/research, api server, players, ts info, librtmp.\${BLACK}"  
160 -echo -e " \${BLACK}+------------------------------------------------------------------------------------\${BLACK}"  
161 -echo -e " |${SrsUtestSummaryColor}utest: ./objs/srs_utest, the utest for srs\${BLACK}"  
162 -echo -e " \${BLACK}+------------------------------------------------------------------------------------\${BLACK}"  
163 -echo -e " |${SrsLibrtmpSummaryColor}librtmp @see: https://github.com/winlinvip/simple-rtmp-server/wiki/v1_CN_SrsLibrtmp\${BLACK}"  
164 -echo -e " |${SrsLibrtmpSummaryColor}librtmp: ./objs/include, ./objs/lib, the srs-librtmp library\${BLACK}"  
165 -echo -e " | ${SrsLibrtmpSummaryColor}simple handshake: publish/play stream with simple handshake to server\${BLACK}"  
166 -echo -e " | ${SrsLibrtmpSSLSummaryColor}complex handshake: it's not required for client, recommend disable it\${BLACK}"  
167 -echo -e " | ${SrsLibrtmpSummaryColor}librtmp-sample: ./research/librtmp, the srs-librtmp client sample\${BLACK}"  
168 -echo -e " | ${SrsLibrtmpSummaryColor}librtmp-sample: ./research/librtmp/objs/srs_ingest_flv\${BLACK}"  
169 -echo -e " | ${SrsLibrtmpSummaryColor}librtmp-sample: ./research/librtmp/objs/srs_ingest_rtmp\${BLACK}"  
170 -echo -e " | ${SrsLibrtmpSummaryColor}librtmp-sample: ./research/librtmp/objs/srs_detect_rtmp\${BLACK}"  
171 -echo -e " | ${SrsLibrtmpSummaryColor}librtmp-sample: ./research/librtmp/objs/srs_bandwidth_check\${BLACK}"  
172 -echo -e " \${BLACK}+------------------------------------------------------------------------------------\${BLACK}"  
173 -echo -e " |\${GREEN}server: ./objs/srs -c conf/srs.conf, start the srs server\${BLACK}"  
174 -echo -e " | ${SrsHlsSummaryColor}hls @see: https://github.com/winlinvip/simple-rtmp-server/wiki/v1_CN_DeliveryHLS\${BLACK}"  
175 -echo -e " | ${SrsHlsSummaryColor}hls: generate m3u8 and ts from rtmp stream\${BLACK}"  
176 -echo -e " | ${SrsDvrSummaryColor}dvr @see: https://github.com/winlinvip/simple-rtmp-server/wiki/v1_CN_DVR\${BLACK}"  
177 -echo -e " | ${SrsDvrSummaryColor}dvr: record RTMP stream to flv files.\${BLACK}"  
178 -echo -e " | ${SrsNginxSummaryColor}nginx @see: https://github.com/winlinvip/simple-rtmp-server/wiki/v1_CN_DeliveryHLS\${BLACK}"  
179 -echo -e " | ${SrsNginxSummaryColor}nginx: delivery HLS stream by nginx\${BLACK}"  
180 -echo -e " | ${SrsNginxSummaryColor}nginx: sudo ./objs/nginx/sbin/nginx\${BLACK}"  
181 -echo -e " | ${SrsSslSummaryColor}ssl @see: https://github.com/winlinvip/simple-rtmp-server/wiki/v1_CN_RTMPHandshake\${BLACK}"  
182 -echo -e " | ${SrsSslSummaryColor}ssl: support RTMP complex handshake for client required, for instance, flash\${BLACK}"  
183 -echo -e " | ${SrsFfmpegSummaryColor}ffmpeg @see: https://github.com/winlinvip/simple-rtmp-server/wiki/v1_CN_FFMPEG\${BLACK}"  
184 -echo -e " | ${SrsFfmpegSummaryColor}ffmpeg: transcode, mux, ingest tool\${BLACK}"  
185 -echo -e " | ${SrsFfmpegSummaryColor}ffmpeg: ./objs/ffmpeg/bin/ffmpeg\${BLACK}"  
186 -echo -e " | ${SrsTranscodeSummaryColor}transcode @see: https://github.com/winlinvip/simple-rtmp-server/wiki/v1_CN_FFMPEG\${BLACK}"  
187 -echo -e " | ${SrsTranscodeSummaryColor}transcode: support transcoding RTMP stream\${BLACK}"  
188 -echo -e " | ${SrsIngestSummaryColor}ingest @see: https://github.com/winlinvip/simple-rtmp-server/wiki/v1_CN_Ingest\${BLACK}"  
189 -echo -e " | ${SrsIngestSummaryColor}ingest: support ingest file/stream/device then push to SRS by RTMP stream\${BLACK}"  
190 -echo -e " | ${SrsHttpCallbackSummaryColor}http-callback @see: https://github.com/winlinvip/simple-rtmp-server/wiki/v1_CN_HTTPCallback\${BLACK}"  
191 -echo -e " | ${SrsHttpCallbackSummaryColor}http-callback: support http callback for authentication and event injection\${BLACK}"  
192 -echo -e " | ${SrsHttpServerSummaryColor}http-server @see: https://github.com/winlinvip/simple-rtmp-server/wiki/v1_CN_HTTPServer\${BLACK}"  
193 -echo -e " | ${SrsHttpServerSummaryColor}http-server: support http server to delivery http stream\${BLACK}"  
194 -echo -e " | ${SrsHttpApiSummaryColor}http-api @see: https://github.com/winlinvip/simple-rtmp-server/wiki/v1_CN_HTTPApi\${BLACK}"  
195 -echo -e " | ${SrsHttpApiSummaryColor}http-api: support http api to manage server\${BLACK}"  
196 -echo -e " \${BLACK}+------------------------------------------------------------------------------------\${BLACK}"  
197 -echo -e "\${GREEN}binaries @see: https://github.com/winlinvip/simple-rtmp-server/wiki/v1_CN_Build\${BLACK}"  
198 -  
199 -echo "you can:"  
200 -echo " ./objs/srs -c conf/srs.conf"  
201 -echo " to start the srs server, with config conf/srs.conf."  
202 -END 128 +# generate colorful summary script
  129 +. auto/summary.sh
203 130
204 ##################################################################################### 131 #####################################################################################
205 # makefile 132 # makefile
206 echo "generate Makefile" 133 echo "generate Makefile"
207 -cat << END > ${SRS_MAKEFILE} 134 +cat << END > ${SRS_WORKDIR}/${SRS_MAKEFILE}
208 .PHONY: default _default install install-api help clean server librtmp utest _prepare_dir 135 .PHONY: default _default install install-api help clean server librtmp utest _prepare_dir
209 136
210 # install prefix. 137 # install prefix.
@@ -215,22 +142,24 @@ END @@ -215,22 +142,24 @@ END
215 142
216 # embeded, ubuntu12, use embeded tool chain. 143 # embeded, ubuntu12, use embeded tool chain.
217 if [ $SRS_EMBEDED_CPU = YES ]; then 144 if [ $SRS_EMBEDED_CPU = YES ]; then
218 - cat << END >> ${SRS_MAKEFILE} 145 + cat << END >> ${SRS_WORKDIR}/${SRS_MAKEFILE}
219 default: 146 default:
220 \$(MAKE) GCC=${SrsArmGCC} CXX=${SrsArmCXX} AR=${SrsArmAR} LINK=${SrsArmCXX} _default 147 \$(MAKE) GCC=${SrsArmGCC} CXX=${SrsArmCXX} AR=${SrsArmAR} LINK=${SrsArmCXX} _default
221 148
222 END 149 END
223 # x86/x64, use gnu-gcc/g++ tool chain. 150 # x86/x64, use gnu-gcc/g++ tool chain.
224 else 151 else
225 - cat << END >> ${SRS_MAKEFILE} 152 + cat << END >> ${SRS_WORKDIR}/${SRS_MAKEFILE}
226 default: 153 default:
227 \$(MAKE) _default 154 \$(MAKE) _default
228 155
229 END 156 END
230 fi 157 fi
231 158
232 -# the real entry for all platform.  
233 -cat << END >> ${SRS_MAKEFILE} 159 +# the real entry for all platform:
  160 +# the server, librtmp and utest
  161 +# where the bellow will check and disable some entry by only echo.
  162 +cat << END >> ${SRS_WORKDIR}/${SRS_MAKEFILE}
234 _default: server librtmp utest 163 _default: server librtmp utest
235 @bash objs/_srs_build_summary.sh 164 @bash objs/_srs_build_summary.sh
236 165
@@ -246,20 +175,45 @@ help: @@ -246,20 +175,45 @@ help:
246 @echo " uninstall uninstall srs from prefix path" 175 @echo " uninstall uninstall srs from prefix path"
247 176
248 clean: 177 clean:
249 - (cd ${SRS_OBJS}; rm -rf srs srs_utest)  
250 - (cd ${SRS_OBJS}; rm -rf src research include lib)  
251 - (cd ${SRS_OBJS}/utest; rm -rf *.o *.a) 178 + (cd ${SRS_OBJS_DIR}; rm -rf srs srs_utest)
  179 + (cd ${SRS_OBJS_DIR}; rm -rf src research include lib)
  180 + (cd ${SRS_OBJS_DIR}/utest; rm -rf *.o *.a)
252 (cd research/librtmp; make clean) 181 (cd research/librtmp; make clean)
253 (cd research/api-server/static-dir; rm -rf crossdomain.xml forward live players) 182 (cd research/api-server/static-dir; rm -rf crossdomain.xml forward live players)
254 183
  184 +END
  185 +
  186 +# if export librtmp, donot build the srs server.
  187 +if [ $SRS_EXPORT_LIBRTMP != NO ]; then
  188 + cat << END >> ${SRS_WORKDIR}/${SRS_MAKEFILE}
  189 +server: _prepare_dir
  190 + @echo "donot build the srs(simple rtmp server) for srs-librtmp"
  191 +
  192 +END
  193 +else
  194 + cat << END >> ${SRS_WORKDIR}/${SRS_MAKEFILE}
255 server: _prepare_dir 195 server: _prepare_dir
256 @echo "build the srs(simple rtmp server) over st(state-threads)" 196 @echo "build the srs(simple rtmp server) over st(state-threads)"
257 - \$(MAKE) -f ${SRS_OBJS}/${SRS_MAKEFILE} srs 197 + \$(MAKE) -f ${SRS_OBJS_DIR}/${SRS_MAKEFILE} srs
258 198
259 END 199 END
  200 +fi
  201 +
  202 +# disable install entry for srs-librtmp
  203 +if [ $SRS_EXPORT_LIBRTMP != NO ]; then
  204 + cat << END >> ${SRS_WORKDIR}/${SRS_MAKEFILE}
  205 +uninstall:
  206 + @echo "disable uninstall for srs-librtmp"
  207 +
  208 +install-api:
  209 + @echo "disable install-api for srs-librtmp"
260 210
261 -# install entry  
262 -cat << END >> ${SRS_MAKEFILE} 211 +install:
  212 + @echo "disable install for srs-librtmp"
  213 +
  214 +END
  215 +else
  216 + cat << END >> ${SRS_WORKDIR}/${SRS_MAKEFILE}
263 uninstall: 217 uninstall:
264 @echo "rmdir \$(SRS_PREFIX)" 218 @echo "rmdir \$(SRS_PREFIX)"
265 @rm -rf \$(SRS_PREFIX) 219 @rm -rf \$(SRS_PREFIX)
@@ -311,18 +265,20 @@ install: @@ -311,18 +265,20 @@ install:
311 @echo "@see: https://github.com/winlinvip/simple-rtmp-server/wiki/v1_CN_LinuxService" 265 @echo "@see: https://github.com/winlinvip/simple-rtmp-server/wiki/v1_CN_LinuxService"
312 266
313 END 267 END
  268 +fi
314 269
  270 +# generate srs-librtmp entry
315 if [ $SRS_LIBRTMP = YES ]; then 271 if [ $SRS_LIBRTMP = YES ]; then
316 - cat << END >> ${SRS_MAKEFILE} 272 + cat << END >> ${SRS_WORKDIR}/${SRS_MAKEFILE}
317 librtmp: server 273 librtmp: server
318 @echo "build the client publish/play library." 274 @echo "build the client publish/play library."
319 - \$(MAKE) -f ${SRS_OBJS}/${SRS_MAKEFILE} librtmp 275 + \$(MAKE) -f ${SRS_OBJS_DIR}/${SRS_MAKEFILE} librtmp
320 @echo "build the srs-librtmp sample" 276 @echo "build the srs-librtmp sample"
321 (cd research/librtmp; \$(MAKE) ${SrsLibrtmpSampleEntry}) 277 (cd research/librtmp; \$(MAKE) ${SrsLibrtmpSampleEntry})
322 278
323 END 279 END
324 else 280 else
325 - cat << END >> ${SRS_MAKEFILE} 281 + cat << END >> ${SRS_WORKDIR}/${SRS_MAKEFILE}
326 librtmp: server 282 librtmp: server
327 @echo "srs-librtmp is disabled, ignore." 283 @echo "srs-librtmp is disabled, ignore."
328 284
@@ -330,7 +286,7 @@ END @@ -330,7 +286,7 @@ END
330 fi 286 fi
331 287
332 if [ $SRS_UTEST = YES ]; then 288 if [ $SRS_UTEST = YES ]; then
333 - cat << END >> ${SRS_MAKEFILE} 289 + cat << END >> ${SRS_WORKDIR}/${SRS_MAKEFILE}
334 utest: server 290 utest: server
335 @echo "build the utest for srs" 291 @echo "build the utest for srs"
336 ${SrsUtestMakeEntry} 292 ${SrsUtestMakeEntry}
@@ -338,17 +294,17 @@ utest: server @@ -338,17 +294,17 @@ utest: server
338 294
339 END 295 END
340 else 296 else
341 - cat << END >> ${SRS_MAKEFILE} 297 + cat << END >> ${SRS_WORKDIR}/${SRS_MAKEFILE}
342 utest: server 298 utest: server
343 @echo "utest is disabled, ignore" 299 @echo "utest is disabled, ignore"
344 300
345 END 301 END
346 fi 302 fi
347 303
348 -cat << END >> ${SRS_MAKEFILE} 304 +cat << END >> ${SRS_WORKDIR}/${SRS_MAKEFILE}
349 # the ./configure will generate it. 305 # the ./configure will generate it.
350 _prepare_dir: 306 _prepare_dir:
351 - @mkdir -p ${SRS_OBJS} 307 + @mkdir -p ${SRS_OBJS_DIR}
352 END 308 END
353 309
354 ##################################################################################### 310 #####################################################################################
@@ -387,16 +343,16 @@ END @@ -387,16 +343,16 @@ END
387 # library(.a): add to ModuleLibFiles if binary need the specifeid library. for example, LibSTfile 343 # library(.a): add to ModuleLibFiles if binary need the specifeid library. for example, LibSTfile
388 # 344 #
389 # st(state-threads) the basic network library for SRS. 345 # st(state-threads) the basic network library for SRS.
390 -LibSTRoot="${SRS_OBJS}/st"; LibSTfile="${LibSTRoot}/libst.a" 346 +LibSTRoot="${SRS_OBJS_DIR}/st"; LibSTfile="${LibSTRoot}/libst.a"
391 # hp(http-parser) the http request/url parser, for SRS to support HTTP callback. 347 # hp(http-parser) the http request/url parser, for SRS to support HTTP callback.
392 LibHttpParserRoot=""; LibHttpParserfile="" 348 LibHttpParserRoot=""; LibHttpParserfile=""
393 -if [ $SRS_HTTP_PARSER = YES ]; then LibHttpParserRoot="${SRS_OBJS}/hp"; LibHttpParserfile="${LibHttpParserRoot}/libhttp_parser.a"; fi 349 +if [ $SRS_HTTP_PARSER = YES ]; then LibHttpParserRoot="${SRS_OBJS_DIR}/hp"; LibHttpParserfile="${LibHttpParserRoot}/libhttp_parser.a"; fi
394 # openssl-1.0.1f, for the RTMP complex handshake. 350 # openssl-1.0.1f, for the RTMP complex handshake.
395 LibSSLRoot="";LibSSLfile="" 351 LibSSLRoot="";LibSSLfile=""
396 -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 352 +if [ $SRS_SSL = YES ]; then if [ $SRS_USE_SYS_SSL = NO ]; then LibSSLRoot="${SRS_OBJS_DIR}/openssl/include"; LibSSLfile="${SRS_OBJS_DIR}/openssl/lib/libssl.a ${SRS_OBJS_DIR}/openssl/lib/libcrypto.a"; fi fi
397 # gperftools-2.1, for mem check and mem/cpu profile 353 # gperftools-2.1, for mem check and mem/cpu profile
398 LibGperfRoot=""; LibGperfFile="" 354 LibGperfRoot=""; LibGperfFile=""
399 -if [ $SRS_GPERF = YES ]; then LibGperfRoot="${SRS_OBJS}/gperf/include"; LibGperfFile="${SRS_OBJS}/gperf/lib/libtcmalloc_and_profiler.a"; fi 355 +if [ $SRS_GPERF = YES ]; then LibGperfRoot="${SRS_OBJS_DIR}/gperf/include"; LibGperfFile="${SRS_OBJS_DIR}/gperf/lib/libtcmalloc_and_profiler.a"; fi
400 # the link options, always use static link 356 # the link options, always use static link
401 SrsLinkOptions="-ldl"; 357 SrsLinkOptions="-ldl";
402 if [ $SRS_SSL = YES ]; then if [ $SRS_USE_SYS_SSL = YES ]; then SrsLinkOptions="${SrsLinkOptions} -lssl"; fi fi 358 if [ $SRS_SSL = YES ]; then if [ $SRS_USE_SYS_SSL = YES ]; then SrsLinkOptions="${SrsLinkOptions} -lssl"; fi fi
@@ -412,7 +368,7 @@ if [ $SRS_MIPS_UBUNTU12 = YES ]; then SrsLinkOptions="${SrsLinkOptions} -lgcc_eh @@ -412,7 +368,7 @@ if [ $SRS_MIPS_UBUNTU12 = YES ]; then SrsLinkOptions="${SrsLinkOptions} -lgcc_eh
412 #Core, depends only on system apis. 368 #Core, depends only on system apis.
413 MODULE_ID="CORE" 369 MODULE_ID="CORE"
414 MODULE_DEPENDS=() 370 MODULE_DEPENDS=()
415 -ModuleLibIncs=(${SRS_OBJS}) 371 +ModuleLibIncs=(${SRS_OBJS_DIR})
416 MODULE_FILES=("srs_core" "srs_core_autofree") 372 MODULE_FILES=("srs_core" "srs_core_autofree")
417 CORE_INCS="src/core"; MODULE_DIR=${CORE_INCS} . auto/modules.sh 373 CORE_INCS="src/core"; MODULE_DIR=${CORE_INCS} . auto/modules.sh
418 CORE_OBJS="${MODULE_OBJS[@]}" 374 CORE_OBJS="${MODULE_OBJS[@]}"
@@ -420,7 +376,7 @@ CORE_OBJS="${MODULE_OBJS[@]}" @@ -420,7 +376,7 @@ CORE_OBJS="${MODULE_OBJS[@]}"
420 #Kernel, depends on core, provides error/log/config, nothing about stream information. 376 #Kernel, depends on core, provides error/log/config, nothing about stream information.
421 MODULE_ID="KERNEL" 377 MODULE_ID="KERNEL"
422 MODULE_DEPENDS=("CORE") 378 MODULE_DEPENDS=("CORE")
423 -ModuleLibIncs=(${SRS_OBJS}) 379 +ModuleLibIncs=(${SRS_OBJS_DIR})
424 MODULE_FILES=("srs_kernel_error" "srs_kernel_log" "srs_kernel_stream" "srs_kernel_buffer" 380 MODULE_FILES=("srs_kernel_error" "srs_kernel_log" "srs_kernel_stream" "srs_kernel_buffer"
425 "srs_kernel_utility" "srs_kernel_flv" "srs_kernel_codec" "srs_kernel_file" 381 "srs_kernel_utility" "srs_kernel_flv" "srs_kernel_codec" "srs_kernel_file"
426 "srs_kernel_consts") 382 "srs_kernel_consts")
@@ -430,57 +386,64 @@ KERNEL_OBJS="${MODULE_OBJS[@]}" @@ -430,57 +386,64 @@ KERNEL_OBJS="${MODULE_OBJS[@]}"
430 #RTMP Protocol, depends on core/kernel, provides rtmp/htttp protocol features. 386 #RTMP Protocol, depends on core/kernel, provides rtmp/htttp protocol features.
431 MODULE_ID="RTMP" 387 MODULE_ID="RTMP"
432 MODULE_DEPENDS=("CORE" "KERNEL") 388 MODULE_DEPENDS=("CORE" "KERNEL")
433 -ModuleLibIncs=(${SRS_OBJS} ${LibSSLRoot}) 389 +ModuleLibIncs=(${SRS_OBJS_DIR} ${LibSSLRoot})
434 MODULE_FILES=("srs_protocol_amf0" "srs_protocol_io" "srs_protocol_stack" "srs_protocol_rtmp" 390 MODULE_FILES=("srs_protocol_amf0" "srs_protocol_io" "srs_protocol_stack" "srs_protocol_rtmp"
435 "srs_protocol_handshake" "srs_protocol_utility" "srs_protocol_msg_array") 391 "srs_protocol_handshake" "srs_protocol_utility" "srs_protocol_msg_array")
436 RTMP_INCS="src/rtmp"; MODULE_DIR=${RTMP_INCS} . auto/modules.sh 392 RTMP_INCS="src/rtmp"; MODULE_DIR=${RTMP_INCS} . auto/modules.sh
437 RTMP_OBJS="${MODULE_OBJS[@]}" 393 RTMP_OBJS="${MODULE_OBJS[@]}"
438 # 394 #
439 #App Module 395 #App Module
440 -MODULE_ID="APP"  
441 -MODULE_DEPENDS=("CORE" "KERNEL" "RTMP")  
442 -ModuleLibIncs=(${LibSTRoot} ${LibHttpParserRoot} ${SRS_OBJS})  
443 -MODULE_FILES=("srs_app_server" "srs_app_conn" "srs_app_rtmp_conn" "srs_app_st_socket" "srs_app_source"  
444 - "srs_app_refer" "srs_app_hls" "srs_app_forward" "srs_app_encoder" "srs_app_http"  
445 - "srs_app_thread" "srs_app_bandwidth" "srs_app_st" "srs_app_log" "srs_app_config"  
446 - "srs_app_pithy_print" "srs_app_reload" "srs_app_http_api" "srs_app_http_conn" "srs_app_http_hooks"  
447 - "srs_app_json" "srs_app_ingest" "srs_app_ffmpeg" "srs_app_utility" "srs_app_dvr" "srs_app_edge"  
448 - "srs_app_kbps" "srs_app_heartbeat" "srs_app_empty" "srs_app_http_client" "srs_app_avc_aac")  
449 -APP_INCS="src/app"; MODULE_DIR=${APP_INCS} . auto/modules.sh  
450 -APP_OBJS="${MODULE_OBJS[@]}" 396 +if [ $SRS_EXPORT_LIBRTMP = NO ]; then
  397 + MODULE_ID="APP"
  398 + MODULE_DEPENDS=("CORE" "KERNEL" "RTMP")
  399 + ModuleLibIncs=(${LibSTRoot} ${LibHttpParserRoot} ${SRS_OBJS_DIR})
  400 + MODULE_FILES=("srs_app_server" "srs_app_conn" "srs_app_rtmp_conn" "srs_app_st_socket" "srs_app_source"
  401 + "srs_app_refer" "srs_app_hls" "srs_app_forward" "srs_app_encoder" "srs_app_http"
  402 + "srs_app_thread" "srs_app_bandwidth" "srs_app_st" "srs_app_log" "srs_app_config"
  403 + "srs_app_pithy_print" "srs_app_reload" "srs_app_http_api" "srs_app_http_conn" "srs_app_http_hooks"
  404 + "srs_app_json" "srs_app_ingest" "srs_app_ffmpeg" "srs_app_utility" "srs_app_dvr" "srs_app_edge"
  405 + "srs_app_kbps" "srs_app_heartbeat" "srs_app_empty" "srs_app_http_client" "srs_app_avc_aac")
  406 + APP_INCS="src/app"; MODULE_DIR=${APP_INCS} . auto/modules.sh
  407 + APP_OBJS="${MODULE_OBJS[@]}"
  408 +fi
451 # 409 #
452 #LIBS Module, build libsrs.a for static link. 410 #LIBS Module, build libsrs.a for static link.
453 MODULE_ID="LIBS" 411 MODULE_ID="LIBS"
454 MODULE_DEPENDS=("CORE" "KERNEL" "RTMP") 412 MODULE_DEPENDS=("CORE" "KERNEL" "RTMP")
455 -ModuleLibIncs=(${SRS_OBJS}) 413 +ModuleLibIncs=(${SRS_OBJS_DIR})
456 MODULE_FILES=("srs_librtmp" "srs_lib_simple_socket" "srs_lib_bandwidth") 414 MODULE_FILES=("srs_librtmp" "srs_lib_simple_socket" "srs_lib_bandwidth")
457 LIBS_INCS="src/libs"; MODULE_DIR=${LIBS_INCS} . auto/modules.sh 415 LIBS_INCS="src/libs"; MODULE_DIR=${LIBS_INCS} . auto/modules.sh
458 LIBS_OBJS="${MODULE_OBJS[@]}" 416 LIBS_OBJS="${MODULE_OBJS[@]}"
459 # 417 #
460 #Main Module 418 #Main Module
461 -MODULE_ID="MAIN"  
462 -MODULE_DEPENDS=("CORE" "KERNEL" "RTMP" "APP")  
463 -ModuleLibIncs=(${LibSTRoot} ${SRS_OBJS} ${LibGperfRoot})  
464 -MODULE_FILES=("srs_main_server")  
465 -MAIN_INCS="src/main"; MODULE_DIR=${MAIN_INCS} . auto/modules.sh  
466 -MAIN_OBJS="${MODULE_OBJS[@]}" 419 +if [ $SRS_EXPORT_LIBRTMP = NO ]; then
  420 + MODULE_ID="MAIN"
  421 + MODULE_DEPENDS=("CORE" "KERNEL" "RTMP" "APP")
  422 + ModuleLibIncs=(${LibSTRoot} ${SRS_OBJS_DIR} ${LibGperfRoot})
  423 + MODULE_FILES=("srs_main_server")
  424 + MAIN_INCS="src/main"; MODULE_DIR=${MAIN_INCS} . auto/modules.sh
  425 + MAIN_OBJS="${MODULE_OBJS[@]}"
  426 +fi
467 427
468 ##################################################################################### 428 #####################################################################################
469 # Binaries, main entrances, link the module and its depends modules, 429 # Binaries, main entrances, link the module and its depends modules,
470 # then link to a binary, for example, objs/srs 430 # then link to a binary, for example, objs/srs
471 # 431 #
472 -# all main entrances  
473 -MAIN_ENTRANCES=("srs_main_server")  
474 -#  
475 -# all depends libraries  
476 -ModuleLibFiles=(${LibSTfile} ${LibHttpParserfile} ${LibSSLfile} ${LibGperfFile})  
477 -# all depends objects  
478 -MODULE_OBJS="${CORE_OBJS[@]} ${KERNEL_OBJS[@]} ${RTMP_OBJS[@]} ${APP_OBJS[@]} ${MAIN_OBJS[@]}"  
479 -LINK_OPTIONS="${SrsLinkOptions}${SrsGprofLink}${SrsGperfLink}"  
480 -#  
481 -# srs:  
482 -# srs(simple rtmp server) over st(state-threads)  
483 -BUILD_KEY="srs" APP_MAIN="srs_main_server" APP_NAME="srs" . auto/apps.sh 432 +# disable all app when export librtmp
  433 +if [ $SRS_EXPORT_LIBRTMP = NO ]; then
  434 + # all main entrances
  435 + MAIN_ENTRANCES=("srs_main_server")
  436 + #
  437 + # all depends libraries
  438 + ModuleLibFiles=(${LibSTfile} ${LibHttpParserfile} ${LibSSLfile} ${LibGperfFile})
  439 + # all depends objects
  440 + MODULE_OBJS="${CORE_OBJS[@]} ${KERNEL_OBJS[@]} ${RTMP_OBJS[@]} ${APP_OBJS[@]} ${MAIN_OBJS[@]}"
  441 + LINK_OPTIONS="${SrsLinkOptions}${SrsGprofLink}${SrsGperfLink}"
  442 + #
  443 + # srs:
  444 + # srs(simple rtmp server) over st(state-threads)
  445 + BUILD_KEY="srs" APP_MAIN="srs_main_server" APP_NAME="srs" . auto/apps.sh
  446 +fi
484 # srs librtmp 447 # srs librtmp
485 if [ $SRS_LIBRTMP = YES ]; then 448 if [ $SRS_LIBRTMP = YES ]; then
486 MODULE_OBJS="${CORE_OBJS[@]} ${KERNEL_OBJS[@]} ${RTMP_OBJS[@]} ${LIBS_OBJS[@]}" 449 MODULE_OBJS="${CORE_OBJS[@]} ${KERNEL_OBJS[@]} ${RTMP_OBJS[@]} ${LIBS_OBJS[@]}"
@@ -488,14 +451,16 @@ if [ $SRS_LIBRTMP = YES ]; then @@ -488,14 +451,16 @@ if [ $SRS_LIBRTMP = YES ]; then
488 fi 451 fi
489 # 452 #
490 # utest, the unit-test cases of srs, base on gtest1.6 453 # utest, the unit-test cases of srs, base on gtest1.6
491 -MODULE_FILES=("srs_utest" "srs_utest_amf0" "srs_utest_protocol"  
492 - "srs_utest_kernel" "srs_utest_core" "srs_utest_config"  
493 - "srs_utest_reload")  
494 -ModuleLibIncs=(${SRS_OBJS} ${LibSTRoot} ${LibSSLRoot})  
495 -ModuleLibFiles=(${LibSTfile} ${LibHttpParserfile} ${LibSSLfile})  
496 -MODULE_DEPENDS=("CORE" "KERNEL" "RTMP" "APP")  
497 -MODULE_OBJS="${CORE_OBJS[@]} ${KERNEL_OBJS[@]} ${RTMP_OBJS[@]} ${APP_OBJS[@]}"  
498 -LINK_OPTIONS="-lpthread ${SrsLinkOptions}" MODULE_DIR="src/utest" APP_NAME="srs_utest" . auto/utest.sh 454 +if [ $SRS_UTEST = YES ]; then
  455 + MODULE_FILES=("srs_utest" "srs_utest_amf0" "srs_utest_protocol"
  456 + "srs_utest_kernel" "srs_utest_core" "srs_utest_config"
  457 + "srs_utest_reload")
  458 + ModuleLibIncs=(${SRS_OBJS_DIR} ${LibSTRoot} ${LibSSLRoot})
  459 + ModuleLibFiles=(${LibSTfile} ${LibHttpParserfile} ${LibSSLfile})
  460 + MODULE_DEPENDS=("CORE" "KERNEL" "RTMP" "APP")
  461 + MODULE_OBJS="${CORE_OBJS[@]} ${KERNEL_OBJS[@]} ${RTMP_OBJS[@]} ${APP_OBJS[@]}"
  462 + LINK_OPTIONS="-lpthread ${SrsLinkOptions}" MODULE_DIR="src/utest" APP_NAME="srs_utest" . auto/utest.sh
  463 +fi
499 464
500 echo 'configure ok! ' 465 echo 'configure ok! '
501 466