正在显示
1 个修改的文件
包含
23 行增加
和
7 行删除
| @@ -37,8 +37,9 @@ echo "" >> $SRS_AUTO_HEADERS_H | @@ -37,8 +37,9 @@ echo "" >> $SRS_AUTO_HEADERS_H | ||
| 37 | ##################################################################################### | 37 | ##################################################################################### |
| 38 | # generate Makefile. | 38 | # generate Makefile. |
| 39 | ##################################################################################### | 39 | ##################################################################################### |
| 40 | -echo "generate Makefile" | ||
| 41 | 40 | ||
| 41 | +##################################################################################### | ||
| 42 | +echo "generate Makefile" | ||
| 42 | SRS_MAKEFILE="Makefile" | 43 | SRS_MAKEFILE="Makefile" |
| 43 | cat << END > ${SRS_MAKEFILE} | 44 | cat << END > ${SRS_MAKEFILE} |
| 44 | .PHONY: default help clean server bandwidth _prepare_dir | 45 | .PHONY: default help clean server bandwidth _prepare_dir |
| @@ -67,8 +68,8 @@ _prepare_dir: | @@ -67,8 +68,8 @@ _prepare_dir: | ||
| 67 | @mkdir -p ${SRS_OBJS} | 68 | @mkdir -p ${SRS_OBJS} |
| 68 | END | 69 | END |
| 69 | 70 | ||
| 70 | -echo 'generate Makefile ok!' | ||
| 71 | - | 71 | +##################################################################################### |
| 72 | +# build tools or compiler args. | ||
| 72 | # the performance analysis, uncomments the following when use gperf to analysis the performance. see third-party/readme.txt | 73 | # the performance analysis, uncomments the following when use gperf to analysis the performance. see third-party/readme.txt |
| 73 | Performance="-pg" | 74 | Performance="-pg" |
| 74 | # enable gdb debug | 75 | # enable gdb debug |
| @@ -92,14 +93,23 @@ default: | @@ -92,14 +93,23 @@ default: | ||
| 92 | 93 | ||
| 93 | END | 94 | END |
| 94 | 95 | ||
| 95 | -# Libraries | 96 | +##################################################################################### |
| 97 | +# Libraries, external library to build in srs, | ||
| 98 | +# header(.h): add to ModuleLibIncs if need the specified library. for example, LibSTRoot | ||
| 99 | +# library(.a): add to ModuleLibFiles if binary need the specifeid library. for example, LibSTfile | ||
| 100 | +# | ||
| 101 | +# st(state-threads) the basic network library for SRS. | ||
| 96 | LibSTRoot="${SRS_OBJS}/st" | 102 | LibSTRoot="${SRS_OBJS}/st" |
| 97 | LibSTfile="${LibSTRoot}/libst.a" | 103 | LibSTfile="${LibSTRoot}/libst.a" |
| 104 | +# hp(http-parser) the http request/url parser, for SRS to support HTTP callback. | ||
| 98 | if [ $SRS_HTTP = YES ]; then | 105 | if [ $SRS_HTTP = YES ]; then |
| 99 | LibHttpParserRoot="${SRS_OBJS}/hp" | 106 | LibHttpParserRoot="${SRS_OBJS}/hp" |
| 100 | LibHttpParserfile="${LibHttpParserRoot}/libhttp_parser.a" | 107 | LibHttpParserfile="${LibHttpParserRoot}/libhttp_parser.a" |
| 101 | fi | 108 | fi |
| 102 | 109 | ||
| 110 | +##################################################################################### | ||
| 111 | +# Modules, compile each module, then link to binary | ||
| 112 | +# | ||
| 103 | #Core Module | 113 | #Core Module |
| 104 | MODULE_ID="CORE" | 114 | MODULE_ID="CORE" |
| 105 | MODULE_DEPENDS=() | 115 | MODULE_DEPENDS=() |
| @@ -118,7 +128,7 @@ MODULE_FILES=("srs_core" "srs_core_log" "srs_core_server" | @@ -118,7 +128,7 @@ MODULE_FILES=("srs_core" "srs_core_log" "srs_core_server" | ||
| 118 | "srs_core_http" "srs_core_thread" "srs_core_bandwidth") | 128 | "srs_core_http" "srs_core_thread" "srs_core_bandwidth") |
| 119 | MODULE_DIR="src/core" . auto/modules.sh | 129 | MODULE_DIR="src/core" . auto/modules.sh |
| 120 | CORE_OBJS="${MODULE_OBJS[@]}" | 130 | CORE_OBJS="${MODULE_OBJS[@]}" |
| 121 | - | 131 | +# |
| 122 | #Main Module | 132 | #Main Module |
| 123 | MODULE_ID="MAIN" | 133 | MODULE_ID="MAIN" |
| 124 | MODULE_DEPENDS=("CORE") | 134 | MODULE_DEPENDS=("CORE") |
| @@ -127,21 +137,27 @@ MODULE_FILES=("srs_main_server" "srs_main_bandcheck") | @@ -127,21 +137,27 @@ MODULE_FILES=("srs_main_server" "srs_main_bandcheck") | ||
| 127 | MODULE_DIR="src/main" . auto/modules.sh | 137 | MODULE_DIR="src/main" . auto/modules.sh |
| 128 | MAIN_OBJS="${MODULE_OBJS[@].o}" | 138 | MAIN_OBJS="${MODULE_OBJS[@].o}" |
| 129 | 139 | ||
| 140 | +##################################################################################### | ||
| 141 | +# Binaries, main entrances, link the module and its depends modules, | ||
| 142 | +# then link to a binary, for example, objs/srs | ||
| 143 | +# | ||
| 130 | # all main entrances | 144 | # all main entrances |
| 131 | MAIN_ENTRANCES=("srs_main_server" "srs_main_bandcheck") | 145 | MAIN_ENTRANCES=("srs_main_server" "srs_main_bandcheck") |
| 132 | - | ||
| 133 | -# srs(simple rtmp server) over st(state-threads) | 146 | +# all depends libraries |
| 134 | ModuleLibFiles=(${LibSTfile}) | 147 | ModuleLibFiles=(${LibSTfile}) |
| 135 | if [ $SRS_HTTP = YES ]; then | 148 | if [ $SRS_HTTP = YES ]; then |
| 136 | ModuleLibFiles="${ModuleLibFiles[@]} ${LibHttpParserfile}" | 149 | ModuleLibFiles="${ModuleLibFiles[@]} ${LibHttpParserfile}" |
| 137 | fi | 150 | fi |
| 151 | +# all depends objects | ||
| 138 | MODULE_OBJS="${CORE_OBJS[@]} ${CONFIG_OBJS[@]} ${PROTOCOL_OBJS[@]} ${MAIN_OBJS[@]}" | 152 | MODULE_OBJS="${CORE_OBJS[@]} ${CONFIG_OBJS[@]} ${PROTOCOL_OBJS[@]} ${MAIN_OBJS[@]}" |
| 139 | if [ $SRS_SSL = YES ]; then | 153 | if [ $SRS_SSL = YES ]; then |
| 140 | LINK_OPTIONS="-ldl -lssl -lcrypto" | 154 | LINK_OPTIONS="-ldl -lssl -lcrypto" |
| 141 | else | 155 | else |
| 142 | LINK_OPTIONS="-ldl" | 156 | LINK_OPTIONS="-ldl" |
| 143 | fi | 157 | fi |
| 158 | +# srs(simple rtmp server) over st(state-threads) | ||
| 144 | BUILD_KEY="srs" APP_MAIN="srs_main_server" APP_NAME="srs" SO_PATH="" . auto/apps.sh | 159 | BUILD_KEY="srs" APP_MAIN="srs_main_server" APP_NAME="srs" SO_PATH="" . auto/apps.sh |
| 160 | +# bandwidth test tool, to test the bandwidth to server | ||
| 145 | BUILD_KEY="bandwidth" APP_MAIN="srs_main_bandcheck" APP_NAME="bandwidth" SO_PATH="" . auto/apps.sh | 161 | BUILD_KEY="bandwidth" APP_MAIN="srs_main_bandcheck" APP_NAME="bandwidth" SO_PATH="" . auto/apps.sh |
| 146 | 162 | ||
| 147 | echo 'configure ok! ' | 163 | echo 'configure ok! ' |
-
请 注册 或 登录 后发表评论