winlin

refine build script, add comments for app.sh. change version to 0.9.3

1 -#!/bin/bash  
2 - 1 +# generate the binary
  2 +#
3 # params: 3 # params:
4 -# $SRS_OBJS the objs directory. ie. objs  
5 -# $SRS_MAKEFILE the makefile name. ie. Makefile  
6 -# $MAIN_ENTRANCES array, all main entrance, disable all except the $APP_MAIN itself  
7 -# $MODULE_OBJS array, the objects to compile the app.  
8 -# $BUILD_KEY a string indicates the build key for Makefile. ie. dump  
9 -# $APP_MAIN the object file that contains main function. ie. your_app_main  
10 -# $APP_NAME the app name to output. ie. your_app  
11 -# $ModuleLibFiles array, the 3rdpart library file to link with. ie. (objs/st-1.9/obj/libst.a objs/libx264/obj/libx264.a)  
12 -# $LINK_OPTIONS the linker options.  
13 -# $SO_PATH the libssl.so.10 and other so file path. 4 +# $SRS_OBJS the objs directory. ie. objs
  5 +# $SRS_MAKEFILE the makefile name. ie. Makefile
  6 +#
  7 +# $MAIN_ENTRANCES array, disable all except the $APP_MAIN itself. ie. ["srs_main_server" "srs_main_bandcheck"]
  8 +# $APP_MAIN the object file that contains main function. ie. srs_main_server
  9 +# $BUILD_KEY a string indicates the build key for Makefile. ie. srs
  10 +# $APP_NAME the app name to output. ie. srs
  11 +# $MODULE_OBJS array, the objects to compile the app.
  12 +# $ModuleLibFiles array, the 3rdpart library file to link with. ie. [objs/st-1.9/obj/libst.a objs/libx264/obj/libx264.a]
  13 +# $LINK_OPTIONS the linker options. ie. -ldl
14 14
15 FILE=${SRS_OBJS}/${SRS_MAKEFILE} 15 FILE=${SRS_OBJS}/${SRS_MAKEFILE}
16 16
@@ -19,8 +19,11 @@ APP_TARGET="${SRS_OBJS}/${APP_NAME}" @@ -19,8 +19,11 @@ APP_TARGET="${SRS_OBJS}/${APP_NAME}"
19 echo "generate app ${APP_NAME} depends..."; 19 echo "generate app ${APP_NAME} depends...";
20 20
21 echo "# build ${APP_TARGET}" >> ${FILE} 21 echo "# build ${APP_TARGET}" >> ${FILE}
  22 +# generate the binary depends, for example:
  23 +# srs: objs/srs
22 echo "${BUILD_KEY}: ${APP_TARGET}" >> ${FILE} 24 echo "${BUILD_KEY}: ${APP_TARGET}" >> ${FILE}
23 - 25 +# the link commands, for example:
  26 +# objs/srs: objs/src/core/srs_core.o
24 echo -n "${APP_TARGET}: " >> ${FILE} 27 echo -n "${APP_TARGET}: " >> ${FILE}
25 for item in ${MODULE_OBJS[*]}; do 28 for item in ${MODULE_OBJS[*]}; do
26 FILE_NAME=`basename $item` 29 FILE_NAME=`basename $item`
@@ -50,7 +53,9 @@ echo "" >> ${FILE} @@ -50,7 +53,9 @@ echo "" >> ${FILE}
50 53
51 echo "generate app ${APP_NAME} link..."; 54 echo "generate app ${APP_NAME} link...";
52 55
53 -echo -n " \$(LINK) ${PerformanceLink} -o ${APP_TARGET} " >> ${FILE} 56 +# genereate the actual link command, for example:
  57 +# $(LINK) -o objs/srs objs/src/core/srs_core.o -ldl
  58 +echo -n " \$(LINK) -o ${APP_TARGET} " >> ${FILE}
54 for item in ${MODULE_OBJS[*]}; do 59 for item in ${MODULE_OBJS[*]}; do
55 FILE_NAME=`basename $item` 60 FILE_NAME=`basename $item`
56 FILE_NAME=${FILE_NAME%.*} 61 FILE_NAME=${FILE_NAME%.*}
@@ -83,10 +88,4 @@ done @@ -83,10 +88,4 @@ done
83 echo -n "${LINK_OPTIONS}" >> ${FILE} 88 echo -n "${LINK_OPTIONS}" >> ${FILE}
84 echo "" >> ${FILE} 89 echo "" >> ${FILE}
85 90
86 -# set the so reference path.  
87 -if [[ ! -z ${SO_PATH} ]]; then  
88 - echo -n " @bash auto/set_so_rpath.sh ${SOPathTool} ${APP_TARGET} ${SO_PATH}" >> ${FILE}  
89 - echo "" >> ${FILE}  
90 -fi  
91 -  
92 echo -n "generate app ${APP_NAME} ok"; echo '!'; 91 echo -n "generate app ${APP_NAME} ok"; echo '!';
@@ -157,9 +157,9 @@ ModuleLibFiles=(${LibSTfile} ${LibHttpParserfile} ${LibSSLfile}) @@ -157,9 +157,9 @@ ModuleLibFiles=(${LibSTfile} ${LibHttpParserfile} ${LibSSLfile})
157 MODULE_OBJS="${CORE_OBJS[@]} ${CONFIG_OBJS[@]} ${PROTOCOL_OBJS[@]} ${MAIN_OBJS[@]}" 157 MODULE_OBJS="${CORE_OBJS[@]} ${CONFIG_OBJS[@]} ${PROTOCOL_OBJS[@]} ${MAIN_OBJS[@]}"
158 LINK_OPTIONS="-ldl" 158 LINK_OPTIONS="-ldl"
159 # srs(simple rtmp server) over st(state-threads) 159 # srs(simple rtmp server) over st(state-threads)
160 -BUILD_KEY="srs" APP_MAIN="srs_main_server" APP_NAME="srs" SO_PATH="" . auto/apps.sh 160 +BUILD_KEY="srs" APP_MAIN="srs_main_server" APP_NAME="srs" . auto/apps.sh
161 # bandwidth test tool, to test the bandwidth to server 161 # bandwidth test tool, to test the bandwidth to server
162 -BUILD_KEY="bandwidth" APP_MAIN="srs_main_bandcheck" APP_NAME="bandwidth" SO_PATH="" . auto/apps.sh 162 +BUILD_KEY="bandwidth" APP_MAIN="srs_main_bandcheck" APP_NAME="bandwidth" . auto/apps.sh
163 163
164 echo 'configure ok! ' 164 echo 'configure ok! '
165 165
@@ -68,7 +68,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. @@ -68,7 +68,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
68 (void)0 68 (void)0
69 69
70 // current release version 70 // current release version
71 -#define RTMP_SIG_SRS_VERSION "0.9.2" 71 +#define RTMP_SIG_SRS_VERSION "0.9.3"
72 // server info. 72 // server info.
73 #define RTMP_SIG_SRS_KEY "srs" 73 #define RTMP_SIG_SRS_KEY "srs"
74 #define RTMP_SIG_SRS_ROLE "origin server" 74 #define RTMP_SIG_SRS_ROLE "origin server"