1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

For #1537, disable crossbuild for ARM/MIPS.

This commit is contained in:
winlin 2019-12-25 13:17:49 +08:00
parent e6e4bd7fb4
commit dffc96d2fe
7 changed files with 56 additions and 299 deletions

View file

@ -46,12 +46,6 @@ fi
if [ $SRS_X86_X64 = YES ]; then if [ $SRS_X86_X64 = YES ]; then
srs_define_macro "SRS_X86_X64" $SRS_AUTO_HEADERS_H srs_define_macro "SRS_X86_X64" $SRS_AUTO_HEADERS_H
fi fi
if [ $SRS_ARM_UBUNTU12 = YES ]; then
srs_define_macro "SRS_ARM_UBUNTU12" $SRS_AUTO_HEADERS_H
fi
if [ $SRS_MIPS_UBUNTU12 = YES ]; then
srs_define_macro "SRS_MIPS_UBUNTU12" $SRS_AUTO_HEADERS_H
fi
if [ $SRS_PI = YES ]; then if [ $SRS_PI = YES ]; then
srs_define_macro "SRS_PI" $SRS_AUTO_HEADERS_H srs_define_macro "SRS_PI" $SRS_AUTO_HEADERS_H
fi fi
@ -69,15 +63,6 @@ echo "" >> $SRS_AUTO_HEADERS_H
##################################################################################### #####################################################################################
# generate auto headers file, depends on the finished of options.sh # generate auto headers file, depends on the finished of options.sh
##################################################################################### #####################################################################################
# write to source file
if [ $SRS_CROSS_BUILD = YES ]; then
__TOOL_CHAIN="cc=$SrsArmCC gcc=$SrsArmGCC g++=$SrsArmCXX ar=$SrsArmAR ld=$SrsArmLD randlib=$SrsArmRANDLIB" && echo "$__TOOL_CHAIN"
srs_define_macro_value "SRS_AUTO_EMBEDED_TOOL_CHAIN" "\"$__TOOL_CHAIN\"" $SRS_AUTO_HEADERS_H
else
srs_undefine_macro "SRS_AUTO_EMBEDED_TOOL_CHAIN" $SRS_AUTO_HEADERS_H
fi
echo "" >> $SRS_AUTO_HEADERS_H
# auto headers in depends. # auto headers in depends.
if [ $SRS_NGINX = YES ]; then if [ $SRS_NGINX = YES ]; then
srs_define_macro "SRS_AUTO_NGINX" $SRS_AUTO_HEADERS_H srs_define_macro "SRS_AUTO_NGINX" $SRS_AUTO_HEADERS_H
@ -147,27 +132,6 @@ fi
##################################################################################### #####################################################################################
# for embeded. # for embeded.
##################################################################################### #####################################################################################
if [ $SRS_CROSS_BUILD = YES ]; then
srs_define_macro "SRS_AUTO_EMBEDED_CPU" $SRS_AUTO_HEADERS_H
else
srs_undefine_macro "SRS_AUTO_EMBEDED_CPU" $SRS_AUTO_HEADERS_H
fi
# arm
if [ $SRS_ARM_UBUNTU12 = YES ]; then
srs_define_macro "SRS_AUTO_ARM_UBUNTU12" $SRS_AUTO_HEADERS_H
else
srs_undefine_macro "SRS_AUTO_ARM_UBUNTU12" $SRS_AUTO_HEADERS_H
fi
# mips
if [ $SRS_MIPS_UBUNTU12 = YES ]; then
srs_define_macro "SRS_AUTO_MIPS_UBUNTU12" $SRS_AUTO_HEADERS_H
else
srs_undefine_macro "SRS_AUTO_MIPS_UBUNTU12" $SRS_AUTO_HEADERS_H
fi
echo "" >> $SRS_AUTO_HEADERS_H
# for log level compile settings # for log level compile settings
if [ $SRS_LOG_VERBOSE = YES ]; then if [ $SRS_LOG_VERBOSE = YES ]; then
srs_define_macro "SRS_AUTO_VERBOSE" $SRS_AUTO_HEADERS_H srs_define_macro "SRS_AUTO_VERBOSE" $SRS_AUTO_HEADERS_H

View file

