winlin

add configure preset, add test for configure

@@ -536,10 +536,7 @@ fi @@ -536,10 +536,7 @@ fi
536 536
537 # whatever the FFMPEG tools, if transcode and ingest specified, 537 # whatever the FFMPEG tools, if transcode and ingest specified,
538 # srs always compile the FFMPEG tool stub which used to start the FFMPEG process. 538 # srs always compile the FFMPEG tool stub which used to start the FFMPEG process.
539 -__SRS_FFMPEG_STUB=NO  
540 -if [ $SRS_TRANSCODE = YES ]; then __SRS_FFMPEG_STUB=YES; fi  
541 -if [ $SRS_INGEST = YES ]; then __SRS_FFMPEG_STUB=YES; fi  
542 -if [ $__SRS_FFMPEG_STUB = YES ]; then 539 +if [ $SRS_FFMPEG_STUB = YES ]; then
543 echo "#define SRS_AUTO_FFMPEG" >> $SRS_AUTO_HEADERS_H 540 echo "#define SRS_AUTO_FFMPEG" >> $SRS_AUTO_HEADERS_H
544 else 541 else
545 echo "#undef SRS_AUTO_FFMPEG" >> $SRS_AUTO_HEADERS_H 542 echo "#undef SRS_AUTO_FFMPEG" >> $SRS_AUTO_HEADERS_H
@@ -20,7 +20,6 @@ SRS_SSL=RESERVED @@ -20,7 +20,6 @@ SRS_SSL=RESERVED
20 SRS_FFMPEG_TOOL=RESERVED 20 SRS_FFMPEG_TOOL=RESERVED
21 SRS_TRANSCODE=RESERVED 21 SRS_TRANSCODE=RESERVED
22 SRS_INGEST=RESERVED 22 SRS_INGEST=RESERVED
23 -SRS_HTTP_PARSER=RESERVED  
24 SRS_HTTP_CALLBACK=RESERVED 23 SRS_HTTP_CALLBACK=RESERVED
25 SRS_HTTP_SERVER=RESERVED 24 SRS_HTTP_SERVER=RESERVED
26 SRS_HTTP_API=RESERVED 25 SRS_HTTP_API=RESERVED
@@ -39,7 +38,10 @@ SRS_GPERF_MP=RESERVED @@ -39,7 +38,10 @@ SRS_GPERF_MP=RESERVED
39 SRS_GPERF_CP=RESERVED 38 SRS_GPERF_CP=RESERVED
40 # gprof 39 # gprof
41 SRS_GPROF=RESERVED 40 SRS_GPROF=RESERVED
42 -# 41 +#
  42 +# libraries
  43 +SRS_FFMPEG_STUB=RESERVED
  44 +SRS_HTTP_PARSER=RESERVED
43 # arguments 45 # arguments
44 SRS_PREFIX=/usr/local/srs 46 SRS_PREFIX=/usr/local/srs
45 SRS_JOBS=1 47 SRS_JOBS=1
@@ -54,6 +56,12 @@ SRS_ARM_UBUNTU12=NO @@ -54,6 +56,12 @@ SRS_ARM_UBUNTU12=NO
54 SRS_DEV=NO 56 SRS_DEV=NO
55 # raspberry-pi, open hls/ssl/static 57 # raspberry-pi, open hls/ssl/static
56 SRS_PI=NO 58 SRS_PI=NO
  59 +# the most fast compile, nothing, only support vp6 RTMP.
  60 +SRS_FAST=NO
  61 +# only support RTMP with ssl.
  62 +SRS_PURE_RTMP=NO
  63 +# only support RTMP+HLS with ssl.
  64 +SRS_RTMP_HLS=NO
57 65
58 ##################################################################################### 66 #####################################################################################
59 # menu 67 # menu
@@ -117,13 +125,16 @@ Options: @@ -117,13 +125,16 @@ Options:
117 used for make in the configure, for example, to make ffmpeg. 125 used for make in the configure, for example, to make ffmpeg.
118 126
119 Presets: 127 Presets:
120 - --x86_x64 [default] for x86/x64 cpu, common pc and servers. 128 + --x86-x64 [default] for x86/x64 cpu, common pc and servers.
121 --pi for raspberry-pi(directly build), open features hls/ssl/static. 129 --pi for raspberry-pi(directly build), open features hls/ssl/static.
122 --arm alias for --with-arm-ubuntu12 130 --arm alias for --with-arm-ubuntu12
123 --dev for dev, open all features, no gperf/gprof/arm. 131 --dev for dev, open all features, no gperf/gprof/arm.
  132 + --fast the most fast compile, nothing, only support vp6 RTMP.
  133 + --pure-rtmp only support RTMP with ssl.
  134 + --rtmp-hls only support RTMP+HLS with ssl.
124 135
125 Conflicts: 136 Conflicts:
126 - 1. --dev/x86_x64 vs --static: 137 + 1. --dev/x86-x64 vs --static:
127 the --static only for arm cpus. 138 the --static only for arm cpus.
128 2. --with-gmc vs --with-gmp: 139 2. --with-gmc vs --with-gmp:
129 @see: http://google-perftools.googlecode.com/svn/trunk/doc/heap_checker.html 140 @see: http://google-perftools.googlecode.com/svn/trunk/doc/heap_checker.html
@@ -192,10 +203,13 @@ function parse_user_option() { @@ -192,10 +203,13 @@ function parse_user_option() {
192 --prefix) SRS_PREFIX=${value} ;; 203 --prefix) SRS_PREFIX=${value} ;;
193 --static) SRS_STATIC=YES ;; 204 --static) SRS_STATIC=YES ;;
194 205
195 - --dev) SRS_DEV=YES ;;  
196 - --x86_x64) SRS_X86_X64=YES ;; 206 + --x86-x64) SRS_X86_X64=YES ;;
197 --arm) SRS_ARM_UBUNTU12=YES ;; 207 --arm) SRS_ARM_UBUNTU12=YES ;;
198 --pi) SRS_PI=YES ;; 208 --pi) SRS_PI=YES ;;
  209 + --dev) SRS_DEV=YES ;;
  210 + --fast) SRS_FAST=YES ;;
  211 + --pure-rtmp) SRS_PURE_RTMP=YES ;;
  212 + --rtmp-hls) SRS_RTMP_HLS=YES ;;
