1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-02-12 19:31:53 +00:00

For #1547, support setting cc/cxx/ar tools. 3.0.103

This commit is contained in:
winlin 2020-01-21 10:28:25 +08:00
parent a6fe4e80d3
commit 6af8e38017
5 changed files with 46 additions and 24 deletions

View file

@ -146,6 +146,7 @@ For previous versions, please read:
## V3 changes ## V3 changes
* v3.0, 2020-01-21, For [#1547][bug #1547], support setting cc/cxx/ar tools. 3.0.103
* v3.0, 2020-01-19, For [#1580][bug #1580], fix cid range problem. 3.0.102 * v3.0, 2020-01-19, For [#1580][bug #1580], fix cid range problem. 3.0.102
* v3.0, 2020-01-19, For [#1070][bug #1070], define FLV CodecID for [AV1][bug #1070] and [opus][bug #307]. 3.0.101 * v3.0, 2020-01-19, For [#1070][bug #1070], define FLV CodecID for [AV1][bug #1070] and [opus][bug #307]. 3.0.101
* v3.0, 2020-01-16, For [#1575][bug #1575], correct RTMP redirect as tcUrl, add redirect2 as RTMP URL. 3.0.100 * v3.0, 2020-01-16, For [#1575][bug #1575], correct RTMP redirect as tcUrl, add redirect2 as RTMP URL. 3.0.100
@ -1602,6 +1603,7 @@ Winlin
[bug #307]: https://github.com/ossrs/srs/issues/307 [bug #307]: https://github.com/ossrs/srs/issues/307
[bug #1070]: https://github.com/ossrs/srs/issues/1070 [bug #1070]: https://github.com/ossrs/srs/issues/1070
[bug #1580]: https://github.com/ossrs/srs/issues/1580 [bug #1580]: https://github.com/ossrs/srs/issues/1580
[bug #1547]: https://github.com/ossrs/srs/issues/1547
[bug #xxxxxxxxxxxxx]: https://github.com/ossrs/srs/issues/xxxxxxxxxxxxx [bug #xxxxxxxxxxxxx]: https://github.com/ossrs/srs/issues/xxxxxxxxxxxxx
[exo #828]: https://github.com/google/ExoPlayer/pull/828 [exo #828]: https://github.com/google/ExoPlayer/pull/828

View file

@ -221,8 +221,8 @@ 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
# Pass the global extra flags. # Pass the global extra flags.
if [[ $SRS_EXTRA_CFLAGS != '' ]]; then if [[ $SRS_EXTRA_FLAGS != '' ]]; then
_ST_EXTRA_CFLAGS="$_ST_EXTRA_CFLAGS $SRS_EXTRA_CFLAGS" _ST_EXTRA_CFLAGS="$_ST_EXTRA_CFLAGS $SRS_EXTRA_FLAGS"
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 [[ -f ${SRS_OBJS}/st/libst.a ]]; then if [[ -f ${SRS_OBJS}/st/libst.a ]]; then

View file

@ -54,8 +54,6 @@ SRS_GCOV=NO
SRS_LOG_VERBOSE=NO SRS_LOG_VERBOSE=NO
SRS_LOG_INFO=NO SRS_LOG_INFO=NO
SRS_LOG_TRACE=NO SRS_LOG_TRACE=NO
# The extra c/c++ flags to build SRS. Note that we also pass to ST as EXTRA_CFLAGS.
SRS_EXTRA_CFLAGS=
# #
################################################################ ################################################################
# experts # experts
@ -97,8 +95,12 @@ SRS_DISABLE_ALL=NO
SRS_ENABLE_ALL=NO SRS_ENABLE_ALL=NO
# #
##################################################################################### #####################################################################################
# Whether enable crossbuild for ARM or MIPS. # Toolchain crossbuild for ARM or MIPS.
SRS_CROSS_BUILD=NO SRS_CROSS_BUILD=NO
SRS_TOOL_CC=gcc
SRS_TOOL_CXX=g++
SRS_TOOL_AR=ar
SRS_EXTRA_FLAGS=
##################################################################################### #####################################################################################
# menu # menu
@ -139,8 +141,7 @@ Features:
--log-info Whether enable the log info level. default: no. --log-info Whether enable the log info level. default: no.
--log-trace Whether enable the log trace level. default: yes. --log-trace Whether enable the log trace level. default: yes.
Performance: Performance: @see https://blog.csdn.net/win_lin/article/details/53503869
https://blog.csdn.net/win_lin/article/details/53503869
--with-valgrind Support valgrind for memory check. --with-valgrind Support valgrind for memory check.
--with-gperf Build SRS with gperf tools(no gmd/gmc/gmp/gcp, with tcmalloc only). --with-gperf Build SRS with gperf tools(no gmd/gmc/gmp/gcp, with tcmalloc only).
--with-gmc Build memory check for SRS with gperf tools. --with-gmc Build memory check for SRS with gperf tools.
@ -157,8 +158,12 @@ Performance:
--without-gcp Do not build cpu profile for SRS with gperf tools. --without-gcp Do not build cpu profile for SRS with gperf tools.
--without-gprof Do not build srs with gprof(GNU profile tool). --without-gprof Do not build srs with gprof(GNU profile tool).
Toolchain options: Toolchain options: @see https://github.com/ossrs/srs/issues/1547#issuecomment-576078411
https://github.com/ossrs/srs/issues/1547#issuecomment-576078411 --arm Enable crossbuild for ARM.
--mips Enable crossbuild for MIPS.
--cc=<CC> Use c compiler CC, default is gcc.
--cxx=<CXX> Use c++ compiler CXX, default is g++.
--ar=<AR> Use archive tool AR, default is ar.
--extra-flags=<EFLAGS> Set EFLAGS as CFLAGS and CXXFLAGS. Also passed to ST as EXTRA_CFLAGS. --extra-flags=<EFLAGS> Set EFLAGS as CFLAGS and CXXFLAGS. Also passed to ST as EXTRA_CFLAGS.
Conflicts: Conflicts:
@ -232,7 +237,6 @@ function parse_user_option() {
--without-mips-ubuntu12) SRS_CROSS_BUILD=NO ;; --without-mips-ubuntu12) SRS_CROSS_BUILD=NO ;;
--jobs) SRS_JOBS=${value} ;; --jobs) SRS_JOBS=${value} ;;
--extra-flags) SRS_EXTRA_CFLAGS=${value} ;;
--prefix) SRS_PREFIX=${value} ;; --prefix) SRS_PREFIX=${value} ;;
--static) SRS_STATIC=YES ;; --static) SRS_STATIC=YES ;;
--log-verbose) SRS_LOG_VERBOSE=YES ;; --log-verbose) SRS_LOG_VERBOSE=YES ;;
@ -240,12 +244,17 @@ function parse_user_option() {
--log-trace) SRS_LOG_TRACE=YES ;; --log-trace) SRS_LOG_TRACE=YES ;;
--gcov) SRS_GCOV=YES ;; --gcov) SRS_GCOV=YES ;;
--arm) SRS_CROSS_BUILD=YES ;;
--mips) SRS_CROSS_BUILD=YES ;;
--cc) SRS_TOOL_CC=${value} ;;
--cxx) SRS_TOOL_CXX=${value} ;;
--ar) SRS_TOOL_AR=${value} ;;
--extra-flags) SRS_EXTRA_FLAGS=${value} ;;
--x86-x64) SRS_X86_X64=YES ;; --x86-x64) SRS_X86_X64=YES ;;
--x86-64) SRS_X86_X64=YES ;; --x86-64) SRS_X86_X64=YES ;;
--osx) SRS_OSX=YES ;; --osx) SRS_OSX=YES ;;
--allow-osx) SRS_OSX=YES ;; --allow-osx) SRS_OSX=YES ;;
--arm) SRS_CROSS_BUILD=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 ;;
@ -285,7 +294,7 @@ function parse_user_option_to_value_and_option() {
case "$option" in case "$option" in
-*=*) -*=*)
value=`echo "$option" | sed -e 's|[-_a-zA-Z0-9/]*=||'` value=`echo "$option" | sed -e 's|[-_a-zA-Z0-9/]*=||'`
option=`echo "$option" | sed -e 's|=[-_a-zA-Z0-9/. ]*||'` option=`echo "$option" | sed -e 's|=[-_a-zA-Z0-9/. +]*||'`
;; ;;
*) value="" ;; *) value="" ;;
esac esac
@ -507,7 +516,10 @@ SRS_AUTO_CONFIGURE="--prefix=${SRS_PREFIX}"
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
if [ $SRS_LOG_TRACE = YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --log-trace"; fi if [ $SRS_LOG_TRACE = YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --log-trace"; fi
if [ $SRS_GCOV = YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --gcov"; fi if [ $SRS_GCOV = YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --gcov"; fi
if [[ $SRS_EXTRA_CFLAGS != '' ]]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --extra-flags=\\\"$SRS_EXTRA_CFLAGS\\\""; fi if [[ $SRS_EXTRA_FLAGS != '' ]]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --extra-flags=\\\"$SRS_EXTRA_FLAGS\\\""; fi
if [[ $SRS_TOOL_CC != '' ]]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --cc=$SRS_TOOL_CC"; fi
if [[ $SRS_TOOL_CXX != '' ]]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --cxx=$SRS_TOOL_CXX"; fi
if [[ $SRS_TOOL_AR != '' ]]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --ar=$SRS_TOOL_AR"; fi
echo "User config: $SRS_AUTO_USER_CONFIGURE" echo "User config: $SRS_AUTO_USER_CONFIGURE"
echo "Detail config: ${SRS_AUTO_CONFIGURE}" echo "Detail config: ${SRS_AUTO_CONFIGURE}"
} }
@ -517,8 +529,16 @@ regenerate_options
# check user options # check user options
##################################################################################### #####################################################################################
function check_option_conflicts() { function check_option_conflicts() {
if [ $SRS_CROSS_BUILD = YES ]; then if [[ $SRS_TOOL_CC == '' ]]; then
echo "We don't support crossbuild for ARM/MIPS, please directly build it on ARM/MIPS server." echo "No c compiler"
exit -1
fi
if [[ $SRS_TOOL_CXX == '' ]]; then
echo "No c++ compiler"
exit -1
fi
if [[ $SRS_TOOL_AR == '' ]]; then
echo "No arhive tool"
exit -1 exit -1
fi fi

12
trunk/configure vendored
View file

@ -119,16 +119,16 @@ if [[ $SRS_GCOV == YES ]]; then
CXXFLAGS="${CXXFLAGS} ${SrsGcov}"; CXXFLAGS="${CXXFLAGS} ${SrsGcov}";
fi fi
# User configed options. # User configed options.
if [[ $SRS_EXTRA_CFLAGS != '' ]]; then if [[ $SRS_EXTRA_FLAGS != '' ]]; then
CXXFLAGS="${CXXFLAGS} $SRS_EXTRA_CFLAGS"; CXXFLAGS="${CXXFLAGS} $SRS_EXTRA_FLAGS";
fi fi
# Start to generate the Makefile. # Start to generate the Makefile.
cat << END >> ${SRS_OBJS}/${SRS_MAKEFILE} cat << END >> ${SRS_OBJS}/${SRS_MAKEFILE}
GCC = gcc GCC = ${SRS_TOOL_CC}
CXX = g++ CXX = ${SRS_TOOL_CXX}
AR = ar AR = ${SRS_TOOL_AR}
ARFLAGS = -rs ARFLAGS = -rs
LINK = g++ LINK = ${SRS_TOOL_CXX}
CXXFLAGS = ${CXXFLAGS} CXXFLAGS = ${CXXFLAGS}
.PHONY: default srs srs_ingest_hls librtmp .PHONY: default srs srs_ingest_hls librtmp

View file

@ -27,7 +27,7 @@
// The version config. // The version config.
#define VERSION_MAJOR 3 #define VERSION_MAJOR 3
#define VERSION_MINOR 0 #define VERSION_MINOR 0
#define VERSION_REVISION 102 #define VERSION_REVISION 103
// The macros generated by configure script. // The macros generated by configure script.
#include <srs_auto_headers.hpp> #include <srs_auto_headers.hpp>