diff --git a/trunk/auto/auto_headers.sh b/trunk/auto/auto_headers.sh index a3dc7ce2e..137eaa269 100644 --- a/trunk/auto/auto_headers.sh +++ b/trunk/auto/auto_headers.sh @@ -67,7 +67,7 @@ if [[ -z $SrsArmAR ]]; then SrsArmAR=$__SrsArmAR; fi if [[ -z $SrsArmLD ]]; then SrsArmLD=$__SrsArmLD; fi if [[ -z $SrsArmRANDLIB ]]; then SrsArmRANDLIB=$__SrsArmRANDLIB; fi # write to source file -if [ $SRS_EMBEDED_CPU = YES ]; then +if [ $SRS_CROSS_BUILD = YES ]; then echo "cc=$SrsArmCC gcc=$SrsArmGCC g++=$SrsArmCXX ar=$SrsArmAR ld=$SrsArmLD randlib=$SrsArmRANDLIB" echo "#define SRS_AUTO_EMBEDED_TOOL_CHAIN \"cc=$SrsArmCC gcc=$SrsArmGCC g++=$SrsArmCXX ar=$SrsArmAR ld=$SrsArmLD randlib=$SrsArmRANDLIB\"" >> $SRS_AUTO_HEADERS_H else @@ -206,7 +206,7 @@ fi ##################################################################################### # for embeded. ##################################################################################### -if [ $SRS_EMBEDED_CPU = YES ]; then +if [ $SRS_CROSS_BUILD = YES ]; then echo "#define SRS_AUTO_EMBEDED_CPU" >> $SRS_AUTO_HEADERS_H else echo "#undef SRS_AUTO_EMBEDED_CPU" >> $SRS_AUTO_HEADERS_H diff --git a/trunk/auto/depends.sh b/trunk/auto/depends.sh index f1666caf6..8a1deb391 100644 --- a/trunk/auto/depends.sh +++ b/trunk/auto/depends.sh @@ -148,7 +148,7 @@ function Centos_prepare() fi # for arm, install the cross build tool chain. - if [ $SRS_EMBEDED_CPU = YES ]; then + if [ $SRS_CROSS_BUILD = YES ]; then echo "embeded(arm/mips) is invalid for CentOS" return 1 fi @@ -253,7 +253,7 @@ function OSX_prepare() fi # for arm, install the cross build tool chain. - if [ $SRS_EMBEDED_CPU = YES ]; then + if [ $SRS_CROSS_BUILD = YES ]; then echo "embeded(arm/mips) is invalid for OSX" return 1 fi @@ -362,12 +362,15 @@ fi ##################################################################################### # user must specifies something what a fuck, we suppport following os: # centos/ubuntu/osx, -# embeded system, for example, mips or arm, +# cross build for embeded system, for example, mips or arm, +# directly build on arm/mips, for example, pi or cubie, # export srs-librtmp # others is invalid. -if [[ $OS_IS_UBUNTU = NO && $OS_IS_CENTOS = NO && $OS_IS_OSX = NO && $SRS_EMBEDED_CPU = NO && $SRS_EXPORT_LIBRTMP_PROJECT = NO ]]; then - echo "what a fuck, os not supported." - exit 1 +if [[ $OS_IS_UBUNTU = NO && $OS_IS_CENTOS = NO && $OS_IS_OSX = NO && $SRS_EXPORT_LIBRTMP_PROJECT = NO ]]; then + if [[ $SRS_PI = NO && $SRS_CUBIE = NO && $SRS_CROSS_BUILD = NO ]]; then + echo "what a fuck, os not supported." + exit 1 + fi fi ##################################################################################### @@ -382,7 +385,7 @@ if [ $SRS_EXPORT_LIBRTMP_PROJECT = NO ]; then fi # memory leak for linux-optimized # @see: https://github.com/simple-rtmp-server/srs/issues/197 - if [ $SRS_EMBEDED_CPU = YES ]; then + if [ $SRS_CROSS_BUILD = 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 ]]; then echo "st-1.9t for arm is ok."; @@ -409,6 +412,7 @@ if [ $SRS_EXPORT_LIBRTMP_PROJECT = NO ]; then ( rm -rf ${SRS_OBJS}/st-1.9 && cd ${SRS_OBJS} && unzip -q ../3rdparty/st-1.9.zip && cd st-1.9 && chmod +w * && + patch -p0 < ../../3rdparty/patches/1.st.arm.patch && patch -p0 < ../../3rdparty/patches/3.st.osx.kqueue.patch && patch -p0 < ../../3rdparty/patches/4.st.disable.examples.patch && make ${_ST_MAKE} ${_ST_EXTRA_CFLAGS} && @@ -428,7 +432,7 @@ fi # check the arm flag file, if flag changed, need to rebuild the st. if [ $SRS_HTTP_CORE = YES ]; then # ok, arm specified, if the flag filed does not exists, need to rebuild. - if [ $SRS_EMBEDED_CPU = YES ]; then + if [ $SRS_CROSS_BUILD = YES ]; then if [[ -f ${SRS_OBJS}/_flag.st.hp.tmp && -f ${SRS_OBJS}/hp/http_parser.h && -f ${SRS_OBJS}/hp/libhttp_parser.a ]]; then echo "http-parser-2.1 for arm is ok."; else @@ -483,7 +487,7 @@ if [ $SRS_EXPORT_LIBRTMP_PROJECT = NO ]; then mkdir -p ${SRS_OBJS}/nginx fi # make nginx -__SRS_BUILD_NGINX=NO; if [ $SRS_EMBEDED_CPU = NO ]; then if [ $SRS_NGINX = YES ]; then __SRS_BUILD_NGINX=YES; fi fi +__SRS_BUILD_NGINX=NO; if [ $SRS_CROSS_BUILD = NO ]; then if [ $SRS_NGINX = YES ]; then __SRS_BUILD_NGINX=YES; fi fi if [ $__SRS_BUILD_NGINX = YES ]; then if [[ -f ${SRS_OBJS}/nginx/sbin/nginx ]]; then echo "nginx-1.5.7 is ok."; @@ -595,7 +599,7 @@ fi ##################################################################################### # extra configure options CONFIGURE_TOOL="./config" -if [ $SRS_EMBEDED_CPU = YES ]; then +if [ $SRS_CROSS_BUILD = YES ]; then CONFIGURE_TOOL="./Configure linux-armv4" fi if [ $SRS_OSX = YES ]; then @@ -610,7 +614,7 @@ if [ $SRS_SSL = YES ]; then echo "warning: donot compile ssl, use system ssl" else # check the arm flag file, if flag changed, need to rebuild the st. - if [ $SRS_EMBEDED_CPU = YES ]; then + if [ $SRS_CROSS_BUILD = YES ]; then # ok, arm specified, if the flag filed does not exists, need to rebuild. if [[ -f ${SRS_OBJS}/_flag.ssl.arm.tmp && -f ${SRS_OBJS}/openssl/lib/libssl.a ]]; then echo "openssl-1.0.1f for arm is ok."; diff --git a/trunk/auto/generate-srs-librtmp-project.sh b/trunk/auto/generate-srs-librtmp-project.sh index d2baf0466..2a24b1265 100755 --- a/trunk/auto/generate-srs-librtmp-project.sh +++ b/trunk/auto/generate-srs-librtmp-project.sh @@ -27,4 +27,4 @@ if [ $SRS_EXPORT_LIBRTMP_PROJECT != NO ]; then _CPT=${SRS_EXPORT_LIBRTMP_PROJECT}/src/libs && mkdir -p ${_CPT} && cp src/libs/* ${_CPT} # check ret ret=$?; if [[ $ret -ne 0 ]]; then echo "export src failed, ret=$ret"; exit $ret; fi -fi \ No newline at end of file +fi diff --git a/trunk/auto/options.sh b/trunk/auto/options.sh index 80856a1f6..3e8fa6885 100755 --- a/trunk/auto/options.sh +++ b/trunk/auto/options.sh @@ -101,9 +101,8 @@ SRS_DISABLE_ALL=NO SRS_ENABLE_ALL=NO # ################################################################ -# calc -# whether embed cpu, arm/mips -SRS_EMBEDED_CPU=NO +# whether cross build for embed cpu, arm/mips +SRS_CROSS_BUILD=NO ##################################################################################### # menu @@ -374,10 +373,10 @@ function apply_user_presets() { # whether embeded cpu. if [ $SRS_ARM_UBUNTU12 = YES ]; then - SRS_EMBEDED_CPU=YES + SRS_CROSS_BUILD=YES fi if [ $SRS_MIPS_UBUNTU12 = YES ]; then - SRS_EMBEDED_CPU=YES + SRS_CROSS_BUILD=YES fi # all disabled. @@ -906,7 +905,7 @@ function check_option_conflicts() { # check embeded(arm/mips), if embeded enabled, only allow st/ssl/librtmp, # user should disable all other features - if [ $SRS_EMBEDED_CPU = YES ]; then + if [ $SRS_CROSS_BUILD = YES ]; then if [ $SRS_FFMPEG_TOOL = YES ]; then echo "ffmpeg for arm is not available, see: ./configure --help"; __check_ok=NO; fi if [ $SRS_RESEARCH = YES ]; then echo "research for arm is not available, see: ./configure --help"; __check_ok=NO; fi if [ $SRS_GPERF = YES ]; then echo "gperf for arm is not available, see: ./configure --help"; __check_ok=NO; fi diff --git a/trunk/configure b/trunk/configure index b61f8dc09..4d47abf8a 100755 --- a/trunk/configure +++ b/trunk/configure @@ -286,7 +286,7 @@ __REAL_INSTALL=\$(DESTDIR)\$(SRS_PREFIX) END # embeded, ubuntu12, use embeded tool chain. -if [ $SRS_EMBEDED_CPU = YES ]; then +if [ $SRS_CROSS_BUILD = YES ]; then cat << END >> ${SRS_WORKDIR}/${SRS_MAKEFILE} default: \$(MAKE) GCC=${SrsArmGCC} CXX=${SrsArmCXX} AR=${SrsArmAR} LINK=${SrsArmCXX} _default