Skip to content

Commit 6af8e38

Browse files
committed
For #1547, support setting cc/cxx/ar tools. 3.0.103
1 parent a6fe4e8 commit 6af8e38

File tree

5 files changed

+46
-24
lines changed

5 files changed

+46
-24
lines changed

README.md

+2
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,7 @@ For previous versions, please read:
146146

147147
## V3 changes
148148

149+
* v3.0, 2020-01-21, For [#1547][bug #1547], support setting cc/cxx/ar tools. 3.0.103
149150
* v3.0, 2020-01-19, For [#1580][bug #1580], fix cid range problem. 3.0.102
150151
* v3.0, 2020-01-19, For [#1070][bug #1070], define FLV CodecID for [AV1][bug #1070] and [opus][bug #307]. 3.0.101
151152
* 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
16021603
[bug #307]: https://github.com/ossrs/srs/issues/307
16031604
[bug #1070]: https://github.com/ossrs/srs/issues/1070
16041605
[bug #1580]: https://github.com/ossrs/srs/issues/1580
1606+
[bug #1547]: https://github.com/ossrs/srs/issues/1547
16051607
[bug #xxxxxxxxxxxxx]: https://github.com/ossrs/srs/issues/xxxxxxxxxxxxx
16061608

16071609
[exo #828]: https://github.com/google/ExoPlayer/pull/828

trunk/auto/depends.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -221,8 +221,8 @@ if [ $SRS_EXPORT_LIBRTMP_PROJECT = NO ]; then
221221
_ST_EXTRA_CFLAGS="$_ST_EXTRA_CFLAGS -DMD_VALGRIND"
222222
fi
223223
# Pass the global extra flags.
224-
if [[ $SRS_EXTRA_CFLAGS != '' ]]; then
225-
_ST_EXTRA_CFLAGS="$_ST_EXTRA_CFLAGS $SRS_EXTRA_CFLAGS"
224+
if [[ $SRS_EXTRA_FLAGS != '' ]]; then
225+
_ST_EXTRA_CFLAGS="$_ST_EXTRA_CFLAGS $SRS_EXTRA_FLAGS"
226226
fi
227227
# Patched ST from https://github.com/ossrs/state-threads/tree/srs
228228
if [[ -f ${SRS_OBJS}/st/libst.a ]]; then

trunk/auto/options.sh

+35-15
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,6 @@ SRS_GCOV=NO
5454
SRS_LOG_VERBOSE=NO
5555
SRS_LOG_INFO=NO
5656
SRS_LOG_TRACE=NO
57-
# The extra c/c++ flags to build SRS. Note that we also pass to ST as EXTRA_CFLAGS.
58-
SRS_EXTRA_CFLAGS=
5957
#
6058
################################################################
6159
# experts
@@ -97,8 +95,12 @@ SRS_DISABLE_ALL=NO
9795
SRS_ENABLE_ALL=NO
9896
#
9997
#####################################################################################
100-
# Whether enable crossbuild for ARM or MIPS.
98+
# Toolchain crossbuild for ARM or MIPS.
10199
SRS_CROSS_BUILD=NO
100+
SRS_TOOL_CC=gcc
101+
SRS_TOOL_CXX=g++
102+
SRS_TOOL_AR=ar
103+
SRS_EXTRA_FLAGS=
102104

103105
#####################################################################################
104106
# menu
@@ -139,8 +141,7 @@ Features:
139141
--log-info Whether enable the log info level. default: no.
140142
--log-trace Whether enable the log trace level. default: yes.
141143
142-
Performance:
143-
https://blog.csdn.net/win_lin/article/details/53503869
144+
Performance: @see https://blog.csdn.net/win_lin/article/details/53503869
144145
--with-valgrind Support valgrind for memory check.
145146
--with-gperf Build SRS with gperf tools(no gmd/gmc/gmp/gcp, with tcmalloc only).
146147
--with-gmc Build memory check for SRS with gperf tools.
@@ -157,8 +158,12 @@ Performance:
157158
--without-gcp Do not build cpu profile for SRS with gperf tools.
158159
--without-gprof Do not build srs with gprof(GNU profile tool).
159160
160-
Toolchain options:
161-
https://github.com/ossrs/srs/issues/1547#issuecomment-576078411
161+
Toolchain options: @see https://github.com/ossrs/srs/issues/1547#issuecomment-576078411
162+
--arm Enable crossbuild for ARM.
163+
--mips Enable crossbuild for MIPS.
164+
--cc=<CC> Use c compiler CC, default is gcc.
165+
--cxx=<CXX> Use c++ compiler CXX, default is g++.
166+
--ar=<AR> Use archive tool AR, default is ar.
162167
--extra-flags=<EFLAGS> Set EFLAGS as CFLAGS and CXXFLAGS. Also passed to ST as EXTRA_CFLAGS.
163168
164169
Conflicts:
@@ -232,20 +237,24 @@ function parse_user_option() {
232237
--without-mips-ubuntu12) SRS_CROSS_BUILD=NO ;;
233238

234239
--jobs) SRS_JOBS=${value} ;;
235-
--extra-flags) SRS_EXTRA_CFLAGS=${value} ;;
236240
--prefix) SRS_PREFIX=${value} ;;
237241
--static) SRS_STATIC=YES ;;
238242
--log-verbose) SRS_LOG_VERBOSE=YES ;;
239243
--log-info) SRS_LOG_INFO=YES ;;
240244
--log-trace) SRS_LOG_TRACE=YES ;;
241245
--gcov) SRS_GCOV=YES ;;
242-
246+
247+
--arm) SRS_CROSS_BUILD=YES ;;
248+
--mips) SRS_CROSS_BUILD=YES ;;
249+
--cc) SRS_TOOL_CC=${value} ;;
250+
--cxx) SRS_TOOL_CXX=${value} ;;
251+
--ar) SRS_TOOL_AR=${value} ;;
252+
--extra-flags) SRS_EXTRA_FLAGS=${value} ;;
253+
243254
--x86-x64) SRS_X86_X64=YES ;;
244255
--x86-64) SRS_X86_X64=YES ;;
245256
--osx) SRS_OSX=YES ;;
246257
--allow-osx) SRS_OSX=YES ;;
247-
--arm) SRS_CROSS_BUILD=YES ;;
248-
--mips) SRS_CROSS_BUILD=YES ;;
249258
--pi) SRS_PI=YES ;;
250259
--cubie) SRS_CUBIE=YES ;;
251260
--dev) SRS_DEV=YES ;;
@@ -285,7 +294,7 @@ function parse_user_option_to_value_and_option() {
285294
case "$option" in
286295
-*=*)
287296
value=`echo "$option" | sed -e 's|[-_a-zA-Z0-9/]*=||'`
288-
option=`echo "$option" | sed -e 's|=[-_a-zA-Z0-9/. ]*||'`
297+
option=`echo "$option" | sed -e 's|=[-_a-zA-Z0-9/. +]*||'`
289298
;;
290299
*) value="" ;;
291300
esac
@@ -507,7 +516,10 @@ SRS_AUTO_CONFIGURE="--prefix=${SRS_PREFIX}"
507516
if [ $SRS_LOG_INFO = YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --log-info"; fi
508517
if [ $SRS_LOG_TRACE = YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --log-trace"; fi
509518
if [ $SRS_GCOV = YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --gcov"; fi
510-
if [[ $SRS_EXTRA_CFLAGS != '' ]]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --extra-flags=\\\"$SRS_EXTRA_CFLAGS\\\""; fi
519+
if [[ $SRS_EXTRA_FLAGS != '' ]]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --extra-flags=\\\"$SRS_EXTRA_FLAGS\\\""; fi
520+
if [[ $SRS_TOOL_CC != '' ]]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --cc=$SRS_TOOL_CC"; fi
521+
if [[ $SRS_TOOL_CXX != '' ]]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --cxx=$SRS_TOOL_CXX"; fi
522+
if [[ $SRS_TOOL_AR != '' ]]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --ar=$SRS_TOOL_AR"; fi
511523
echo "User config: $SRS_AUTO_USER_CONFIGURE"
512524
echo "Detail config: ${SRS_AUTO_CONFIGURE}"
513525
}
@@ -517,8 +529,16 @@ regenerate_options
517529
# check user options
518530
#####################################################################################
519531
function check_option_conflicts() {
520-
if [ $SRS_CROSS_BUILD = YES ]; then
521-
echo "We don't support crossbuild for ARM/MIPS, please directly build it on ARM/MIPS server."
532+
if [[ $SRS_TOOL_CC == '' ]]; then
533+
echo "No c compiler"
534+
exit -1
535+
fi
536+
if [[ $SRS_TOOL_CXX == '' ]]; then
537+
echo "No c++ compiler"
538+
exit -1
539+
fi
540+
if [[ $SRS_TOOL_AR == '' ]]; then
541+
echo "No arhive tool"
522542
exit -1
523543
fi
524544

trunk/configure

+6-6
Original file line numberDiff line numberDiff line change
@@ -119,16 +119,16 @@ if [[ $SRS_GCOV == YES ]]; then
119119
CXXFLAGS="${CXXFLAGS} ${SrsGcov}";
120120
fi
121121
# User configed options.
122-
if [[ $SRS_EXTRA_CFLAGS != '' ]]; then
123-
CXXFLAGS="${CXXFLAGS} $SRS_EXTRA_CFLAGS";
122+
if [[ $SRS_EXTRA_FLAGS != '' ]]; then
123+
CXXFLAGS="${CXXFLAGS} $SRS_EXTRA_FLAGS";
124124
fi
125125
# Start to generate the Makefile.
126126
cat << END >> ${SRS_OBJS}/${SRS_MAKEFILE}
127-
GCC = gcc
128-
CXX = g++
129-
AR = ar
127+
GCC = ${SRS_TOOL_CC}
128+
CXX = ${SRS_TOOL_CXX}
129+
AR = ${SRS_TOOL_AR}
130130
ARFLAGS = -rs
131-
LINK = g++
131+
LINK = ${SRS_TOOL_CXX}
132132
CXXFLAGS = ${CXXFLAGS}
133133
134134
.PHONY: default srs srs_ingest_hls librtmp

trunk/src/core/srs_core.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
// The version config.
2828
#define VERSION_MAJOR 3
2929
#define VERSION_MINOR 0
30-
#define VERSION_REVISION 102
30+
#define VERSION_REVISION 103
3131

3232
// The macros generated by configure script.
3333
#include <srs_auto_headers.hpp>

0 commit comments

Comments
 (0)