From e37f312f277ebdf79794dd3f378eaaf45d028060 Mon Sep 17 00:00:00 2001 From: winlin Date: Sun, 27 Jul 2014 21:56:44 +0800 Subject: [PATCH] refine the code for ios build. add authors StevenLiu. 0.9.177 --- AUTHORS.txt | 2 +- trunk/auto/depends.sh | 58 ++++++++++++------------------------- trunk/auto/options.sh | 11 +++++-- trunk/src/core/srs_core.hpp | 2 +- 4 files changed, 29 insertions(+), 44 deletions(-) mode change 100755 => 100644 AUTHORS.txt diff --git a/AUTHORS.txt b/AUTHORS.txt old mode 100755 new mode 100644 index eb077359c..f0df62105 --- a/AUTHORS.txt +++ b/AUTHORS.txt @@ -10,4 +10,4 @@ Authors ordered by first contribution. * suhetao * Johnny * karthikeyan - \ No newline at end of file +* StevenLiu diff --git a/trunk/auto/depends.sh b/trunk/auto/depends.sh index 1534051b0..aa2253926 100755 --- a/trunk/auto/depends.sh +++ b/trunk/auto/depends.sh @@ -304,9 +304,10 @@ OSX_prepare; ret=$?; if [[ 0 -ne $ret ]]; then echo "OSX prepare failed, ret=$re # st-1.9 ##################################################################################### # check the arm flag file, if flag changed, need to rebuild the st. +_ST_MAKE=linux-debug if [ $SRS_EMBEDED_CPU = YES ]; then # ok, arm specified, if the flag filed does not exists, need to rebuild. - if [[ -f ${SRS_OBJS}/_flag.st.arm.tmp && -f ${SRS_OBJS}/st/libst.a && -f ${SRS_OBJS}/st/libst.so ]]; then + if [[ -f ${SRS_OBJS}/_flag.st.arm.tmp && -f ${SRS_OBJS}/st/libst.a ]]; then echo "st-1.9t for arm is ok."; else # TODO: FIXME: patch the bug. @@ -316,55 +317,34 @@ if [ $SRS_EMBEDED_CPU = YES ]; then rm -rf ${SRS_OBJS}/st-1.9 && cd ${SRS_OBJS} && unzip -q ../3rdparty/st-1.9.zip && cd st-1.9 && patch -p0 < ../../3rdparty/patches/1.st.arm.patch && - make CC=${SrsArmCC} AR=${SrsArmAR} LD=${SrsArmLD} RANDLIB=${SrsArmRANDLIB} EXTRA_CFLAGS="-DMD_HAVE_EPOLL" linux-debug && + make CC=${SrsArmCC} AR=${SrsArmAR} LD=${SrsArmLD} RANDLIB=${SrsArmRANDLIB} EXTRA_CFLAGS="-DMD_HAVE_EPOLL" ${_ST_MAKE} && cd .. && rm -rf st && ln -sf st-1.9/obj st && cd .. && touch ${SRS_OBJS}/_flag.st.arm.tmp ) fi else - if [ $OS_IS_OSX = YES ]; then - if [[ ! -f ${SRS_OBJS}/_flag.st.arm.tmp && -f ${SRS_OBJS}/st/libst.a && -f ${SRS_OBJS}/st/libst.so ]]; then - echo "st-1.9t is ok."; - else - echo "build st-1.9t"; - ( - rm -rf ${SRS_OBJS}/st-1.9 && cd ${SRS_OBJS} && - unzip -q ../3rdparty/st-1.9.zip && cd st-1.9 && - echo "we alaways patch the st, for we may build srs under arm directly" && - echo "the 1.st.arm.patch is ok for x86 because it's only modify code under macro linux arm" && - patch -p0 < ../../3rdparty/patches/1.st.arm.patch && - make darwin-debug && - cd .. && rm -rf st && ln -sf st-1.9/obj st && - cd .. && rm -f ${SRS_OBJS}/_flag.st.arm.tmp - ) - fi + if [ $SRS_OSX = YES ]; then + _ST_MAKE=darwin-debug + fi + if [[ ! -f ${SRS_OBJS}/_flag.st.arm.tmp && -f ${SRS_OBJS}/st/libst.a ]]; then + echo "st-1.9t is ok."; else - # arm not specified, if exists flag, need to rebuild for no-arm platform. - if [[ ! -f ${SRS_OBJS}/_flag.st.arm.tmp && -f ${SRS_OBJS}/st/libst.a && -f ${SRS_OBJS}/st/libst.so ]]; then - echo "st-1.9t is ok."; - else - echo "build st-1.9t"; - ( - rm -rf ${SRS_OBJS}/st-1.9 && cd ${SRS_OBJS} && - unzip -q ../3rdparty/st-1.9.zip && cd st-1.9 && - echo "we alaways patch the st, for we may build srs under arm directly" && - echo "the 1.st.arm.patch is ok for x86 because it's only modify code under macro linux arm" && - patch -p0 < ../../3rdparty/patches/1.st.arm.patch && - make EXTRA_CFLAGS="-DMD_HAVE_EPOLL" linux-debug && - cd .. && rm -rf st && ln -sf st-1.9/obj st && - cd .. && rm -f ${SRS_OBJS}/_flag.st.arm.tmp - ) - fi + echo "build st-1.9t"; + ( + rm -rf ${SRS_OBJS}/st-1.9 && cd ${SRS_OBJS} && + unzip -q ../3rdparty/st-1.9.zip && cd st-1.9 && + echo "we alaways patch the st, for we may build srs under arm directly" && + echo "the 1.st.arm.patch is ok for x86 because it's only modify code under macro linux arm" && + patch -p0 < ../../3rdparty/patches/1.st.arm.patch && + make ${_ST_MAKE} && + cd .. && rm -rf st && ln -sf st-1.9/obj st && + cd .. && rm -f ${SRS_OBJS}/_flag.st.arm.tmp + ) fi fi # check status ret=$?; if [[ $ret -ne 0 ]]; then echo "build st-1.9 failed, ret=$ret"; exit $ret; fi if [ ! -f ${SRS_OBJS}/st/libst.a ]; then echo "build st-1.9 static lib failed."; exit -1; fi -if [ OS_IS_OSX = Darwin ] then - if [ ! -f ${SRS_OBJS}/st/libst.dylib ]; then echo "build st-1.9 shared lib failed."; exit -1; fi -else - if [ ! -f ${SRS_OBJS}/st/libst.so ]; then echo "build st-1.9 shared lib failed."; exit -1; fi -fi ##################################################################################### # http-parser-2.1 diff --git a/trunk/auto/options.sh b/trunk/auto/options.sh index dfe0b1004..7e114b46e 100755 --- a/trunk/auto/options.sh +++ b/trunk/auto/options.sh @@ -62,6 +62,8 @@ SRS_USE_SYS_SSL=NO # presets # for x86/x64 pc/servers SRS_X86_X64=NO +# for ios(darwin) +SRS_OSX=NO # armhf(v7cpu) built on ubuntu12 SRS_ARM_UBUNTU12=NO # mips built on ubuntu12 @@ -158,6 +160,7 @@ Options: Presets: --x86-x64 [default] for x86/x64 cpu, common pc and servers. + --osx for IOS(darwin) to build SRS. --pi for raspberry-pi(directly build), open features hls/ssl/static. --cubie for cubieboard(directly build), open features except ffmpeg/nginx. --arm alias for --with-arm-ubuntu12, for ubuntu12, arm crossbuild @@ -246,13 +249,13 @@ function parse_user_option() { --log-trace) SRS_LOG_TRACE=YES ;; --x86-x64) SRS_X86_X64=YES ;; + --osx) SRS_OSX=YES ;; --arm) SRS_ARM_UBUNTU12=YES ;; --mips) SRS_MIPS_UBUNTU12=YES ;; --pi) SRS_PI=YES ;; --cubie) SRS_CUBIE=YES ;; --dev) SRS_DEV=YES ;; --fast-dev) SRS_FAST_DEV=YES ;; - --osx-dev) SRS_OSX_DEV=YES ;; --demo) SRS_DEMO=YES ;; --fast) SRS_FAST=YES ;; --disable-all) SRS_DISABLE_ALL=YES ;; @@ -316,7 +319,9 @@ function apply_user_presets() { if [ $SRS_PI = NO ]; then if [ $SRS_CUBIE = NO ]; then if [ $SRS_X86_X64 = NO ]; then - SRS_X86_X64=YES; opt="--x86-x64 $opt"; + if [ $SRS_OSX = NO ]; then + SRS_X86_X64=YES; opt="--x86-x64 $opt"; + fi fi fi fi @@ -581,7 +586,7 @@ function apply_user_presets() { fi # if osx dev specified, open main server features. - if [ $SRS_OSX_DEV = YES ]; then + if [ $SRS_OSX = YES ]; then SRS_HLS=YES SRS_DVR=YES SRS_NGINX=NO diff --git a/trunk/src/core/srs_core.hpp b/trunk/src/core/srs_core.hpp index fa2d7c464..01faf0070 100644 --- a/trunk/src/core/srs_core.hpp +++ b/trunk/src/core/srs_core.hpp @@ -31,7 +31,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // current release version #define VERSION_MAJOR "0" #define VERSION_MINOR "9" -#define VERSION_REVISION "176" +#define VERSION_REVISION "177" #define RTMP_SIG_SRS_VERSION VERSION_MAJOR"."VERSION_MINOR"."VERSION_REVISION // server info. #define RTMP_SIG_SRS_KEY "SRS"