winlin

refine the code for ios build. add authors StevenLiu. 0.9.177

@@ -10,4 +10,4 @@ Authors ordered by first contribution. @@ -10,4 +10,4 @@ Authors ordered by first contribution.
10 * suhetao<suhetao@gmail.com> 10 * suhetao<suhetao@gmail.com>
11 * Johnny<fengjihu@163.com> 11 * Johnny<fengjihu@163.com>
12 * karthikeyan<keyanmca@gmail.com> 12 * karthikeyan<keyanmca@gmail.com>
13 -  
  13 +* StevenLiu<lq@chinaffmpeg.org>
@@ -304,9 +304,10 @@ OSX_prepare; ret=$?; if [[ 0 -ne $ret ]]; then echo "OSX prepare failed, ret=$re @@ -304,9 +304,10 @@ OSX_prepare; ret=$?; if [[ 0 -ne $ret ]]; then echo "OSX prepare failed, ret=$re
304 # st-1.9 304 # st-1.9
305 ##################################################################################### 305 #####################################################################################
306 # check the arm flag file, if flag changed, need to rebuild the st. 306 # check the arm flag file, if flag changed, need to rebuild the st.
  307 +_ST_MAKE=linux-debug
307 if [ $SRS_EMBEDED_CPU = YES ]; then 308 if [ $SRS_EMBEDED_CPU = YES ]; then
308 # ok, arm specified, if the flag filed does not exists, need to rebuild. 309 # ok, arm specified, if the flag filed does not exists, need to rebuild.
309 - if [[ -f ${SRS_OBJS}/_flag.st.arm.tmp && -f ${SRS_OBJS}/st/libst.a && -f ${SRS_OBJS}/st/libst.so ]]; then 310 + if [[ -f ${SRS_OBJS}/_flag.st.arm.tmp && -f ${SRS_OBJS}/st/libst.a ]]; then
310 echo "st-1.9t for arm is ok."; 311 echo "st-1.9t for arm is ok.";
311 else 312 else
312 # TODO: FIXME: patch the bug. 313 # TODO: FIXME: patch the bug.
@@ -316,55 +317,34 @@ if [ $SRS_EMBEDED_CPU = YES ]; then @@ -316,55 +317,34 @@ if [ $SRS_EMBEDED_CPU = YES ]; then
316 rm -rf ${SRS_OBJS}/st-1.9 && cd ${SRS_OBJS} && 317 rm -rf ${SRS_OBJS}/st-1.9 && cd ${SRS_OBJS} &&
317 unzip -q ../3rdparty/st-1.9.zip && cd st-1.9 && 318 unzip -q ../3rdparty/st-1.9.zip && cd st-1.9 &&
318 patch -p0 < ../../3rdparty/patches/1.st.arm.patch && 319 patch -p0 < ../../3rdparty/patches/1.st.arm.patch &&
319 - make CC=${SrsArmCC} AR=${SrsArmAR} LD=${SrsArmLD} RANDLIB=${SrsArmRANDLIB} EXTRA_CFLAGS="-DMD_HAVE_EPOLL" linux-debug && 320 + make CC=${SrsArmCC} AR=${SrsArmAR} LD=${SrsArmLD} RANDLIB=${SrsArmRANDLIB} EXTRA_CFLAGS="-DMD_HAVE_EPOLL" ${_ST_MAKE} &&
320 cd .. && rm -rf st && ln -sf st-1.9/obj st && 321 cd .. && rm -rf st && ln -sf st-1.9/obj st &&
321 cd .. && touch ${SRS_OBJS}/_flag.st.arm.tmp 322 cd .. && touch ${SRS_OBJS}/_flag.st.arm.tmp
322 ) 323 )
323 fi 324 fi
324 else 325 else
325 - if [ $OS_IS_OSX = YES ]; then  
326 - if [[ ! -f ${SRS_OBJS}/_flag.st.arm.tmp && -f ${SRS_OBJS}/st/libst.a && -f ${SRS_OBJS}/st/libst.so ]]; then  
327 - echo "st-1.9t is ok.";  
328 - else  
329 - echo "build st-1.9t";  
330 - (  
331 - rm -rf ${SRS_OBJS}/st-1.9 && cd ${SRS_OBJS} &&  
332 - unzip -q ../3rdparty/st-1.9.zip && cd st-1.9 &&  
333 - echo "we alaways patch the st, for we may build srs under arm directly" &&  
334 - echo "the 1.st.arm.patch is ok for x86 because it's only modify code under macro linux arm" &&  
335 - patch -p0 < ../../3rdparty/patches/1.st.arm.patch &&  
336 - make darwin-debug &&  
337 - cd .. && rm -rf st && ln -sf st-1.9/obj st &&  
338 - cd .. && rm -f ${SRS_OBJS}/_flag.st.arm.tmp  
339 - )  
340 - fi 326 + if [ $SRS_OSX = YES ]; then
  327 + _ST_MAKE=darwin-debug
  328 + fi
  329 + if [[ ! -f ${SRS_OBJS}/_flag.st.arm.tmp && -f ${SRS_OBJS}/st/libst.a ]]; then
  330 + echo "st-1.9t is ok.";
