winlin

support build on pi and cubie

@@ -67,7 +67,7 @@ if [[ -z $SrsArmAR ]]; then SrsArmAR=$__SrsArmAR; fi @@ -67,7 +67,7 @@ if [[ -z $SrsArmAR ]]; then SrsArmAR=$__SrsArmAR; fi
67 if [[ -z $SrsArmLD ]]; then SrsArmLD=$__SrsArmLD; fi 67 if [[ -z $SrsArmLD ]]; then SrsArmLD=$__SrsArmLD; fi
68 if [[ -z $SrsArmRANDLIB ]]; then SrsArmRANDLIB=$__SrsArmRANDLIB; fi 68 if [[ -z $SrsArmRANDLIB ]]; then SrsArmRANDLIB=$__SrsArmRANDLIB; fi
69 # write to source file 69 # write to source file
70 -if [ $SRS_EMBEDED_CPU = YES ]; then 70 +if [ $SRS_CROSS_BUILD = YES ]; then
71 echo "cc=$SrsArmCC gcc=$SrsArmGCC g++=$SrsArmCXX ar=$SrsArmAR ld=$SrsArmLD randlib=$SrsArmRANDLIB" 71 echo "cc=$SrsArmCC gcc=$SrsArmGCC g++=$SrsArmCXX ar=$SrsArmAR ld=$SrsArmLD randlib=$SrsArmRANDLIB"
72 echo "#define SRS_AUTO_EMBEDED_TOOL_CHAIN \"cc=$SrsArmCC gcc=$SrsArmGCC g++=$SrsArmCXX ar=$SrsArmAR ld=$SrsArmLD randlib=$SrsArmRANDLIB\"" >> $SRS_AUTO_HEADERS_H 72 echo "#define SRS_AUTO_EMBEDED_TOOL_CHAIN \"cc=$SrsArmCC gcc=$SrsArmGCC g++=$SrsArmCXX ar=$SrsArmAR ld=$SrsArmLD randlib=$SrsArmRANDLIB\"" >> $SRS_AUTO_HEADERS_H
73 else 73 else
@@ -200,7 +200,7 @@ fi @@ -200,7 +200,7 @@ fi
200 ##################################################################################### 200 #####################################################################################
201 # for embeded. 201 # for embeded.
202 ##################################################################################### 202 #####################################################################################
203 -if [ $SRS_EMBEDED_CPU = YES ]; then 203 +if [ $SRS_CROSS_BUILD = YES ]; then
204 echo "#define SRS_AUTO_EMBEDED_CPU" >> $SRS_AUTO_HEADERS_H 204 echo "#define SRS_AUTO_EMBEDED_CPU" >> $SRS_AUTO_HEADERS_H
205 else 205 else
206 echo "#undef SRS_AUTO_EMBEDED_CPU" >> $SRS_AUTO_HEADERS_H 206 echo "#undef SRS_AUTO_EMBEDED_CPU" >> $SRS_AUTO_HEADERS_H
@@ -148,7 +148,7 @@ function Centos_prepare() @@ -148,7 +148,7 @@ function Centos_prepare()
148 fi 148 fi
149 149
150 # for arm, install the cross build tool chain. 150 # for arm, install the cross build tool chain.
151 - if [ $SRS_EMBEDED_CPU = YES ]; then 151 + if [ $SRS_CROSS_BUILD = YES ]; then
152 echo "embeded(arm/mips) is invalid for CentOS" 152 echo "embeded(arm/mips) is invalid for CentOS"
153 return 1 153 return 1
154 fi 154 fi
@@ -253,7 +253,7 @@ function OSX_prepare() @@ -253,7 +253,7 @@ function OSX_prepare()
253 fi 253 fi
254 254
255 # for arm, install the cross build tool chain. 255 # for arm, install the cross build tool chain.
256 - if [ $SRS_EMBEDED_CPU = YES ]; then 256 + if [ $SRS_CROSS_BUILD = YES ]; then
257 echo "embeded(arm/mips) is invalid for OSX" 257 echo "embeded(arm/mips) is invalid for OSX"
258 return 1 258 return 1
259 fi 259 fi
@@ -367,7 +367,7 @@ fi @@ -367,7 +367,7 @@ fi
367 # export srs-librtmp 367 # export srs-librtmp
368 # others is invalid. 368 # others is invalid.
369 if [[ $OS_IS_UBUNTU = NO && $OS_IS_CENTOS = NO && $OS_IS_OSX = NO && $SRS_EXPORT_LIBRTMP_PROJECT = NO ]]; then 369 if [[ $OS_IS_UBUNTU = NO && $OS_IS_CENTOS = NO && $OS_IS_OSX = NO && $SRS_EXPORT_LIBRTMP_PROJECT = NO ]]; then
370 - if [[ $SRS_PI = NO && $SRS_CUBIE = NO && $SRS_EMBEDED_CPU = NO ]]; then 370 + if [[ $SRS_PI = NO && $SRS_CUBIE = NO && $SRS_CROSS_BUILD = NO ]]; then
371 echo "what a fuck, os not supported." 371 echo "what a fuck, os not supported."
372 exit 1 372 exit 1
373 fi 373 fi
@@ -385,7 +385,7 @@ if [ $SRS_EXPORT_LIBRTMP_PROJECT = NO ]; then @@ -385,7 +385,7 @@ if [ $SRS_EXPORT_LIBRTMP_PROJECT = NO ]; then
385 fi 385 fi
386 # memory leak for linux-optimized 386 # memory leak for linux-optimized
387 # @see: https://github.com/simple-rtmp-server/srs/issues/197 387 # @see: https://github.com/simple-rtmp-server/srs/issues/197
388 - if [ $SRS_EMBEDED_CPU = YES ]; then 388 + if [ $SRS_CROSS_BUILD = YES ]; then
389 # ok, arm specified, if the flag filed does not exists, need to rebuild. 389 # ok, arm specified, if the flag filed does not exists, need to rebuild.
390 if [[ -f ${SRS_OBJS}/_flag.st.arm.tmp && -f ${SRS_OBJS}/st/libst.a ]]; then 390 if [[ -f ${SRS_OBJS}/_flag.st.arm.tmp && -f ${SRS_OBJS}/st/libst.a ]]; then
391 echo "st-1.9t for arm is ok."; 391 echo "st-1.9t for arm is ok.";
@@ -432,7 +432,7 @@ fi @@ -432,7 +432,7 @@ fi
432 # check the arm flag file, if flag changed, need to rebuild the st. 432 # check the arm flag file, if flag changed, need to rebuild the st.
433 if [ $SRS_HTTP_CORE = YES ]; then 433 if [ $SRS_HTTP_CORE = YES ]; then
434 # ok, arm specified, if the flag filed does not exists, need to rebuild. 434 # ok, arm specified, if the flag filed does not exists, need to rebuild.
435 - if [ $SRS_EMBEDED_CPU = YES ]; then 435 + if [ $SRS_CROSS_BUILD = YES ]; then
436 if [[ -f ${SRS_OBJS}/_flag.st.hp.tmp && -f ${SRS_OBJS}/hp/http_parser.h && -f ${SRS_OBJS}/hp/libhttp_parser.a ]]; then 436 if [[ -f ${SRS_OBJS}/_flag.st.hp.tmp && -f ${SRS_OBJS}/hp/http_parser.h && -f ${SRS_OBJS}/hp/libhttp_parser.a ]]; then
437 echo "http-parser-2.1 for arm is ok."; 437 echo "http-parser-2.1 for arm is ok.";
438 else 438 else
@@ -487,7 +487,7 @@ if [ $SRS_EXPORT_LIBRTMP_PROJECT = NO ]; then @@ -487,7 +487,7 @@ if [ $SRS_EXPORT_LIBRTMP_PROJECT = NO ]; then
487 mkdir -p ${SRS_OBJS}/nginx 487 mkdir -p ${SRS_OBJS}/nginx
488 fi 488 fi
489 # make nginx 489 # make nginx
490 -__SRS_BUILD_NGINX=NO; if [ $SRS_EMBEDED_CPU = NO ]; then if [ $SRS_NGINX = YES ]; then __SRS_BUILD_NGINX=YES; fi fi 490 +__SRS_BUILD_NGINX=NO; if [ $SRS_CROSS_BUILD = NO ]; then if [ $SRS_NGINX = YES ]; then __SRS_BUILD_NGINX=YES; fi fi
491 if [ $__SRS_BUILD_NGINX = YES ]; then 491 if [ $__SRS_BUILD_NGINX = YES ]; then
492 if [[ -f ${SRS_OBJS}/nginx/sbin/nginx ]]; then 492 if [[ -f ${SRS_OBJS}/nginx/sbin/nginx ]]; then
493 echo "nginx-1.5.7 is ok."; 493 echo "nginx-1.5.7 is ok.";
@@ -599,7 +599,7 @@ fi @@ -599,7 +599,7 @@ fi
599 ##################################################################################### 599 #####################################################################################
600 # extra configure options 600 # extra configure options
601 CONFIGURE_TOOL="./config" 601 CONFIGURE_TOOL="./config"
602 -if [ $SRS_EMBEDED_CPU = YES ]; then 602 +if [ $SRS_CROSS_BUILD = YES ]; then
603 CONFIGURE_TOOL="./Configure linux-armv4" 603 CONFIGURE_TOOL="./Configure linux-armv4"
604 fi 604 fi
605 if [ $SRS_OSX = YES ]; then 605 if [ $SRS_OSX = YES ]; then
@@ -614,7 +614,7 @@ if [ $SRS_SSL = YES ]; then @@ -614,7 +614,7 @@ if [ $SRS_SSL = YES ]; then
614 echo "warning: donot compile ssl, use system ssl" 614 echo "warning: donot compile ssl, use system ssl"
615 else 615 else
616 # check the arm flag file, if flag changed, need to rebuild the st. 616 # check the arm flag file, if flag changed, need to rebuild the st.
617 - if [ $SRS_EMBEDED_CPU = YES ]; then 617 + if [ $SRS_CROSS_BUILD = YES ]; then
618 # ok, arm specified, if the flag filed does not exists, need to rebuild. 618 # ok, arm specified, if the flag filed does not exists, need to rebuild.
619 if [[ -f ${SRS_OBJS}/_flag.ssl.arm.tmp && -f ${SRS_OBJS}/openssl/lib/libssl.a ]]; then 619 if [[ -f ${SRS_OBJS}/_flag.ssl.arm.tmp && -f ${SRS_OBJS}/openssl/lib/libssl.a ]]; then
620 echo "openssl-1.0.1f for arm is ok."; 620 echo "openssl-1.0.1f for arm is ok.";
@@ -27,4 +27,4 @@ if [ $SRS_EXPORT_LIBRTMP_PROJECT != NO ]; then @@ -27,4 +27,4 @@ if [ $SRS_EXPORT_LIBRTMP_PROJECT != NO ]; then
27 _CPT=${SRS_EXPORT_LIBRTMP_PROJECT}/src/libs && mkdir -p ${_CPT} && cp src/libs/* ${_CPT} 27 _CPT=${SRS_EXPORT_LIBRTMP_PROJECT}/src/libs && mkdir -p ${_CPT} && cp src/libs/* ${_CPT}
28 # check ret 28 # check ret
29 ret=$?; if [[ $ret -ne 0 ]]; then echo "export src failed, ret=$ret"; exit $ret; fi 29 ret=$?; if [[ $ret -ne 0 ]]; then echo "export src failed, ret=$ret"; exit $ret; fi
30 -fi  
  30 +fi
@@ -101,7 +101,7 @@ SRS_ENABLE_ALL=NO @@ -101,7 +101,7 @@ SRS_ENABLE_ALL=NO
101 # 101 #
102 ################################################################ 102 ################################################################
103 # whether cross build for embed cpu, arm/mips 103 # whether cross build for embed cpu, arm/mips
104 -SRS_EMBEDED_CPU=NO 104 +SRS_CROSS_BUILD=NO
105 105
106 ##################################################################################### 106 #####################################################################################
107 # menu 107 # menu
@@ -363,10 +363,10 @@ function apply_user_presets() { @@ -363,10 +363,10 @@ function apply_user_presets() {
363 363
364 # whether embeded cpu. 364 # whether embeded cpu.
365 if [ $SRS_ARM_UBUNTU12 = YES ]; then 365 if [ $SRS_ARM_UBUNTU12 = YES ]; then
366 - SRS_EMBEDED_CPU=YES 366 + SRS_CROSS_BUILD=YES
367 fi 367 fi
368 if [ $SRS_MIPS_UBUNTU12 = YES ]; then 368 if [ $SRS_MIPS_UBUNTU12 = YES ]; then
369 - SRS_EMBEDED_CPU=YES 369 + SRS_CROSS_BUILD=YES
370 fi 370 fi
371 371
372 # all disabled. 372 # all disabled.
@@ -879,7 +879,7 @@ function check_option_conflicts() { @@ -879,7 +879,7 @@ function check_option_conflicts() {
879 879
880 # check embeded(arm/mips), if embeded enabled, only allow st/ssl/librtmp, 880 # check embeded(arm/mips), if embeded enabled, only allow st/ssl/librtmp,
881 # user should disable all other features 881 # user should disable all other features
882 - if [ $SRS_EMBEDED_CPU = YES ]; then 882 + if [ $SRS_CROSS_BUILD = YES ]; then
883 if [ $SRS_FFMPEG_TOOL = YES ]; then echo "ffmpeg for arm is not available, see: ./configure --help"; __check_ok=NO; fi 883 if [ $SRS_FFMPEG_TOOL = YES ]; then echo "ffmpeg for arm is not available, see: ./configure --help"; __check_ok=NO; fi
884 if [ $SRS_RESEARCH = YES ]; then echo "research for arm is not available, see: ./configure --help"; __check_ok=NO; fi 884 if [ $SRS_RESEARCH = YES ]; then echo "research for arm is not available, see: ./configure --help"; __check_ok=NO; fi
885 if [ $SRS_GPERF = YES ]; then echo "gperf for arm is not available, see: ./configure --help"; __check_ok=NO; fi 885 if [ $SRS_GPERF = YES ]; then echo "gperf for arm is not available, see: ./configure --help"; __check_ok=NO; fi
@@ -285,7 +285,7 @@ __REAL_INSTALL=\$(DESTDIR)\$(SRS_PREFIX) @@ -285,7 +285,7 @@ __REAL_INSTALL=\$(DESTDIR)\$(SRS_PREFIX)
285 END 285 END
286 286
287 # embeded, ubuntu12, use embeded tool chain. 287 # embeded, ubuntu12, use embeded tool chain.
288 -if [ $SRS_EMBEDED_CPU = YES ]; then 288 +if [ $SRS_CROSS_BUILD = YES ]; then
289 cat << END >> ${SRS_WORKDIR}/${SRS_MAKEFILE} 289 cat << END >> ${SRS_WORKDIR}/${SRS_MAKEFILE}
290 default: 290 default:
291 \$(MAKE) GCC=${SrsArmGCC} CXX=${SrsArmCXX} AR=${SrsArmAR} LINK=${SrsArmCXX} _default 291 \$(MAKE) GCC=${SrsArmGCC} CXX=${SrsArmCXX} AR=${SrsArmAR} LINK=${SrsArmCXX} _default