正在显示
7 个修改的文件
包含
243 行增加
和
152 行删除
trunk/auto/apps.sh
100644 → 100755
trunk/auto/generate_header.sh
100644 → 100755
trunk/auto/libs.sh
100644 → 100755
trunk/auto/modules.sh
100644 → 100755
@@ -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 |
trunk/auto/summary.sh
0 → 100755
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 |
@@ -4,7 +4,8 @@ | @@ -4,7 +4,8 @@ | ||
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="${SRS_WORKDIR}/objs" | ||
8 | mkdir -p ${SRS_OBJS} | 9 | mkdir -p ${SRS_OBJS} |
9 | 10 | ||
10 | ##################################################################################### | 11 | ##################################################################################### |
@@ -19,14 +20,33 @@ BLACK="\\e[0m" | @@ -19,14 +20,33 @@ BLACK="\\e[0m" | ||
19 | # srs features: SRS_SSL/SRS_HLS/SRS_NGINX/SRS_FFMPEG_TOOL/SRS_HTTP_CALLBACK/...... | 20 | # srs features: SRS_SSL/SRS_HLS/SRS_NGINX/SRS_FFMPEG_TOOL/SRS_HTTP_CALLBACK/...... |
20 | # build options: SRS_JOBS | 21 | # build options: SRS_JOBS |
21 | ##################################################################################### | 22 | ##################################################################################### |
22 | -SRS_AUTO_HEADERS_H="${SRS_OBJS}/srs_auto_headers.hpp" | ||
23 | # parse options, exit with error when parse options invalid. | 23 | # parse options, exit with error when parse options invalid. |
24 | . auto/options.sh | 24 | . auto/options.sh |
25 | 25 | ||
26 | -# clean the exists | 26 | +# for export srs-librtmp, change target to it. |
27 | +if [ $SRS_EXPORT_LIBRTMP != NO ]; then | ||
28 | + if [[ -d ${SRS_EXPORT_LIBRTMP} ]]; then | ||
29 | + echo -e "${RED}srs-librtmp target dir exists: ${SRS_EXPORT_LIBRTMP}. ${BLACK}" | ||
30 | + exit 1 | ||
31 | + fi | ||
32 | + # create target | ||
33 | + SRS_WORKDIR=${SRS_EXPORT_LIBRTMP} && SRS_OBJS=${SRS_WORKDIR}/objs && mkdir -p ${SRS_OBJS} && | ||
34 | + # copy src to target | ||
35 | + _CPT=${SRS_EXPORT_LIBRTMP}/3rdparty && mkdir -p ${_CPT} && cp 3rdparty/st-1.9.zip ${_CPT} && | ||
36 | + _CPT=${SRS_EXPORT_LIBRTMP}/3rdparty/patches && mkdir -p ${_CPT} && cp 3rdparty/patches/1.st.arm.patch ${_CPT} && | ||
37 | + # check ret | ||
38 | + ret=$?; if [[ $ret -ne 0 ]]; then echo "export src failed, ret=$ret"; exit $ret; fi | ||
39 | +fi | ||
40 | + | ||
41 | +# the auto generated variables. | ||
42 | +SRS_AUTO_HEADERS_H="${SRS_OBJS}/srs_auto_headers.hpp" | ||
43 | + | ||
44 | +# clean the exists, when not export srs-librtmp. | ||
27 | # do this only when the options is ok. | 45 | # do this only when the options is ok. |
28 | -if [[ -f Makefile ]]; then | ||
29 | - make clean | 46 | +if [ $SRS_EXPORT_LIBRTMP = NO ]; then |
47 | + if [[ -f Makefile ]]; then | ||
48 | + make clean | ||
49 | + fi | ||
30 | fi | 50 | fi |
31 | 51 | ||
32 | # write user options to headers | 52 | # write user options to headers |
@@ -102,109 +122,13 @@ SrsUtestMakeEntry="@echo -e \"ignore utest for it's disabled\"" | @@ -102,109 +122,13 @@ SrsUtestMakeEntry="@echo -e \"ignore utest for it's disabled\"" | ||
102 | if [ $SRS_UTEST = YES ]; then SrsUtestMakeEntry="(cd ${SRS_OBJS}/utest; \$(MAKE))"; fi | 122 | if [ $SRS_UTEST = YES ]; then SrsUtestMakeEntry="(cd ${SRS_OBJS}/utest; \$(MAKE))"; fi |
103 | 123 | ||
104 | ##################################################################################### | 124 | ##################################################################################### |
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 | 125 | +# generate colorful summary script |
126 | +. auto/summary.sh | ||
203 | 127 | ||
204 | ##################################################################################### | 128 | ##################################################################################### |
205 | # makefile | 129 | # makefile |
206 | echo "generate Makefile" | 130 | echo "generate Makefile" |
207 | -cat << END > ${SRS_MAKEFILE} | 131 | +cat << END > ${SRS_WORKDIR}/${SRS_MAKEFILE} |
208 | .PHONY: default _default install install-api help clean server librtmp utest _prepare_dir | 132 | .PHONY: default _default install install-api help clean server librtmp utest _prepare_dir |
209 | 133 | ||
210 | # install prefix. | 134 | # install prefix. |
@@ -215,22 +139,24 @@ END | @@ -215,22 +139,24 @@ END | ||
215 | 139 | ||
216 | # embeded, ubuntu12, use embeded tool chain. | 140 | # embeded, ubuntu12, use embeded tool chain. |
217 | if [ $SRS_EMBEDED_CPU = YES ]; then | 141 | if [ $SRS_EMBEDED_CPU = YES ]; then |
218 | - cat << END >> ${SRS_MAKEFILE} | 142 | + cat << END >> ${SRS_WORKDIR}/${SRS_MAKEFILE} |
219 | default: | 143 | default: |
220 | \$(MAKE) GCC=${SrsArmGCC} CXX=${SrsArmCXX} AR=${SrsArmAR} LINK=${SrsArmCXX} _default | 144 | \$(MAKE) GCC=${SrsArmGCC} CXX=${SrsArmCXX} AR=${SrsArmAR} LINK=${SrsArmCXX} _default |
221 | 145 | ||
222 | END | 146 | END |
223 | # x86/x64, use gnu-gcc/g++ tool chain. | 147 | # x86/x64, use gnu-gcc/g++ tool chain. |
224 | else | 148 | else |
225 | - cat << END >> ${SRS_MAKEFILE} | 149 | + cat << END >> ${SRS_WORKDIR}/${SRS_MAKEFILE} |
226 | default: | 150 | default: |
227 | \$(MAKE) _default | 151 | \$(MAKE) _default |
228 | 152 | ||
229 | END | 153 | END |
230 | fi | 154 | fi |
231 | 155 | ||
232 | -# the real entry for all platform. | ||
233 | -cat << END >> ${SRS_MAKEFILE} | 156 | +# the real entry for all platform: |
157 | +# the server, librtmp and utest | ||
158 | +# where the bellow will check and disable some entry by only echo. | ||
159 | +cat << END >> ${SRS_WORKDIR}/${SRS_MAKEFILE} | ||
234 | _default: server librtmp utest | 160 | _default: server librtmp utest |
235 | @bash objs/_srs_build_summary.sh | 161 | @bash objs/_srs_build_summary.sh |
236 | 162 | ||
@@ -252,14 +178,39 @@ clean: | @@ -252,14 +178,39 @@ clean: | ||
252 | (cd research/librtmp; make clean) | 178 | (cd research/librtmp; make clean) |
253 | (cd research/api-server/static-dir; rm -rf crossdomain.xml forward live players) | 179 | (cd research/api-server/static-dir; rm -rf crossdomain.xml forward live players) |
254 | 180 | ||
181 | +END | ||
182 | + | ||
183 | +# if export librtmp, donot build the srs server. | ||
184 | +if [ $SRS_EXPORT_LIBRTMP != NO ]; then | ||
185 | + cat << END >> ${SRS_WORKDIR}/${SRS_MAKEFILE} | ||
186 | +server: _prepare_dir | ||
187 | + @echo "donot build the srs(simple rtmp server) for srs-librtmp" | ||
188 | + | ||
189 | +END | ||
190 | +else | ||
191 | + cat << END >> ${SRS_WORKDIR}/${SRS_MAKEFILE} | ||
255 | server: _prepare_dir | 192 | server: _prepare_dir |
256 | @echo "build the srs(simple rtmp server) over st(state-threads)" | 193 | @echo "build the srs(simple rtmp server) over st(state-threads)" |
257 | \$(MAKE) -f ${SRS_OBJS}/${SRS_MAKEFILE} srs | 194 | \$(MAKE) -f ${SRS_OBJS}/${SRS_MAKEFILE} srs |
258 | 195 | ||
259 | END | 196 | END |
197 | +fi | ||
198 | + | ||
199 | +# disable install entry for srs-librtmp | ||
200 | +if [ $SRS_EXPORT_LIBRTMP != NO ]; then | ||
201 | + cat << END >> ${SRS_WORKDIR}/${SRS_MAKEFILE} | ||
202 | +uninstall: | ||
203 | + @echo "disable uninstall for srs-librtmp" | ||
204 | + | ||
205 | +install-api: | ||
206 | + @echo "disable install-api for srs-librtmp" | ||
260 | 207 | ||
261 | -# install entry | ||
262 | -cat << END >> ${SRS_MAKEFILE} | 208 | +install: |
209 | + @echo "disable install for srs-librtmp" | ||
210 | + | ||
211 | +END | ||
212 | +else | ||
213 | + cat << END >> ${SRS_WORKDIR}/${SRS_MAKEFILE} | ||
263 | uninstall: | 214 | uninstall: |
264 | @echo "rmdir \$(SRS_PREFIX)" | 215 | @echo "rmdir \$(SRS_PREFIX)" |
265 | @rm -rf \$(SRS_PREFIX) | 216 | @rm -rf \$(SRS_PREFIX) |
@@ -311,9 +262,11 @@ install: | @@ -311,9 +262,11 @@ install: | ||
311 | @echo "@see: https://github.com/winlinvip/simple-rtmp-server/wiki/v1_CN_LinuxService" | 262 | @echo "@see: https://github.com/winlinvip/simple-rtmp-server/wiki/v1_CN_LinuxService" |
312 | 263 | ||
313 | END | 264 | END |
265 | +fi | ||
314 | 266 | ||
267 | +# generate srs-librtmp entry | ||
315 | if [ $SRS_LIBRTMP = YES ]; then | 268 | if [ $SRS_LIBRTMP = YES ]; then |
316 | - cat << END >> ${SRS_MAKEFILE} | 269 | + cat << END >> ${SRS_WORKDIR}/${SRS_MAKEFILE} |
317 | librtmp: server | 270 | librtmp: server |
318 | @echo "build the client publish/play library." | 271 | @echo "build the client publish/play library." |
319 | \$(MAKE) -f ${SRS_OBJS}/${SRS_MAKEFILE} librtmp | 272 | \$(MAKE) -f ${SRS_OBJS}/${SRS_MAKEFILE} librtmp |
@@ -322,7 +275,7 @@ librtmp: server | @@ -322,7 +275,7 @@ librtmp: server | ||
322 | 275 | ||
323 | END | 276 | END |
324 | else | 277 | else |
325 | - cat << END >> ${SRS_MAKEFILE} | 278 | + cat << END >> ${SRS_WORKDIR}/${SRS_MAKEFILE} |
326 | librtmp: server | 279 | librtmp: server |
327 | @echo "srs-librtmp is disabled, ignore." | 280 | @echo "srs-librtmp is disabled, ignore." |
328 | 281 | ||
@@ -330,7 +283,7 @@ END | @@ -330,7 +283,7 @@ END | ||
330 | fi | 283 | fi |
331 | 284 | ||
332 | if [ $SRS_UTEST = YES ]; then | 285 | if [ $SRS_UTEST = YES ]; then |
333 | - cat << END >> ${SRS_MAKEFILE} | 286 | + cat << END >> ${SRS_WORKDIR}/${SRS_MAKEFILE} |
334 | utest: server | 287 | utest: server |
335 | @echo "build the utest for srs" | 288 | @echo "build the utest for srs" |
336 | ${SrsUtestMakeEntry} | 289 | ${SrsUtestMakeEntry} |
@@ -338,14 +291,14 @@ utest: server | @@ -338,14 +291,14 @@ utest: server | ||
338 | 291 | ||
339 | END | 292 | END |
340 | else | 293 | else |
341 | - cat << END >> ${SRS_MAKEFILE} | 294 | + cat << END >> ${SRS_WORKDIR}/${SRS_MAKEFILE} |
342 | utest: server | 295 | utest: server |
343 | @echo "utest is disabled, ignore" | 296 | @echo "utest is disabled, ignore" |
344 | 297 | ||
345 | END | 298 | END |
346 | fi | 299 | fi |
347 | 300 | ||
348 | -cat << END >> ${SRS_MAKEFILE} | 301 | +cat << END >> ${SRS_WORKDIR}/${SRS_MAKEFILE} |
349 | # the ./configure will generate it. | 302 | # the ./configure will generate it. |
350 | _prepare_dir: | 303 | _prepare_dir: |
351 | @mkdir -p ${SRS_OBJS} | 304 | @mkdir -p ${SRS_OBJS} |
@@ -437,17 +390,19 @@ RTMP_INCS="src/rtmp"; MODULE_DIR=${RTMP_INCS} . auto/modules.sh | @@ -437,17 +390,19 @@ RTMP_INCS="src/rtmp"; MODULE_DIR=${RTMP_INCS} . auto/modules.sh | ||
437 | RTMP_OBJS="${MODULE_OBJS[@]}" | 390 | RTMP_OBJS="${MODULE_OBJS[@]}" |
438 | # | 391 | # |
439 | #App Module | 392 | #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[@]}" | 393 | +if [ $SRS_EXPORT_LIBRTMP = NO ]; then |
394 | + MODULE_ID="APP" | ||
395 | + MODULE_DEPENDS=("CORE" "KERNEL" "RTMP") | ||
396 | + ModuleLibIncs=(${LibSTRoot} ${LibHttpParserRoot} ${SRS_OBJS}) | ||
397 | + MODULE_FILES=("srs_app_server" "srs_app_conn" "srs_app_rtmp_conn" "srs_app_st_socket" "srs_app_source" | ||
398 | + "srs_app_refer" "srs_app_hls" "srs_app_forward" "srs_app_encoder" "srs_app_http" | ||
399 | + "srs_app_thread" "srs_app_bandwidth" "srs_app_st" "srs_app_log" "srs_app_config" | ||
400 | + "srs_app_pithy_print" "srs_app_reload" "srs_app_http_api" "srs_app_http_conn" "srs_app_http_hooks" | ||
401 | + "srs_app_json" "srs_app_ingest" "srs_app_ffmpeg" "srs_app_utility" "srs_app_dvr" "srs_app_edge" | ||
402 | + "srs_app_kbps" "srs_app_heartbeat" "srs_app_empty" "srs_app_http_client" "srs_app_avc_aac") | ||
403 | + APP_INCS="src/app"; MODULE_DIR=${APP_INCS} . auto/modules.sh | ||
404 | + APP_OBJS="${MODULE_OBJS[@]}" | ||
405 | +fi | ||
451 | # | 406 | # |
452 | #LIBS Module, build libsrs.a for static link. | 407 | #LIBS Module, build libsrs.a for static link. |
453 | MODULE_ID="LIBS" | 408 | MODULE_ID="LIBS" |
@@ -458,29 +413,34 @@ LIBS_INCS="src/libs"; MODULE_DIR=${LIBS_INCS} . auto/modules.sh | @@ -458,29 +413,34 @@ LIBS_INCS="src/libs"; MODULE_DIR=${LIBS_INCS} . auto/modules.sh | ||
458 | LIBS_OBJS="${MODULE_OBJS[@]}" | 413 | LIBS_OBJS="${MODULE_OBJS[@]}" |
459 | # | 414 | # |
460 | #Main Module | 415 | #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[@]}" | 416 | +if [ $SRS_EXPORT_LIBRTMP = NO ]; then |
417 | + MODULE_ID="MAIN" | ||
418 | + MODULE_DEPENDS=("CORE" "KERNEL" "RTMP" "APP") | ||
419 | + ModuleLibIncs=(${LibSTRoot} ${SRS_OBJS} ${LibGperfRoot}) | ||
420 | + MODULE_FILES=("srs_main_server") | ||
421 | + MAIN_INCS="src/main"; MODULE_DIR=${MAIN_INCS} . auto/modules.sh | ||
422 | + MAIN_OBJS="${MODULE_OBJS[@]}" | ||
423 | +fi | ||
467 | 424 | ||
468 | ##################################################################################### | 425 | ##################################################################################### |
469 | # Binaries, main entrances, link the module and its depends modules, | 426 | # Binaries, main entrances, link the module and its depends modules, |
470 | # then link to a binary, for example, objs/srs | 427 | # then link to a binary, for example, objs/srs |
471 | # | 428 | # |
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 | 429 | +# disable all app when export librtmp |
430 | +if [ $SRS_EXPORT_LIBRTMP = NO ]; then | ||
431 | + # all main entrances | ||
432 | + MAIN_ENTRANCES=("srs_main_server") | ||
433 | + # | ||
434 | + # all depends libraries | ||
435 | + ModuleLibFiles=(${LibSTfile} ${LibHttpParserfile} ${LibSSLfile} ${LibGperfFile}) | ||
436 | + # all depends objects | ||
437 | + MODULE_OBJS="${CORE_OBJS[@]} ${KERNEL_OBJS[@]} ${RTMP_OBJS[@]} ${APP_OBJS[@]} ${MAIN_OBJS[@]}" | ||
438 | + LINK_OPTIONS="${SrsLinkOptions}${SrsGprofLink}${SrsGperfLink}" | ||
439 | + # | ||
440 | + # srs: | ||
441 | + # srs(simple rtmp server) over st(state-threads) | ||
442 | + BUILD_KEY="srs" APP_MAIN="srs_main_server" APP_NAME="srs" . auto/apps.sh | ||
443 | +fi | ||
484 | # srs librtmp | 444 | # srs librtmp |
485 | if [ $SRS_LIBRTMP = YES ]; then | 445 | if [ $SRS_LIBRTMP = YES ]; then |
486 | MODULE_OBJS="${CORE_OBJS[@]} ${KERNEL_OBJS[@]} ${RTMP_OBJS[@]} ${LIBS_OBJS[@]}" | 446 | MODULE_OBJS="${CORE_OBJS[@]} ${KERNEL_OBJS[@]} ${RTMP_OBJS[@]} ${LIBS_OBJS[@]}" |
@@ -488,14 +448,16 @@ if [ $SRS_LIBRTMP = YES ]; then | @@ -488,14 +448,16 @@ if [ $SRS_LIBRTMP = YES ]; then | ||
488 | fi | 448 | fi |
489 | # | 449 | # |
490 | # utest, the unit-test cases of srs, base on gtest1.6 | 450 | # 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 | 451 | +if [ $SRS_UTEST = YES ]; then |
452 | + MODULE_FILES=("srs_utest" "srs_utest_amf0" "srs_utest_protocol" | ||
453 | + "srs_utest_kernel" "srs_utest_core" "srs_utest_config" | ||
454 | + "srs_utest_reload") | ||
455 | + ModuleLibIncs=(${SRS_OBJS} ${LibSTRoot} ${LibSSLRoot}) | ||
456 | + ModuleLibFiles=(${LibSTfile} ${LibHttpParserfile} ${LibSSLfile}) | ||
457 | + MODULE_DEPENDS=("CORE" "KERNEL" "RTMP" "APP") | ||
458 | + MODULE_OBJS="${CORE_OBJS[@]} ${KERNEL_OBJS[@]} ${RTMP_OBJS[@]} ${APP_OBJS[@]}" | ||
459 | + LINK_OPTIONS="-lpthread ${SrsLinkOptions}" MODULE_DIR="src/utest" APP_NAME="srs_utest" . auto/utest.sh | ||
460 | +fi | ||
499 | 461 | ||
500 | echo 'configure ok! ' | 462 | echo 'configure ok! ' |
501 | 463 |
-
请 注册 或 登录 后发表评论