199 213
200 *) 214 *)
201 echo "$0: error: invalid option \"$option\"" 215 echo "$0: error: invalid option \"$option\""
@@ -204,6 +218,16 @@ function parse_user_option() { @@ -204,6 +218,16 @@ function parse_user_option() {
204 esac 218 esac
205 } 219 }
206 220
  221 +function parse_user_option_to_value_and_option() {
  222 + case "$option" in
  223 + -*=*)
  224 + value=`echo "$option" | sed -e 's|[-_a-zA-Z0-9/]*=||'`
  225 + option=`echo "$option" | sed -e 's|=[-_a-zA-Z0-9/]*||'`
  226 + ;;
  227 + *) value="" ;;
  228 + esac
  229 +}
  230 +
207 ##################################################################################### 231 #####################################################################################
208 # parse preset options 232 # parse preset options
209 ##################################################################################### 233 #####################################################################################
@@ -212,270 +236,342 @@ opt= @@ -212,270 +236,342 @@ opt=
212 for option 236 for option
213 do 237 do
214 opt="$opt `echo $option | sed -e \"s/\(--[^=]*=\)\(.* .*\)/\1'\2'/\"`" 238 opt="$opt `echo $option | sed -e \"s/\(--[^=]*=\)\(.* .*\)/\1'\2'/\"`"
215 -  
216 - case "$option" in  
217 - -*=*)  
218 - value=`echo "$option" | sed -e 's|[-_a-zA-Z0-9/]*=||'`  
219 - option=`echo "$option" | sed -e 's|=[-_a-zA-Z0-9/]*||'`  
220 - ;;  
221 - *) value="" ;;  
222 - esac  
223 - 239 + parse_user_option_to_value_and_option
224 parse_user_option 240 parse_user_option
225 done 241 done
226 242
227 -# set default preset if not specifies  
228 -if [ $SRS_DEV = NO ]; then  
229 - if [ $SRS_ARM_UBUNTU12 = NO ]; then  
230 - if [ $SRS_PI = NO ]; then  
231 - if [ $SRS_X86_X64 = NO ]; then  
232 - SRS_X86_X64=YES; opt="--x86_x64 $opt"; 243 +if [ $help = yes ]; then
  244 + show_help
  245 + exit 0
  246 +fi
  247 +
  248 +function apply_user_presets() {
  249 + # set default preset if not specifies
  250 + if [ $SRS_RTMP_HLS = NO ]; then
  251 + if [ $SRS_PURE_RTMP = NO ]; then
  252 + if [ $SRS_FAST = NO ]; then
  253 + if [ $SRS_DEV = NO ]; then
  254 + if [ $SRS_ARM_UBUNTU12 = NO ]; then
  255 + if [ $SRS_PI = NO ]; then
  256 + if [ $SRS_X86_X64 = NO ]; then
  257 + SRS_X86_X64=YES; opt="--x86-x64 $opt";
  258 + fi
  259 + fi
  260 + fi
  261 + fi
233 fi 262 fi
234 fi 263 fi
235 fi 264 fi
236 -fi  
237 265
238 -# if arm specified, set some default to disabled.  
239 -if [ $SRS_ARM_UBUNTU12 = YES ]; then  
240 - SRS_HLS=YES  
241 - SRS_DVR=YES  
242 - SRS_NGINX=NO  
243 - SRS_SSL=YES  
244 - SRS_FFMPEG_TOOL=NO  
245 - SRS_TRANSCODE=YES  
246 - SRS_INGEST=YES  
247 - SRS_HTTP_PARSER=YES  
248 - SRS_HTTP_CALLBACK=YES  
249 - SRS_HTTP_SERVER=YES  
250 - SRS_HTTP_API=YES  
251 - SRS_LIBRTMP=NO  
252 - SRS_BWTC=NO  
253 - SRS_RESEARCH=NO  
254 - SRS_UTEST=NO  
255 - SRS_GPERF=NO  
256 - SRS_GPERF_MC=NO  
257 - SRS_GPERF_MP=NO  
258 - SRS_GPERF_CP=NO  
259 - SRS_GPROF=NO  
260 - SRS_STATIC=YES  
261 -fi 266 + # all disabled.
  267 + if [ $SRS_FAST = YES ]; then
  268 + SRS_HLS=NO
  269 + SRS_DVR=NO
  270 + SRS_NGINX=NO
  271 + SRS_SSL=NO
  272 + SRS_FFMPEG_TOOL=NO
  273 + SRS_TRANSCODE=NO
  274 + SRS_INGEST=NO
  275 + SRS_HTTP_PARSER=NO
  276 + SRS_HTTP_CALLBACK=NO
  277 + SRS_HTTP_SERVER=NO
  278 + SRS_HTTP_API=NO
  279 + SRS_LIBRTMP=NO
  280 + SRS_BWTC=NO
  281 + SRS_RESEARCH=NO
  282 + SRS_UTEST=NO
  283 + SRS_GPERF=NO
  284 + SRS_GPERF_MC=NO
  285 + SRS_GPERF_MP=NO
  286 + SRS_GPERF_CP=NO
  287 + SRS_GPROF=NO
  288 + SRS_STATIC=NO
  289 + fi
262 290
263 -# defaults for x86/x64  
264 -if [ $SRS_X86_X64 = YES ]; then  
265 - SRS_HLS=YES  
266 - SRS_DVR=YES  
267 - SRS_NGINX=NO  
268 - SRS_SSL=YES  
269 - SRS_FFMPEG_TOOL=NO  
270 - SRS_TRANSCODE=YES  
271 - SRS_INGEST=YES  
272 - SRS_HTTP_PARSER=YES  
273 - SRS_HTTP_CALLBACK=YES  
274 - SRS_HTTP_SERVER=YES  
275 - SRS_HTTP_API=YES  
276 - SRS_LIBRTMP=YES  
277 - SRS_BWTC=YES  
278 - SRS_RESEARCH=NO  
279 - SRS_UTEST=YES  
280 - SRS_GPERF=NO  
281 - SRS_GPERF_MC=NO  
282 - SRS_GPERF_MP=NO  
283 - SRS_GPERF_CP=NO  
284 - SRS_GPROF=NO  
285 - SRS_STATIC=NO  
286 -fi 291 + # all disabled.
  292 + if [ $SRS_RTMP_HLS = YES ]; then
  293 + SRS_HLS=YES
  294 + SRS_DVR=NO
  295 + SRS_NGINX=NO
  296 + SRS_SSL=YES
  297 + SRS_FFMPEG_TOOL=NO
  298 + SRS_TRANSCODE=NO
  299 + SRS_INGEST=NO
  300 + SRS_HTTP_PARSER=NO
  301 + SRS_HTTP_CALLBACK=NO
  302 + SRS_HTTP_SERVER=NO
  303 + SRS_HTTP_API=NO
  304 + SRS_LIBRTMP=NO
  305 + SRS_BWTC=NO
  306 + SRS_RESEARCH=NO
  307 + SRS_UTEST=NO
  308 + SRS_GPERF=NO
  309 + SRS_GPERF_MC=NO
  310 + SRS_GPERF_MP=NO
  311 + SRS_GPERF_CP=NO
  312 + SRS_GPROF=NO
  313 + SRS_STATIC=NO
  314 + fi
287 315
288 -# if dev specified, open features if possible.  
289 -if [ $SRS_DEV = YES ]; then  
290 - SRS_HLS=YES  
291 - SRS_DVR=YES  
292 - SRS_NGINX=NO  
293 - SRS_SSL=YES  
294 - SRS_FFMPEG_TOOL=YES  
295 - SRS_TRANSCODE=YES  
296 - SRS_INGEST=YES  
297 - SRS_HTTP_PARSER=YES  
298 - SRS_HTTP_CALLBACK=YES  
299 - SRS_HTTP_SERVER=YES  
300 - SRS_HTTP_API=YES  
301 - SRS_LIBRTMP=YES  
302 - SRS_BWTC=YES  
303 - SRS_RESEARCH=YES  
304 - SRS_UTEST=YES  
305 - SRS_GPERF=NO  
306 - SRS_GPERF_MC=NO  
307 - SRS_GPERF_MP=NO  
308 - SRS_GPERF_CP=NO  
309 - SRS_GPROF=NO  
310 - SRS_STATIC=NO  
311 -fi 316 + # only ssl for RTMP with complex handshake.
  317 + if [ $SRS_PURE_RTMP = YES ]; then
  318 + SRS_HLS=NO
  319 + SRS_DVR=NO
  320 + SRS_NGINX=NO
  321 + SRS_SSL=YES
  322 + SRS_FFMPEG_TOOL=NO
  323 + SRS_TRANSCODE=NO
  324 + SRS_INGEST=NO
  325 + SRS_HTTP_PARSER=NO
  326 + SRS_HTTP_CALLBACK=NO
  327 + SRS_HTTP_SERVER=NO
  328 + SRS_HTTP_API=NO
  329 + SRS_LIBRTMP=NO
  330 + SRS_BWTC=NO
  331 + SRS_RESEARCH=NO
  332 + SRS_UTEST=NO
  333 + SRS_GPERF=NO
  334 + SRS_GPERF_MC=NO
  335 + SRS_GPERF_MP=NO
  336 + SRS_GPERF_CP=NO
  337 + SRS_GPROF=NO
  338 + SRS_STATIC=NO
  339 + fi
312 340
313 -# if raspberry-pi specified, open ssl/hls/static features  
314 -if [ $SRS_PI = YES ]; then  
315 - SRS_HLS=YES  
316 - SRS_DVR=YES  
317 - SRS_NGINX=NO  
318 - SRS_SSL=YES  
319 - SRS_FFMPEG_TOOL=NO  
320 - SRS_TRANSCODE=YES  
321 - SRS_INGEST=YES  
322 - SRS_HTTP_PARSER=YES  
323 - SRS_HTTP_CALLBACK=YES  
324 - SRS_HTTP_SERVER=YES  
325 - SRS_HTTP_API=YES  
326 - SRS_LIBRTMP=NO  
327 - SRS_BWTC=NO  
328 - SRS_RESEARCH=NO  
329 - SRS_UTEST=NO  
330 - SRS_GPERF=NO  
331 - SRS_GPERF_MC=NO  
332 - SRS_GPERF_MP=NO  
333 - SRS_GPERF_CP=NO  
334 - SRS_GPROF=NO  
335 - SRS_STATIC=YES  
336 -fi 341 + # if arm specified, set some default to disabled.
  342 + if [ $SRS_ARM_UBUNTU12 = YES ]; then
  343 + SRS_HLS=YES
  344 + SRS_DVR=YES
  345 + SRS_NGINX=NO
  346 + SRS_SSL=YES
  347 + SRS_FFMPEG_TOOL=NO
  348 + SRS_TRANSCODE=YES
  349 + SRS_INGEST=YES
  350 + SRS_HTTP_PARSER=YES
  351 + SRS_HTTP_CALLBACK=YES
  352 + SRS_HTTP_SERVER=YES
  353 + SRS_HTTP_API=YES
  354 + SRS_LIBRTMP=NO
  355 + SRS_BWTC=NO
  356 + SRS_RESEARCH=NO
  357 + SRS_UTEST=NO
  358 + SRS_GPERF=NO
  359 + SRS_GPERF_MC=NO
  360 + SRS_GPERF_MP=NO
  361 + SRS_GPERF_CP=NO
  362 + SRS_GPROF=NO
  363 + SRS_STATIC=YES
  364 + fi
  365 +
  366 + # defaults for x86/x64
  367 + if [ $SRS_X86_X64 = YES ]; then
  368 + SRS_HLS=YES
  369 + SRS_DVR=YES
  370 + SRS_NGINX=NO
  371 + SRS_SSL=YES
  372 + SRS_FFMPEG_TOOL=NO
  373 + SRS_TRANSCODE=YES
  374 + SRS_INGEST=YES
  375 + SRS_HTTP_PARSER=YES
  376 + SRS_HTTP_CALLBACK=YES
  377 + SRS_HTTP_SERVER=YES
  378 + SRS_HTTP_API=YES
  379 + SRS_LIBRTMP=YES
  380 + SRS_BWTC=YES
  381 + SRS_RESEARCH=NO
  382 + SRS_UTEST=YES
  383 + SRS_GPERF=NO
  384 + SRS_GPERF_MC=NO
  385 + SRS_GPERF_MP=NO
  386 + SRS_GPERF_CP=NO
  387 + SRS_GPROF=NO
  388 + SRS_STATIC=NO
  389 + fi
  390 +
  391 + # if dev specified, open features if possible.
  392 + if [ $SRS_DEV = YES ]; then
  393 + SRS_HLS=YES
  394 + SRS_DVR=YES
  395 + SRS_NGINX=NO
  396 + SRS_SSL=YES
  397 + SRS_FFMPEG_TOOL=YES
  398 + SRS_TRANSCODE=YES
  399 + SRS_INGEST=YES
  400 + SRS_HTTP_PARSER=YES
  401 + SRS_HTTP_CALLBACK=YES
  402 + SRS_HTTP_SERVER=YES
  403 + SRS_HTTP_API=YES
  404 + SRS_LIBRTMP=YES
  405 + SRS_BWTC=YES
  406 + SRS_RESEARCH=YES
  407 + SRS_UTEST=YES
  408 + SRS_GPERF=NO
  409 + SRS_GPERF_MC=NO
  410 + SRS_GPERF_MP=NO
  411 + SRS_GPERF_CP=NO
  412 + SRS_GPROF=NO
  413 + SRS_STATIC=NO
  414 + fi
  415 +
  416 + # if raspberry-pi specified, open ssl/hls/static features
  417 + if [ $SRS_PI = YES ]; then
  418 + SRS_HLS=YES
  419 + SRS_DVR=YES
  420 + SRS_NGINX=NO
  421 + SRS_SSL=YES
  422 + SRS_FFMPEG_TOOL=NO
  423 + SRS_TRANSCODE=YES
  424 + SRS_INGEST=YES
  425 + SRS_HTTP_PARSER=YES
  426 + SRS_HTTP_CALLBACK=YES
  427 + SRS_HTTP_SERVER=YES
  428 + SRS_HTTP_API=YES
  429 + SRS_LIBRTMP=NO
  430 + SRS_BWTC=NO
  431 + SRS_RESEARCH=NO
  432 + SRS_UTEST=NO
  433 + SRS_GPERF=NO
  434 + SRS_GPERF_MC=NO
  435 + SRS_GPERF_MP=NO
  436 + SRS_GPERF_CP=NO
  437 + SRS_GPROF=NO
  438 + SRS_STATIC=YES
  439 + fi
  440 +}
  441 +apply_user_presets
