mirror of
https://github.com/ossrs/srs.git
synced 2025-02-12 19:31:53 +00:00
support use other g++ when configure.
This commit is contained in:
parent
cd7e6cc321
commit
72d477f466
5 changed files with 63 additions and 19 deletions
|
@ -27,7 +27,7 @@ else
|
|||
fi
|
||||
# add yasm to path, for x264 to use yasm directly.
|
||||
# ffmpeg can specifies the yasm path when configure it.
|
||||
PATH=${PATH}:${ff_release_dir}/bin
|
||||
export PATH=${PATH}:${ff_release_dir}/bin
|
||||
|
||||
# libaacplus
|
||||
if [[ -f ${ff_release_dir}/lib/libaacplus.a ]]; then
|
||||
|
|
|
@ -1,5 +1,15 @@
|
|||
#!/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()
|
||||
{
|
||||
sudo echo "" >/dev/null 2>&1
|
||||
|
@ -14,7 +24,7 @@ function require_sudoer()
|
|||
echo "check gcc/g++/gdb/make/openssl-devel"
|
||||
echo "depends tools are ok"
|
||||
#####################################################################################
|
||||
# for Ubuntu
|
||||
# for Ubuntu, auto install tools by apt-get
|
||||
#####################################################################################
|
||||
function Ubuntu_prepare()
|
||||
{
|
||||
|
@ -92,7 +102,7 @@ function Ubuntu_prepare()
|
|||
}
|
||||
Ubuntu_prepare
|
||||
#####################################################################################
|
||||
# for Centos
|
||||
# for Centos, auto install tools by yum
|
||||
#####################################################################################
|
||||
function Centos_prepare()
|
||||
{
|
||||
|
@ -380,10 +390,12 @@ fi
|
|||
#####################################################################################
|
||||
# build research code
|
||||
#####################################################################################
|
||||
mkdir -p ${SRS_OBJS}/research
|
||||
if [ $SRS_RESEARCH = YES ]; then
|
||||
mkdir -p ${SRS_OBJS}/research
|
||||
|
||||
(cd research/hls && make && mv ts_info ../../${SRS_OBJS}/research)
|
||||
ret=$?; if [[ $ret -ne 0 ]]; then echo "build research/hls failed, ret=$ret"; exit $ret; fi
|
||||
(cd research/hls && make && mv ts_info ../../${SRS_OBJS}/research)
|
||||
ret=$?; if [[ $ret -ne 0 ]]; then echo "build research/hls failed, ret=$ret"; exit $ret; fi
|
||||
|
||||
(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
|
||||
(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
|
||||
fi
|
||||
|
|
2
trunk/auto/modules.sh
Normal file → Executable file
2
trunk/auto/modules.sh
Normal file → Executable file
|
@ -50,7 +50,7 @@ for item in ${MODULE_FILES[*]}; do
|
|||
MODULE_OBJS="${MODULE_OBJS[@]} ${CPP_FILE}"
|
||||
if [ -f ${CPP_FILE} ]; then
|
||||
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}
|
||||
fi
|
||||
done
|
||||
|
|
|
@ -1,18 +1,32 @@
|
|||
#!/bin/bash
|
||||
|
||||
#####################################################################################
|
||||
#####################################################################################
|
||||
# parse user options, do this at first
|
||||
#####################################################################################
|
||||
#####################################################################################
|
||||
|
||||
#####################################################################################
|
||||
# output variables
|
||||
#####################################################################################
|
||||
help=no
|
||||
|
||||
SRS_HLS=RESERVED
|
||||
SRS_SSL=RESERVED
|
||||
SRS_FFMPEG=RESERVED
|
||||
SRS_HTTP=RESERVED
|
||||
SRS_RESEARCH=RESERVED
|
||||
|
||||
# TODO: remove the default to yes.
|
||||
SRS_HLS=YES
|
||||
SRS_SSL=YES
|
||||
SRS_FFMPEG=YES
|
||||
SRS_HTTP=YES
|
||||
SRS_RESEARCH=NO
|
||||
|
||||
#####################################################################################
|
||||
# parse options
|
||||
#####################################################################################
|
||||
opt=
|
||||
|
||||
for option
|
||||
|
@ -31,11 +45,13 @@ do
|
|||
--with-hls) SRS_HLS=YES ;;
|
||||
--with-ffmpeg) SRS_FFMPEG=YES ;;
|
||||
--with-http) SRS_HTTP=YES ;;
|
||||
--with-research) SRS_RESEARCH=YES ;;
|
||||
|
||||
--without-ssl) SRS_SSL=NO ;;
|
||||
--without-hls) SRS_HLS=NO ;;
|
||||
--without-ffmpeg) SRS_FFMPEG=NO ;;
|
||||
--without-http) SRS_HTTP=NO ;;
|
||||
--without-research) SRS_RESEARCH=NO ;;
|
||||
|
||||
*)
|
||||
echo "$0: error: invalid option \"$option\""
|
||||
|
@ -44,11 +60,14 @@ do
|
|||
esac
|
||||
done
|
||||
|
||||
# save all config options to macro.
|
||||
# save all config options to macro to write to auto headers file
|
||||
SRS_CONFIGURE="$opt"
|
||||
|
||||
#####################################################################################
|
||||
# show help and exit
|
||||
#####################################################################################
|
||||
if [ $help = yes ]; then
|
||||
cat << END
|
||||
cat << END
|
||||
|
||||
--help print this message
|
||||
|
||||
|
@ -58,17 +77,21 @@ cat << END
|
|||
--with-http enable http hooks, build cherrypy as demo api server.
|
||||
srs will call the http hooks, such as: on_connect.
|
||||
--with-ffmpeg enable transcoding with ffmpeg.
|
||||
--with-research build the research tools.
|
||||
|
||||
--without-ssl disable rtmp complex handshake.
|
||||
--without-hls disable hls, rtmp streaming only.
|
||||
--without-http disable http, http hooks callback.
|
||||
--without-ffmpeg disable the ffmpeg transcoding feature.
|
||||
--without-research do not build the research tools.
|
||||
|
||||
END
|
||||
|
||||
exit 1
|
||||
exit 0
|
||||
fi
|
||||
|
||||
#####################################################################################
|
||||
# check user options
|
||||
#####################################################################################
|
||||
__check_ok=YES
|
||||
if [ $SRS_SSL = RESERVED ]; then
|
||||
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";
|
||||
__check_ok=NO
|
||||
fi
|
||||
if [ $SRS_RESEARCH = RESERVED ]; then
|
||||
echo "you must specifies the research, see: ./configure --help";
|
||||
__check_ok=NO
|
||||
fi
|
||||
if [ $__check_ok = NO ]; then
|
||||
exit 1;
|
||||
fi
|
||||
fi
|
||||
|
|
15
trunk/configure
vendored
15
trunk/configure
vendored
|
@ -52,7 +52,7 @@ help:
|
|||
@echo " bandwidth build the bandwidth test client tool."
|
||||
|
||||
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
|
||||
@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} ${Performance}"
|
||||
cat << END > ${SRS_OBJS}/${SRS_MAKEFILE}
|
||||
CXXFLAGS = ${CXXFLAGS}
|
||||
GCC = g++
|
||||
LINK = \$(GCC)
|
||||
AR = ar
|
||||
CXXFLAGS ?= ${CXXFLAGS}
|
||||
CXX ?= g++
|
||||
LINK ?= \$(CXX)
|
||||
AR ?= ar
|
||||
|
||||
.PHONY: default srs bandwidth
|
||||
|
||||
|
@ -174,6 +174,11 @@ if [ $SRS_HTTP = YES ]; then
|
|||
else
|
||||
echo -e "${YELLOW}warning: without http hooks callback over CherryPy support${BLACK}"
|
||||
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 -p ${SRS_OBJS}/logs
|
||||
|
|
Loading…
Reference in a new issue