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

support use other g++ when configure.

This commit is contained in:
winlin 2014-02-28 14:38:27 +08:00
parent cd7e6cc321
commit 72d477f466
5 changed files with 63 additions and 19 deletions

View file

@ -27,7 +27,7 @@ else
fi fi
# add yasm to path, for x264 to use yasm directly. # add yasm to path, for x264 to use yasm directly.
# ffmpeg can specifies the yasm path when configure it. # ffmpeg can specifies the yasm path when configure it.
PATH=${PATH}:${ff_release_dir}/bin export PATH=${PATH}:${ff_release_dir}/bin
# libaacplus # libaacplus
if [[ -f ${ff_release_dir}/lib/libaacplus.a ]]; then if [[ -f ${ff_release_dir}/lib/libaacplus.a ]]; then

View file

@ -1,5 +1,15 @@
#!/bin/bash #!/bin/bash
#####################################################################################
#####################################################################################
# prepare the depends tools and libraries
# DEPENDS: options.sh, only when user options parsed, the depends tools are known.
#####################################################################################
#####################################################################################
#####################################################################################
# utilities
#####################################################################################
function require_sudoer() function require_sudoer()
{ {
sudo echo "" >/dev/null 2>&1 sudo echo "" >/dev/null 2>&1
@ -14,7 +24,7 @@ function require_sudoer()
echo "check gcc/g++/gdb/make/openssl-devel" echo "check gcc/g++/gdb/make/openssl-devel"
echo "depends tools are ok" echo "depends tools are ok"
##################################################################################### #####################################################################################
# for Ubuntu # for Ubuntu, auto install tools by apt-get
##################################################################################### #####################################################################################
function Ubuntu_prepare() function Ubuntu_prepare()
{ {
@ -92,7 +102,7 @@ function Ubuntu_prepare()
} }
Ubuntu_prepare Ubuntu_prepare
##################################################################################### #####################################################################################
# for Centos # for Centos, auto install tools by yum
##################################################################################### #####################################################################################
function Centos_prepare() function Centos_prepare()
{ {
@ -380,6 +390,7 @@ fi
##################################################################################### #####################################################################################
# build research code # build research code
##################################################################################### #####################################################################################
if [ $SRS_RESEARCH = YES ]; then
mkdir -p ${SRS_OBJS}/research mkdir -p ${SRS_OBJS}/research
(cd research/hls && make && mv ts_info ../../${SRS_OBJS}/research) (cd research/hls && make && mv ts_info ../../${SRS_OBJS}/research)
@ -387,3 +398,4 @@ ret=$?; if [[ $ret -ne 0 ]]; then echo "build research/hls failed, ret=$ret"; ex
(cd research/ffempty && make && mv ffempty ../../${SRS_OBJS}/research) (cd research/ffempty && make && mv ffempty ../../${SRS_OBJS}/research)
ret=$?; if [[ $ret -ne 0 ]]; then echo "build research/ffempty failed, ret=$ret"; exit $ret; fi ret=$?; if [[ $ret -ne 0 ]]; then echo "build research/ffempty failed, ret=$ret"; exit $ret; fi
fi

2
trunk/auto/modules.sh Normal file → Executable file
View file

@ -50,7 +50,7 @@ for item in ${MODULE_FILES[*]}; do
MODULE_OBJS="${MODULE_OBJS[@]} ${CPP_FILE}" MODULE_OBJS="${MODULE_OBJS[@]} ${CPP_FILE}"
if [ -f ${CPP_FILE} ]; then if [ -f ${CPP_FILE} ]; then
echo "${OBJ_FILE}: \$(${DEPS_NAME}) ${CPP_FILE} " >> ${FILE} echo "${OBJ_FILE}: \$(${DEPS_NAME}) ${CPP_FILE} " >> ${FILE}
echo " \$(GCC) -c \$(CXXFLAGS) \$(${INCS_NAME})\\" >> ${FILE} echo " \$(CXX) -c \$(CXXFLAGS) \$(${INCS_NAME})\\" >> ${FILE}
echo " -o ${OBJ_FILE} ${CPP_FILE}" >> ${FILE} echo " -o ${OBJ_FILE} ${CPP_FILE}" >> ${FILE}
fi fi
done done

View file

@ -1,18 +1,32 @@
#!/bin/bash #!/bin/bash
#####################################################################################
#####################################################################################
# parse user options, do this at first
#####################################################################################
#####################################################################################
#####################################################################################
# output variables
#####################################################################################
help=no help=no
SRS_HLS=RESERVED SRS_HLS=RESERVED
SRS_SSL=RESERVED SRS_SSL=RESERVED
SRS_FFMPEG=RESERVED SRS_FFMPEG=RESERVED
SRS_HTTP=RESERVED SRS_HTTP=RESERVED
SRS_RESEARCH=RESERVED
# TODO: remove the default to yes. # TODO: remove the default to yes.
SRS_HLS=YES SRS_HLS=YES
SRS_SSL=YES SRS_SSL=YES
SRS_FFMPEG=YES SRS_FFMPEG=YES
SRS_HTTP=YES SRS_HTTP=YES
SRS_RESEARCH=NO
#####################################################################################
# parse options
#####################################################################################
opt= opt=
for option for option
@ -31,11 +45,13 @@ do
--with-hls) SRS_HLS=YES ;; --with-hls) SRS_HLS=YES ;;
--with-ffmpeg) SRS_FFMPEG=YES ;; --with-ffmpeg) SRS_FFMPEG=YES ;;
--with-http) SRS_HTTP=YES ;; --with-http) SRS_HTTP=YES ;;
--with-research) SRS_RESEARCH=YES ;;
--without-ssl) SRS_SSL=NO ;; --without-ssl) SRS_SSL=NO ;;
--without-hls) SRS_HLS=NO ;; --without-hls) SRS_HLS=NO ;;
--without-ffmpeg) SRS_FFMPEG=NO ;; --without-ffmpeg) SRS_FFMPEG=NO ;;
--without-http) SRS_HTTP=NO ;; --without-http) SRS_HTTP=NO ;;
--without-research) SRS_RESEARCH=NO ;;
*) *)
echo "$0: error: invalid option \"$option\"" echo "$0: error: invalid option \"$option\""
@ -44,9 +60,12 @@ do
esac esac
done done
# save all config options to macro. # save all config options to macro to write to auto headers file
SRS_CONFIGURE="$opt" SRS_CONFIGURE="$opt"
#####################################################################################
# show help and exit
#####################################################################################
if [ $help = yes ]; then if [ $help = yes ]; then
cat << END cat << END
@ -58,17 +77,21 @@ cat << END
--with-http enable http hooks, build cherrypy as demo api server. --with-http enable http hooks, build cherrypy as demo api server.
srs will call the http hooks, such as: on_connect. srs will call the http hooks, such as: on_connect.
--with-ffmpeg enable transcoding with ffmpeg. --with-ffmpeg enable transcoding with ffmpeg.
--with-research build the research tools.
--without-ssl disable rtmp complex handshake. --without-ssl disable rtmp complex handshake.
--without-hls disable hls, rtmp streaming only. --without-hls disable hls, rtmp streaming only.
--without-http disable http, http hooks callback. --without-http disable http, http hooks callback.
--without-ffmpeg disable the ffmpeg transcoding feature. --without-ffmpeg disable the ffmpeg transcoding feature.
--without-research do not build the research tools.
END END
exit 0
exit 1
fi fi
#####################################################################################
# check user options
#####################################################################################
__check_ok=YES __check_ok=YES
if [ $SRS_SSL = RESERVED ]; then if [ $SRS_SSL = RESERVED ]; then
echo "you must specifies the ssl, see: ./configure --help"; echo "you must specifies the ssl, see: ./configure --help";
@ -86,6 +109,10 @@ if [ $SRS_HTTP = RESERVED ]; then
echo "you must specifies the http, see: ./configure --help"; echo "you must specifies the http, see: ./configure --help";
__check_ok=NO __check_ok=NO
fi fi
if [ $SRS_RESEARCH = RESERVED ]; then
echo "you must specifies the research, see: ./configure --help";
__check_ok=NO
fi
if [ $__check_ok = NO ]; then if [ $__check_ok = NO ]; then
exit 1; exit 1;
fi fi