@ -46,24 +46,6 @@ function Ubuntu_prepare()
fi fi
fi fi
# cross build for arm, install the cross build tool chain.
if [ $SRS_ARM_UBUNTU12 = YES ]; then
$SrsArmCC --help >/dev/null 2>&1; ret=$?; if [[ 0 -ne $ret ]]; then
echo "Installing gcc-arm-linux-gnueabi g++-arm-linux-gnueabi."
require_sudoer "sudo apt-get install -y --force-yes gcc-arm-linux-gnueabi g++-arm-linux-gnueabi"
sudo apt-get install -y --force-yes gcc-arm-linux-gnueabi g++-arm-linux-gnueabi; ret=$?; if [[ 0 -ne $ret ]]; then return $ret; fi
echo "The gcc-arm-linux-gnueabi g++-arm-linux-gnueabi are installed."
fi
fi
# cross build for mips, user must installed the tool chain.
if [ $SRS_MIPS_UBUNTU12 = YES ]; then
$SrsArmCC --help >/dev/null 2>&1; ret=$?; if [[ 0 -ne $ret ]]; then
echo "You must install the tool chain: $SrsArmCC"
return 2
fi
fi
OS_IS_UBUNTU=YES OS_IS_UBUNTU=YES
echo "Installing tools for Ubuntu." echo "Installing tools for Ubuntu."
@ -169,12 +151,6 @@ function Centos_prepare()
return 0; return 0;
fi fi
# cross build for arm, install the cross build tool chain.
if [ $SRS_CROSS_BUILD = YES ]; then
echo "CentOS doesn't support crossbuild for arm/mips, please use Ubuntu instead."
return 1
fi
OS_IS_CENTOS=YES OS_IS_CENTOS=YES
echo "Installing tools for Centos." echo "Installing tools for Centos."
@ -292,12 +268,6 @@ function OSX_prepare()
return 0; return 0;
fi fi
# cross build for arm, install the cross build tool chain.
if [ $SRS_CROSS_BUILD = YES ]; then
echo "OSX doesn't support crossbuild for arm/mips, please use Ubuntu instead."
return 1
fi
OS_IS_OSX=YES OS_IS_OSX=YES
echo "Installing tools for OSX." echo "Installing tools for OSX."
# requires the osx when os # requires the osx when os
@ -455,37 +425,19 @@ if [ $SRS_EXPORT_LIBRTMP_PROJECT = NO ]; then
_ST_EXTRA_CFLAGS="$_ST_EXTRA_CFLAGS -DMD_VALGRIND" _ST_EXTRA_CFLAGS="$_ST_EXTRA_CFLAGS -DMD_VALGRIND"
fi fi
# Patched ST from https://github.com/ossrs/state-threads/tree/srs # Patched ST from https://github.com/ossrs/state-threads/tree/srs
if [ $SRS_CROSS_BUILD = YES ]; then if [[ ! -f ${SRS_OBJS}/_flag.st.cross.build.tmp && -f ${SRS_OBJS}/st/libst.a ]]; then
# ok, arm specified, if the flag filed does not exists, need to rebuild. echo "The state-threads is ok.";
if [[ -f ${SRS_OBJS}/_flag.st.cross.build.tmp && -f ${SRS_OBJS}/st/libst.a ]]; then
echo "The state-threads for arm is ok.";
else
echo "Building state-threads for arm.";
(
rm -rf ${SRS_OBJS}/state-threads-1.9.1 && cd ${SRS_OBJS} &&
tar xf ../3rdparty/state-threads-1.9.1.tar.gz && cd state-threads-1.9.1 && chmod +w * &&
patch -p0 < ../../3rdparty/patches/6.st.osx10.14.build.patch &&
make ${_ST_MAKE} CC=${SrsArmCC} AR=${SrsArmAR} LD=${SrsArmLD} RANDLIB=${SrsArmRANDLIB} EXTRA_CFLAGS="${_ST_EXTRA_CFLAGS}" &&
cd .. && rm -f st && ln -sf state-threads-1.9.1/obj st &&
rm -f state-threads && ln -sf state-threads-1.9.1 state-threads &&
cd .. && touch ${SRS_OBJS}/_flag.st.cross.build.tmp
)
fi
else else
if [[ ! -f ${SRS_OBJS}/_flag.st.cross.build.tmp && -f ${SRS_OBJS}/st/libst.a ]]; then echo "Building state-threads.";
echo "The state-threads is ok."; (
else rm -rf ${SRS_OBJS}/state-threads-1.9.1 && cd ${SRS_OBJS} &&
echo "Building state-threads."; tar xf ../3rdparty/state-threads-1.9.1.tar.gz && cd state-threads-1.9.1 && chmod +w * &&
( patch -p0 < ../../3rdparty/patches/6.st.osx10.14.build.patch &&
rm -rf ${SRS_OBJS}/state-threads-1.9.1 && cd ${SRS_OBJS} && make ${_ST_MAKE} EXTRA_CFLAGS="${_ST_EXTRA_CFLAGS}" &&
tar xf ../3rdparty/state-threads-1.9.1.tar.gz && cd state-threads-1.9.1 && chmod +w * && cd .. && rm -f st && ln -sf state-threads-1.9.1/obj st &&
patch -p0 < ../../3rdparty/patches/6.st.osx10.14.build.patch && rm -f state-threads && ln -sf state-threads-1.9.1 state-threads &&
make ${_ST_MAKE} EXTRA_CFLAGS="${_ST_EXTRA_CFLAGS}" && cd .. && rm -f ${SRS_OBJS}/_flag.st.cross.build.tmp
cd .. && rm -f st && ln -sf state-threads-1.9.1/obj st && )
rm -f state-threads && ln -sf state-threads-1.9.1 state-threads &&
cd .. && rm -f ${SRS_OBJS}/_flag.st.cross.build.tmp
)
fi
fi fi
# check status # check status
ret=$?; if [[ $ret -ne 0 ]]; then echo "Build state-threads failed, ret=$ret"; exit $ret; fi ret=$?; if [[ $ret -ne 0 ]]; then echo "Build state-threads failed, ret=$ret"; exit $ret; fi
@ -508,7 +460,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_CROSS_BUILD = NO ]; then if [ $SRS_NGINX = YES ]; then __SRS_BUILD_NGINX=YES; fi fi __SRS_BUILD_NGINX=NO; if [ $SRS_NGINX = YES ]; then __SRS_BUILD_NGINX=YES; 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 "The nginx-1.5.7 is ok."; echo "The nginx-1.5.7 is ok.";
@ -615,9 +567,6 @@ fi
##################################################################################### #####################################################################################
# extra configure options # extra configure options
CONFIGURE_TOOL="./config" CONFIGURE_TOOL="./config"
if [ $SRS_CROSS_BUILD = YES ]; then
CONFIGURE_TOOL="./Configure linux-armv4"
fi
if [ $SRS_OSX = YES ]; then if [ $SRS_OSX = YES ]; then
CONFIGURE_TOOL="./Configure darwin64-`uname -m`-cc" CONFIGURE_TOOL="./Configure darwin64-`uname -m`-cc"
fi fi
@ -635,39 +584,19 @@ if [ $SRS_SSL = YES ]; then
if [ $SRS_USE_SYS_SSL = YES ]; then if [ $SRS_USE_SYS_SSL = YES ]; then
echo "Warning: Use system libssl, without compiling openssl." echo "Warning: Use system libssl, without compiling openssl."
else else
# check the cross build flag file, if flag changed, need to rebuild the st. # cross build not specified, if exists flag, need to rebuild for no-arm platform.
if [ $SRS_CROSS_BUILD = YES ]; then if [[ ! -f ${SRS_OBJS}/_flag.ssl.cross.build.tmp && -f ${SRS_OBJS}/openssl/lib/libssl.a ]]; then
# ok, arm specified, if the flag filed does not exists, need to rebuild. echo "Openssl-1.1.0e is ok.";
if [[ -f ${SRS_OBJS}/_flag.ssl.cross.build.tmp && -f ${SRS_OBJS}/openssl/lib/libssl.a ]]; then
echo "The openssl-1.1.0e for arm is ok.";
else
echo "Building openssl-1.1.0e for ARM.";
(
rm -rf ${SRS_OBJS}/openssl-1.1.0e && cd ${SRS_OBJS} &&
unzip -q ../3rdparty/openssl-1.1.0e.zip && cd openssl-1.1.0e &&
$CONFIGURE_TOOL --prefix=`pwd`/_release -no-shared no-asm no-threads $OPENSSL_HOTFIX &&
make CC=${SrsArmCC} GCC=${SrsArmGCC} AR="${SrsArmAR} r" \
LD=${SrsArmLD} LINK=${SrsArmGCC} RANDLIB=${SrsArmRANDLIB} &&
make install_sw &&
cd .. && rm -rf openssl && ln -sf openssl-1.1.0e/_release openssl &&
cd .. && touch ${SRS_OBJS}/_flag.ssl.cross.build.tmp
)
fi
else else
# cross build not specified, if exists flag, need to rebuild for no-arm platform. echo "Building openssl-1.1.0e.";
if [[ ! -f ${SRS_OBJS}/_flag.ssl.cross.build.tmp && -f ${SRS_OBJS}/openssl/lib/libssl.a ]]; then (
echo "Openssl-1.1.0e is ok."; rm -rf ${SRS_OBJS}/openssl-1.1.0e && cd ${SRS_OBJS} &&
else unzip -q ../3rdparty/openssl-1.1.0e.zip && cd openssl-1.1.0e &&
echo "Building openssl-1.1.0e."; $CONFIGURE_TOOL --prefix=`pwd`/_release -no-shared no-threads $OPENSSL_HOTFIX &&
( make && make install_sw &&
rm -rf ${SRS_OBJS}/openssl-1.1.0e && cd ${SRS_OBJS} && cd .. && rm -rf openssl && ln -sf openssl-1.1.0e/_release openssl &&
unzip -q ../3rdparty/openssl-1.1.0e.zip && cd openssl-1.1.0e && cd .. && rm -f ${SRS_OBJS}/_flag.ssl.cross.build.tmp
$CONFIGURE_TOOL --prefix=`pwd`/_release -no-shared no-threads $OPENSSL_HOTFIX && )
make && make install_sw &&
cd .. && rm -rf openssl && ln -sf openssl-1.1.0e/_release openssl &&
cd .. && rm -f ${SRS_OBJS}/_flag.ssl.cross.build.tmp
)
fi
fi fi
# check status # check status
ret=$?; if [[ $ret -ne 0 ]]; then echo "Build openssl-1.1.0e failed, ret=$ret"; exit $ret; fi ret=$?; if [[ $ret -ne 0 ]]; then echo "Build openssl-1.1.0e failed, ret=$ret"; exit $ret; fi