337 442
338 ##################################################################################### 443 #####################################################################################
339 # parse detail feature options 444 # parse detail feature options
340 ##################################################################################### 445 #####################################################################################
341 for option 446 for option
342 do 447 do
343 - case "$option" in  
344 - -*=*)  
345 - value=`echo "$option" | sed -e 's|[-_a-zA-Z0-9/]*=||'`  
346 - option=`echo "$option" | sed -e 's|=[-_a-zA-Z0-9/]*||'`  
347 - ;;  
348 - *) value="" ;;  
349 - esac  
350 - 448 + parse_user_option_to_value_and_option
351 parse_user_option 449 parse_user_option
352 done 450 done
353 451
354 -#####################################################################################  
355 -# show help and exit  
356 -#####################################################################################  
357 -if [ $help = yes ]; then  
358 - show_help  
359 - exit 0  
360 -fi 452 +function apply_user_detail_options() {
  453 + # if transcode/ingest specified, requires the ffmpeg stub classes.
  454 + SRS_FFMPEG_STUB=NO
  455 + if [ $SRS_TRANSCODE = YES ]; then SRS_FFMPEG_STUB=YES; fi
  456 + if [ $SRS_INGEST = YES ]; then SRS_FFMPEG_STUB=YES; fi
361 457
362 -#####################################################################################  
363 -# generate the internal values from user specifies options  
364 -#####################################################################################  
365 -# if transcode specified, try ffmpeg if possible.  
366 -if [ $SRS_TRANSCODE = YES ]; then if [ $SRS_FFMPEG_TOOL = RESERVED ]; then SRS_FFMPEG_TOOL=YES; fi fi  
367 -if [ $SRS_INGEST = YES ]; then if [ $SRS_FFMPEG_TOOL = RESERVED ]; then SRS_FFMPEG_TOOL=YES; fi fi  
368 -  
369 -# if http-xxxx specified, open the SRS_HTTP_PARSER  
370 -SRS_HTTP_PARSER=NO  
371 -if [ $SRS_HTTP_CALLBACK = YES ]; then SRS_HTTP_PARSER=YES; fi  
372 -if [ $SRS_HTTP_SERVER = YES ]; then SRS_HTTP_PARSER=YES; fi  
373 -if [ $SRS_HTTP_API = YES ]; then SRS_HTTP_PARSER=YES; fi  
374 -  
375 -# parse the jobs for make  
376 -if [[ "" -eq SRS_JOBS ]]; then  
377 - export SRS_JOBS="--jobs"  
378 -else  
379 - export SRS_JOBS="--jobs=${SRS_JOBS}"  
380 -fi 458 + # if http-xxxx specified, open the SRS_HTTP_PARSER
  459 + SRS_HTTP_PARSER=NO
  460 + if [ $SRS_HTTP_CALLBACK = YES ]; then SRS_HTTP_PARSER=YES; fi
  461 + if [ $SRS_HTTP_SERVER = YES ]; then SRS_HTTP_PARSER=YES; fi
  462 + if [ $SRS_HTTP_API = YES ]; then SRS_HTTP_PARSER=YES; fi
381 463
382 -# save all config options to macro to write to auto headers file  
383 -SRS_AUTO_USER_CONFIGURE="$opt" 464 + # parse the jobs for make
  465 + if [[ "" -eq SRS_JOBS ]]; then
  466 + export SRS_JOBS="--jobs=1"
  467 + else
  468 + export SRS_JOBS="--jobs=${SRS_JOBS}"
  469 + fi
  470 +}
  471 +apply_user_detail_options
  472 +
  473 +function regenerate_options() {
  474 + # save all config options to macro to write to auto headers file
  475 + SRS_AUTO_USER_CONFIGURE="$opt"
  476 + # regenerate the options for default values.
  477 + SRS_AUTO_CONFIGURE="--prefix=${SRS_PREFIX}"
  478 + if [ $SRS_HLS = YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --with-hls"; else SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --without-hls"; fi
  479 + if [ $SRS_DVR = YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --with-dvr"; else SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --without-dvr"; fi
  480 + if [ $SRS_NGINX = YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --with-nginx"; else SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --without-nginx"; fi
  481 + if [ $SRS_SSL = YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --with-ssl"; else SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --without-ssl"; fi
  482 + if [ $SRS_FFMPEG_TOOL = YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --with-ffmpeg"; else SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --without-ffmpeg"; fi
  483 + if [ $SRS_TRANSCODE = YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --with-transcode"; else SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --without-transcode"; fi
  484 + if [ $SRS_INGEST = YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --with-ingest"; else SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --without-ingest"; fi
  485 + if [ $SRS_HTTP_CALLBACK = YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --with-http-callback"; else SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --without-http-callback"; fi
  486 + if [ $SRS_HTTP_SERVER = YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --with-http-server"; else SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --without-http-server"; fi
  487 + if [ $SRS_HTTP_API = YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --with-http-api"; else SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --without-http-api"; fi
  488 + if [ $SRS_LIBRTMP = YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --with-librtmp"; else SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --without-librtmp"; fi
  489 + if [ $SRS_BWTC = YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --with-bwtc"; else SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --without-bwtc"; fi
  490 + if [ $SRS_RESEARCH = YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --with-research"; else SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --without-research"; fi
  491 + if [ $SRS_UTEST = YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --with-utest"; else SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --without-utest"; fi
  492 + if [ $SRS_GPERF = YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --with-gperf"; else SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --without-gperf"; fi
  493 + if [ $SRS_GPERF_MC = YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --with-gmc"; else SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --without-gmc"; fi
  494 + if [ $SRS_GPERF_MP = YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --with-gmp"; else SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --without-gmp"; fi
  495 + if [ $SRS_GPERF_CP = YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --with-gcp"; else SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --without-gcp"; fi
  496 + if [ $SRS_GPROF = YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --with-gprof"; else SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --without-gprof"; fi
  497 + if [ $SRS_ARM_UBUNTU12 = YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --with-arm-ubuntu12"; else SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --without-arm-ubuntu12"; fi
  498 + if [ $SRS_STATIC = YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --static"; fi
  499 + echo "regenerate config: ${SRS_AUTO_CONFIGURE}"
  500 +}
  501 +regenerate_options
384 502
385 ##################################################################################### 503 #####################################################################################
386 # check user options 504 # check user options
387 ##################################################################################### 505 #####################################################################################
388 -__check_ok=YES  
389 -# check conflict  
390 -if [ $SRS_GPERF = NO ]; then  
391 - if [ $SRS_GPERF_MC = YES ]; then echo "gperf-mc depends on gperf, see: ./configure --help"; __check_ok=NO; fi  
392 - if [ $SRS_GPERF_MP = YES ]; then echo "gperf-mp depends on gperf, see: ./configure --help"; __check_ok=NO; fi  
393 - if [ $SRS_GPERF_CP = YES ]; then echo "gperf-cp depends on gperf, see: ./configure --help"; __check_ok=NO; fi  
394 -fi  
395 -if [ $SRS_GPERF_MC = YES ]; then  
396 - if [ $SRS_GPERF_MP = YES ]; then  
397 - echo "gperf-mc not compatible with gperf-mp, see: ./configure --help";  
398 - echo "@see: http://google-perftools.googlecode.com/svn/trunk/doc/heap_checker.html";  
399 - echo "Note that since the heap-checker uses the heap-profiling framework internally, it is not possible to run both the heap-checker and heap profiler at the same time";  
400 - __check_ok=NO 506 +function check_option_conflicts() {
  507 + __check_ok=YES
  508 + # check conflict
  509 + if [ $SRS_GPERF = NO ]; then
  510 + if [ $SRS_GPERF_MC = YES ]; then echo "gperf-mc depends on gperf, see: ./configure --help"; __check_ok=NO; fi
  511 + if [ $SRS_GPERF_MP = YES ]; then echo "gperf-mp depends on gperf, see: ./configure --help"; __check_ok=NO; fi
  512 + if [ $SRS_GPERF_CP = YES ]; then echo "gperf-cp depends on gperf, see: ./configure --help"; __check_ok=NO; fi
401 fi 513 fi
402 -fi  
403 -# generate the group option: SRS_GPERF  
404 -__gperf_slow=NO  
405 -if [ $SRS_GPERF_MC = YES ]; then SRS_GPERF=YES; __gperf_slow=YES; fi  
406 -if [ $SRS_GPERF_MP = YES ]; then SRS_GPERF=YES; __gperf_slow=YES; fi  
407 -if [ $SRS_GPERF_CP = YES ]; then SRS_GPERF=YES; __gperf_slow=YES; fi  
408 -if [ $__gperf_slow = YES ]; then if [ $SRS_GPROF = YES ]; then  
409 - echo "gmc/gmp/gcp not compatible with gprof, see: ./configure --help"; __check_ok=NO;  
410 -fi fi  
411 -  
412 -# check arm, if arm enabled, only allow st/ssl/librtmp,  
413 -# user should disable all other features  
414 -if [ $SRS_ARM_UBUNTU12 = YES ]; then  
415 - if [ $SRS_FFMPEG_TOOL = YES ]; then echo "ffmpeg for arm is not available, see: ./configure --help"; __check_ok=NO; fi  
416 - if [ $SRS_BWTC = YES ]; then echo "bwtc for arm is not available, see: ./configure --help"; __check_ok=NO; fi  
417 - if [ $SRS_RESEARCH = YES ]; then echo "research for arm is not available, see: ./configure --help"; __check_ok=NO; fi  
418 - if [ $SRS_GPERF = YES ]; then echo "gperf for arm is not available, see: ./configure --help"; __check_ok=NO; fi  
419 - if [ $SRS_GPERF_MC = YES ]; then echo "gmc for arm is not available, see: ./configure --help"; __check_ok=NO; fi  
420 - if [ $SRS_GPERF_MP = YES ]; then echo "gmp for arm is not available, see: ./configure --help"; __check_ok=NO; fi  
421 - if [ $SRS_GPERF_CP = YES ]; then echo "gcp for arm is not available, see: ./configure --help"; __check_ok=NO; fi  
422 - if [ $SRS_GPROF = YES ]; then echo "gprof for arm is not available, see: ./configure --help"; __check_ok=NO; fi  
423 -fi  
424 -  
425 -# if x86/x64 or directly build, never use static  
426 -if [ $SRS_ARM_UBUNTU12 = NO ]; then  
427 - if [ $SRS_PI = NO ]; then  
428 - if [ $SRS_STATIC = YES ]; then  
429 - echo "x86/x64 should never use static, see: ./configure --help"; __check_ok=NO; 514 + if [ $SRS_GPERF_MC = YES ]; then
  515 + if [ $SRS_GPERF_MP = YES ]; then
  516 + echo "gperf-mc not compatible with gperf-mp, see: ./configure --help";
  517 + echo "@see: http://google-perftools.googlecode.com/svn/trunk/doc/heap_checker.html";
  518 + echo "Note that since the heap-checker uses the heap-profiling framework internally, it is not possible to run both the heap-checker and heap profiler at the same time";
  519 + __check_ok=NO
430 fi 520 fi
431 fi 521 fi
432 -fi 522 + # generate the group option: SRS_GPERF
  523 + __gperf_slow=NO
  524 + if [ $SRS_GPERF_MC = YES ]; then SRS_GPERF=YES; __gperf_slow=YES; fi
  525 + if [ $SRS_GPERF_MP = YES ]; then SRS_GPERF=YES; __gperf_slow=YES; fi
  526 + if [ $SRS_GPERF_CP = YES ]; then SRS_GPERF=YES; __gperf_slow=YES; fi
  527 + if [ $__gperf_slow = YES ]; then if [ $SRS_GPROF = YES ]; then
  528 + echo "gmc/gmp/gcp not compatible with gprof, see: ./configure --help"; __check_ok=NO;
  529 + fi fi
433 530
434 -# check variable neccessary  
435 -if [ $SRS_HLS = RESERVED ]; then echo "you must specifies the hls, see: ./configure --help"; __check_ok=NO; fi  
436 -if [ $SRS_DVR = RESERVED ]; then echo "you must specifies the dvr, see: ./configure --help"; __check_ok=NO; fi  
437 -if [ $SRS_NGINX = RESERVED ]; then echo "you must specifies the nginx, see: ./configure --help"; __check_ok=NO; fi  
438 -if [ $SRS_SSL = RESERVED ]; then echo "you must specifies the ssl, see: ./configure --help"; __check_ok=NO; fi  
439 -if [ $SRS_FFMPEG_TOOL = RESERVED ]; then echo "you must specifies the ffmpeg, see: ./configure --help"; __check_ok=NO; fi  
440 -if [ $SRS_HTTP_CALLBACK = RESERVED ]; then echo "you must specifies the http-callback, see: ./configure --help"; __check_ok=NO; fi  
441 -if [ $SRS_HTTP_SERVER = RESERVED ]; then echo "you must specifies the http-server, see: ./configure --help"; __check_ok=NO; fi  
442 -if [ $SRS_HTTP_API = RESERVED ]; then echo "you must specifies the http-api, see: ./configure --help"; __check_ok=NO; fi  
443 -if [ $SRS_LIBRTMP = RESERVED ]; then echo "you must specifies the librtmp, see: ./configure --help"; __check_ok=NO; fi  
444 -if [ $SRS_BWTC = RESERVED ]; then echo "you must specifies the bwtc, see: ./configure --help"; __check_ok=NO; fi  
445 -if [ $SRS_RESEARCH = RESERVED ]; then echo "you must specifies the research, see: ./configure --help"; __check_ok=NO; fi  
446 -if [ $SRS_UTEST = RESERVED ]; then echo "you must specifies the utest, see: ./configure --help"; __check_ok=NO; fi  
447 -if [ $SRS_GPERF = RESERVED ]; then echo "you must specifies the gperf, see: ./configure --help"; __check_ok=NO; fi  
448 -if [ $SRS_GPERF_MC = RESERVED ]; then echo "you must specifies the gperf-mc, see: ./configure --help"; __check_ok=NO; fi  
449 -if [ $SRS_GPERF_MP = RESERVED ]; then echo "you must specifies the gperf-mp, see: ./configure --help"; __check_ok=NO; fi  
450 -if [ $SRS_GPERF_CP = RESERVED ]; then echo "you must specifies the gperf-cp, see: ./configure --help"; __check_ok=NO; fi  
451 -if [ $SRS_GPROF = RESERVED ]; then echo "you must specifies the gprof, see: ./configure --help"; __check_ok=NO; fi  
452 -if [ $SRS_ARM_UBUNTU12 = RESERVED ]; then echo "you must specifies the arm-ubuntu12, see: ./configure --help"; __check_ok=NO; fi  
453 -if [[ -z $SRS_PREFIX ]]; then echo "you must specifies the prefix, see: ./configure --prefix"; __check_ok=NO; fi  
454 -if [ $__check_ok = NO ]; then  
455 - exit 1;  
456 -fi 531 + # check arm, if arm enabled, only allow st/ssl/librtmp,
  532 + # user should disable all other features
  533 + if [ $SRS_ARM_UBUNTU12 = YES ]; then
  534 + if [ $SRS_FFMPEG_TOOL = YES ]; then echo "ffmpeg for arm is not available, see: ./configure --help"; __check_ok=NO; fi
  535 + if [ $SRS_BWTC = YES ]; then echo "bwtc for arm is not available, see: ./configure --help"; __check_ok=NO; fi
  536 + if [ $SRS_RESEARCH = YES ]; then echo "research for arm is not available, see: ./configure --help"; __check_ok=NO; fi
  537 + if [ $SRS_GPERF = YES ]; then echo "gperf for arm is not available, see: ./configure --help"; __check_ok=NO; fi
  538 + if [ $SRS_GPERF_MC = YES ]; then echo "gmc for arm is not available, see: ./configure --help"; __check_ok=NO; fi
  539 + if [ $SRS_GPERF_MP = YES ]; then echo "gmp for arm is not available, see: ./configure --help"; __check_ok=NO; fi
  540 + if [ $SRS_GPERF_CP = YES ]; then echo "gcp for arm is not available, see: ./configure --help"; __check_ok=NO; fi
  541 + if [ $SRS_GPROF = YES ]; then echo "gprof for arm is not available, see: ./configure --help"; __check_ok=NO; fi
  542 + fi
  543 +
  544 + # if x86/x64 or directly build, never use static
  545 + if [ $SRS_ARM_UBUNTU12 = NO ]; then
  546 + if [ $SRS_PI = NO ]; then
  547 + if [ $SRS_STATIC = YES ]; then
  548 + echo "x86/x64 should never use static, see: ./configure --help"; __check_ok=NO;
  549 + fi
  550 + fi
  551 + fi
457 552
458 -# regenerate the options for default values.  
459 -SRS_AUTO_CONFIGURE="--prefix=${SRS_PREFIX}"  
460 -if [ $SRS_HLS = YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --with-hls"; else SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --without-hls"; fi  
461 -if [ $SRS_DVR = YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --with-dvr"; else SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --without-dvr"; fi  
462 -if [ $SRS_NGINX = YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --with-nginx"; else SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --without-nginx"; fi  
463 -if [ $SRS_SSL = YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --with-ssl"; else SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --without-ssl"; fi  
464 -if [ $SRS_FFMPEG_TOOL = YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --with-ffmpeg"; else SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --without-ffmpeg"; fi  
465 -if [ $SRS_TRANSCODE = YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --with-transcode"; else SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --without-transcode"; fi  
466 -if [ $SRS_INGEST = YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --with-ingest"; else SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --without-ingest"; fi  
467 -if [ $SRS_HTTP_CALLBACK = YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --with-http-callback"; else SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --without-http-callback"; fi  
468 -if [ $SRS_HTTP_SERVER = YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --with-http-server"; else SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --without-http-server"; fi  
469 -if [ $SRS_HTTP_API = YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --with-http-api"; else SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --without-http-api"; fi  
470 -if [ $SRS_LIBRTMP = YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --with-librtmp"; else SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --without-librtmp"; fi  
471 -if [ $SRS_BWTC = YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --with-bwtc"; else SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --without-bwtc"; fi  
472 -if [ $SRS_RESEARCH = YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --with-research"; else SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --without-research"; fi  
473 -if [ $SRS_UTEST = YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --with-utest"; else SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --without-utest"; fi  
474 -if [ $SRS_GPERF = YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --with-gperf"; else SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --without-gperf"; fi  
475 -if [ $SRS_GPERF_MC = YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --with-gmc"; else SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --without-gmc"; fi  
476 -if [ $SRS_GPERF_MP = YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --with-gmp"; else SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --without-gmp"; fi  
477 -if [ $SRS_GPERF_CP = YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --with-gcp"; else SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --without-gcp"; fi  
478 -if [ $SRS_GPROF = YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --with-gprof"; else SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --without-gprof"; fi  
479 -if [ $SRS_ARM_UBUNTU12 = YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --with-arm-ubuntu12"; else SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --without-arm-ubuntu12"; fi  
480 -if [ $SRS_STATIC = YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --static"; fi  
481 -echo "regenerate config: ${SRS_AUTO_CONFIGURE}" 553 + # check variable neccessary
  554 + if [ $SRS_HLS = RESERVED ]; then echo "you must specifies the hls, see: ./configure --help"; __check_ok=NO; fi
  555 + if [ $SRS_DVR = RESERVED ]; then echo "you must specifies the dvr, see: ./configure --help"; __check_ok=NO; fi
  556 + if [ $SRS_NGINX = RESERVED ]; then echo "you must specifies the nginx, see: ./configure --help"; __check_ok=NO; fi
  557 + if [ $SRS_SSL = RESERVED ]; then echo "you must specifies the ssl, see: ./configure --help"; __check_ok=NO; fi
  558 + if [ $SRS_FFMPEG_TOOL = RESERVED ]; then echo "you must specifies the ffmpeg, see: ./configure --help"; __check_ok=NO; fi
  559 + if [ $SRS_HTTP_CALLBACK = RESERVED ]; then echo "you must specifies the http-callback, see: ./configure --help"; __check_ok=NO; fi
  560 + if [ $SRS_HTTP_SERVER = RESERVED ]; then echo "you must specifies the http-server, see: ./configure --help"; __check_ok=NO; fi
  561 + if [ $SRS_HTTP_API = RESERVED ]; then echo "you must specifies the http-api, see: ./configure --help"; __check_ok=NO; fi
  562 + if [ $SRS_LIBRTMP = RESERVED ]; then echo "you must specifies the librtmp, see: ./configure --help"; __check_ok=NO; fi
  563 + if [ $SRS_BWTC = RESERVED ]; then echo "you must specifies the bwtc, see: ./configure --help"; __check_ok=NO; fi
  564 + if [ $SRS_RESEARCH = RESERVED ]; then echo "you must specifies the research, see: ./configure --help"; __check_ok=NO; fi
  565 + if [ $SRS_UTEST = RESERVED ]; then echo "you must specifies the utest, see: ./configure --help"; __check_ok=NO; fi
  566 + if [ $SRS_GPERF = RESERVED ]; then echo "you must specifies the gperf, see: ./configure --help"; __check_ok=NO; fi
  567 + if [ $SRS_GPERF_MC = RESERVED ]; then echo "you must specifies the gperf-mc, see: ./configure --help"; __check_ok=NO; fi
  568 + if [ $SRS_GPERF_MP = RESERVED ]; then echo "you must specifies the gperf-mp, see: ./configure --help"; __check_ok=NO; fi
  569 + if [ $SRS_GPERF_CP = RESERVED ]; then echo "you must specifies the gperf-cp, see: ./configure --help"; __check_ok=NO; fi
  570 + if [ $SRS_GPROF = RESERVED ]; then echo "you must specifies the gprof, see: ./configure --help"; __check_ok=NO; fi
  571 + if [ $SRS_ARM_UBUNTU12 = RESERVED ]; then echo "you must specifies the arm-ubuntu12, see: ./configure --help"; __check_ok=NO; fi
  572 + if [[ -z $SRS_PREFIX ]]; then echo "you must specifies the prefix, see: ./configure --prefix"; __check_ok=NO; fi
  573 + if [ $__check_ok = NO ]; then
  574 + exit 1;
  575 + fi
  576 +}
  577 +check_option_conflicts
@@ -17,4 +17,38 @@ package_dir=${build_objs}/package @@ -17,4 +17,38 @@ package_dir=${build_objs}/package
17 log="${build_objs}/logs/package.`date +%s`.log" && . ${product_dir}/scripts/_log.sh && check_log 17 log="${build_objs}/logs/package.`date +%s`.log" && . ${product_dir}/scripts/_log.sh && check_log
18 ret=$?; if [[ $ret -ne 0 ]]; then exit $ret; fi 18 ret=$?; if [[ $ret -ne 0 ]]; then exit $ret; fi
19 19
20 -# test default configure. 20 +item="default configure"
  21 +ok_msg "test ${item}"
  22 +(./configure && make) >>$log 2>&1
  23 +ret=$?; if [[ $ret -ne 0 ]]; then failed_msg "test ${item} failed. ret=$ret"; exit $ret; fi
  24 +ok_msg "test ${item} success"
  25 +
  26 +item="preset --x86-x64"
  27 +ok_msg "test ${item}"
  28 +(./configure --x86-x64 && make) >>$log 2>&1
  29 +ret=$?; if [[ $ret -ne 0 ]]; then failed_msg "test ${item} failed. ret=$ret"; exit $ret; fi
  30 +ok_msg "test ${item} success"
  31 +
  32 +item="preset --dev"
  33 +ok_msg "test ${item}"
  34 +(./configure --dev && make) >>$log 2>&1
  35 +ret=$?; if [[ $ret -ne 0 ]]; then failed_msg "test ${item} failed. ret=$ret"; exit $ret; fi
  36 +ok_msg "test ${item} success"
  37 +
  38 +item="preset --fast"
  39 +ok_msg "test ${item}"
  40 +(./configure --fast && make) >>$log 2>&1
  41 +ret=$?; if [[ $ret -ne 0 ]]; then failed_msg "test ${item} failed. ret=$ret"; exit $ret; fi
  42 +ok_msg "test ${item} success"
  43 +
  44 +item="preset --pure-rtmp"
  45 +ok_msg "test ${item}"
  46 +(./configure --pure-rtmp && make) >>$log 2>&1
  47 +ret=$?; if [[ $ret -ne 0 ]]; then failed_msg "test ${item} failed. ret=$ret"; exit $ret; fi
  48 +ok_msg "test ${item} success"
  49 +
  50 +item="preset --rtmp-hls"
  51 +ok_msg "test ${item}"
  52 +(./configure --rtmp-hls && make) >>$log 2>&1
  53 +ret=$?; if [[ $ret -ne 0 ]]; then failed_msg "test ${item} failed. ret=$ret"; exit $ret; fi
  54 +ok_msg "test ${item} success"