341 else 331 else
342 - # arm not specified, if exists flag, need to rebuild for no-arm platform.  
343 - if [[ ! -f ${SRS_OBJS}/_flag.st.arm.tmp && -f ${SRS_OBJS}/st/libst.a && -f ${SRS_OBJS}/st/libst.so ]]; then  
344 - echo "st-1.9t is ok.";  
345 - else  
346 - echo "build st-1.9t";  
347 - (  
348 - rm -rf ${SRS_OBJS}/st-1.9 && cd ${SRS_OBJS} &&  
349 - unzip -q ../3rdparty/st-1.9.zip && cd st-1.9 &&  
350 - echo "we alaways patch the st, for we may build srs under arm directly" &&  
351 - echo "the 1.st.arm.patch is ok for x86 because it's only modify code under macro linux arm" &&  
352 - patch -p0 < ../../3rdparty/patches/1.st.arm.patch &&  
353 - make EXTRA_CFLAGS="-DMD_HAVE_EPOLL" linux-debug &&  
354 - cd .. && rm -rf st && ln -sf st-1.9/obj st &&  
355 - cd .. && rm -f ${SRS_OBJS}/_flag.st.arm.tmp  
356 - )  
357 - fi 332 + echo "build st-1.9t";
  333 + (
  334 + rm -rf ${SRS_OBJS}/st-1.9 && cd ${SRS_OBJS} &&
  335 + unzip -q ../3rdparty/st-1.9.zip && cd st-1.9 &&
  336 + echo "we alaways patch the st, for we may build srs under arm directly" &&
  337 + echo "the 1.st.arm.patch is ok for x86 because it's only modify code under macro linux arm" &&
  338 + patch -p0 < ../../3rdparty/patches/1.st.arm.patch &&
  339 + make ${_ST_MAKE} &&
  340 + cd .. && rm -rf st && ln -sf st-1.9/obj st &&
  341 + cd .. && rm -f ${SRS_OBJS}/_flag.st.arm.tmp
  342 + )
358 fi 343 fi
359 fi 344 fi
360 # check status 345 # check status
361 ret=$?; if [[ $ret -ne 0 ]]; then echo "build st-1.9 failed, ret=$ret"; exit $ret; fi 346 ret=$?; if [[ $ret -ne 0 ]]; then echo "build st-1.9 failed, ret=$ret"; exit $ret; fi
362 if [ ! -f ${SRS_OBJS}/st/libst.a ]; then echo "build st-1.9 static lib failed."; exit -1; fi 347 if [ ! -f ${SRS_OBJS}/st/libst.a ]; then echo "build st-1.9 static lib failed."; exit -1; fi
363 -if [ OS_IS_OSX = Darwin ] then  
364 - if [ ! -f ${SRS_OBJS}/st/libst.dylib ]; then echo "build st-1.9 shared lib failed."; exit -1; fi  
365 -else  
366 - if [ ! -f ${SRS_OBJS}/st/libst.so ]; then echo "build st-1.9 shared lib failed."; exit -1; fi  
367 -fi  
368 348
369 ##################################################################################### 349 #####################################################################################
370 # http-parser-2.1 350 # http-parser-2.1
@@ -62,6 +62,8 @@ SRS_USE_SYS_SSL=NO @@ -62,6 +62,8 @@ SRS_USE_SYS_SSL=NO
62 # presets 62 # presets
63 # for x86/x64 pc/servers 63 # for x86/x64 pc/servers
64 SRS_X86_X64=NO 64 SRS_X86_X64=NO
  65 +# for ios(darwin)
  66 +SRS_OSX=NO
65 # armhf(v7cpu) built on ubuntu12 67 # armhf(v7cpu) built on ubuntu12
66 SRS_ARM_UBUNTU12=NO 68 SRS_ARM_UBUNTU12=NO
67 # mips built on ubuntu12 69 # mips built on ubuntu12
@@ -158,6 +160,7 @@ Options: @@ -158,6 +160,7 @@ Options:
158 160
159 Presets: 161 Presets:
160 --x86-x64 [default] for x86/x64 cpu, common pc and servers. 162 --x86-x64 [default] for x86/x64 cpu, common pc and servers.
  163 + --osx for IOS(darwin) to build SRS.
