Skip to content

Commit

Permalink
For #1547, support setting cc/cxx/ar tools. 3.0.103
Browse files Browse the repository at this point in the history
  • Loading branch information
winlinvip committed Jan 21, 2020
1 parent a6fe4e8 commit 6af8e38
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 24 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ For previous versions, please read:

## 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 [#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
Expand Down Expand Up @@ -1602,6 +1603,7 @@ Winlin
[bug #307]: https://github.com/ossrs/srs/issues/307
[bug #1070]: https://github.com/ossrs/srs/issues/1070
[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

[exo #828]: https://github.com/google/ExoPlayer/pull/828
Expand Down
4 changes: 2 additions & 2 deletions trunk/auto/depends.sh
Original file line number Diff line number Diff line change
Expand Up @@ -221,8 +221,8 @@ if [ $SRS_EXPORT_LIBRTMP_PROJECT = NO ]; then
_ST_EXTRA_CFLAGS="$_ST_EXTRA_CFLAGS -DMD_VALGRIND"
fi
# Pass the global extra flags.
if [[ $SRS_EXTRA_CFLAGS != '' ]]; then
_ST_EXTRA_CFLAGS="$_ST_EXTRA_CFLAGS $SRS_EXTRA_CFLAGS"
if [[ $SRS_EXTRA_FLAGS != '' ]]; then
_ST_EXTRA_CFLAGS="$_ST_EXTRA_CFLAGS $SRS_EXTRA_FLAGS"
fi
# Patched ST from https://github.com/ossrs/state-threads/tree/srs
if [[ -f ${SRS_OBJS}/st/libst.a ]]; then
Expand Down
50 changes: 35 additions & 15 deletions trunk/auto/options.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,6 @@ SRS_GCOV=NO
SRS_LOG_VERBOSE=NO
SRS_LOG_INFO=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
Expand Down Expand Up @@ -97,8 +95,12 @@ SRS_DISABLE_ALL=NO
SRS_ENABLE_ALL=NO
#
#####################################################################################
# Whether enable crossbuild for ARM or MIPS.
# Toolchain crossbuild for ARM or MIPS.
SRS_CROSS_BUILD=NO
SRS_TOOL_CC=gcc
SRS_TOOL_CXX=g++
SRS_TOOL_AR=ar
SRS_EXTRA_FLAGS=

#####################################################################################
# menu
Expand Down Expand Up @@ -139,8 +141,7 @@ Features:
--log-info Whether enable the log info level. default: no.
--log-trace Whether enable the log trace level. default: yes.
Performance:
https://blog.csdn.net/win_lin/article/details/53503869
Performance: @see https://blog.csdn.net/win_lin/article/details/53503869
--with-valgrind Support valgrind for memory check.
--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.
Expand All @@ -157,8 +158,12 @@ Performance:
--without-gcp Do not build cpu profile for SRS with gperf tools.
--without-gprof Do not build srs with gprof(GNU profile tool).
Toolchain options:
https://github.com/ossrs/srs/issues/1547#issuecomment-576078411
Toolchain options: @see 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.
Conflicts:
Expand Down Expand Up @@ -232,20 +237,24 @@ function parse_user_option() {
--without-mips-ubuntu12) SRS_CROSS_BUILD=NO ;;

--jobs) SRS_JOBS=${value} ;;
--extra-flags) SRS_EXTRA_CFLAGS=${value} ;;
--prefix) SRS_PREFIX=${value} ;;
--static) SRS_STATIC=YES ;;
--log-verbose) SRS_LOG_VERBOSE=YES ;;
--log-info) SRS_LOG_INFO=YES ;;
--log-trace) SRS_LOG_TRACE=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-64) SRS_X86_X64=YES ;;
--osx) SRS_OSX=YES ;;
--allow-osx) SRS_OSX=YES ;;
--arm) SRS_CROSS_BUILD=YES ;;
--mips) SRS_CROSS_BUILD=YES ;;
--pi) SRS_PI=YES ;;
--cubie) SRS_CUBIE=YES ;;
--dev) SRS_DEV=YES ;;
Expand Down Expand Up @@ -285,7 +294,7 @@ function parse_user_option_to_value_and_option() {
case "$option" in
-*=*)
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="" ;;
esac
Expand Down Expand Up @@ -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_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_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 "Detail config: ${SRS_AUTO_CONFIGURE}"
}
Expand All @@ -517,8 +529,16 @@ regenerate_options
# check user options
#####################################################################################
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."
if [[ $SRS_TOOL_CC == '' ]]; then
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
fi

Expand Down
12 changes: 6 additions & 6 deletions trunk/configure
Original file line number Diff line number Diff line change
Expand Up @@ -119,16 +119,16 @@ if [[ $SRS_GCOV == YES ]]; then
CXXFLAGS="${CXXFLAGS} ${SrsGcov}";
fi
# User configed options.
if [[ $SRS_EXTRA_CFLAGS != '' ]]; then
CXXFLAGS="${CXXFLAGS} $SRS_EXTRA_CFLAGS";
if [[ $SRS_EXTRA_FLAGS != '' ]]; then
CXXFLAGS="${CXXFLAGS} $SRS_EXTRA_FLAGS";
fi
# Start to generate the Makefile.
cat << END >> ${SRS_OBJS}/${SRS_MAKEFILE}
GCC = gcc
CXX = g++
AR = ar
GCC = ${SRS_TOOL_CC}
CXX = ${SRS_TOOL_CXX}
AR = ${SRS_TOOL_AR}
ARFLAGS = -rs
LINK = g++
LINK = ${SRS_TOOL_CXX}
CXXFLAGS = ${CXXFLAGS}
.PHONY: default srs srs_ingest_hls librtmp
Expand Down
2 changes: 1 addition & 1 deletion trunk/src/core/srs_core.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
// The version config.
#define VERSION_MAJOR 3
#define VERSION_MINOR 0
#define VERSION_REVISION 102
#define VERSION_REVISION 103

// The macros generated by configure script.
#include <srs_auto_headers.hpp>
Expand Down

0 comments on commit 6af8e38

Please sign in to comment.