View file

@ -76,10 +76,6 @@ SRS_X86_X64=NO
# for osx system # for osx system
SRS_OSX=NO SRS_OSX=NO
SRS_ALLOW_OSX=NO SRS_ALLOW_OSX=NO
# armhf(v7cpu) built on ubuntu12
SRS_ARM_UBUNTU12=NO
# mips built on ubuntu12
SRS_MIPS_UBUNTU12=NO
# dev, open all features for dev, no gperf/prof/arm. # dev, open all features for dev, no gperf/prof/arm.
SRS_DEV=NO SRS_DEV=NO
# dev, open main server feature for dev, no utest/research/librtmp # dev, open main server feature for dev, no utest/research/librtmp
@ -99,7 +95,8 @@ SRS_DISABLE_ALL=NO
# all features is on # all features is on
SRS_ENABLE_ALL=NO SRS_ENABLE_ALL=NO
# #
################################################################ #####################################################################################
# We don't support crossbuild for ARM/MIPS, please directly build it on ARM/MIPS server.
# whether cross build for embed cpu, arm/mips # whether cross build for embed cpu, arm/mips
SRS_CROSS_BUILD=NO SRS_CROSS_BUILD=NO
@ -236,8 +233,8 @@ function parse_user_option() {
--with-gmp) SRS_GPERF_MP=YES ;; --with-gmp) SRS_GPERF_MP=YES ;;
--with-gcp) SRS_GPERF_CP=YES ;; --with-gcp) SRS_GPERF_CP=YES ;;
--with-gprof) SRS_GPROF=YES ;; --with-gprof) SRS_GPROF=YES ;;
--with-arm-ubuntu12) SRS_ARM_UBUNTU12=YES ;; --with-arm-ubuntu12) SRS_CROSS_BUILD=YES ;;
--with-mips-ubuntu12) SRS_MIPS_UBUNTU12=YES ;; --with-mips-ubuntu12) SRS_CROSS_BUILD=YES ;;
--without-ssl) SRS_SSL=NO ;; --without-ssl) SRS_SSL=NO ;;
--without-hds) SRS_HDS=NO ;; --without-hds) SRS_HDS=NO ;;
@ -256,8 +253,8 @@ function parse_user_option() {
--without-gmp) SRS_GPERF_MP=NO ;; --without-gmp) SRS_GPERF_MP=NO ;;
--without-gcp) SRS_GPERF_CP=NO ;; --without-gcp) SRS_GPERF_CP=NO ;;
--without-gprof) SRS_GPROF=NO ;; --without-gprof) SRS_GPROF=NO ;;
--without-arm-ubuntu12) SRS_ARM_UBUNTU12=NO ;; --without-arm-ubuntu12) SRS_CROSS_BUILD=NO ;;
--without-mips-ubuntu12) SRS_MIPS_UBUNTU12=NO ;; --without-mips-ubuntu12) SRS_CROSS_BUILD=NO ;;
--jobs) SRS_JOBS=${value} ;; --jobs) SRS_JOBS=${value} ;;
--prefix) SRS_PREFIX=${value} ;; --prefix) SRS_PREFIX=${value} ;;
@ -271,8 +268,8 @@ function parse_user_option() {
--x86-64) SRS_X86_X64=YES ;; --x86-64) SRS_X86_X64=YES ;;
--osx) SRS_OSX=YES ;; --osx) SRS_OSX=YES ;;
--allow-osx) SRS_ALLOW_OSX=YES ;; --allow-osx) SRS_ALLOW_OSX=YES ;;
--arm) SRS_ARM_UBUNTU12=YES ;; --arm) SRS_CROSS_BUILD=YES ;;
--mips) SRS_MIPS_UBUNTU12=YES ;; --mips) SRS_CROSS_BUILD=YES ;;
--pi) SRS_PI=YES ;; --pi) SRS_PI=YES ;;
--cubie) SRS_CUBIE=YES ;; --cubie) SRS_CUBIE=YES ;;
--dev) SRS_DEV=YES ;; --dev) SRS_DEV=YES ;;
@ -341,40 +338,11 @@ function apply_user_presets() {
SRS_LOG_TRACE=YES SRS_LOG_TRACE=YES
# set default preset if not specifies # set default preset if not specifies
if [ $SRS_PURE_RTMP = NO ]; then if [[ $SRS_PURE_RTMP == NO && $SRS_FAST == NO && $SRS_DISABLE_ALL == NO && $SRS_ENABLE_ALL == NO && \
if [ $SRS_FAST = NO ]; then $SRS_DEV == NO && $SRS_FAST_DEV == NO && $SRS_DEMO == NO && $SRS_PI == NO && $SRS_CUBIE == NO && \
if [ $SRS_DISABLE_ALL = NO ]; then $SRS_X86_X64 == NO && $SRS_OSX == NO \
if [ $SRS_ENABLE_ALL = NO ]; then ]]; then
if [ $SRS_DEV = NO ]; then SRS_X86_X64=YES; opt="--x86-x64 $opt";
if [ $SRS_FAST_DEV = NO ]; then
if [ $SRS_DEMO = NO ]; then
if [ $SRS_ARM_UBUNTU12 = NO ]; then
if [ $SRS_MIPS_UBUNTU12 = NO ]; then
if [ $SRS_PI = NO ]; then
if [ $SRS_CUBIE = NO ]; then
if [ $SRS_X86_X64 = NO ]; then
if [ $SRS_OSX = NO ]; then
SRS_X86_X64=YES; opt="--x86-x64 $opt";
fi
fi
fi
fi
fi
fi
fi
fi
fi
fi
fi
fi
fi
# whether embeded cpu.
if [ $SRS_ARM_UBUNTU12 = YES ]; then
SRS_CROSS_BUILD=YES
fi
if [ $SRS_MIPS_UBUNTU12 = YES ]; then
SRS_CROSS_BUILD=YES
fi fi
# all disabled. # all disabled.
@ -421,29 +389,6 @@ function apply_user_presets() {
SRS_STATIC=NO SRS_STATIC=NO
fi fi
# if arm specified, set some default to disabled.
if [ $SRS_ARM_UBUNTU12 = YES ]; then
SRS_HDS=YES
SRS_NGINX=NO
SRS_FFMPEG_TOOL=NO
SRS_LIBRTMP=YES
SRS_RESEARCH=NO
SRS_UTEST=NO
# TODO: FIXME: need static? maybe donot.
SRS_STATIC=YES
fi
# if mips specified, set some default to disabled.
if [ $SRS_MIPS_UBUNTU12 = YES ]; then
SRS_HDS=YES
SRS_NGINX=NO
SRS_FFMPEG_TOOL=NO
SRS_LIBRTMP=YES
SRS_RESEARCH=NO
SRS_UTEST=NO
SRS_STATIC=NO
fi
# defaults for x86/x64 # defaults for x86/x64
if [ $SRS_X86_X64 = YES ]; then if [ $SRS_X86_X64 = YES ]; then
SRS_HDS=YES SRS_HDS=YES
@ -618,8 +563,6 @@ SRS_AUTO_CONFIGURE="--prefix=${SRS_PREFIX}"
if [ $SRS_GPERF_MP = YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --with-gmp"; else SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --without-gmp"; fi if [ $SRS_GPERF_MP = YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --with-gmp"; else SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --without-gmp"; fi
if [ $SRS_GPERF_CP = YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --with-gcp"; else SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --without-gcp"; fi if [ $SRS_GPERF_CP = YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --with-gcp"; else SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --without-gcp"; fi
if [ $SRS_GPROF = YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --with-gprof"; else SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --without-gprof"; fi if [ $SRS_GPROF = YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --with-gprof"; else SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --without-gprof"; fi
if [ $SRS_ARM_UBUNTU12 = YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --with-arm-ubuntu12"; else SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --without-arm-ubuntu12"; fi
if [ $SRS_MIPS_UBUNTU12 = YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --with-mips-ubuntu12"; else SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --without-mips-ubuntu12"; fi
if [ $SRS_STATIC = YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --static"; fi if [ $SRS_STATIC = YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --static"; fi
if [ $SRS_LOG_VERBOSE = YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --log-verbose"; fi if [ $SRS_LOG_VERBOSE = YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --log-verbose"; fi
if [ $SRS_LOG_INFO = YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --log-info"; fi if [ $SRS_LOG_INFO = YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --log-info"; fi
@ -634,6 +577,18 @@ regenerate_options
# check user options # check user options
##################################################################################### #####################################################################################
function check_option_conflicts() { function check_option_conflicts() {
if [ $SRS_CROSS_BUILD = YES ]; then
echo "We don't support crossbuild for ARM/MIPS, please directly build it on ARM/MIPS server."
exit -1
fi
if [ $SRS_OSX = YES ]; then
echo "We don't support OSX, please use docker https://github.com/ossrs/srs-docker"
exit -1
fi
# TODO: FIXME: check more os.
__check_ok=YES __check_ok=YES
# check conflict # check conflict
if [ $SRS_GPERF = NO ]; then if [ $SRS_GPERF = NO ]; then
@ -658,35 +613,6 @@ function check_option_conflicts() {
echo "gmc/gmp/gcp not compatible with gprof, see: ./configure --help"; __check_ok=NO; echo "gmc/gmp/gcp not compatible with gprof, see: ./configure --help"; __check_ok=NO;
fi fi fi fi
# check embeded(arm/mips), if embeded enabled, only allow st/ssl/librtmp,
# user should disable all other features
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
if [ $SRS_GPERF_MC = YES ]; then echo "gmc for arm is not available, see: ./configure --help"; __check_ok=NO; fi
if [ $SRS_GPERF_MD = YES ]; then echo "gmd for arm is not available, see: ./configure --help"; __check_ok=NO; fi
if [ $SRS_GPERF_MP = YES ]; then echo "gmp for arm is not available, see: ./configure --help"; __check_ok=NO; fi
if [ $SRS_GPERF_CP = YES ]; then echo "gcp for arm is not available, see: ./configure --help"; __check_ok=NO; fi
if [ $SRS_GPROF = YES ]; then echo "gprof for arm is not available, see: ./configure --help"; __check_ok=NO; fi
fi
# osx not support gperf.
if [ $SRS_OSX = YES ]; then
if [ $SRS_GPERF = YES ]; then echo "gperf for osx is not available, see: ./configure --help"; __check_ok=NO; fi
if [ $SRS_GPERF_MC = YES ]; then echo "gmc for osx is not available, see: ./configure --help"; __check_ok=NO; fi
if [ $SRS_GPERF_MD = YES ]; then echo "gmd for osx is not available, see: ./configure --help"; __check_ok=NO; fi
if [ $SRS_GPERF_MP = YES ]; then echo "gmp for osx is not available, see: ./configure --help"; __check_ok=NO; fi
if [ $SRS_GPERF_CP = YES ]; then echo "gcp for osx is not available, see: ./configure --help"; __check_ok=NO; fi
fi
# if osx, never use static
if [[ $SRS_OSX = YES && $SRS_STATIC = YES ]]; then
echo "osx should never use static, see: ./configure --help"; __check_ok=NO;
fi
# TODO: FIXME: check more os.
# check variable neccessary # check variable neccessary
if [ $SRS_HDS = RESERVED ]; then echo "you must specifies the hds, see: ./configure --help"; __check_ok=NO; fi if [ $SRS_HDS = RESERVED ]; then echo "you must specifies the hds, see: ./configure --help"; __check_ok=NO; fi
if [ $SRS_NGINX = RESERVED ]; then echo "you must specifies the nginx, see: ./configure --help"; __check_ok=NO; fi if [ $SRS_NGINX = RESERVED ]; then echo "you must specifies the nginx, see: ./configure --help"; __check_ok=NO; fi
@ -702,8 +628,6 @@ function check_option_conflicts() {
if [ $SRS_GPERF_MP = RESERVED ]; then echo "you must specifies the gperf-mp, see: ./configure --help"; __check_ok=NO; fi if [ $SRS_GPERF_MP = RESERVED ]; then echo "you must specifies the gperf-mp, see: ./configure --help"; __check_ok=NO; fi
if [ $SRS_GPERF_CP = RESERVED ]; then echo "you must specifies the gperf-cp, see: ./configure --help"; __check_ok=NO; fi if [ $SRS_GPERF_CP = RESERVED ]; then echo "you must specifies the gperf-cp, see: ./configure --help"; __check_ok=NO; fi
if [ $SRS_GPROF = RESERVED ]; then echo "you must specifies the gprof, see: ./configure --help"; __check_ok=NO; fi if [ $SRS_GPROF = RESERVED ]; then echo "you must specifies the gprof, see: ./configure --help"; __check_ok=NO; fi
if [ $SRS_ARM_UBUNTU12 = RESERVED ]; then echo "you must specifies the arm-ubuntu12, see: ./configure --help"; __check_ok=NO; fi
if [ $SRS_MIPS_UBUNTU12 = RESERVED ]; then echo "you must specifies the mips-ubuntu12, see: ./configure --help"; __check_ok=NO; fi
if [[ -z $SRS_PREFIX ]]; then echo "you must specifies the prefix, see: ./configure --prefix"; __check_ok=NO; fi if [[ -z $SRS_PREFIX ]]; then echo "you must specifies the prefix, see: ./configure --prefix"; __check_ok=NO; fi
if [ $__check_ok = NO ]; then if [ $__check_ok = NO ]; then
exit 1; exit 1;

View file

@ -1,30 +1,3 @@
#!/bin/bash #!/bin/bash
# when options parsed, setup some variables, then build the depends. # when options parsed, setup some variables, then build the depends.
# when arm specified, setup the cross build variables.
if [ $SRS_ARM_UBUNTU12 = YES ]; then
__SrsArmCC="arm-linux-gnueabi-gcc";
__SrsArmGCC="arm-linux-gnueabi-gcc";
__SrsArmCXX="arm-linux-gnueabi-g++";
__SrsArmAR="arm-linux-gnueabi-ar";
__SrsArmLD="arm-linux-gnueabi-ld";
__SrsArmRANDLIB="arm-linux-gnueabi-ranlib";
fi
if [ $SRS_MIPS_UBUNTU12 = YES ]; then
__SrsArmCC="mipsel-openwrt-linux-gcc";
__SrsArmGCC="mipsel-openwrt-linux-gcc";
__SrsArmCXX="mipsel-openwrt-linux-g++";
__SrsArmAR="mipsel-openwrt-linux-ar";
__SrsArmLD="mipsel-openwrt-linux-ld";
__SrsArmRANDLIB="mipsel-openwrt-linux-ranlib";
fi
# the arm-ubuntu12 options for make for depends
if [[ -z $SrsArmCC ]]; then SrsArmCC=$__SrsArmCC; fi
if [[ -z $SrsArmGCC ]]; then SrsArmGCC=$__SrsArmGCC; fi
if [[ -z $SrsArmCXX ]]; then SrsArmCXX=$__SrsArmCXX; fi
if [[ -z $SrsArmAR ]]; then SrsArmAR=$__SrsArmAR; fi
if [[ -z $SrsArmLD ]]; then SrsArmLD=$__SrsArmLD; fi
if [[ -z $SrsArmRANDLIB ]]; then SrsArmRANDLIB=$__SrsArmRANDLIB; fi

27
trunk/configure vendored
View file

@ -163,10 +163,6 @@ fi
if [ $SRS_STATIC = YES ]; then if [ $SRS_STATIC = YES ]; then
SrsLinkOptions="${SrsLinkOptions} -static"; SrsLinkOptions="${SrsLinkOptions} -static";
fi fi
# if mips, add -lgcc_eh, or stl compile failed.
if [ $SRS_MIPS_UBUNTU12 = YES ]; then
SrsLinkOptions="${SrsLinkOptions} -lgcc_eh";
fi
# For coverage. # For coverage.
if [[ $SRS_GCOV == YES ]]; then if [[ $SRS_GCOV == YES ]]; then
SrsLinkOptions="${SrsLinkOptions} ${SrsGcov}"; SrsLinkOptions="${SrsLinkOptions} ${SrsGcov}";
@ -351,23 +347,10 @@ cat << END > ${SRS_WORKDIR}/${SRS_MAKEFILE}
SRS_PREFIX=${SRS_PREFIX} SRS_PREFIX=${SRS_PREFIX}
__REAL_INSTALL=\$(DESTDIR)\$(SRS_PREFIX) __REAL_INSTALL=\$(DESTDIR)\$(SRS_PREFIX)
END
# embeded, ubuntu12, use embeded tool chain.
if [ $SRS_CROSS_BUILD = YES ]; then
cat << END >> ${SRS_WORKDIR}/${SRS_MAKEFILE}
default:
\$(MAKE) GCC=${SrsArmGCC} CXX=${SrsArmCXX} AR=${SrsArmAR} LINK=${SrsArmCXX} _default
END
# x86/x64, use gnu-gcc/g++ tool chain.
else
cat << END >> ${SRS_WORKDIR}/${SRS_MAKEFILE}
default: default:
\$(MAKE) _default \$(MAKE) _default
END END
fi
# the real entry for all platform: # the real entry for all platform:
# the server, librtmp and utest # the server, librtmp and utest
@ -687,16 +670,6 @@ if [ $SRS_EXPORT_LIBRTMP_PROJECT = NO ]; then
else else
echo -e "${GREEN}Note: The gprof(GNU profile tool) is disabled.${BLACK}" echo -e "${GREEN}Note: The gprof(GNU profile tool) is disabled.${BLACK}"
fi fi
if [ $SRS_ARM_UBUNTU12 = YES ]; then
echo -e "${GREEN}The cross-build arm-ubuntu12(armhf, v7cpu) is enabled.${BLACK}"
else
echo -e "${GREEN}Note: The cross-build arm-ubuntu12(armhf, v7cpu)is disabled.${BLACK}"
fi
if [ $SRS_MIPS_UBUNTU12 = YES ]; then
echo -e "${GREEN}The mips-ubuntu12 is enabled.${BLACK}"
else
echo -e "${GREEN}Note: The mips-ubuntu12 is disabled.${BLACK}"
fi
if [ $SRS_VALGRIND = YES ]; then if [ $SRS_VALGRIND = YES ]; then
echo -e "${GREEN}The valgrind is enabled.${BLACK}" echo -e "${GREEN}The valgrind is enabled.${BLACK}"
else else

View file

@ -28,6 +28,7 @@
#include <errno.h> #include <errno.h>
#include <sstream> #include <sstream>
#include <stdarg.h> #include <stdarg.h>
#include <unistd.h>
using namespace std; using namespace std;
bool srs_is_system_control_error(srs_error_t err) bool srs_is_system_control_error(srs_error_t err)
@ -77,7 +78,7 @@ std::string SrsCplxError::description() {
next = this; next = this;
while (next) { while (next) {
ss << "thread [" << next->cid << "]: " ss << "thread [" << getpid() << "][" << next->cid << "]: "
<< next->func << "() [" << next->file << ":" << next->line << "]" << next->func << "() [" << next->file << ":" << next->line << "]"
<< "[errno=" << next->rerrno << "]"; << "[errno=" << next->rerrno << "]";

View file

@ -118,15 +118,14 @@ srs_error_t do_main(int argc, char** argv)
} }
// config already applied to log. // config already applied to log.
srs_trace(RTMP_SIG_SRS_SERVER); srs_trace("%s, %s", RTMP_SIG_SRS_SERVER, RTMP_SIG_SRS_LICENSE);
srs_trace("license: " RTMP_SIG_SRS_LICENSE);
srs_trace("contributors: " SRS_AUTO_CONSTRIBUTORS); srs_trace("contributors: " SRS_AUTO_CONSTRIBUTORS);
srs_trace("build: %s, configure:%s, uname: %s", SRS_AUTO_BUILD_DATE, SRS_AUTO_USER_CONFIGURE, SRS_AUTO_UNAME); srs_trace("cwd=%s, work_dir=%s, build: %s, configure: %s, uname: %s",
_srs_config->cwd().c_str(), cwd.c_str(), SRS_AUTO_BUILD_DATE, SRS_AUTO_USER_CONFIGURE, SRS_AUTO_UNAME);
srs_trace("configure detail: " SRS_AUTO_CONFIGURE); srs_trace("configure detail: " SRS_AUTO_CONFIGURE);
#ifdef SRS_AUTO_EMBEDED_TOOL_CHAIN #ifdef SRS_AUTO_EMBEDED_TOOL_CHAIN
srs_trace("crossbuild tool chain: " SRS_AUTO_EMBEDED_TOOL_CHAIN); srs_trace("crossbuild tool chain: " SRS_AUTO_EMBEDED_TOOL_CHAIN);
#endif #endif
srs_trace("cwd=%s, work_dir=%s", _srs_config->cwd().c_str(), cwd.c_str());
// for memory check or detect. // for memory check or detect.
if (true) { if (true) {
@ -249,12 +248,6 @@ void show_macro_features()
#ifdef SRS_CUBIE #ifdef SRS_CUBIE
ss << "CubieBoard"; ss << "CubieBoard";
#endif #endif
#ifdef SRS_ARM_UBUNTU12
ss << "ARM(build on ubuntu)";
#endif
#ifdef SRS_MIPS_UBUNTU12
ss << "MIPS(build on ubuntu)";
#endif
#if defined(__amd64__) #if defined(__amd64__)
ss << " amd64"; ss << " amd64";