161 --pi for raspberry-pi(directly build), open features hls/ssl/static. 164 --pi for raspberry-pi(directly build), open features hls/ssl/static.
162 --cubie for cubieboard(directly build), open features except ffmpeg/nginx. 165 --cubie for cubieboard(directly build), open features except ffmpeg/nginx.
163 --arm alias for --with-arm-ubuntu12, for ubuntu12, arm crossbuild 166 --arm alias for --with-arm-ubuntu12, for ubuntu12, arm crossbuild
@@ -246,13 +249,13 @@ function parse_user_option() { @@ -246,13 +249,13 @@ function parse_user_option() {
246 --log-trace) SRS_LOG_TRACE=YES ;; 249 --log-trace) SRS_LOG_TRACE=YES ;;
247 250
248 --x86-x64) SRS_X86_X64=YES ;; 251 --x86-x64) SRS_X86_X64=YES ;;
  252 + --osx) SRS_OSX=YES ;;
249 --arm) SRS_ARM_UBUNTU12=YES ;; 253 --arm) SRS_ARM_UBUNTU12=YES ;;
250 --mips) SRS_MIPS_UBUNTU12=YES ;; 254 --mips) SRS_MIPS_UBUNTU12=YES ;;
251 --pi) SRS_PI=YES ;; 255 --pi) SRS_PI=YES ;;
252 --cubie) SRS_CUBIE=YES ;; 256 --cubie) SRS_CUBIE=YES ;;
253 --dev) SRS_DEV=YES ;; 257 --dev) SRS_DEV=YES ;;
254 --fast-dev) SRS_FAST_DEV=YES ;; 258 --fast-dev) SRS_FAST_DEV=YES ;;
255 - --osx-dev) SRS_OSX_DEV=YES ;;  
256 --demo) SRS_DEMO=YES ;; 259 --demo) SRS_DEMO=YES ;;
257 --fast) SRS_FAST=YES ;; 260 --fast) SRS_FAST=YES ;;
258 --disable-all) SRS_DISABLE_ALL=YES ;; 261 --disable-all) SRS_DISABLE_ALL=YES ;;
@@ -316,7 +319,9 @@ function apply_user_presets() { @@ -316,7 +319,9 @@ function apply_user_presets() {
316 if [ $SRS_PI = NO ]; then 319 if [ $SRS_PI = NO ]; then
317 if [ $SRS_CUBIE = NO ]; then 320 if [ $SRS_CUBIE = NO ]; then
318 if [ $SRS_X86_X64 = NO ]; then 321 if [ $SRS_X86_X64 = NO ]; then
319 - SRS_X86_X64=YES; opt="--x86-x64 $opt"; 322 + if [ $SRS_OSX = NO ]; then
  323 + SRS_X86_X64=YES; opt="--x86-x64 $opt";
  324 + fi
320 fi 325 fi
321 fi 326 fi
322 fi 327 fi
@@ -581,7 +586,7 @@ function apply_user_presets() { @@ -581,7 +586,7 @@ function apply_user_presets() {
581 fi 586 fi
582 587
583 # if osx dev specified, open main server features. 588 # if osx dev specified, open main server features.
584 - if [ $SRS_OSX_DEV = YES ]; then 589 + if [ $SRS_OSX = YES ]; then
585 SRS_HLS=YES 590 SRS_HLS=YES
586 SRS_DVR=YES 591 SRS_DVR=YES
587 SRS_NGINX=NO 592 SRS_NGINX=NO
@@ -31,7 +31,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. @@ -31,7 +31,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
31 // current release version 31 // current release version
32 #define VERSION_MAJOR "0" 32 #define VERSION_MAJOR "0"
33 #define VERSION_MINOR "9" 33 #define VERSION_MINOR "9"
34 -#define VERSION_REVISION "176" 34 +#define VERSION_REVISION "177"
35 #define RTMP_SIG_SRS_VERSION VERSION_MAJOR"."VERSION_MINOR"."VERSION_REVISION 35 #define RTMP_SIG_SRS_VERSION VERSION_MAJOR"."VERSION_MINOR"."VERSION_REVISION
36 // server info. 36 // server info.
37 #define RTMP_SIG_SRS_KEY "SRS" 37 #define RTMP_SIG_SRS_KEY "SRS"