15
trunk/configure vendored
View file

@ -52,7 +52,7 @@ help:
@echo " bandwidth build the bandwidth test client tool." @echo " bandwidth build the bandwidth test client tool."
clean: clean:
(rm -f Makefile; cd ${SRS_OBJS}; rm -rf srs bandwidth Makefile *.hpp src st_*_load) (rm -f Makefile; cd ${SRS_OBJS}; rm -rf srs bandwidth Makefile *.hpp src st_*_load research)
server: _prepare_dir server: _prepare_dir
@echo "build the srs(simple rtmp server) over st(state-threads)" @echo "build the srs(simple rtmp server) over st(state-threads)"
@ -81,10 +81,10 @@ CppStd="-ansi"
CXXFLAGS="${CppStd} ${WarnLevel} ${GDBDebug}" CXXFLAGS="${CppStd} ${WarnLevel} ${GDBDebug}"
#CXXFLAGS="${CppStd} ${WarnLevel} ${GDBDebug} ${Performance}" #CXXFLAGS="${CppStd} ${WarnLevel} ${GDBDebug} ${Performance}"
cat << END > ${SRS_OBJS}/${SRS_MAKEFILE} cat << END > ${SRS_OBJS}/${SRS_MAKEFILE}
CXXFLAGS = ${CXXFLAGS} CXXFLAGS ?= ${CXXFLAGS}
GCC = g++ CXX ?= g++
LINK = \$(GCC) LINK ?= \$(CXX)
AR = ar AR ?= ar
.PHONY: default srs bandwidth .PHONY: default srs bandwidth
@ -174,6 +174,11 @@ if [ $SRS_HTTP = YES ]; then
else else
echo -e "${YELLOW}warning: without http hooks callback over CherryPy support${BLACK}" echo -e "${YELLOW}warning: without http hooks callback over CherryPy support${BLACK}"
fi fi
if [ $SRS_RESEARCH = YES ]; then
echo -e "${GREEN}research tools are builded${BLACK}"
else
echo -e "${BLACK}note: research tools are not builded${BLACK}"
fi
# mkdir dirs # mkdir dirs
mkdir -p ${SRS_OBJS}/logs mkdir -p ${SRS_OBJS}/logs