winlin

use relative objs dir for makefile. for bug #191

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 '!';
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,8 +4,9 @@ @@ -4,8 +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_WORKDIR="./"  
8 -SRS_OBJS="${SRS_WORKDIR}/objs" 7 +SRS_WORKDIR="."
  8 +SRS_OBJS_DIR="objs"
  9 +SRS_OBJS="${SRS_WORKDIR}/${SRS_OBJS_DIR}"
9 mkdir -p ${SRS_OBJS} 10 mkdir -p ${SRS_OBJS}
10 11
11 ##################################################################################### 12 #####################################################################################
@@ -30,10 +31,12 @@ if [ $SRS_EXPORT_LIBRTMP != NO ]; then @@ -30,10 +31,12 @@ if [ $SRS_EXPORT_LIBRTMP != NO ]; then
30 exit 1 31 exit 1
31 fi 32 fi
32 # create target 33 # create target
33 - SRS_WORKDIR=${SRS_EXPORT_LIBRTMP} && SRS_OBJS=${SRS_WORKDIR}/objs && mkdir -p ${SRS_OBJS} && 34 + SRS_WORKDIR=${SRS_EXPORT_LIBRTMP} && SRS_OBJS=${SRS_WORKDIR}/${SRS_OBJS_DIR} && mkdir -p ${SRS_OBJS} &&
34 # copy src to target 35 # 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 && 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 _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}
37 # check ret 40 # check ret
38 ret=$?; if [[ $ret -ne 0 ]]; then echo "export src failed, ret=$ret"; exit $ret; fi 41 ret=$?; if [[ $ret -ne 0 ]]; then echo "export src failed, ret=$ret"; exit $ret; fi
39 fi 42 fi
@@ -119,7 +122,7 @@ SrsLibrtmpSampleEntry="nossl" @@ -119,7 +122,7 @@ SrsLibrtmpSampleEntry="nossl"
119 if [ $SRS_SSL = YES ]; then SrsLibrtmpSampleEntry="ssl";fi 122 if [ $SRS_SSL = YES ]; then SrsLibrtmpSampleEntry="ssl";fi
120 # utest make entry, (cd utest; make) 123 # utest make entry, (cd utest; make)
121 SrsUtestMakeEntry="@echo -e \"ignore utest for it's disabled\"" 124 SrsUtestMakeEntry="@echo -e \"ignore utest for it's disabled\""
122 -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
123 126
124 ##################################################################################### 127 #####################################################################################
125 # generate colorful summary script 128 # generate colorful summary script
@@ -172,9 +175,9 @@ help: @@ -172,9 +175,9 @@ help:
172 @echo " uninstall uninstall srs from prefix path" 175 @echo " uninstall uninstall srs from prefix path"
173 176
174 clean: 177 clean:
175 - (cd ${SRS_OBJS}; rm -rf srs srs_utest)  
176 - (cd ${SRS_OBJS}; rm -rf src research include lib)  
177 - (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)
178 (cd research/librtmp; make clean) 181 (cd research/librtmp; make clean)
179 (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)
180 183
@@ -191,7 +194,7 @@ else @@ -191,7 +194,7 @@ else
191 cat << END >> ${SRS_WORKDIR}/${SRS_MAKEFILE} 194 cat << END >> ${SRS_WORKDIR}/${SRS_MAKEFILE}
192 server: _prepare_dir 195 server: _prepare_dir
193 @echo "build the srs(simple rtmp server) over st(state-threads)" 196 @echo "build the srs(simple rtmp server) over st(state-threads)"
194 - \$(MAKE) -f ${SRS_OBJS}/${SRS_MAKEFILE} srs 197 + \$(MAKE) -f ${SRS_OBJS_DIR}/${SRS_MAKEFILE} srs
195 198
196 END 199 END
197 fi 200 fi
@@ -269,7 +272,7 @@ if [ $SRS_LIBRTMP = YES ]; then @@ -269,7 +272,7 @@ if [ $SRS_LIBRTMP = YES ]; then
269 cat << END >> ${SRS_WORKDIR}/${SRS_MAKEFILE} 272 cat << END >> ${SRS_WORKDIR}/${SRS_MAKEFILE}
270 librtmp: server 273 librtmp: server
271 @echo "build the client publish/play library." 274 @echo "build the client publish/play library."
272 - \$(MAKE) -f ${SRS_OBJS}/${SRS_MAKEFILE} librtmp 275 + \$(MAKE) -f ${SRS_OBJS_DIR}/${SRS_MAKEFILE} librtmp
273 @echo "build the srs-librtmp sample" 276 @echo "build the srs-librtmp sample"
274 (cd research/librtmp; \$(MAKE) ${SrsLibrtmpSampleEntry}) 277 (cd research/librtmp; \$(MAKE) ${SrsLibrtmpSampleEntry})
275 278
@@ -301,7 +304,7 @@ fi @@ -301,7 +304,7 @@ fi
301 cat << END >> ${SRS_WORKDIR}/${SRS_MAKEFILE} 304 cat << END >> ${SRS_WORKDIR}/${SRS_MAKEFILE}
302 # the ./configure will generate it. 305 # the ./configure will generate it.
303 _prepare_dir: 306 _prepare_dir:
304 - @mkdir -p ${SRS_OBJS} 307 + @mkdir -p ${SRS_OBJS_DIR}
305 END 308 END
306 309
307 ##################################################################################### 310 #####################################################################################
@@ -340,16 +343,16 @@ END @@ -340,16 +343,16 @@ END
340 # 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
341 # 344 #
342 # st(state-threads) the basic network library for SRS. 345 # st(state-threads) the basic network library for SRS.
343 -LibSTRoot="${SRS_OBJS}/st"; LibSTfile="${LibSTRoot}/libst.a" 346 +LibSTRoot="${SRS_OBJS_DIR}/st"; LibSTfile="${LibSTRoot}/libst.a"
344 # 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.
345 LibHttpParserRoot=""; LibHttpParserfile="" 348 LibHttpParserRoot=""; LibHttpParserfile=""
346 -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
347 # openssl-1.0.1f, for the RTMP complex handshake. 350 # openssl-1.0.1f, for the RTMP complex handshake.
348 LibSSLRoot="";LibSSLfile="" 351 LibSSLRoot="";LibSSLfile=""
349 -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
350 # gperftools-2.1, for mem check and mem/cpu profile 353 # gperftools-2.1, for mem check and mem/cpu profile
351 LibGperfRoot=""; LibGperfFile="" 354 LibGperfRoot=""; LibGperfFile=""
352 -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
353 # the link options, always use static link 356 # the link options, always use static link
354 SrsLinkOptions="-ldl"; 357 SrsLinkOptions="-ldl";
355 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
@@ -365,7 +368,7 @@ if [ $SRS_MIPS_UBUNTU12 = YES ]; then SrsLinkOptions="${SrsLinkOptions} -lgcc_eh @@ -365,7 +368,7 @@ if [ $SRS_MIPS_UBUNTU12 = YES ]; then SrsLinkOptions="${SrsLinkOptions} -lgcc_eh
365 #Core, depends only on system apis. 368 #Core, depends only on system apis.
366 MODULE_ID="CORE" 369 MODULE_ID="CORE"
367 MODULE_DEPENDS=() 370 MODULE_DEPENDS=()
368 -ModuleLibIncs=(${SRS_OBJS}) 371 +ModuleLibIncs=(${SRS_OBJS_DIR})
369 MODULE_FILES=("srs_core" "srs_core_autofree") 372 MODULE_FILES=("srs_core" "srs_core_autofree")
370 CORE_INCS="src/core"; MODULE_DIR=${CORE_INCS} . auto/modules.sh 373 CORE_INCS="src/core"; MODULE_DIR=${CORE_INCS} . auto/modules.sh
371 CORE_OBJS="${MODULE_OBJS[@]}" 374 CORE_OBJS="${MODULE_OBJS[@]}"
@@ -373,7 +376,7 @@ CORE_OBJS="${MODULE_OBJS[@]}" @@ -373,7 +376,7 @@ CORE_OBJS="${MODULE_OBJS[@]}"
373 #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.
374 MODULE_ID="KERNEL" 377 MODULE_ID="KERNEL"
375 MODULE_DEPENDS=("CORE") 378 MODULE_DEPENDS=("CORE")
376 -ModuleLibIncs=(${SRS_OBJS}) 379 +ModuleLibIncs=(${SRS_OBJS_DIR})
377 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"
378 "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"
379 "srs_kernel_consts") 382 "srs_kernel_consts")
@@ -383,7 +386,7 @@ KERNEL_OBJS="${MODULE_OBJS[@]}" @@ -383,7 +386,7 @@ KERNEL_OBJS="${MODULE_OBJS[@]}"
383 #RTMP Protocol, depends on core/kernel, provides rtmp/htttp protocol features. 386 #RTMP Protocol, depends on core/kernel, provides rtmp/htttp protocol features.
384 MODULE_ID="RTMP" 387 MODULE_ID="RTMP"
385 MODULE_DEPENDS=("CORE" "KERNEL") 388 MODULE_DEPENDS=("CORE" "KERNEL")
386 -ModuleLibIncs=(${SRS_OBJS} ${LibSSLRoot}) 389 +ModuleLibIncs=(${SRS_OBJS_DIR} ${LibSSLRoot})
387 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"
388 "srs_protocol_handshake" "srs_protocol_utility" "srs_protocol_msg_array") 391 "srs_protocol_handshake" "srs_protocol_utility" "srs_protocol_msg_array")
389 RTMP_INCS="src/rtmp"; MODULE_DIR=${RTMP_INCS} . auto/modules.sh 392 RTMP_INCS="src/rtmp"; MODULE_DIR=${RTMP_INCS} . auto/modules.sh
@@ -393,7 +396,7 @@ RTMP_OBJS="${MODULE_OBJS[@]}" @@ -393,7 +396,7 @@ RTMP_OBJS="${MODULE_OBJS[@]}"
393 if [ $SRS_EXPORT_LIBRTMP = NO ]; then 396 if [ $SRS_EXPORT_LIBRTMP = NO ]; then
394 MODULE_ID="APP" 397 MODULE_ID="APP"
395 MODULE_DEPENDS=("CORE" "KERNEL" "RTMP") 398 MODULE_DEPENDS=("CORE" "KERNEL" "RTMP")
396 - ModuleLibIncs=(${LibSTRoot} ${LibHttpParserRoot} ${SRS_OBJS}) 399 + ModuleLibIncs=(${LibSTRoot} ${LibHttpParserRoot} ${SRS_OBJS_DIR})
397 MODULE_FILES=("srs_app_server" "srs_app_conn" "srs_app_rtmp_conn" "srs_app_st_socket" "srs_app_source" 400 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" 401 "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" 402 "srs_app_thread" "srs_app_bandwidth" "srs_app_st" "srs_app_log" "srs_app_config"
@@ -407,7 +410,7 @@ fi @@ -407,7 +410,7 @@ fi
407 #LIBS Module, build libsrs.a for static link. 410 #LIBS Module, build libsrs.a for static link.
408 MODULE_ID="LIBS" 411 MODULE_ID="LIBS"
409 MODULE_DEPENDS=("CORE" "KERNEL" "RTMP") 412 MODULE_DEPENDS=("CORE" "KERNEL" "RTMP")
410 -ModuleLibIncs=(${SRS_OBJS}) 413 +ModuleLibIncs=(${SRS_OBJS_DIR})
411 MODULE_FILES=("srs_librtmp" "srs_lib_simple_socket" "srs_lib_bandwidth") 414 MODULE_FILES=("srs_librtmp" "srs_lib_simple_socket" "srs_lib_bandwidth")
412 LIBS_INCS="src/libs"; MODULE_DIR=${LIBS_INCS} . auto/modules.sh 415 LIBS_INCS="src/libs"; MODULE_DIR=${LIBS_INCS} . auto/modules.sh
413 LIBS_OBJS="${MODULE_OBJS[@]}" 416 LIBS_OBJS="${MODULE_OBJS[@]}"
@@ -416,7 +419,7 @@ LIBS_OBJS="${MODULE_OBJS[@]}" @@ -416,7 +419,7 @@ LIBS_OBJS="${MODULE_OBJS[@]}"
416 if [ $SRS_EXPORT_LIBRTMP = NO ]; then 419 if [ $SRS_EXPORT_LIBRTMP = NO ]; then
417 MODULE_ID="MAIN" 420 MODULE_ID="MAIN"
418 MODULE_DEPENDS=("CORE" "KERNEL" "RTMP" "APP") 421 MODULE_DEPENDS=("CORE" "KERNEL" "RTMP" "APP")
419 - ModuleLibIncs=(${LibSTRoot} ${SRS_OBJS} ${LibGperfRoot}) 422 + ModuleLibIncs=(${LibSTRoot} ${SRS_OBJS_DIR} ${LibGperfRoot})
420 MODULE_FILES=("srs_main_server") 423 MODULE_FILES=("srs_main_server")
421 MAIN_INCS="src/main"; MODULE_DIR=${MAIN_INCS} . auto/modules.sh 424 MAIN_INCS="src/main"; MODULE_DIR=${MAIN_INCS} . auto/modules.sh
422 MAIN_OBJS="${MODULE_OBJS[@]}" 425 MAIN_OBJS="${MODULE_OBJS[@]}"
@@ -452,7 +455,7 @@ if [ $SRS_UTEST = YES ]; then @@ -452,7 +455,7 @@ if [ $SRS_UTEST = YES ]; then
452 MODULE_FILES=("srs_utest" "srs_utest_amf0" "srs_utest_protocol" 455 MODULE_FILES=("srs_utest" "srs_utest_amf0" "srs_utest_protocol"
453 "srs_utest_kernel" "srs_utest_core" "srs_utest_config" 456 "srs_utest_kernel" "srs_utest_core" "srs_utest_config"
454 "srs_utest_reload") 457 "srs_utest_reload")
455 - ModuleLibIncs=(${SRS_OBJS} ${LibSTRoot} ${LibSSLRoot}) 458 + ModuleLibIncs=(${SRS_OBJS_DIR} ${LibSTRoot} ${LibSSLRoot})
456 ModuleLibFiles=(${LibSTfile} ${LibHttpParserfile} ${LibSSLfile}) 459 ModuleLibFiles=(${LibSTfile} ${LibHttpParserfile} ${LibSSLfile})
457 MODULE_DEPENDS=("CORE" "KERNEL" "RTMP" "APP") 460 MODULE_DEPENDS=("CORE" "KERNEL" "RTMP" "APP")
458 MODULE_OBJS="${CORE_OBJS[@]} ${KERNEL_OBJS[@]} ${RTMP_OBJS[@]} ${APP_OBJS[@]}" 461 MODULE_OBJS="${CORE_OBJS[@]} ${KERNEL_OBJS[@]} ${RTMP_OBJS[@]} ${APP_OBJS[@]}"