1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-02-14 20:31:56 +00:00

support build on pi and cubie

This commit is contained in:
winlin 2015-09-23 10:27:57 +08:00
parent a8829e0a8b
commit 7dcdb18588
5 changed files with 16 additions and 16 deletions

View file

@ -67,7 +67,7 @@ if [[ -z $SrsArmAR ]]; then SrsArmAR=$__SrsArmAR; fi
if [[ -z $SrsArmLD ]]; then SrsArmLD=$__SrsArmLD; fi if [[ -z $SrsArmLD ]]; then SrsArmLD=$__SrsArmLD; fi
if [[ -z $SrsArmRANDLIB ]]; then SrsArmRANDLIB=$__SrsArmRANDLIB; fi if [[ -z $SrsArmRANDLIB ]]; then SrsArmRANDLIB=$__SrsArmRANDLIB; fi
# write to source file # 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 "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 echo "#define SRS_AUTO_EMBEDED_TOOL_CHAIN \"cc=$SrsArmCC gcc=$SrsArmGCC g++=$SrsArmCXX ar=$SrsArmAR ld=$SrsArmLD randlib=$SrsArmRANDLIB\"" >> $SRS_AUTO_HEADERS_H
else else
@ -200,7 +200,7 @@ fi
##################################################################################### #####################################################################################
# for embeded. # for embeded.
##################################################################################### #####################################################################################
if [ $SRS_EMBEDED_CPU = YES ]; then if [ $SRS_CROSS_BUILD = YES ]; then
echo "#define SRS_AUTO_EMBEDED_CPU" >> $SRS_AUTO_HEADERS_H echo "#define SRS_AUTO_EMBEDED_CPU" >> $SRS_AUTO_HEADERS_H
else else
echo "#undef SRS_AUTO_EMBEDED_CPU" >> $SRS_AUTO_HEADERS_H echo "#undef SRS_AUTO_EMBEDED_CPU" >> $SRS_AUTO_HEADERS_H

View file

@ -148,7 +148,7 @@ function Centos_prepare()
fi fi
# for arm, install the cross build tool chain. # 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" echo "embeded(arm/mips) is invalid for CentOS"
return 1 return 1
fi fi
@ -253,7 +253,7 @@ function OSX_prepare()
fi fi
# for arm, install the cross build tool chain. # 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" echo "embeded(arm/mips) is invalid for OSX"
return 1 return 1
fi fi
@ -367,7 +367,7 @@ fi
# export srs-librtmp # export srs-librtmp
# others is invalid. # others is invalid.
if [[ $OS_IS_UBUNTU = NO && $OS_IS_CENTOS = NO && $OS_IS_OSX = NO && $SRS_EXPORT_LIBRTMP_PROJECT = NO ]]; then 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_EMBEDED_CPU = NO ]]; then if [[ $SRS_PI = NO && $SRS_CUBIE = NO && $SRS_CROSS_BUILD = NO ]]; then
echo "what a fuck, os not supported." echo "what a fuck, os not supported."
exit 1 exit 1
fi fi
@ -385,7 +385,7 @@ if [ $SRS_EXPORT_LIBRTMP_PROJECT = NO ]; then
fi fi
# memory leak for linux-optimized # memory leak for linux-optimized
# @see: https://github.com/simple-rtmp-server/srs/issues/197 # @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. # 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 if [[ -f ${SRS_OBJS}/_flag.st.arm.tmp && -f ${SRS_OBJS}/st/libst.a ]]; then
echo "st-1.9t for arm is ok."; echo "st-1.9t for arm is ok.";
@ -432,7 +432,7 @@ fi
# check the arm flag file, if flag changed, need to rebuild the st. # check the arm flag file, if flag changed, need to rebuild the st.
if [ $SRS_HTTP_CORE = YES ]; then if [ $SRS_HTTP_CORE = YES ]; then
# ok, arm specified, if the flag filed does not exists, need to rebuild. # 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 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."; echo "http-parser-2.1 for arm is ok.";
else else
@ -487,7 +487,7 @@ if [ $SRS_EXPORT_LIBRTMP_PROJECT = NO ]; then
mkdir -p ${SRS_OBJS}/nginx mkdir -p ${SRS_OBJS}/nginx
fi fi
# make nginx # 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 [ $__SRS_BUILD_NGINX = YES ]; then
if [[ -f ${SRS_OBJS}/nginx/sbin/nginx ]]; then if [[ -f ${SRS_OBJS}/nginx/sbin/nginx ]]; then
echo "nginx-1.5.7 is ok."; echo "nginx-1.5.7 is ok.";
@ -599,7 +599,7 @@ fi
##################################################################################### #####################################################################################
# extra configure options # extra configure options
CONFIGURE_TOOL="./config" CONFIGURE_TOOL="./config"
if [ $SRS_EMBEDED_CPU = YES ]; then if [ $SRS_CROSS_BUILD = YES ]; then
CONFIGURE_TOOL="./Configure linux-armv4" CONFIGURE_TOOL="./Configure linux-armv4"
fi fi
if [ $SRS_OSX = YES ]; then if [ $SRS_OSX = YES ]; then
@ -614,7 +614,7 @@ if [ $SRS_SSL = YES ]; then
echo "warning: donot compile ssl, use system ssl" echo "warning: donot compile ssl, use system ssl"
else else
# check the arm flag file, if flag changed, need to rebuild the st. # 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. # 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 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."; echo "openssl-1.0.1f for arm is ok.";

