@@ -54,8 +54,6 @@ SRS_GCOV=NO
54
54
SRS_LOG_VERBOSE=NO
55
55
SRS_LOG_INFO=NO
56
56
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=
59
57
#
60
58
# ###############################################################
61
59
# experts
@@ -97,8 +95,12 @@ SRS_DISABLE_ALL=NO
97
95
SRS_ENABLE_ALL=NO
98
96
#
99
97
# ####################################################################################
100
- # Whether enable crossbuild for ARM or MIPS.
98
+ # Toolchain crossbuild for ARM or MIPS.
101
99
SRS_CROSS_BUILD=NO
100
+ SRS_TOOL_CC=gcc
101
+ SRS_TOOL_CXX=g++
102
+ SRS_TOOL_AR=ar
103
+ SRS_EXTRA_FLAGS=
102
104
103
105
# ####################################################################################
104
106
# menu
@@ -139,8 +141,7 @@ Features:
139
141
--log-info Whether enable the log info level. default: no.
140
142
--log-trace Whether enable the log trace level. default: yes.
141
143
142
- Performance:
143
- https://blog.csdn.net/win_lin/article/details/53503869
144
+ Performance: @see https://blog.csdn.net/win_lin/article/details/53503869
144
145
--with-valgrind Support valgrind for memory check.
145
146
--with-gperf Build SRS with gperf tools(no gmd/gmc/gmp/gcp, with tcmalloc only).
146
147
--with-gmc Build memory check for SRS with gperf tools.
@@ -157,8 +158,12 @@ Performance:
157
158
--without-gcp Do not build cpu profile for SRS with gperf tools.
158
159
--without-gprof Do not build srs with gprof(GNU profile tool).
159
160
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.
162
167
--extra-flags=<EFLAGS> Set EFLAGS as CFLAGS and CXXFLAGS. Also passed to ST as EXTRA_CFLAGS.
163
168
164
169
Conflicts:
@@ -232,20 +237,24 @@ function parse_user_option() {
232
237
--without-mips-ubuntu12) SRS_CROSS_BUILD=NO ;;
233
238
234
239
--jobs) SRS_JOBS=${value} ;;
235
- --extra-flags) SRS_EXTRA_CFLAGS=${value} ;;
236
240
--prefix) SRS_PREFIX=${value} ;;
237
241
--static) SRS_STATIC=YES ;;
238
242
--log-verbose) SRS_LOG_VERBOSE=YES ;;
239
243
--log-info) SRS_LOG_INFO=YES ;;
240
244
--log-trace) SRS_LOG_TRACE=YES ;;
241
245
--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
+
243
254
--x86-x64) SRS_X86_X64=YES ;;
244
255
--x86-64) SRS_X86_X64=YES ;;
245
256
--osx) SRS_OSX=YES ;;
246
257
--allow-osx) SRS_OSX=YES ;;
247
- --arm) SRS_CROSS_BUILD=YES ;;
248
- --mips) SRS_CROSS_BUILD=YES ;;
249
258
--pi) SRS_PI=YES ;;
250
259
--cubie) SRS_CUBIE=YES ;;
251
260
--dev) SRS_DEV=YES ;;
@@ -285,7 +294,7 @@ function parse_user_option_to_value_and_option() {
285
294
case " $option " in
286
295
-* =* )
287
296
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/. + ]*||' `
289
298
;;
290
299
* ) value=" " ;;
291
300
esac
@@ -507,7 +516,10 @@ SRS_AUTO_CONFIGURE="--prefix=${SRS_PREFIX}"
507
516
if [ $SRS_LOG_INFO = YES ]; then SRS_AUTO_CONFIGURE=" ${SRS_AUTO_CONFIGURE} --log-info" ; fi
508
517
if [ $SRS_LOG_TRACE = YES ]; then SRS_AUTO_CONFIGURE=" ${SRS_AUTO_CONFIGURE} --log-trace" ; fi
509
518
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
511
523
echo " User config: $SRS_AUTO_USER_CONFIGURE "
512
524
echo " Detail config: ${SRS_AUTO_CONFIGURE} "
513
525
}
@@ -517,8 +529,16 @@ regenerate_options
517
529
# check user options
518
530
# ####################################################################################
519
531
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"
522
542
exit -1
523
543
fi
524
544
0 commit comments