options.sh 38 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937
  1. #!/bin/bash
  2. # variables, parent script must set it:
  3. #####################################################################################
  4. #####################################################################################
  5. # parse user options, do this at first
  6. #####################################################################################
  7. #####################################################################################
  8. #####################################################################################
  9. # output variables
  10. #####################################################################################
  11. help=no
  12. ################################################################
  13. # feature options
  14. SRS_HLS=RESERVED
  15. SRS_HDS=RESERVED
  16. SRS_DVR=RESERVED
  17. SRS_NGINX=RESERVED
  18. SRS_SSL=RESERVED
  19. SRS_FFMPEG_TOOL=RESERVED
  20. SRS_TRANSCODE=RESERVED
  21. SRS_INGEST=RESERVED
  22. SRS_STAT=RESERVED
  23. SRS_HTTP_CALLBACK=RESERVED
  24. SRS_HTTP_SERVER=RESERVED
  25. SRS_STREAM_CASTER=RESERVED
  26. SRS_HTTP_API=RESERVED
  27. SRS_LIBRTMP=RESERVED
  28. SRS_RESEARCH=RESERVED
  29. SRS_UTEST=RESERVED
  30. # tcmalloc
  31. SRS_GPERF=RESERVED
  32. # gperf memory check
  33. SRS_GPERF_MC=RESERVED
  34. # gperf memory profile
  35. SRS_GPERF_MP=RESERVED
  36. # gperf cpu profile
  37. SRS_GPERF_CP=RESERVED
  38. # gprof
  39. SRS_GPROF=RESERVED
  40. #
  41. ################################################################
  42. # libraries
  43. SRS_FFMPEG_STUB=RESERVED
  44. SRS_HTTP_CORE=RESERVED
  45. # arguments
  46. SRS_PREFIX=/usr/local/srs
  47. SRS_JOBS=1
  48. SRS_STATIC=RESERVED
  49. # whether enable the log verbose/info/trace level.
  50. # always enable the warn/error level.
  51. SRS_LOG_VERBOSE=RESERVED
  52. SRS_LOG_INFO=RESERVED
  53. SRS_LOG_TRACE=RESERVED
  54. #
  55. ################################################################
  56. # experts
  57. # donot compile ssl, use system ssl(-lssl) if required.
  58. SRS_USE_SYS_SSL=NO
  59. # enable memory watch, detect memory leak,
  60. # similar to gmc, should disable in release version for hurts performance.
  61. SRS_MEM_WATCH=NO
  62. # export the srs-librtmp to specified project, NO to disable it.
  63. SRS_EXPORT_LIBRTMP_PROJECT=NO
  64. # export the srs-librtmp to a single .h and .c, NO to disable it.
  65. SRS_EXPORT_LIBRTMP_SINGLE=NO
  66. #
  67. ################################################################
  68. # presets
  69. # for x86/x64 pc/servers
  70. SRS_X86_X64=NO
  71. # for osx system
  72. SRS_OSX=NO
  73. SRS_ALLOW_OSX=NO
  74. # armhf(v7cpu) built on ubuntu12
  75. SRS_ARM_UBUNTU12=NO
  76. # mips built on ubuntu12
  77. SRS_MIPS_UBUNTU12=NO
  78. # dev, open all features for dev, no gperf/prof/arm.
  79. SRS_DEV=NO
  80. # dev, open main server feature for dev, no utest/research/librtmp
  81. SRS_FAST_DEV=NO
  82. # demo, for the demo of srs, @see: https://github.com/ossrs/srs/wiki/v1_CN_SampleDemo
  83. SRS_DEMO=NO
  84. # raspberry-pi, open hls/ssl/static
  85. SRS_PI=NO
  86. # cubieboard, donot open ffmpeg/nginx.
  87. SRS_CUBIE=NO
  88. # the most fast compile, nothing, only support vp6 RTMP.
  89. SRS_FAST=NO
  90. # only support RTMP with ssl.
  91. SRS_PURE_RTMP=NO
  92. # only support RTMP+HLS with ssl.
  93. SRS_RTMP_HLS=NO
  94. # the most fast compile, nothing, only support vp6 RTMP.
  95. SRS_DISABLE_ALL=NO
  96. # all features is on
  97. SRS_ENABLE_ALL=NO
  98. #
  99. ################################################################
  100. # whether cross build for embed cpu, arm/mips
  101. SRS_CROSS_BUILD=NO
  102. #####################################################################################
  103. # menu
  104. #####################################################################################
  105. function show_help() {
  106. cat << END
  107. Options:
  108. -h, --help print this message
  109. --with-ssl enable rtmp complex handshake, requires openssl-devel installed.
  110. to delivery h264 video and aac audio to flash player.
  111. --with-hls enable hls streaming, mux RTMP to m3u8/ts files.
  112. --with-hds enable hds streaming, mux RTMP to f4m/f4v files.
  113. --with-dvr enable dvr, mux RTMP to flv files.
  114. --with-nginx enable delivery HTTP stream with nginx.
  115. build nginx at: ./objs/nginx/sbin/nginx
  116. --with-http-callback enable http hooks, build cherrypy as demo api server.
  117. --with-http-server enable http server to delivery http stream.
  118. --with-stream-caster enable stream caster to serve other stream over other protocol.
  119. --with-http-api enable http api, to manage SRS by http api.
  120. --with-ffmpeg enable transcoding tool ffmpeg.
  121. build ffmpeg at: ./objs/ffmpeg/bin/ffmpeg
  122. --with-transcode enable transcoding features.
  123. user must specifies the transcode tools in conf.
  124. --with-ingest enable ingest features.
  125. user must specifies the ingest tools in conf.
  126. --with-stat enable the data statistic, for http api.
  127. --with-librtmp enable srs-librtmp, library for client.
  128. --with-research build the research tools.
  129. --with-utest build the utest for SRS.
  130. --with-gperf build SRS with gperf tools(no gmc/gmp/gcp, with tcmalloc only).
  131. --with-gmc build memory check for SRS with gperf tools.
  132. --with-gmp build memory profile for SRS with gperf tools.
  133. --with-gcp build cpu profile for SRS with gperf tools.
  134. --with-gprof build SRS with gprof(GNU profile tool).
  135. --with-arm-ubuntu12 cross build SRS on ubuntu12 for armhf(v7cpu).
  136. --without-ssl disable rtmp complex handshake.
  137. --without-hls disable hls, the apple http live streaming.
  138. --without-hds disable hds, the adobe http dynamic streaming.
  139. --without-dvr disable dvr, donot support record RTMP stream to flv.
  140. --without-nginx disable delivery HTTP stream with nginx.
  141. --without-http-callback disable http, http hooks callback.
  142. --without-http-server disable http server, use external server to delivery http stream.
  143. --without-stream-caster disable stream caster, only listen and serve RTMP/HTTP.
  144. --without-http-api disable http api, only use console to manage SRS process.
  145. --without-ffmpeg disable the ffmpeg transcode tool feature.
  146. --without-transcode disable the transcoding feature.
  147. --without-ingest disable the ingest feature.
  148. --without-stat disable the data statistic feature.
  149. --without-librtmp disable srs-librtmp, library for client.
  150. --without-research do not build the research tools.
  151. --without-utest do not build the utest for SRS.
  152. --without-gperf do not build SRS with gperf tools(without tcmalloc and gmc/gmp/gcp).
  153. --without-gmc do not build memory check for SRS with gperf tools.
  154. --without-gmp do not build memory profile for SRS with gperf tools.
  155. --without-gcp do not build cpu profile for SRS with gperf tools.
  156. --without-gprof do not build srs with gprof(GNU profile tool).
  157. --without-arm-ubuntu12 do not cross build srs on ubuntu12 for armhf(v7cpu).
  158. --prefix=<path> the absolute install path for srs.
  159. --static whether add '-static' to link options.
  160. --jobs[=N] Allow N jobs at once; infinite jobs with no arg.
  161. used for make in the configure, for example, to make ffmpeg.
  162. --log-verbose whether enable the log verbose level. default: no.
  163. --log-info whether enable the log info level. default: no.
  164. --log-trace whether enable the log trace level. default: yes.
  165. Presets:
  166. --x86-x64 [default] for x86/x64 cpu, common pc and servers.
  167. --osx for osx(darwin) system to build SRS.
  168. --pi for raspberry-pi(directly build), open features hls/ssl/static.
  169. --cubie for cubieboard(directly build), open features except ffmpeg/nginx.
  170. --arm alias for --with-arm-ubuntu12, for ubuntu12, arm crossbuild
  171. --mips alias for --with-mips-ubuntu12, for ubuntu12, mips crossbuild
  172. --fast the most fast compile, nothing, only support vp6 RTMP.
  173. --pure-rtmp only support RTMP with ssl.
  174. --rtmp-hls only support RTMP+HLS with ssl.
  175. --disable-all disable all features, only support vp6 RTMP.
  176. --dev for dev, open all features, no nginx/gperf/gprof/arm.
  177. --fast-dev for dev fast compile, the RTMP server, without librtmp/utest/research.
  178. --demo for srs demo, @see: https://github.com/ossrs/srs/wiki/v1_CN_SampleDemo
  179. --full enable all features, no gperf/gprof/arm.
  180. Conflicts:
  181. 1. --with-gmc vs --with-gmp:
  182. @see: http://google-perftools.googlecode.com/svn/trunk/doc/heap_checker.html
  183. 2. --with-gperf/gmc/gmp vs --with-gprof:
  184. gperftools not compatible with gprof.
  185. 3. --arm vs --with-ffmpeg/gperf/gmc/gmp/gprof:
  186. the complex tools not available for arm.
  187. Experts:
  188. --use-sys-ssl donot compile ssl, use system ssl(-lssl) if required.
  189. --memory-watch enable memory watch to detect memory leaking(hurts performance).
  190. --export-librtmp-project=<path> export srs-librtmp to specified project in path.
  191. --export-librtmp-single=<path> export srs-librtmp to a single file(.h+.cpp) in path.
  192. Workflow:
  193. 1. apply "Presets". if not specified, use default preset.
  194. 2. apply "Options". user specified option will override the preset.
  195. 3. check conflicts. @see Conflicts section.
  196. 4. generate detail features.
  197. END
  198. }
  199. function parse_user_option() {
  200. case "$option" in
  201. -h) help=yes ;;
  202. --help) help=yes ;;
  203. --with-ssl) SRS_SSL=YES ;;
  204. --with-hls) SRS_HLS=YES ;;
  205. --with-hds) SRS_HDS=YES ;;
  206. --with-dvr) SRS_DVR=YES ;;
  207. --with-nginx) SRS_NGINX=YES ;;
  208. --with-ffmpeg) SRS_FFMPEG_TOOL=YES ;;
  209. --with-transcode) SRS_TRANSCODE=YES ;;
  210. --with-ingest) SRS_INGEST=YES ;;
  211. --with-stat) SRS_STAT=YES ;;
  212. --with-http-callback) SRS_HTTP_CALLBACK=YES ;;
  213. --with-http-server) SRS_HTTP_SERVER=YES ;;
  214. --with-stream-caster) SRS_STREAM_CASTER=YES ;;
  215. --with-http-api) SRS_HTTP_API=YES ;;
  216. --with-librtmp) SRS_LIBRTMP=YES ;;
  217. --with-research) SRS_RESEARCH=YES ;;
  218. --with-utest) SRS_UTEST=YES ;;
  219. --with-gperf) SRS_GPERF=YES ;;
  220. --with-gmc) SRS_GPERF_MC=YES ;;
  221. --with-gmp) SRS_GPERF_MP=YES ;;
  222. --with-gcp) SRS_GPERF_CP=YES ;;
  223. --with-gprof) SRS_GPROF=YES ;;
  224. --with-arm-ubuntu12) SRS_ARM_UBUNTU12=YES ;;
  225. --with-mips-ubuntu12) SRS_MIPS_UBUNTU12=YES ;;
  226. --without-ssl) SRS_SSL=NO ;;
  227. --without-hls) SRS_HLS=NO ;;
  228. --without-hds) SRS_HDS=NO ;;
  229. --without-dvr) SRS_DVR=NO ;;
  230. --without-nginx) SRS_NGINX=NO ;;
  231. --without-ffmpeg) SRS_FFMPEG_TOOL=NO ;;
  232. --without-transcode) SRS_TRANSCODE=NO ;;
  233. --without-ingest) SRS_INGEST=NO ;;
  234. --without-stat) SRS_STAT=NO ;;
  235. --without-http-callback) SRS_HTTP_CALLBACK=NO ;;
  236. --without-http-server) SRS_HTTP_SERVER=NO ;;
  237. --without-stream-caster) SRS_STREAM_CASTER=NO ;;
  238. --without-http-api) SRS_HTTP_API=NO ;;
  239. --without-librtmp) SRS_LIBRTMP=NO ;;
  240. --without-research) SRS_RESEARCH=NO ;;
  241. --without-utest) SRS_UTEST=NO ;;
  242. --without-gperf) SRS_GPERF=NO ;;
  243. --without-gmc) SRS_GPERF_MC=NO ;;
  244. --without-gmp) SRS_GPERF_MP=NO ;;
  245. --without-gcp) SRS_GPERF_CP=NO ;;
  246. --without-gprof) SRS_GPROF=NO ;;
  247. --without-arm-ubuntu12) SRS_ARM_UBUNTU12=NO ;;
  248. --without-mips-ubuntu12) SRS_MIPS_UBUNTU12=NO ;;
  249. --jobs) SRS_JOBS=${value} ;;
  250. --prefix) SRS_PREFIX=${value} ;;
  251. --static) SRS_STATIC=YES ;;
  252. --log-verbose) SRS_LOG_VERBOSE=YES ;;
  253. --log-info) SRS_LOG_INFO=YES ;;
  254. --log-trace) SRS_LOG_TRACE=YES ;;
  255. --x86-x64) SRS_X86_X64=YES ;;
  256. --osx) SRS_OSX=YES ;;
  257. --allow-osx) SRS_ALLOW_OSX=YES ;;
  258. --arm) SRS_ARM_UBUNTU12=YES ;;
  259. --mips) SRS_MIPS_UBUNTU12=YES ;;
  260. --pi) SRS_PI=YES ;;
  261. --cubie) SRS_CUBIE=YES ;;
  262. --dev) SRS_DEV=YES ;;
  263. --fast-dev) SRS_FAST_DEV=YES ;;
  264. --demo) SRS_DEMO=YES ;;
  265. --fast) SRS_FAST=YES ;;
  266. --disable-all) SRS_DISABLE_ALL=YES ;;
  267. --pure-rtmp) SRS_PURE_RTMP=YES ;;
  268. --rtmp-hls) SRS_RTMP_HLS=YES ;;
  269. --full) SRS_ENABLE_ALL=YES ;;
  270. --use-sys-ssl) SRS_USE_SYS_SSL=YES ;;
  271. --memory-watch) SRS_MEM_WATCH=YES ;;
  272. --export-librtmp-project) SRS_EXPORT_LIBRTMP_PROJECT=${value} ;;
  273. --export-librtmp-single) SRS_EXPORT_LIBRTMP_SINGLE=${value} ;;
  274. *)
  275. echo "$0: error: invalid option \"$option\""
  276. exit 1
  277. ;;
  278. esac
  279. }
  280. function parse_user_option_to_value_and_option() {
  281. case "$option" in
  282. -*=*)
  283. value=`echo "$option" | sed -e 's|[-_a-zA-Z0-9/]*=||'`
  284. option=`echo "$option" | sed -e 's|=[-_a-zA-Z0-9/.]*||'`
  285. ;;
  286. *) value="" ;;
  287. esac
  288. }
  289. #####################################################################################
  290. # parse preset options
  291. #####################################################################################
  292. opt=
  293. for option
  294. do
  295. opt="$opt `echo $option | sed -e \"s/\(--[^=]*=\)\(.* .*\)/\1'\2'/\"`"
  296. parse_user_option_to_value_and_option
  297. parse_user_option
  298. done
  299. if [ $help = yes ]; then
  300. show_help
  301. exit 0
  302. fi
  303. function apply_user_presets() {
  304. # always set the log level for all presets.
  305. SRS_LOG_VERBOSE=NO
  306. SRS_LOG_INFO=NO
  307. SRS_LOG_TRACE=YES
  308. # set default preset if not specifies
  309. if [ $SRS_RTMP_HLS = NO ]; then
  310. if [ $SRS_PURE_RTMP = NO ]; then
  311. if [ $SRS_FAST = NO ]; then
  312. if [ $SRS_DISABLE_ALL = NO ]; then
  313. if [ $SRS_ENABLE_ALL = NO ]; then
  314. if [ $SRS_DEV = NO ]; then
  315. if [ $SRS_FAST_DEV = NO ]; then
  316. if [ $SRS_DEMO = NO ]; then
  317. if [ $SRS_ARM_UBUNTU12 = NO ]; then
  318. if [ $SRS_MIPS_UBUNTU12 = NO ]; then
  319. if [ $SRS_PI = NO ]; then
  320. if [ $SRS_CUBIE = NO ]; then
  321. if [ $SRS_X86_X64 = NO ]; then
  322. if [ $SRS_OSX = NO ]; then
  323. SRS_X86_X64=YES; opt="--x86-x64 $opt";
  324. fi
  325. fi
  326. fi
  327. fi
  328. fi
  329. fi
  330. fi
  331. fi
  332. fi
  333. fi
  334. fi
  335. fi
  336. fi
  337. fi
  338. # whether embeded cpu.
  339. if [ $SRS_ARM_UBUNTU12 = YES ]; then
  340. SRS_CROSS_BUILD=YES
  341. fi
  342. if [ $SRS_MIPS_UBUNTU12 = YES ]; then
  343. SRS_CROSS_BUILD=YES
  344. fi
  345. # all disabled.
  346. if [ $SRS_DISABLE_ALL = YES ]; then
  347. SRS_HLS=NO
  348. SRS_HDS=NO
  349. SRS_DVR=NO
  350. SRS_NGINX=NO
  351. SRS_SSL=NO
  352. SRS_FFMPEG_TOOL=NO
  353. SRS_TRANSCODE=NO
  354. SRS_INGEST=NO
  355. SRS_STAT=NO
  356. SRS_HTTP_CORE=NO
  357. SRS_HTTP_CALLBACK=NO
  358. SRS_HTTP_SERVER=NO
  359. SRS_STREAM_CASTER=NO
  360. SRS_HTTP_API=NO
  361. SRS_LIBRTMP=NO
  362. SRS_RESEARCH=NO
  363. SRS_UTEST=NO
  364. SRS_GPERF=NO
  365. SRS_GPERF_MC=NO
  366. SRS_GPERF_MP=NO
  367. SRS_GPERF_CP=NO
  368. SRS_GPROF=NO
  369. SRS_STATIC=NO
  370. fi
  371. # all enabled.
  372. if [ $SRS_ENABLE_ALL = YES ]; then
  373. SRS_HLS=YES
  374. SRS_HDS=YES
  375. SRS_DVR=YES
  376. SRS_NGINX=YES
  377. SRS_SSL=YES
  378. SRS_FFMPEG_TOOL=YES
  379. SRS_TRANSCODE=YES
  380. SRS_INGEST=YES
  381. SRS_STAT=YES
  382. SRS_HTTP_CORE=YES
  383. SRS_HTTP_CALLBACK=YES
  384. SRS_HTTP_SERVER=YES
  385. SRS_STREAM_CASTER=YES
  386. SRS_HTTP_API=YES
  387. SRS_LIBRTMP=YES
  388. SRS_RESEARCH=YES
  389. SRS_UTEST=YES
  390. SRS_GPERF=NO
  391. SRS_GPERF_MC=NO
  392. SRS_GPERF_MP=NO
  393. SRS_GPERF_CP=NO
  394. SRS_GPROF=NO
  395. SRS_STATIC=NO
  396. fi
  397. # only rtmp vp6
  398. if [ $SRS_FAST = YES ]; then
  399. SRS_HLS=NO
  400. SRS_HDS=NO
  401. SRS_DVR=NO
  402. SRS_NGINX=NO
  403. SRS_SSL=NO
  404. SRS_FFMPEG_TOOL=NO
  405. SRS_TRANSCODE=NO
  406. SRS_INGEST=NO
  407. SRS_STAT=NO
  408. SRS_HTTP_CORE=NO
  409. SRS_HTTP_CALLBACK=NO
  410. SRS_HTTP_SERVER=NO
  411. SRS_STREAM_CASTER=NO
  412. SRS_HTTP_API=NO
  413. SRS_LIBRTMP=NO
  414. SRS_RESEARCH=NO
  415. SRS_UTEST=NO
  416. SRS_GPERF=NO
  417. SRS_GPERF_MC=NO
  418. SRS_GPERF_MP=NO
  419. SRS_GPERF_CP=NO
  420. SRS_GPROF=NO
  421. SRS_STATIC=NO
  422. fi
  423. # all disabled.
  424. if [ $SRS_RTMP_HLS = YES ]; then
  425. SRS_HLS=YES
  426. SRS_HDS=YES
  427. SRS_DVR=NO
  428. SRS_NGINX=NO
  429. SRS_SSL=YES
  430. SRS_FFMPEG_TOOL=NO
  431. SRS_TRANSCODE=NO
  432. SRS_INGEST=NO
  433. SRS_STAT=NO
  434. SRS_HTTP_CORE=NO
  435. SRS_HTTP_CALLBACK=NO
  436. SRS_HTTP_SERVER=NO
  437. SRS_STREAM_CASTER=NO
  438. SRS_HTTP_API=NO
  439. SRS_LIBRTMP=NO
  440. SRS_RESEARCH=NO
  441. SRS_UTEST=NO
  442. SRS_GPERF=NO
  443. SRS_GPERF_MC=NO
  444. SRS_GPERF_MP=NO
  445. SRS_GPERF_CP=NO
  446. SRS_GPROF=NO
  447. SRS_STATIC=NO
  448. fi
  449. # only ssl for RTMP with complex handshake.
  450. if [ $SRS_PURE_RTMP = YES ]; then
  451. SRS_HLS=NO
  452. SRS_HDS=NO
  453. SRS_DVR=NO
  454. SRS_NGINX=NO
  455. SRS_SSL=YES
  456. SRS_FFMPEG_TOOL=NO
  457. SRS_TRANSCODE=NO
  458. SRS_INGEST=NO
  459. SRS_STAT=NO
  460. SRS_HTTP_CORE=NO
  461. SRS_HTTP_CALLBACK=NO
  462. SRS_HTTP_SERVER=NO
  463. SRS_STREAM_CASTER=NO
  464. SRS_HTTP_API=NO
  465. SRS_LIBRTMP=NO
  466. SRS_RESEARCH=NO
  467. SRS_UTEST=NO
  468. SRS_GPERF=NO
  469. SRS_GPERF_MC=NO
  470. SRS_GPERF_MP=NO
  471. SRS_GPERF_CP=NO
  472. SRS_GPROF=NO
  473. SRS_STATIC=NO
  474. fi
  475. # if arm specified, set some default to disabled.
  476. if [ $SRS_ARM_UBUNTU12 = YES ]; then
  477. SRS_HLS=YES
  478. SRS_HDS=YES
  479. SRS_DVR=YES
  480. SRS_NGINX=NO
  481. SRS_SSL=YES
  482. SRS_FFMPEG_TOOL=NO
  483. SRS_TRANSCODE=YES
  484. SRS_INGEST=YES
  485. SRS_STAT=YES
  486. SRS_HTTP_CORE=YES
  487. SRS_HTTP_CALLBACK=YES
  488. SRS_HTTP_SERVER=YES
  489. SRS_STREAM_CASTER=NO
  490. SRS_HTTP_API=YES
  491. SRS_LIBRTMP=YES
  492. SRS_RESEARCH=NO
  493. SRS_UTEST=NO
  494. SRS_GPERF=NO
  495. SRS_GPERF_MC=NO
  496. SRS_GPERF_MP=NO
  497. SRS_GPERF_CP=NO
  498. SRS_GPROF=NO
  499. # TODO: FIXME: need static? maybe donot.
  500. SRS_STATIC=YES
  501. fi
  502. # if mips specified, set some default to disabled.
  503. if [ $SRS_MIPS_UBUNTU12 = YES ]; then
  504. SRS_HLS=YES
  505. SRS_HDS=YES
  506. SRS_DVR=YES
  507. SRS_NGINX=NO
  508. SRS_SSL=YES
  509. SRS_FFMPEG_TOOL=NO
  510. SRS_TRANSCODE=YES
  511. SRS_INGEST=YES
  512. SRS_STAT=YES
  513. SRS_HTTP_CORE=YES
  514. SRS_HTTP_CALLBACK=YES
  515. SRS_HTTP_SERVER=YES
  516. SRS_STREAM_CASTER=NO
  517. SRS_HTTP_API=YES
  518. SRS_LIBRTMP=YES
  519. SRS_RESEARCH=NO
  520. SRS_UTEST=NO
  521. SRS_GPERF=NO
  522. SRS_GPERF_MC=NO
  523. SRS_GPERF_MP=NO
  524. SRS_GPERF_CP=NO
  525. SRS_GPROF=NO
  526. SRS_STATIC=NO
  527. fi
  528. # defaults for x86/x64
  529. if [ $SRS_X86_X64 = YES ]; then
  530. SRS_HLS=YES
  531. SRS_HDS=YES
  532. SRS_DVR=YES
  533. SRS_NGINX=NO
  534. SRS_SSL=YES
  535. SRS_FFMPEG_TOOL=NO
  536. SRS_TRANSCODE=YES
  537. SRS_INGEST=YES
  538. SRS_STAT=YES
  539. SRS_HTTP_CORE=YES
  540. SRS_HTTP_CALLBACK=YES
  541. SRS_HTTP_SERVER=YES
  542. SRS_STREAM_CASTER=NO
  543. SRS_HTTP_API=YES
  544. SRS_LIBRTMP=YES
  545. SRS_RESEARCH=NO
  546. SRS_UTEST=YES
  547. SRS_GPERF=NO
  548. SRS_GPERF_MC=NO
  549. SRS_GPERF_MP=NO
  550. SRS_GPERF_CP=NO
  551. SRS_GPROF=NO
  552. SRS_STATIC=NO
  553. fi
  554. # for osx(darwin)
  555. if [ $SRS_OSX = YES ]; then
  556. SRS_HLS=YES
  557. SRS_HDS=YES
  558. SRS_DVR=YES
  559. SRS_NGINX=NO
  560. SRS_SSL=YES
  561. SRS_FFMPEG_TOOL=NO
  562. SRS_TRANSCODE=YES
  563. SRS_INGEST=YES
  564. SRS_STAT=YES
  565. SRS_HTTP_CORE=YES
  566. SRS_HTTP_CALLBACK=YES
  567. SRS_HTTP_SERVER=YES
  568. SRS_STREAM_CASTER=NO
  569. SRS_HTTP_API=YES
  570. SRS_LIBRTMP=NO
  571. SRS_RESEARCH=NO
  572. SRS_UTEST=YES
  573. SRS_GPERF=NO
  574. SRS_GPERF_MC=NO
  575. SRS_GPERF_MP=NO
  576. SRS_GPERF_CP=NO
  577. SRS_GPROF=NO
  578. SRS_STATIC=NO
  579. fi
  580. # if dev specified, open features if possible.
  581. if [ $SRS_DEV = YES ]; then
  582. SRS_HLS=YES
  583. SRS_HDS=YES
  584. SRS_DVR=YES
  585. SRS_NGINX=NO
  586. SRS_SSL=YES
  587. SRS_FFMPEG_TOOL=YES
  588. SRS_TRANSCODE=YES
  589. SRS_INGEST=YES
  590. SRS_STAT=YES
  591. SRS_HTTP_CORE=YES
  592. SRS_HTTP_CALLBACK=YES
  593. SRS_HTTP_SERVER=YES
  594. SRS_STREAM_CASTER=NO
  595. SRS_HTTP_API=YES
  596. SRS_LIBRTMP=YES
  597. SRS_RESEARCH=YES
  598. SRS_UTEST=YES
  599. SRS_GPERF=NO
  600. SRS_GPERF_MC=NO
  601. SRS_GPERF_MP=NO
  602. SRS_GPERF_CP=NO
  603. SRS_GPROF=NO
  604. SRS_STATIC=NO
  605. fi
  606. # if fast dev specified, open main server features.
  607. if [ $SRS_FAST_DEV = YES ]; then
  608. SRS_HLS=YES
  609. SRS_HDS=YES
  610. SRS_DVR=YES
  611. SRS_NGINX=NO
  612. SRS_SSL=YES
  613. SRS_FFMPEG_TOOL=NO
  614. SRS_TRANSCODE=YES
  615. SRS_INGEST=YES
  616. SRS_STAT=YES
  617. SRS_HTTP_CORE=YES
  618. SRS_HTTP_CALLBACK=YES
  619. SRS_HTTP_SERVER=YES
  620. SRS_STREAM_CASTER=NO
  621. SRS_HTTP_API=YES
  622. SRS_LIBRTMP=NO
  623. SRS_RESEARCH=NO
  624. SRS_UTEST=NO
  625. SRS_GPERF=NO
  626. SRS_GPERF_MC=NO
  627. SRS_GPERF_MP=NO
  628. SRS_GPERF_CP=NO
  629. SRS_GPROF=NO
  630. SRS_STATIC=NO
  631. fi
  632. # for srs demo
  633. if [ $SRS_DEMO = YES ]; then
  634. SRS_HLS=YES
  635. SRS_HDS=YES
  636. SRS_DVR=YES
  637. SRS_NGINX=NO
  638. SRS_SSL=YES
  639. SRS_FFMPEG_TOOL=YES
  640. SRS_TRANSCODE=YES
  641. SRS_INGEST=YES
  642. SRS_STAT=YES
  643. SRS_HTTP_CORE=YES
  644. SRS_HTTP_CALLBACK=YES
  645. SRS_HTTP_SERVER=YES
  646. SRS_STREAM_CASTER=NO
  647. SRS_HTTP_API=YES
  648. SRS_LIBRTMP=YES
  649. SRS_RESEARCH=NO
  650. SRS_UTEST=YES
  651. SRS_GPERF=NO
  652. SRS_GPERF_MC=NO
  653. SRS_GPERF_MP=NO
  654. SRS_GPERF_CP=NO
  655. SRS_GPROF=NO
  656. SRS_STATIC=NO
  657. fi
  658. # if raspberry-pi specified, open ssl/hls/static features
  659. if [ $SRS_PI = YES ]; then
  660. SRS_HLS=YES
  661. SRS_HDS=YES
  662. SRS_DVR=YES
  663. SRS_NGINX=NO
  664. SRS_SSL=YES
  665. SRS_FFMPEG_TOOL=NO
  666. SRS_TRANSCODE=YES
  667. SRS_INGEST=YES
  668. SRS_STAT=YES
  669. SRS_HTTP_CORE=YES
  670. SRS_HTTP_CALLBACK=YES
  671. SRS_HTTP_SERVER=YES
  672. SRS_STREAM_CASTER=NO
  673. SRS_HTTP_API=YES
  674. SRS_LIBRTMP=YES
  675. SRS_RESEARCH=NO
  676. SRS_UTEST=NO
  677. SRS_GPERF=NO
  678. SRS_GPERF_MC=NO
  679. SRS_GPERF_MP=NO
  680. SRS_GPERF_CP=NO
  681. SRS_GPROF=NO
  682. SRS_STATIC=NO
  683. fi
  684. # if cubieboard specified, open features except ffmpeg/nginx.
  685. if [ $SRS_CUBIE = YES ]; then
  686. SRS_HLS=YES
  687. SRS_HDS=YES
  688. SRS_DVR=YES
  689. SRS_NGINX=NO
  690. SRS_SSL=YES
  691. SRS_FFMPEG_TOOL=YES
  692. SRS_TRANSCODE=YES
  693. SRS_INGEST=YES
  694. SRS_STAT=YES
  695. SRS_HTTP_CORE=YES
  696. SRS_HTTP_CALLBACK=YES
  697. SRS_HTTP_SERVER=YES
  698. SRS_STREAM_CASTER=NO
  699. SRS_HTTP_API=YES
  700. SRS_LIBRTMP=YES
  701. SRS_RESEARCH=NO
  702. SRS_UTEST=NO
  703. SRS_GPERF=NO
  704. SRS_GPERF_MC=NO
  705. SRS_GPERF_MP=NO
  706. SRS_GPERF_CP=NO
  707. SRS_GPROF=NO
  708. SRS_STATIC=NO
  709. fi
  710. }
  711. apply_user_presets
  712. #####################################################################################
  713. # parse detail feature options
  714. #####################################################################################
  715. for option
  716. do
  717. parse_user_option_to_value_and_option
  718. parse_user_option
  719. done
  720. function apply_user_detail_options() {
  721. # if transcode/ingest specified, requires the ffmpeg stub classes.
  722. SRS_FFMPEG_STUB=NO
  723. if [ $SRS_TRANSCODE = YES ]; then SRS_FFMPEG_STUB=YES; fi
  724. if [ $SRS_INGEST = YES ]; then SRS_FFMPEG_STUB=YES; fi
  725. # if http-xxxx specified, open the SRS_HTTP_CORE
  726. SRS_HTTP_CORE=NO
  727. if [ $SRS_HTTP_CALLBACK = YES ]; then SRS_HTTP_CORE=YES; fi
  728. if [ $SRS_HTTP_SERVER = YES ]; then SRS_HTTP_CORE=YES; fi
  729. if [ $SRS_HTTP_API = YES ]; then SRS_HTTP_CORE=YES; fi
  730. # parse the jobs for make
  731. if [[ "" -eq SRS_JOBS ]]; then
  732. export SRS_JOBS="--jobs=1"
  733. else
  734. export SRS_JOBS="--jobs=${SRS_JOBS}"
  735. fi
  736. # if specified export single file, export project first.
  737. if [ $SRS_EXPORT_LIBRTMP_SINGLE != NO ]; then
  738. SRS_EXPORT_LIBRTMP_PROJECT=$SRS_EXPORT_LIBRTMP_SINGLE
  739. fi
  740. # disable almost all features for export srs-librtmp.
  741. if [ $SRS_EXPORT_LIBRTMP_PROJECT != NO ]; then
  742. SRS_HLS=NO
  743. SRS_HDS=NO
  744. SRS_DVR=NO
  745. SRS_NGINX=NO
  746. SRS_SSL=NO
  747. SRS_FFMPEG_TOOL=NO
  748. SRS_TRANSCODE=NO
  749. SRS_INGEST=NO
  750. SRS_STAT=NO
  751. SRS_HTTP_CORE=NO
  752. SRS_HTTP_CALLBACK=NO
  753. SRS_HTTP_SERVER=NO
  754. SRS_STREAM_CASTER=NO
  755. SRS_HTTP_API=NO
  756. SRS_LIBRTMP=YES
  757. SRS_RESEARCH=YES
  758. SRS_UTEST=NO
  759. SRS_GPERF=NO
  760. SRS_GPERF_MC=NO
  761. SRS_GPERF_MP=NO
  762. SRS_GPERF_CP=NO
  763. SRS_GPROF=NO
  764. SRS_STATIC=NO
  765. fi
  766. }
  767. apply_user_detail_options
  768. function regenerate_options() {
  769. # save all config options to macro to write to auto headers file
  770. SRS_AUTO_USER_CONFIGURE="$opt"
  771. # regenerate the options for default values.
  772. SRS_AUTO_CONFIGURE="--prefix=${SRS_PREFIX}"
  773. if [ $SRS_HLS = YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --with-hls"; else SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --without-hls"; fi
  774. if [ $SRS_HDS = YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --with-hds"; else SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --without-hds"; fi
  775. if [ $SRS_DVR = YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --with-dvr"; else SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --without-dvr"; fi
  776. if [ $SRS_NGINX = YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --with-nginx"; else SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --without-nginx"; fi
  777. if [ $SRS_SSL = YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --with-ssl"; else SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --without-ssl"; fi
  778. if [ $SRS_FFMPEG_TOOL = YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --with-ffmpeg"; else SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --without-ffmpeg"; fi
  779. if [ $SRS_TRANSCODE = YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --with-transcode"; else SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --without-transcode"; fi
  780. if [ $SRS_INGEST = YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --with-ingest"; else SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --without-ingest"; fi
  781. if [ $SRS_STAT = YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --with-stat"; else SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --without-stat"; fi
  782. 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
  783. 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
  784. if [ $SRS_STREAM_CASTER = YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --with-stream-caster"; else SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --without-stream-caster"; fi
  785. 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
  786. if [ $SRS_LIBRTMP = YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --with-librtmp"; else SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --without-librtmp"; fi
  787. if [ $SRS_RESEARCH = YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --with-research"; else SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --without-research"; fi
  788. if [ $SRS_UTEST = YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --with-utest"; else SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --without-utest"; fi
  789. if [ $SRS_GPERF = YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --with-gperf"; else SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --without-gperf"; fi
  790. if [ $SRS_GPERF_MC = YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --with-gmc"; else SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --without-gmc"; fi
  791. if [ $SRS_GPERF_MP = YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --with-gmp"; else SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --without-gmp"; fi
  792. if [ $SRS_GPERF_CP = YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --with-gcp"; else SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --without-gcp"; fi
  793. if [ $SRS_GPROF = YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --with-gprof"; else SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --without-gprof"; fi
  794. 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
  795. if [ $SRS_MIPS_UBUNTU12 = YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --with-mips-ubuntu12"; else SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --without-mips-ubuntu12"; fi
  796. if [ $SRS_STATIC = YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --static"; fi
  797. if [ $SRS_LOG_VERBOSE = YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --log-verbose"; fi
  798. if [ $SRS_LOG_INFO = YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --log-info"; fi
  799. if [ $SRS_LOG_TRACE = YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --log-trace"; fi
  800. echo "regenerate config: ${SRS_AUTO_CONFIGURE}"
  801. }
  802. regenerate_options
  803. #####################################################################################
  804. # check user options
  805. #####################################################################################
  806. function check_option_conflicts() {
  807. __check_ok=YES
  808. # check conflict
  809. if [ $SRS_GPERF = NO ]; then
  810. if [ $SRS_GPERF_MC = YES ]; then echo "gperf-mc depends on gperf, see: ./configure --help"; __check_ok=NO; fi
  811. if [ $SRS_GPERF_MP = YES ]; then echo "gperf-mp depends on gperf, see: ./configure --help"; __check_ok=NO; fi
  812. if [ $SRS_GPERF_CP = YES ]; then echo "gperf-cp depends on gperf, see: ./configure --help"; __check_ok=NO; fi
  813. fi
  814. if [[ $SRS_GPERF_MC = YES && $SRS_GPERF_MP = YES ]]; then
  815. echo "gperf-mc not compatible with gperf-mp, see: ./configure --help";
  816. echo "@see: http://google-perftools.googlecode.com/svn/trunk/doc/heap_checker.html";
  817. 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";
  818. __check_ok=NO
  819. fi
  820. if [[ $SRS_HTTP_CORE = NO && $SRS_STREAM_CASTER = YES ]]; then
  821. echo "stream-caster depends on http-api or http-server, see: ./configure --help"; __check_ok=NO;
  822. fi
  823. # generate the group option: SRS_GPERF
  824. __gperf_slow=NO
  825. if [ $SRS_GPERF_MC = YES ]; then SRS_GPERF=YES; __gperf_slow=YES; fi
  826. if [ $SRS_GPERF_MP = YES ]; then SRS_GPERF=YES; __gperf_slow=YES; fi
  827. if [ $SRS_GPERF_CP = YES ]; then SRS_GPERF=YES; __gperf_slow=YES; fi
  828. if [ $__gperf_slow = YES ]; then if [ $SRS_GPROF = YES ]; then
  829. echo "gmc/gmp/gcp not compatible with gprof, see: ./configure --help"; __check_ok=NO;
  830. fi fi
  831. # check embeded(arm/mips), if embeded enabled, only allow st/ssl/librtmp,
  832. # user should disable all other features
  833. if [ $SRS_CROSS_BUILD = YES ]; then
  834. if [ $SRS_FFMPEG_TOOL = YES ]; then echo "ffmpeg for arm is not available, see: ./configure --help"; __check_ok=NO; fi
  835. if [ $SRS_RESEARCH = YES ]; then echo "research for arm is not available, see: ./configure --help"; __check_ok=NO; fi
  836. if [ $SRS_GPERF = YES ]; then echo "gperf for arm is not available, see: ./configure --help"; __check_ok=NO; fi
  837. if [ $SRS_GPERF_MC = YES ]; then echo "gmc for arm is not available, see: ./configure --help"; __check_ok=NO; fi
  838. if [ $SRS_GPERF_MP = YES ]; then echo "gmp for arm is not available, see: ./configure --help"; __check_ok=NO; fi
  839. if [ $SRS_GPERF_CP = YES ]; then echo "gcp for arm is not available, see: ./configure --help"; __check_ok=NO; fi
  840. if [ $SRS_GPROF = YES ]; then echo "gprof for arm is not available, see: ./configure --help"; __check_ok=NO; fi
  841. fi
  842. # if x86/x64 or directly build, never use static
  843. if [[ $SRS_X86_X64 = YES && $SRS_STATIC = YES ]]; then
  844. echo "x86/x64 should never use static, see: ./configure --help"; __check_ok=NO;
  845. fi
  846. # TODO: FIXME: check more os.
  847. # check variable neccessary
  848. if [ $SRS_HLS = RESERVED ]; then echo "you must specifies the hls, see: ./configure --help"; __check_ok=NO; fi
  849. if [ $SRS_HDS = RESERVED ]; then echo "you must specifies the hds, see: ./configure --help"; __check_ok=NO; fi
  850. if [ $SRS_DVR = RESERVED ]; then echo "you must specifies the dvr, see: ./configure --help"; __check_ok=NO; fi
  851. if [ $SRS_NGINX = RESERVED ]; then echo "you must specifies the nginx, see: ./configure --help"; __check_ok=NO; fi
  852. if [ $SRS_SSL = RESERVED ]; then echo "you must specifies the ssl, see: ./configure --help"; __check_ok=NO; fi
  853. if [ $SRS_FFMPEG_TOOL = RESERVED ]; then echo "you must specifies the ffmpeg, see: ./configure --help"; __check_ok=NO; fi
  854. if [ $SRS_HTTP_CALLBACK = RESERVED ]; then echo "you must specifies the http-callback, see: ./configure --help"; __check_ok=NO; fi
  855. if [ $SRS_HTTP_SERVER = RESERVED ]; then echo "you must specifies the http-server, see: ./configure --help"; __check_ok=NO; fi
  856. if [ $SRS_STREAM_CASTER = RESERVED ]; then echo "you must specifies the stream-caster, see: ./configure --help"; __check_ok=NO; fi
  857. if [ $SRS_HTTP_API = RESERVED ]; then echo "you must specifies the http-api, see: ./configure --help"; __check_ok=NO; fi
  858. if [ $SRS_LIBRTMP = RESERVED ]; then echo "you must specifies the librtmp, see: ./configure --help"; __check_ok=NO; fi
  859. if [ $SRS_RESEARCH = RESERVED ]; then echo "you must specifies the research, see: ./configure --help"; __check_ok=NO; fi
  860. if [ $SRS_UTEST = RESERVED ]; then echo "you must specifies the utest, see: ./configure --help"; __check_ok=NO; fi
  861. if [ $SRS_GPERF = RESERVED ]; then echo "you must specifies the gperf, see: ./configure --help"; __check_ok=NO; fi
  862. if [ $SRS_GPERF_MC = RESERVED ]; then echo "you must specifies the gperf-mc, see: ./configure --help"; __check_ok=NO; fi
  863. if [ $SRS_GPERF_MP = RESERVED ]; then echo "you must specifies the gperf-mp, see: ./configure --help"; __check_ok=NO; fi
  864. if [ $SRS_GPERF_CP = RESERVED ]; then echo "you must specifies the gperf-cp, see: ./configure --help"; __check_ok=NO; fi
  865. if [ $SRS_GPROF = RESERVED ]; then echo "you must specifies the gprof, see: ./configure --help"; __check_ok=NO; fi
  866. if [ $SRS_ARM_UBUNTU12 = RESERVED ]; then echo "you must specifies the arm-ubuntu12, see: ./configure --help"; __check_ok=NO; fi
  867. if [ $SRS_MIPS_UBUNTU12 = RESERVED ]; then echo "you must specifies the mips-ubuntu12, see: ./configure --help"; __check_ok=NO; fi
  868. if [[ -z $SRS_PREFIX ]]; then echo "you must specifies the prefix, see: ./configure --prefix"; __check_ok=NO; fi
  869. if [ $__check_ok = NO ]; then
  870. exit 1;
  871. fi
  872. if [[ $SRS_OSX == YES && $SRS_ALLOW_OSX == NO ]]; then
  873. macOSVersion=`sw_vers -productVersion`
  874. macOSVersionMajor=`echo $macOSVersion|awk -F '.' '{print $1}'`
  875. macOSVersionMinor=`echo $macOSVersion|awk -F '.' '{print $2}'`
  876. if [[ $macOSVersionMajor -ge 10 && $macOSVersionMinor -ge 14 ]]; then
  877. echo "macOS $macOSVersion is not supported, read https://github.com/ossrs/srs/issues/1250"
  878. exit -1
  879. fi
  880. fi
  881. }
  882. check_option_conflicts