View file

@ -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} _CPT=${SRS_EXPORT_LIBRTMP_PROJECT}/src/libs && mkdir -p ${_CPT} && cp src/libs/* ${_CPT}
# check ret # check ret
ret=$?; if [[ $ret -ne 0 ]]; then echo "export src failed, ret=$ret"; exit $ret; fi ret=$?; if [[ $ret -ne 0 ]]; then echo "export src failed, ret=$ret"; exit $ret; fi
fi fi

View file

@ -101,7 +101,7 @@ SRS_ENABLE_ALL=NO
# #
################################################################ ################################################################
# whether cross build for embed cpu, arm/mips # whether cross build for embed cpu, arm/mips
SRS_EMBEDED_CPU=NO SRS_CROSS_BUILD=NO
##################################################################################### #####################################################################################
# menu # menu
@ -363,10 +363,10 @@ function apply_user_presets() {
# whether embeded cpu. # whether embeded cpu.
if [ $SRS_ARM_UBUNTU12 = YES ]; then if [ $SRS_ARM_UBUNTU12 = YES ]; then
SRS_EMBEDED_CPU=YES SRS_CROSS_BUILD=YES
fi fi
if [ $SRS_MIPS_UBUNTU12 = YES ]; then if [ $SRS_MIPS_UBUNTU12 = YES ]; then
SRS_EMBEDED_CPU=YES SRS_CROSS_BUILD=YES
fi fi
# all disabled. # all disabled.
@ -879,7 +879,7 @@ function check_option_conflicts() {
# check embeded(arm/mips), if embeded enabled, only allow st/ssl/librtmp, # check embeded(arm/mips), if embeded enabled, only allow st/ssl/librtmp,
# user should disable all other features # 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_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_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 if [ $SRS_GPERF = YES ]; then echo "gperf for arm is not available, see: ./configure --help"; __check_ok=NO; fi

2
trunk/configure vendored
View file

@ -285,7 +285,7 @@ __REAL_INSTALL=\$(DESTDIR)\$(SRS_PREFIX)
END END
# embeded, ubuntu12, use embeded tool chain. # embeded, ubuntu12, use embeded tool chain.
if [ $SRS_EMBEDED_CPU = YES ]; then if [ $SRS_CROSS_BUILD = YES ]; then
cat << END >> ${SRS_WORKDIR}/${SRS_MAKEFILE} cat << END >> ${SRS_WORKDIR}/${SRS_MAKEFILE}
default: default:
\$(MAKE) GCC=${SrsArmGCC} CXX=${SrsArmCXX} AR=${SrsArmAR} LINK=${SrsArmCXX} _default \$(MAKE) GCC=${SrsArmGCC} CXX=${SrsArmCXX} AR=${SrsArmAR} LINK=${SrsArmCXX} _default